ph10 2006/02/08 16:10:47 GMT
Modified files:
exim-doc/doc-txt ChangeLog NewStuff
exim-src/src deliver.c
exim-test/confs 0095
exim-test/mail 0095.userx
exim-test/scripts/0000-Basic 0095
Log:
Don't add From: or Reply-To: to quota warning messages if they are
provided by quota_warn_message.
Revision Changes Path
1.288 +4 -0 exim/exim-doc/doc-txt/ChangeLog
1.81 +5 -1 exim/exim-doc/doc-txt/NewStuff
1.28 +43 -4 exim/exim-src/src/deliver.c
1.2 +5 -0 exim/exim-test/confs/0095
1.2 +4 -5 exim/exim-test/mail/0095.userx
1.2 +8 -2 exim/exim-test/scripts/0000-Basic/0095
Index: ChangeLog
===================================================================
RCS file: /home/cvs/exim/exim-doc/doc-txt/ChangeLog,v
retrieving revision 1.287
retrieving revision 1.288
diff -u -r1.287 -r1.288
--- ChangeLog 8 Feb 2006 14:28:51 -0000 1.287
+++ ChangeLog 8 Feb 2006 16:10:46 -0000 1.288
@@ -1,4 +1,4 @@
-$Cambridge: exim/exim-doc/doc-txt/ChangeLog,v 1.287 2006/02/08 14:28:51 ph10 Exp $
+$Cambridge: exim/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
-------------------------------------------
@@ -101,6 +101,10 @@
PH/17 If a delivery to a pipe, file, or autoreply was deferred, Exim was not
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.
Index: NewStuff
===================================================================
RCS file: /home/cvs/exim/exim-doc/doc-txt/NewStuff,v
retrieving revision 1.80
retrieving revision 1.81
diff -u -r1.80 -r1.81
--- NewStuff 12 Dec 2005 15:58:53 -0000 1.80
+++ NewStuff 8 Feb 2006 16:10:46 -0000 1.81
@@ -1,4 +1,4 @@
-$Cambridge: exim/exim-doc/doc-txt/NewStuff,v 1.80 2005/12/12 15:58:53 ph10 Exp $
+$Cambridge: exim/exim-doc/doc-txt/NewStuff,v 1.81 2006/02/08 16:10:46 ph10 Exp $
New Features in Exim
--------------------
@@ -20,13 +20,17 @@
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
settings on the queue. However, going in the other direction
(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
Index: deliver.c
===================================================================
RCS file: /home/cvs/exim/exim-src/src/deliver.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- deliver.c 8 Feb 2006 14:28:51 -0000 1.27
+++ deliver.c 8 Feb 2006 16:10:46 -0000 1.28
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/exim-src/src/deliver.c,v 1.27 2006/02/08 14:28:51 ph10 Exp $ */
+/* $Cambridge: exim/exim-src/src/deliver.c,v 1.28 2006/02/08 16:10:46 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -1490,6 +1490,44 @@
+/******************************************************
+* 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 *
@@ -1991,12 +2029,13 @@
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. */
Index: 0095
===================================================================
RCS file: /home/cvs/exim/exim-test/confs/0095,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- 0095 7 Feb 2006 10:34:25 -0000 1.1
+++ 0095 8 Feb 2006 16:10:47 -0000 1.2
@@ -1,5 +1,8 @@
# Exim test configuration 0095
+ERT=
+QWM=
+
exim_path = EXIM_PATH
host_lookup_order = bydns
primary_hostname = myhost.test.ex
@@ -11,6 +14,7 @@
# ----- Main settings -----
+ERT
# ----- Routers -----
@@ -43,6 +47,7 @@
file = DIR/test-mail/$local_part
quota = $h_quota
quota_warn_threshold = $h_threshold
+ QWM
user = CALLER
appendfile2:
Index: 0095.userx
===================================================================
RCS file: /home/cvs/exim/exim-test/mail/0095.userx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- 0095.userx 7 Feb 2006 10:34:59 -0000 1.1
+++ 0095.userx 8 Feb 2006 16:10:47 -0000 1.2
@@ -40,16 +40,14 @@
id 10HmbA-0005vi-00
for userx@???; Tue, 2 Mar 1999 09:44:33 +0000
Auto-Submitted: auto-replied
-From: Mail Delivery System <Mailer-Daemon@???>
+From : p@q
+Reply-To: a@b
To: userx@???
Subject: Your mailbox
Message-Id: <E10HmbA-0005vi-00@???>
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@??? Tue Mar 02 09:44:33 1999
Received: from CALLER by myhost.test.ex with local (Exim x.yz)
@@ -68,6 +66,7 @@
Received: from root by myhost.test.ex with local (Exim x.yz)
id 10HmbC-0005vi-00
for userx@???; Tue, 2 Mar 1999 09:44:33 +0000
+Reply-To: x@y
Auto-Submitted: auto-replied
From: Mail Delivery System <Mailer-Daemon@???>
To: userx@???
Index: 0095
===================================================================
RCS file: /home/cvs/exim/exim-test/scripts/0000-Basic/0095,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- 0095 7 Feb 2006 10:54:33 -0000 1.1
+++ 0095 8 Feb 2006 16:10:47 -0000 1.2
@@ -7,12 +7,18 @@
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