X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fsrc%2Fmoan.c;h=e54117c345d18b1f705ce84c8e39a9724451393c;hb=9031f51a298749869af8c082bad850eb103db09a;hp=6c04f7a570560a5f8d465e55ba935eed916de279;hpb=3634fc257bd0667daef14d72005cd87c735bbb24;p=user%2Fhenk%2Fcode%2Fexim.git diff --git a/src/src/moan.c b/src/src/moan.c index 6c04f7a57..e54117c34 100644 --- a/src/src/moan.c +++ b/src/src/moan.c @@ -2,7 +2,7 @@ * Exim - an Internet mail transport agent * *************************************************/ -/* Copyright (c) University of Cambridge 1995 - 2009 */ +/* Copyright (c) University of Cambridge 1995 - 2015 */ /* See the file NOTICE for conditions of use and distribution. */ /* Functions for sending messages to sender or to mailmaster. */ @@ -202,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, @@ -280,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. */ @@ -570,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; @@ -591,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. */