2020-04-24 23:06:34 +02:00
|
|
|
/*
|
|
|
|
* Mailattach - a program to remove attachments and replace them with links.
|
|
|
|
* Licensed under the Apache 2.0 License. Parts taken from the sendmail
|
|
|
|
* libmilter sample. License restrictions from their license may apply.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <sysexits.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
|
2020-04-25 00:53:36 +02:00
|
|
|
#include "version.h"
|
|
|
|
#include "config.h"
|
2020-04-25 01:37:15 +02:00
|
|
|
#include "attach.h"
|
2020-04-24 23:06:34 +02:00
|
|
|
|
2020-04-25 23:04:53 +02:00
|
|
|
int main(int argc, char* argv[]){
|
2020-04-24 23:06:34 +02:00
|
|
|
|
2020-04-25 23:04:53 +02:00
|
|
|
FILE* logfile = fopen("/tmp/shit", "a+");
|
2020-04-24 23:06:34 +02:00
|
|
|
|
2020-04-25 23:04:53 +02:00
|
|
|
fprintf(logfile, "INIT\n");
|
|
|
|
fprintf(logfile, "Arguments passed on:\n");
|
|
|
|
for(size_t i = 0; i < argc; i++){
|
|
|
|
fprintf(logfile, "\t%lu:%s\n",i, argv[i]);
|
|
|
|
}
|
2020-04-25 23:19:05 +02:00
|
|
|
char input[1024];
|
|
|
|
fread(input, sizeof(input), 1, stdin);
|
|
|
|
fprintf(logfile, input);
|
|
|
|
|
2020-04-25 23:04:53 +02:00
|
|
|
fclose(logfile);
|
2020-04-24 23:06:34 +02:00
|
|
|
|
2020-04-25 19:24:29 +02:00
|
|
|
|
2020-04-25 23:04:53 +02:00
|
|
|
return EX_TEMPFAIL;
|
2020-04-25 00:53:36 +02:00
|
|
|
|
2020-04-24 23:06:34 +02:00
|
|
|
}
|