provided by quota_warn_message.
-$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.287 2006/02/08 14:28:51 ph10 Exp $
+$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.288 2006/02/08 16:10:46 ph10 Exp $
Change log file for Exim from version 4.21
-------------------------------------------
using the correct key (the original address) when searching the retry
rules in order to find which one to use for generating the retry hint.
+PH/18 If quota_warn_message contains a From: header, Exim now refrains from
+ adding the default one. Similarly, if it contains a Reply-To: header, the
+ errors_reply_to option, if set, is not used.
+
Exim version 4.60
-$Cambridge: exim/doc/doc-txt/NewStuff,v 1.80 2005/12/12 15:58:53 ph10 Exp $
+$Cambridge: exim/doc/doc-txt/NewStuff,v 1.81 2006/02/08 16:10:46 ph10 Exp $
New Features in Exim
--------------------
data, etc. are also ignored. If IP literals are enabled, the ipliteral
router declines to handle IPv6 literal addresses.
-PH/01 There are now 20 of each type of ACL variable by default (instead of 10).
+PH/02 There are now 20 of each type of ACL variable by default (instead of 10).
It is also possible to change the numbers by setting ACL_CVARS and/or
ACL_MVARS in Local/Makefile. Backward compatibility is maintained if you
upgrade to this release with existing messages containing ACL variable
(downgrading) will not be compatible; the values of ACL variables will be
lost.
+PH/03 If quota_warn_message contains a From: header, Exim now refrains from
+ adding the default one. Similarly, if it contains a Reply-To: header, the
+ errors_reply_to option, if set, is not used.
+
Version 4.60
------------
-/* $Cambridge: exim/src/src/deliver.c,v 1.27 2006/02/08 14:28:51 ph10 Exp $ */
+/* $Cambridge: exim/src/src/deliver.c,v 1.28 2006/02/08 16:10:46 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
+/******************************************************
+* Check for a given header in a header string *
+******************************************************/
+
+/* This function is used when generating quota warnings. The configuration may
+specify any header lines it likes in quota_warn_message. If certain of them are
+missing, defaults are inserted, so we need to be able to test for the presence
+of a given header.
+
+Arguments:
+ hdr the required header name
+ hstring the header string
+
+Returns: TRUE the header is in the string
+ FALSE the header is not in the string
+*/
+
+static BOOL
+contains_header(uschar *hdr, uschar *hstring)
+{
+int len = Ustrlen(hdr);
+uschar *p = hstring;
+while (*p != 0)
+ {
+ if (strncmpic(p, hdr, len) == 0)
+ {
+ p += len;
+ while (*p == ' ' || *p == '\t') p++;
+ if (*p == ':') return TRUE;
+ }
+ while (*p != 0 && *p != '\n') p++;
+ if (*p == '\n') p++;
+ }
+return FALSE;
+}
+
+
+
/*************************************************
* Perform a local delivery *
if (pid > 0)
{
FILE *f = fdopen(fd, "wb");
-
- if (errors_reply_to != NULL)
+ if (errors_reply_to != NULL &&
+ !contains_header(US"Reply-To", warn_message))
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);
+ if (!contains_header(US"From", warn_message))
+ fprintf(f, "From: Mail Delivery System <Mailer-Daemon@%s>\n",
+ qualify_domain_sender);
fprintf(f, "%s", CS warn_message);
/* Close and wait for child process to complete, without a timeout. */
# Exim test configuration 0095
+ERT=
+QWM=
+
exim_path = EXIM_PATH
host_lookup_order = bydns
primary_hostname = myhost.test.ex
# ----- Main settings -----
+ERT
# ----- Routers -----
file = DIR/test-mail/$local_part
quota = $h_quota
quota_warn_threshold = $h_threshold
+ QWM
user = CALLER
appendfile2:
id 10HmbA-0005vi-00
for userx@myhost.test.ex; Tue, 2 Mar 1999 09:44:33 +0000
Auto-Submitted: auto-replied
-From: Mail Delivery System <Mailer-Daemon@myhost.test.ex>
+From : p@q
+Reply-To: a@b
To: userx@myhost.test.ex
Subject: Your mailbox
Message-Id: <E10HmbA-0005vi-00@myhost.test.ex>
Date: Tue, 2 Mar 1999 09:44:33 +0000
-This message is automatically created by mail delivery software (Exim).
-
-The size of your mailbox has exceeded a warning threshold that is
-set by the system administrator.
+Your mailbox has crossed the threshold
From CALLER@myhost.test.ex Tue Mar 02 09:44:33 1999
Received: from CALLER by myhost.test.ex with local (Exim x.yz)
Received: from root by myhost.test.ex with local (Exim x.yz)
id 10HmbC-0005vi-00
for userx@myhost.test.ex; Tue, 2 Mar 1999 09:44:33 +0000
+Reply-To: x@y
Auto-Submitted: auto-replied
From: Mail Delivery System <Mailer-Daemon@myhost.test.ex>
To: userx@myhost.test.ex
threshold: 10
This is a test message
****
-exim -odi userx
+exim -DERT='errors_reply_to = x@y' \
+ -DQWM='quota_warn_message = From : p@q\n\
+ Reply-To: a@b\n\
+ To: $local_part@$domain\n\
+ Subject: Your mailbox\n\n\
+ Your mailbox has crossed the threshold\n' \
+ -odi userx
quota: 10K
threshold: 900
A test message
****
-exim -odi userx
+exim -DERT='errors_reply_to = x@y' -odi userx
quota: 2200
threshold: 90%
This is a test message