50 |
#endif |
#endif |
51 |
#include <stdlib.h> |
#include <stdlib.h> |
52 |
#include <unistd.h> |
#include <unistd.h> |
53 |
#include <getopt.h> |
#ifdef HAVE_GETOPT_H |
54 |
|
# include <getopt.h> |
55 |
|
#endif |
56 |
#include <string.h> |
#include <string.h> |
57 |
#include <pwd.h> |
#include <pwd.h> |
58 |
#include <sys/stat.h> |
#include <sys/stat.h> |
338 |
return 0; |
return 0; |
339 |
} |
} |
340 |
|
|
341 |
|
#define SENDER_WARNING "set sender using -f flag" |
342 |
|
|
343 |
int |
int |
344 |
message_finalize (message_t msg, int warn) |
message_finalize (message_t msg, int warn) |
345 |
{ |
{ |
351 |
|
|
352 |
if (warn && from_person) |
if (warn && from_person) |
353 |
{ |
{ |
|
char *warn = NULL; |
|
354 |
struct passwd *pwd = getpwuid (getuid ()); |
struct passwd *pwd = getpwuid (getuid ()); |
355 |
asprintf (&warn, "%s set sender using -f flag", pwd->pw_name); |
char *warn = malloc (strlen (pwd->pw_name) + 1 + |
356 |
|
sizeof (SENDER_WARNING)); |
357 |
|
if (warn == NULL) |
358 |
|
{ |
359 |
|
mu_error ("%s: not enough memory", progname); |
360 |
|
return 1; |
361 |
|
} |
362 |
|
sprintf (warn, "%s %s", pwd->pw_name, SENDER_WARNING); |
363 |
header_set_value (header, "X-Authentication-Warning", warn, 0); |
header_set_value (header, "X-Authentication-Warning", warn, 0); |
364 |
free (warn); |
free (warn); |
365 |
} |
} |