ph10 2006/10/31 16:08:12 GMT
Modified files:
exim-doc/doc-txt ChangeLog
exim-src/src match.c
Added files:
exim-test/confs 0544
exim-test/log 0544
exim-test/scripts/0000-Basic 0544
exim-test/stderr 0544
exim-test/stdout 0544
Log:
$domain not always set when scanning a domain list.
Revision Changes Path
1.423 +4 -0 exim/exim-doc/doc-txt/ChangeLog
1.16 +13 -1 exim/exim-src/src/match.c
1.1 +70 -0 exim/exim-test/confs/0544 (new)
1.1 +3 -0 exim/exim-test/log/0544 (new)
1.1 +13 -0 exim/exim-test/scripts/0000-Basic/0544 (new)
1.1 +109 -0 exim/exim-test/stderr/0544 (new)
1.1 +8 -0 exim/exim-test/stdout/0544 (new)
Index: ChangeLog
===================================================================
RCS file: /home/cvs/exim/exim-doc/doc-txt/ChangeLog,v
retrieving revision 1.422
retrieving revision 1.423
diff -u -r1.422 -r1.423
--- ChangeLog 31 Oct 2006 14:26:34 -0000 1.422
+++ ChangeLog 31 Oct 2006 16:08:11 -0000 1.423
@@ -1,4 +1,4 @@
-$Cambridge: exim/exim-doc/doc-txt/ChangeLog,v 1.422 2006/10/31 14:26:34 ph10 Exp $
+$Cambridge: exim/exim-doc/doc-txt/ChangeLog,v 1.423 2006/10/31 16:08:11 ph10 Exp $
Change log file for Exim from version 4.21
-------------------------------------------
@@ -225,6 +225,10 @@
PH/33 The hint "could be header name not terminated by colon", which has been
given for certain expansion errors for a long time, was not being given
for the ${if def:h_colon_omitted{... case.
+
+PH/34 The spec says: "With one important exception, whenever a domain list is
+ being scanned, $domain contains the subject domain." There was at least
+ one case where this was not true.
Exim version 4.63
Index: match.c
===================================================================
RCS file: /home/cvs/exim/exim-src/src/match.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- match.c 27 Jul 2006 13:50:43 -0000 1.15
+++ match.c 31 Oct 2006 16:08:11 -0000 1.16
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/exim-src/src/match.c,v 1.15 2006/07/27 13:50:43 ph10 Exp $ */
+/* $Cambridge: exim/exim-src/src/match.c,v 1.16 2006/10/31 16:08:11 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -481,7 +481,19 @@
}
else
{
- list = expand_string(*listptr);
+ /* If we are searching a domain list, and $domain is not set, set it to the
+ subject that is being sought for the duration of the expansion. */
+
+ if (type == MCL_DOMAIN && deliver_domain == NULL)
+ {
+ check_string_block *cb = (check_string_block *)arg;
+ deliver_domain = cb->subject;
+ list = expand_string(*listptr);
+ deliver_domain = NULL;
+ }
+
+ else list = expand_string(*listptr);
+
if (list == NULL)
{
if (expand_string_forcedfail)
Index: 0544
====================================================================
# Exim test configuration 0544
exim_path = EXIM_PATH
host_lookup_order = bydns
rfc1413_query_timeout = 0s
spool_directory = DIR/spool
log_file_path = DIR/spool/log/%slog
gecos_pattern = ""
gecos_name = CALLER_NAME
# ----- Main settings -----
domainlist dlist = testdb;$domain
acl_smtp_helo = check_helo
acl_smtp_mail = check_mail
acl_smtp_rcpt = check_rcpt
queue_smtp_domains = testdb;$domain
qualify_domain = test.ex
# ----- ACLs -----
begin acl
check_helo:
warn
condition = ${if match_domain {$sender_helo_name}{+dlist}}
accept
check_mail:
warn hosts = domain=$domain/sender_domain=$sender_address_domain
accept
check_rcpt:
warn domains = domain=$domain/sender_domain=$sender_address_domain
warn sender_domains = domain=$domain/sender_domain=$sender_address_domain
accept
# ----- Routers -----
begin routers
smarthost:
driver = accept
transport = smtp
# ----- Transports -----
begin transports
smtp:
driver = smtp
hosts = 127.0.0.1
allow_localhost
port = PORT_S
# ----- Retry -----
begin retry
* * F,5d,15m
# End
Index: 0544
====================================================================
1999-03-02 09:44:33 10HmaX-0005vi-00 <= CALLER@??? U=CALLER P=local S=sss
1999-03-02 09:44:33 10HmaX-0005vi-00 == userx@??? R=smarthost T=smtp defer (-1): domain matches queue_smtp_domains, or -odqs set
1999-03-02 09:44:33 10HmaX-0005vi-00 == userx@??? R=smarthost T=smtp defer (-1): domain matches queue_smtp_domains, or -odqs set
Index: 0544
====================================================================
# $domain setting in domain list matching
need_ipv4
#
exim -odi -d-all+expand userx@??? userx@???
****
# Check of $domain and $sender_domain at RCPT time
exim -bs -d-all+expand
ehlo ehlo.domain
mail from:<userx@???>
rcpt to:<userx@???>
quit
****
no_msglog_check
Index: 0544
====================================================================
Exim version x.yz ....
configuration file is TESTSUITE/test-config
admin user
expanding: ${tod_full}
result: Tue, 2 Mar 1999 09:44:33 +0000
condition: def:sender_rcvhost
result: false
expanding: from $sender_rcvhost
result: from
skipping: result is not used
condition: def:sender_ident
result: true
expanding: $sender_ident
result: CALLER
expanding: from ${quote_local_part:$sender_ident}
result: from CALLER
condition: def:sender_helo_name
result: false
expanding: (helo=$sender_helo_name)
result: (helo=)
skipping: result is not used
expanding: ${if def:sender_ident {from ${quote_local_part:$sender_ident} }}${if def:sender_helo_name {(helo=$sender_helo_name)
}}
result: from CALLER
condition: def:received_protocol
result: true
expanding: with $received_protocol
result: with local
condition: def:sender_address
result: true
expanding: (envelope-from <$sender_address>)
result: (envelope-from <CALLER@???>)
condition: def:received_for
result: false
expanding:
for $received_for
result:
for
skipping: result is not used
expanding: ${tod_full}
result: Tue, 2 Mar 1999 09:44:33 +0000
LOG: MAIN
<= CALLER@??? U=CALLER P=local S=sss
created log directory TESTSUITE/spool/log
Exim version x.yz ....
configuration file is TESTSUITE/test-config
trusted user
admin user
expanding: testdb;$domain
result: testdb;domain1.ex
LOG: MAIN
== userx@??? R=smarthost T=smtp defer (-1): domain matches queue_smtp_domains, or -odqs set
LOG: MAIN
== userx@??? R=smarthost T=smtp defer (-1): domain matches queue_smtp_domains, or -odqs set
expanding: $h_list-id:$h_list-post:$h_list-subscribe:
result:
expanding:
result:
expanding: $h_precedence:
result:
expanding: (?i)bulk|list|junk
result: (?i)bulk|list|junk
expanding: $h_auto-submitted:
result:
expanding: (?i)auto-generated|auto-replied
result: (?i)auto-generated|auto-replied
condition: or {{ !eq{$h_list-id:$h_list-post:$h_list-subscribe:}{} }{ match{$h_precedence:}{(?i)bulk|list|junk} }{ match{$h_auto-submitted:}{(?i)auto-generated|auto-replied} }}
result: false
expanding: no
result: no
skipping: result is not used
expanding: yes
result: yes
expanding: ${if or {{ !eq{$h_list-id:$h_list-post:$h_list-subscribe:}{} }{ match{$h_precedence:}{(?i)bulk|list|junk} }{ match{$h_auto-submitted:}{(?i)auto-generated|auto-replied} }} {no}{yes}}
result: yes
>>>>>>>>>>>>>>>> Exim pid=pppp terminating with rc=0 >>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Exim pid=pppp terminating with rc=0 >>>>>>>>>>>>>>>>
Exim version x.yz ....
configuration file is TESTSUITE/test-config
admin user
LOG: smtp_connection MAIN
SMTP connection from CALLER
expanding: $smtp_active_hostname ESMTP Exim $version_number $tod_full
result: the.local.host.name ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000
expanding: $sender_helo_name
result: ehlo.domain
expanding: +dlist
result: +dlist
expanding: testdb;$domain
result: testdb;ehlo.domain
condition: match_domain {$sender_helo_name}{+dlist}
result: true
expanding: ${if match_domain {$sender_helo_name}{+dlist}}
result: true
expanding: domain=$domain/sender_domain=$sender_address_domain
result: domain=/sender_domain=sender.domain
expanding: domain=$domain/sender_domain=$sender_address_domain
result: domain=recipient.domain/sender_domain=sender.domain
expanding: domain=$domain/sender_domain=$sender_address_domain
result: domain=recipient.domain/sender_domain=sender.domain
LOG: smtp_connection MAIN
SMTP connection from CALLER closed by QUIT
>>>>>>>>>>>>>>>> Exim pid=pppp terminating with rc=0 >>>>>>>>>>>>>>>>
Index: 0544
====================================================================
220 the.local.host.name ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000
250-the.local.host.name Hello CALLER at ehlo.domain
250-SIZE 52428800
250-PIPELINING
250 HELP
250 OK
250 Accepted
221 the.local.host.name closing connection