ph10 2004/10/19 12:04:26 BST
Modified files:
exim-doc/doc-txt ChangeLog NewStuff
exim-src/src acl.c exim.c globals.c globals.h
receive.c smtp_in.c
exim-test-orig/AutoTest/confs 571
exim-test-orig/AutoTest/log 449
exim-test-orig/AutoTest/mail 449.ok
exim-test-orig/AutoTest/scripts 571
exim-test-orig/AutoTest/stdout 571
Log:
Added /sender_retain facility to control=submission, named by analogy
with the local_sender_retain option.
Revision Changes Path
1.10 +2 -0 exim/exim-doc/doc-txt/ChangeLog
1.3 +4 -0 exim/exim-doc/doc-txt/NewStuff
1.3 +19 -7 exim/exim-src/src/acl.c
1.5 +5 -0 exim/exim-src/src/exim.c
1.3 +3 -1 exim/exim-src/src/globals.c
1.3 +3 -1 exim/exim-src/src/globals.h
1.3 +11 -11 exim/exim-src/src/receive.c
1.2 +4 -2 exim/exim-src/src/smtp_in.c
1.2 +2 -2 exim/exim-test-orig/AutoTest/confs/571
1.2 +1 -1 exim/exim-test-orig/AutoTest/log/449
1.2 +3 -1 exim/exim-test-orig/AutoTest/mail/449.ok
1.2 +39 -3 exim/exim-test-orig/AutoTest/scripts/571
1.2 +56 -0 exim/exim-test-orig/AutoTest/stdout/571
Index: ChangeLog
===================================================================
RCS file: /home/cvs/exim/exim-doc/doc-txt/ChangeLog,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- ChangeLog 18 Oct 2004 11:36:23 -0000 1.9
+++ ChangeLog 19 Oct 2004 11:04:26 -0000 1.10
@@ -1,4 +1,4 @@
-$Cambridge: exim/exim-doc/doc-txt/ChangeLog,v 1.9 2004/10/18 11:36:23 ph10 Exp $
+$Cambridge: exim/exim-doc/doc-txt/ChangeLog,v 1.10 2004/10/19 11:04:26 ph10 Exp $
Change log file for Exim from version 4.21
-------------------------------------------
@@ -37,6 +37,8 @@
controls (e.g. 4.43/32), the checks on when to allow different forms of
"control" were broken. There should now be diagnostics for all cases when a
control that does not make sense is encountered.
+
+ 9. Added the /retain_sender option to "control=submission".
Exim version 4.43
Index: NewStuff
===================================================================
RCS file: /home/cvs/exim/exim-doc/doc-txt/NewStuff,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- NewStuff 18 Oct 2004 09:16:57 -0000 1.2
+++ NewStuff 19 Oct 2004 11:04:26 -0000 1.3
@@ -1,4 +1,4 @@
-$Cambridge: exim/exim-doc/doc-txt/NewStuff,v 1.2 2004/10/18 09:16:57 ph10 Exp $
+$Cambridge: exim/exim-doc/doc-txt/NewStuff,v 1.3 2004/10/19 11:04:26 ph10 Exp $
New Features in Exim
--------------------
@@ -15,6 +15,10 @@
1. There is a new build-time option called CONFIGURE_GROUP which works like
CONFIGURE_OWNER. It specifies one additional group that is permitted for
the runtime configuration file when the group write permission is set.
+
+ 2. The "control=submission" facility has a new option /retain_sender. This
+ has the effect of setting local_sender_retain true and local_from_check
+ false for the incoming message in which it is encountered.
Version 4.43
Index: acl.c
===================================================================
RCS file: /home/cvs/exim/exim-src/src/acl.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- acl.c 18 Oct 2004 11:36:23 -0000 1.2
+++ acl.c 19 Oct 2004 11:04:26 -0000 1.3
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/exim-src/src/acl.c,v 1.2 2004/10/18 11:36:23 ph10 Exp $ */
+/* $Cambridge: exim/exim-src/src/acl.c,v 1.3 2004/10/19 11:04:26 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -1384,14 +1384,26 @@
case CONTROL_SUBMISSION:
submission_mode = TRUE;
- if (Ustrncmp(p, "/domain=", 8) == 0)
- {
- submission_domain = string_copy(p+8);
- }
- else if (*p != 0)
+ while (*p == '/')
+ {
+ if (Ustrncmp(p, "/sender_retain", 14) == 0)
+ {
+ p += 14;
+ active_local_sender_retain = TRUE;
+ active_local_from_check = FALSE;
+ }
+ else if (Ustrncmp(p, "/domain=", 8) == 0)
+ {
+ uschar *pp = p + 8;
+ while (*pp != 0 && *pp != '/') pp++;
+ submission_domain = string_copyn(p+8, pp-p);
+ p = pp;
+ }
+ else break;
+ }
+ if (*p != 0)
{
- *log_msgptr = string_sprintf("syntax error in argument for "
- "\"control\" modifier \"%s\"", arg);
+ *log_msgptr = string_sprintf("syntax error in \"control=%s\"", arg);
return ERROR;
}
break;
Index: exim.c
===================================================================
RCS file: /home/cvs/exim/exim-src/src/exim.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- exim.c 18 Oct 2004 09:26:02 -0000 1.4
+++ exim.c 19 Oct 2004 11:04:26 -0000 1.5
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/exim-src/src/exim.c,v 1.4 2004/10/18 09:26:02 ph10 Exp $ */
+/* $Cambridge: exim/exim-src/src/exim.c,v 1.5 2004/10/19 11:04:26 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -4393,6 +4393,11 @@
int rcount = 0;
int count = argc - recipients_arg;
uschar **list = argv + recipients_arg;
+
+ /* These options cannot be changed dynamically for non-SMTP messages */
+
+ active_local_sender_retain = local_sender_retain;
+ active_local_from_check = local_from_check;
/* Save before any rewriting */
Index: globals.c
===================================================================
RCS file: /home/cvs/exim/exim-src/src/globals.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- globals.c 18 Oct 2004 09:16:57 -0000 1.2
+++ globals.c 19 Oct 2004 11:04:26 -0000 1.3
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/exim-src/src/globals.c,v 1.2 2004/10/18 09:16:57 ph10 Exp $ */
+/* $Cambridge: exim/exim-src/src/globals.c,v 1.3 2004/10/19 11:04:26 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -209,7 +209,9 @@
550, /* STARTTLS */
252 /* VRFY */
};
-
+
+BOOL active_local_from_check = FALSE;
+BOOL active_local_sender_retain = FALSE;
BOOL accept_8bitmime = FALSE;
address_item *addr_duplicate = NULL;
Index: globals.h
===================================================================
RCS file: /home/cvs/exim/exim-src/src/globals.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- globals.h 18 Oct 2004 09:16:57 -0000 1.2
+++ globals.h 19 Oct 2004 11:04:26 -0000 1.3
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/exim-src/src/globals.h,v 1.2 2004/10/18 09:16:57 ph10 Exp $ */
+/* $Cambridge: exim/exim-src/src/globals.h,v 1.3 2004/10/19 11:04:26 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -118,6 +118,8 @@
extern string_item *acl_warn_logged; /* Logged lines */
extern int acl_wherecodes[]; /* Response codes for ACL fails */
extern uschar *acl_wherenames[]; /* Names for messages */
+extern BOOL active_local_from_check;/* For adding Sender: (switchable) */
+extern BOOL active_local_sender_retain; /* For keeping Sender: (switchable) */
extern address_item *addr_duplicate; /* Duplicate address list */
extern address_item address_defaults; /* Default data for address item */
extern uschar *address_file; /* Name of file when delivering to one */
@@ -324,7 +326,7 @@
extern uschar *eldap_dn; /* Where LDAP DNs are left */
extern int load_average; /* Most recently read load average */
extern BOOL local_error_message; /* True if handling one of these */
-extern BOOL local_from_check; /* For adding Sender: */
+extern BOOL local_from_check; /* For adding Sender: (global value) */
extern uschar *local_from_prefix; /* Permitted prefixes */
extern uschar *local_from_suffix; /* Permitted suffixes */
extern uschar *local_interfaces; /* For forcing specific interfaces */
Index: receive.c
===================================================================
RCS file: /home/cvs/exim/exim-src/src/receive.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- receive.c 18 Oct 2004 11:36:23 -0000 1.2
+++ receive.c 19 Oct 2004 11:04:26 -0000 1.3
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/exim-src/src/receive.c,v 1.2 2004/10/18 11:36:23 ph10 Exp $ */
+/* $Cambridge: exim/exim-src/src/receive.c,v 1.3 2004/10/19 11:04:26 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -971,8 +971,9 @@
blocks.
. If there is a "sender:" header and the message is locally originated,
- throw it away, unless the caller is trusted, or unless local_sender_retain
- is set - which can only happen if local_from_check is false.
+ throw it away, unless the caller is trusted, or unless
+ active_local_sender_retain is set - which can only happen if
+ active_local_from_check is false.
. If recipients are to be extracted from the message, build the
recipients list from the headers, removing any that were on the
@@ -997,7 +998,7 @@
. If the sender is local, check that from: is correct, and if not, generate
a Sender: header, unless message comes from a trusted caller, or this
- feature is disabled by no_local_from_check.
+ feature is disabled by active_local_from_check being false.
. If there is no "date" header, generate one, for locally-originated
or submission mode messages only.
@@ -1767,17 +1768,16 @@
/* If there is a "Sender:" header and the message is locally originated,
and from an untrusted caller, or if we are in submission mode for a remote
message, mark it "old" so that it will not be transmitted with the message,
- unless local_sender_retain is set. (This can only be true if
- local_from_check is false.) If there are any resent- headers in the
+ unless active_local_sender_retain is set. (This can only be true if
+ active_local_from_check is false.) If there are any resent- headers in the
message, apply this rule to Resent-Sender: instead of Sender:. Messages
with multiple resent- header sets cannot be tidily handled. (For this
reason, at least one MUA - Pine - turns old resent- headers into X-resent-
headers when resending, leaving just one set.) */
case htype_sender:
- h->type = ((
- (sender_local && !trusted_caller && !local_sender_retain) ||
- submission_mode
+ h->type = ((!active_local_sender_retain &&
+ ((sender_local && !trusted_caller) || submission_mode)
) &&
(!resents_exist||is_resent))?
htype_old : htype_sender;
@@ -2194,9 +2194,9 @@
Sender: header is inserted, as required. */
if (from_header != NULL &&
- (
- (sender_local && local_from_check && !trusted_caller) ||
- (submission_mode && authenticated_id != NULL)
+ (active_local_from_check &&
+ ((sender_local && !trusted_caller) ||
+ (submission_mode && authenticated_id != NULL))
))
{
BOOL make_sender = TRUE;
Index: smtp_in.c
===================================================================
RCS file: /home/cvs/exim/exim-src/src/smtp_in.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- smtp_in.c 7 Oct 2004 10:39:01 -0000 1.1
+++ smtp_in.c 19 Oct 2004 11:04:26 -0000 1.2
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/exim-src/src/smtp_in.c,v 1.1 2004/10/07 10:39:01 ph10 Exp $ */
+/* $Cambridge: exim/exim-src/src/smtp_in.c,v 1.2 2004/10/19 11:04:26 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -803,8 +803,10 @@
message_size = -1;
acl_warn_headers = NULL;
queue_only_policy = FALSE;
-deliver_freeze = FALSE; /* Can be set by ACL */
-submission_mode = FALSE; /* Can be set by ACL */
+deliver_freeze = FALSE; /* Can be set by ACL */
+submission_mode = FALSE; /* Can be set by ACL */
+active_local_from_check = local_from_check; /* Can be set by ACL */
+active_local_sender_retain = local_sender_retain; /* Can be set by ACL */
sender_address = NULL;
raw_sender = NULL; /* After SMTP rewrite, before qualifying */
sender_address_unrewritten = NULL; /* Set only after verify rewrite */
Index: 571
===================================================================
RCS file: /home/cvs/exim/exim-test-orig/AutoTest/confs/571,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- 571 8 Oct 2004 14:49:16 -0000 1.1
+++ 571 19 Oct 2004 11:04:26 -0000 1.2
@@ -1,7 +1,7 @@
# Exim test configuration 571
SERVER=
-SUBMISSION_DOMAIN=
+SUBMISSION_OPTIONS=
AUTH_ID_DOMAIN=
# Macros are set externally in order to get the path
@@ -28,7 +28,7 @@
a1:
warn senders = ^(?!notsubmit@)
- control = submissionSUBMISSION_DOMAIN
+ control = submissionSUBMISSION_OPTIONS
accept
Index: 449
===================================================================
RCS file: /home/cvs/exim/exim-test-orig/AutoTest/log/449,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- 449 8 Oct 2004 14:49:31 -0000 1.1
+++ 449 19 Oct 2004 11:04:26 -0000 1.2
@@ -6,7 +6,7 @@
1999-03-02 09:44:33 10HmbB-0005vi-00 => ph10 <ph10@???> R=accept T=appendfile
1999-03-02 09:44:33 10HmbB-0005vi-00 Completed
1999-03-02 09:44:33 10HmaY-0005vi-00 F=<ok@test2> rejected by non-SMTP ACL: cannot test hosts condition in non-SMTP ACL
-1999-03-02 09:44:33 10HmbC-0005vi-00 <= <> R=10HmaY-0005vi-00 U=exim P=local S=801
+1999-03-02 09:44:33 10HmbC-0005vi-00 <= <> R=10HmaY-0005vi-00 U=exim P=local S=863
1999-03-02 09:44:33 10HmbC-0005vi-00 => ok <ok@test2> R=accept T=appendfile
1999-03-02 09:44:33 10HmbC-0005vi-00 Completed
1999-03-02 09:44:33 10HmbD-0005vi-00 <= ok@test3 U=ph10 P=local S=250
Index: 449.ok
===================================================================
RCS file: /home/cvs/exim/exim-test-orig/AutoTest/mail/449.ok,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- 449.ok 8 Oct 2004 14:49:42 -0000 1.1
+++ 449.ok 19 Oct 2004 11:04:26 -0000 1.2
@@ -10,7 +10,9 @@
Date: Tue, 2 Mar 1999 09:44:33 +0000
A message that you sent was rejected by the local scanning code that
-checks incoming messages on this system.
+checks incoming messages on this system. The following error was given:
+
+ local configuration problem
------ This is a copy of your message, including all the headers. ------
Index: 571
===================================================================
RCS file: /home/cvs/exim/exim-test-orig/AutoTest/scripts/571,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- 571 8 Oct 2004 14:49:53 -0000 1.1
+++ 571 19 Oct 2004 11:04:26 -0000 1.2
@@ -83,7 +83,7 @@
sleep 1
****
0
-exim -DSERVER=server -DSUBMISSION_DOMAIN=/domain=another.domain -bd -oX 1225
+exim -DSERVER=server -DSUBMISSION_OPTIONS=/domain=another.domain -bd -oX 1225
****
0
sleep 1
@@ -117,7 +117,7 @@
sleep 1
****
0
-exim -DSERVER=server -DSUBMISSION_DOMAIN=/domain= -DAUTH_ID_DOMAIN=@auth.id.domain -bd -oX 1225
+exim -DSERVER=server -DSUBMISSION_OPTIONS=/domain= -DAUTH_ID_DOMAIN=@auth.id.domain -bd -oX 1225
****
0
sleep 1
@@ -151,7 +151,7 @@
sleep 1
****
0
-exim -DSERVER=server -DSUBMISSION_DOMAIN=/domain= -DAUTH_ID_DOMAIN=@auth.id.domain -bd -oX 1225
+exim -DSERVER=server -DSUBMISSION_OPTIONS=/domain= -DAUTH_ID_DOMAIN=@auth.id.domain -bd -oX 1225
****
0
sleep 1
@@ -183,6 +183,36 @@
killdaemon
****
0
+exim -DSERVER=server -DSUBMISSION_OPTIONS=/domain=a.b.c/sender_retain -bd -oX 1225
+****
+0
+sleep 1
+****
+0
+client 127.0.0.1 1225
+??? 220
+ehlo rhu.barb
+??? 250-
+??? 250-
+??? 250-
+??? 250-
+??? 250
+mail from:<a@y>
+??? 250
+rcpt to:<x@y>
+??? 250
+data
+??? 354
+Sender: sender@???
+.
+??? 250
+quit
+??? 221
+****
+0
+killdaemon
+****
+0
catwrite /dev/null
****
0
@@ -241,5 +271,11 @@
****
0
exim -Mvh $msg10
+****
+0
+catwrite /dev/null
+****
+0
+exim -Mvh $msg11
****
no_msglog_check
Index: 571
===================================================================
RCS file: /home/cvs/exim/exim-test-orig/AutoTest/stdout/571,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- 571 8 Oct 2004 14:50:14 -0000 1.1
+++ 571 19 Oct 2004 11:04:26 -0000 1.2
@@ -205,6 +205,37 @@
??? 221
<<< 221 myhost.test.ex closing connection
End of script
+Connecting to 127.0.0.1 port 1225 ... connected
+??? 220
+<<< 220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000
+>>> ehlo rhu.barb
+??? 250-
+<<< 250-myhost.test.ex Hello ph10 at rhu.barb [127.0.0.1]
+??? 250-
+<<< 250-SIZE 52428800
+??? 250-
+<<< 250-PIPELINING
+??? 250-
+<<< 250-AUTH PLAIN
+??? 250
+<<< 250 HELP
+>>> mail from:<a@y>
+??? 250
+<<< 250 OK
+>>> rcpt to:<x@y>
+??? 250
+<<< 250 Accepted
+>>> data
+??? 354
+<<< 354 Enter message, ending with "." on a line by itself
+>>> Sender: sender@???
+>>> .
+??? 250
+<<< 250 OK id=10HmbH-0005vi-00
+>>> quit
+??? 221
+<<< 221 myhost.test.ex closing connection
+End of script
==========
==========
10HmaX-0005vi-00-H
@@ -451,4 +482,29 @@
016F From: abc@???
047I Message-Id: <E10HmbG-0005vi-00@???>
032S Sender: username@???
+038 Date: Tue, 2 Mar 1999 09:44:33 +0000
+==========
+==========
+10HmbH-0005vi-00-H
+ph10 1169 1169
+<a@y>
+ddddddddd 0
+-helo_name rhu.barb
+-host_address 127.0.0.1.9999
+-interface_address 127.0.0.1.1225
+-ident ph10
+-received_protocol esmtp
+-body_linecount 0
+-deliver_firsttime
+XX
+1
+x@y
+
+159P Received: from [127.0.0.1] (helo=rhu.barb ident=ph10)
+ by myhost.test.ex with esmtp (Exim x.yz)
+ id 10HmbH-0005vi-00
+ for x@y; Tue, 2 Mar 1999 09:44:33 +0000
+026S Sender: sender@???
+047I Message-Id: <E10HmbH-0005vi-00@???>
+010F From: a@y
038 Date: Tue, 2 Mar 1999 09:44:33 +0000