-$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.469 2007/02/06 10:00:24 ph10 Exp $
+$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.470 2007/02/06 11:11:39 ph10 Exp $
Change log file for Exim from version 4.21
-------------------------------------------
PH/16 Add ${if forany and ${if forall.
+PH/17 Added dsn_from option to vary the From: line in DSNs.
+
Exim version 4.66
-----------------
-$Cambridge: exim/doc/doc-txt/NewStuff,v 1.136 2007/02/06 10:00:24 ph10 Exp $
+$Cambridge: exim/doc/doc-txt/NewStuff,v 1.137 2007/02/06 11:11:39 ph10 Exp $
New Features in Exim
--------------------
Its value is saved and restored while forany/forall is being processed, to
enable these expansion items to be nested.
+13. There's a new global option called dsn_from that can be used to vary the
+ contents of From: lines in bounces and other automatically generated
+ messages ("delivery status notifications" - hence the name of the option).
+ The default setting is:
+
+ dsn_from = Mail Delivery System <Mailer-Daemon@$qualify_domain>
+
+ The value is expanded every time it is needed. If the expansion fails, a
+ panic is logged, and the default setting is used.
+
Version 4.66
------------
-/* $Cambridge: exim/src/src/deliver.c,v 1.42 2007/01/23 12:33:08 magnus Exp $ */
+/* $Cambridge: exim/src/src/deliver.c,v 1.43 2007/02/06 11:11:40 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
!contains_header(US"Reply-To", warn_message))
fprintf(f, "Reply-To: %s\n", errors_reply_to);
fprintf(f, "Auto-Submitted: auto-replied\n");
- if (!contains_header(US"From", warn_message))
- fprintf(f, "From: Mail Delivery System <Mailer-Daemon@%s>\n",
- qualify_domain_sender);
+ if (!contains_header(US"From", warn_message)) moan_write_from(f);
fprintf(f, "%s", CS warn_message);
/* Close and wait for child process to complete, without a timeout. */
if (errors_reply_to != NULL)
fprintf(f, "Reply-To: %s\n", errors_reply_to);
fprintf(f, "Auto-Submitted: auto-replied\n");
- fprintf(f, "From: Mail Delivery System <Mailer-Daemon@%s>\n",
- qualify_domain_sender);
+ moan_write_from(f);
fprintf(f, "To: %s\n", bounce_recipient);
/* Open a template file if one is provided. Log failure to open, but
if (errors_reply_to != NULL)
fprintf(f, "Reply-To: %s\n", errors_reply_to);
fprintf(f, "Auto-Submitted: auto-replied\n");
- fprintf(f, "From: Mail Delivery System <Mailer-Daemon@%s>\n",
- qualify_domain_sender);
+ moan_write_from(f);
fprintf(f, "To: %s\n", recipients);
wmf_text = next_emf(wmf, US"header");
-/* $Cambridge: exim/src/src/functions.h,v 1.34 2007/01/18 15:35:42 ph10 Exp $ */
+/* $Cambridge: exim/src/src/functions.h,v 1.35 2007/02/06 11:11:40 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
extern void moan_tell_someone(uschar *, address_item *, uschar *, char *,
...);
extern BOOL moan_to_sender(int, error_block *, header_line *, FILE *, BOOL);
+extern void moan_write_from(FILE *);
extern FILE *modefopen(uschar *, char *, mode_t);
extern uschar *parse_extract_address(uschar *, uschar **, int *, int *, int *,
-/* $Cambridge: exim/src/src/globals.c,v 1.69 2007/02/06 10:00:24 ph10 Exp $ */
+/* $Cambridge: exim/src/src/globals.c,v 1.70 2007/02/06 11:11:40 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
BOOL dont_deliver = FALSE;
BOOL dot_ends = TRUE;
BOOL drop_cr = FALSE; /* No longer used */
+uschar *dsn_from = US DEFAULT_DSN_FROM;
BOOL enable_dollar_recipients = FALSE;
BOOL envelope_to_remove = TRUE;
uschar *extra_local_interfaces = NULL;
int fake_response = OK;
-uschar *fake_response_text = US"Your message has been rejected but is being kept for evaluation.\nIf it was a legitimate message, it may still be delivered to the target recipient(s).";
+uschar *fake_response_text = US"Your message has been rejected but is "
+ "being kept for evaluation.\nIf it was a "
+ "legitimate message, it may still be "
+ "delivered to the target recipient(s).";
int filter_n[FILTER_VARIABLE_COUNT];
BOOL filter_running = FALSE;
int filter_sn[FILTER_VARIABLE_COUNT];
-/* $Cambridge: exim/src/src/globals.h,v 1.49 2007/02/06 10:00:24 ph10 Exp $ */
+/* $Cambridge: exim/src/src/globals.h,v 1.50 2007/02/06 11:11:40 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
/* This option is now a no-opt, retained for compatibility */
extern BOOL drop_cr; /* For broken local MUAs */
+extern uschar *dsn_from; /* From: string for DSNs */
+
extern BOOL enable_dollar_recipients; /* Make $recipients available */
extern int envelope_to_remove; /* Remove envelope_to_headers */
extern int errno_quota; /* Quota errno in this OS */
-/* $Cambridge: exim/src/src/macros.h,v 1.31 2007/01/31 16:52:12 ph10 Exp $ */
+/* $Cambridge: exim/src/src/macros.h,v 1.32 2007/02/06 11:11:40 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
#define DEBUG(x) if ((debug_selector & (x)) != 0)
#define HDEBUG(x) if (host_checking || (debug_selector & (x)) != 0)
+/* The default From: text for DSNs */
+
+#define DEFAULT_DSN_FROM "Mail Delivery System <Mailer-Daemon@$qualify_domain>"
+
/* The size of the vector for saving/restoring address expansion pointers while
verifying. This has to be explicit because it is referenced in more than one
source module. */
-/* $Cambridge: exim/src/src/moan.c,v 1.7 2007/01/08 10:50:18 ph10 Exp $ */
+/* $Cambridge: exim/src/src/moan.c,v 1.8 2007/02/06 11:11:40 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
+/*************************************************
+* Write From: line for DSN *
+*************************************************/
+
+/* This function is called to write the From: line in automatically generated
+messages - bounces, warnings, etc. It expands a configuration item in order to
+get the text. If the expansion fails, a panic is logged and the default value
+for the option is used.
+
+Argument: the FILE to write to
+Returns: nothing
+*/
+
+void
+moan_write_from(FILE *f)
+{
+uschar *s = expand_string(dsn_from);
+if (s == NULL)
+ {
+ log_write(0, LOG_MAIN|LOG_PANIC,
+ "Failed to expand dsn_from (using default): %s", expand_string_message);
+ s = expand_string(US DEFAULT_DSN_FROM);
+ }
+fprintf(f, "From: %s\n", s);
+}
+
+
+
/*************************************************
* Send error message *
*************************************************/
f = fdopen(fd, "wb");
if (errors_reply_to != NULL) fprintf(f, "Reply-To: %s\n", errors_reply_to);
fprintf(f, "Auto-Submitted: auto-replied\n");
-fprintf(f, "From: Mail Delivery System <Mailer-Daemon@%s>\n",
- qualify_domain_sender);
+moan_write_from(f);
fprintf(f, "To: %s\n", recipient);
switch(ident)
f = fdopen(fd, "wb");
fprintf(f, "Auto-Submitted: auto-replied\n");
-fprintf(f, "From: Mail Delivery System <Mailer-Daemon@%s>\n",
- qualify_domain_sender);
+moan_write_from(f);
fprintf(f, "To: %s\n", who);
fprintf(f, "Subject: %s\n\n", subject);
va_start(ap, format);
f = fdopen(fd, "wb");
fprintf(f, "Auto-Submitted: auto-replied\n");
-fprintf(f, "From: Mail Delivery System <Mailer-Daemon@%s>\n",
- qualify_domain_sender);
+moan_write_from(f);
fprintf(f, "To: %s\n", s);
fprintf(f, "Subject: error(s) in forwarding or filtering\n\n");
-/* $Cambridge: exim/src/src/readconf.c,v 1.28 2007/01/22 16:29:54 ph10 Exp $ */
+/* $Cambridge: exim/src/src/readconf.c,v 1.29 2007/02/06 11:11:40 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
/* This option is now a no-op, retained for compability */
{ "drop_cr", opt_bool, &drop_cr },
/*********************************************************/
+ { "dsn_from", opt_stringptr, &dsn_from },
{ "envelope_to_remove", opt_bool, &envelope_to_remove },
{ "errors_copy", opt_stringptr, &errors_copy },
{ "errors_reply_to", opt_stringptr, &errors_reply_to },
# ----- Main settings -----
+dsn_from = MailProgram <xyz@some.where>
# ----- Routers -----
for CALLER@myhost.ex; Tue, 2 Mar 1999 09:44:33 +0000
X-Failed-Recipients: userx@mxt1.test.ex
Auto-Submitted: auto-replied
-From: Mail Delivery System <Mailer-Daemon@myhost.ex>
+From: MailProgram <xyz@some.where>
To: CALLER@myhost.ex
Subject: Mail delivery failed: returning message to sender
Message-Id: <E10HmaY-0005vi-00@myhost.ex>