X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fsrc%2Fmoan.c;h=a369989564cda037afce9fe5e272ee9e4a102eb0;hb=55414b2;hp=1b6d1a97fe6006a999d9e52e8c1cafd63ab50b82;hpb=bc64a74dadcd9d2560b84cad283a52e7346d4140;p=exim.git diff --git a/src/src/moan.c b/src/src/moan.c index 1b6d1a97f..a36998956 100644 --- a/src/src/moan.c +++ b/src/src/moan.c @@ -1,10 +1,8 @@ -/* $Cambridge: exim/src/src/moan.c,v 1.10 2007/08/29 15:06:47 ph10 Exp $ */ - /************************************************* * Exim - an Internet mail transport agent * *************************************************/ -/* Copyright (c) University of Cambridge 1995 - 2007 */ +/* Copyright (c) University of Cambridge 1995 - 2014 */ /* See the file NOTICE for conditions of use and distribution. */ /* Functions for sending messages to sender or to mailmaster. */ @@ -204,6 +202,26 @@ switch(ident) fprintf(f, "\n"); break; +#ifdef EXPERIMENTAL_DMARC + case ERRMESS_DMARC_FORENSIC: + bounce_return_message = TRUE; + bounce_return_body = FALSE; + fprintf(f, + "Subject: DMARC Forensic Report for %s from IP %s\n\n", + ((eblock == NULL) ? US"Unknown" : eblock->text2), + sender_host_address); + fprintf(f, + "A message claiming to be from you has failed the published DMARC\n" + "policy for your domain.\n\n"); + while (eblock != NULL) + { + fprintf(f, " %s: %s\n", eblock->text1, eblock->text2); + count++; + eblock = eblock->next; + } + break; +#endif + default: fprintf(f, "Subject: Mail failure\n\n"); fprintf(f, @@ -282,8 +300,16 @@ if (bounce_return_message) } } } +#ifdef EXPERIMENTAL_DMARC + /* Overkill, but use exact test in case future code gets inserted */ + else if (bounce_return_body && message_file == NULL) + { + /* This doesn't print newlines, disable until can parse and fix + * output to be legible. */ + fprintf(f, "%s", expand_string(US"$message_body")); + } +#endif } - /* Close the file, which should send an EOF to the child process that is receiving the message. Wait for it to finish, without a timeout. */ @@ -437,8 +463,8 @@ Returns: nothing */ void -moan_tell_someone(uschar *who, address_item *addr, uschar *subject, - char *format, ...) +moan_tell_someone(uschar *who, address_item *addr, + const uschar *subject, const char *format, ...) { FILE *f; va_list ap; @@ -505,7 +531,7 @@ Returns: does not return; exits from the program */ void -moan_smtp_batch(uschar *cmd_buffer, char *format, ...) +moan_smtp_batch(uschar *cmd_buffer, const char *format, ...) { va_list ap; int yield = (receive_messagecount > 0)? 1 : 2; @@ -572,7 +598,7 @@ uschar * moan_check_errorcopy(uschar *recipient) { uschar *item, *localpart, *domain; -uschar *listptr = errors_copy; +const uschar *listptr = errors_copy; uschar *yield = NULL; uschar buffer[256]; int sep = 0; @@ -593,8 +619,8 @@ llen = domain++ - recipient; while ((item = string_nextinlist(&listptr, &sep, buffer, sizeof(buffer))) != NULL) { - uschar *newaddress = item; - uschar *pattern = string_dequote(&newaddress); + const uschar *newaddress = item; + const uschar *pattern = string_dequote(&newaddress); /* If no new address found, just skip this item. */