From f358d5e0ef3cb10a0a6d107f70e9e0442087f6f2 Mon Sep 17 00:00:00 2001 From: Jeremy Harris Date: Thu, 9 Apr 2015 22:15:53 +0100 Subject: [PATCH] sender verify callout --- src/src/acl.c | 3 ++ src/src/transports/smtp.c | 2 +- test/log/4201 | 23 +++++++++- test/rejectlog/4201 | 5 ++ test/scripts/4200-International/4201 | 53 ++++++++++++++++++++++ test/scripts/4200-International/REQUIRES | 1 + test/stdout/4201 | 58 ++++++++++++++++++++++++ 7 files changed, 143 insertions(+), 2 deletions(-) create mode 100644 test/scripts/4200-International/REQUIRES diff --git a/src/src/acl.c b/src/src/acl.c index e16fbb989..5c0de55e7 100644 --- a/src/src/acl.c +++ b/src/src/acl.c @@ -2079,6 +2079,9 @@ else if (verify_sender_address != NULL) uschar *save_address_data = deliver_address_data; sender_vaddr = deliver_make_addr(verify_sender_address, TRUE); +#ifdef EXPERIMENTAL_INTERNATIONAL + sender_vaddr->p.utf8 = message_smtputf8; +#endif if (no_details) setflag(sender_vaddr, af_sverify_told); if (verify_sender_address[0] != 0) { diff --git a/src/src/transports/smtp.c b/src/src/transports/smtp.c index c64885531..92df8fa2d 100644 --- a/src/src/transports/smtp.c +++ b/src/src/transports/smtp.c @@ -574,7 +574,7 @@ if (*errno_value == ERRNO_WRITEINCOMPLETE) /* Handle lack of advertised SMTPUTF8, for international message */ if (*errno_value == ERRNO_UTF8_FWD) { - *message = US string_sprintf("utf8 support required but not offerred for forwarding"); + *message = US string_sprintf("utf8 support required but not offered for forwarding"); DEBUG(D_deliver|D_transport) debug_printf("%s\n", *message); return TRUE; } diff --git a/test/log/4201 b/test/log/4201 index 467bb6c94..959070a82 100644 --- a/test/log/4201 +++ b/test/log/4201 @@ -15,7 +15,7 @@ 1999-03-02 09:44:33 End queue run: pid=pppp -qqff 1999-03-02 09:44:33 exim x.yz daemon started: pid=pppp, no queue runs, listening for SMTP on port 1225 1999-03-02 09:44:33 10HmbB-0005vi-00 <= यहलोगहिन्दीक्योंनहींबोलसकतेहैं@japanese.なぜみんな日本語を話してくれないのか.local U=CALLER P=utf8local-esmtp S=sss for userz@test.ex -1999-03-02 09:44:33 10HmbB-0005vi-00 ** userz@test.ex F=<यहलोगहिन्दीक्योंनहींबोलसकतेहैं@japanese.なぜみんな日本語を話してくれないのか.local> R=rmt T=rmt_smtp H=127.0.0.1 [127.0.0.1]: utf8 support required but not offerred for forwarding +1999-03-02 09:44:33 10HmbB-0005vi-00 ** userz@test.ex F=<यहलोगहिन्दीक्योंनहींबोलसकतेहैं@japanese.なぜみんな日本語を話してくれないのか.local> R=rmt T=rmt_smtp H=127.0.0.1 [127.0.0.1]: utf8 support required but not offered for forwarding 1999-03-02 09:44:33 10HmbC-0005vi-00 <= <> R=10HmbB-0005vi-00 U=EXIMUSER P=local S=sss for यहलोगहिन्दीक्योंनहींबोलसकतेहैं@japanese.なぜみんな日本語を話してくれないのか.local 1999-03-02 09:44:33 10HmbC-0005vi-00 no immediate delivery: queued by ACL 1999-03-02 09:44:33 10HmbB-0005vi-00 Completed @@ -51,3 +51,24 @@ 1999-03-02 09:44:33 10HmbI-0005vi-00 => :blackhole: R=localuser 1999-03-02 09:44:33 10HmbI-0005vi-00 Completed 1999-03-02 09:44:33 End queue run: pid=pppp -qqff +1999-03-02 09:44:33 exim x.yz daemon started: pid=pppp, no queue runs, listening for SMTP on port 1225 +1999-03-02 09:44:33 10HmbJ-0005vi-00 <= userV.වැල්_මී@test.ex U=CALLER P=utf8local-esmtp S=sss for user.அதிமதுரம்@test.ex +1999-03-02 09:44:33 10HmbK-0005vi-00 <= userV.වැල්_මී@test.ex H=localhost (the.local.host.name) [127.0.0.1] P=utf8esmtp S=sss id=E10HmbJ-0005vi-00@the.local.host.name for user.அதிமதுரம்@test.ex +1999-03-02 09:44:33 10HmbJ-0005vi-00 => user.அதிமதுரம்@test.ex F= R=rmt T=rmt_smtp H=127.0.0.1 [127.0.0.1] C="250 OK id=10HmbK-0005vi-00" +1999-03-02 09:44:33 10HmbJ-0005vi-00 Completed +1999-03-02 09:44:33 H=localhost (the.local.host.name) [127.0.0.1] F=<> rejected RCPT : relay not permitted +1999-03-02 09:44:33 10HmbL-0005vi-00 <= userW@test.ex U=CALLER P=utf8local-esmtp S=sss for user.ഇരട്ടിമധുരം@test.ex +1999-03-02 09:44:33 10HmbM-0005vi-00 <= userW@test.ex H=localhost (the.local.host.name) [127.0.0.1] P=utf8esmtp S=sss id=E10HmbL-0005vi-00@the.local.host.name for user.ഇരട്ടിമധുരം@test.ex +1999-03-02 09:44:33 10HmbL-0005vi-00 => user.ഇരട്ടിമധുരം@test.ex F= R=rmt T=rmt_smtp H=127.0.0.1 [127.0.0.1] C="250 OK id=10HmbM-0005vi-00" +1999-03-02 09:44:33 10HmbL-0005vi-00 Completed +1999-03-02 09:44:33 Start queue run: pid=pppp -qqff +1999-03-02 09:44:33 10HmbK-0005vi-00 => :blackhole: R=localuser +1999-03-02 09:44:33 10HmbK-0005vi-00 Completed +1999-03-02 09:44:33 10HmbM-0005vi-00 => :blackhole: R=localuser +1999-03-02 09:44:33 10HmbM-0005vi-00 Completed +1999-03-02 09:44:33 End queue run: pid=pppp -qqff +1999-03-02 09:44:33 exim x.yz daemon started: pid=pppp, no queue runs, listening for SMTP on port 1225 +1999-03-02 09:44:33 U=CALLER sender verify fail for : response to "EHLO the.local.host.name" from 127.0.0.1 [127.0.0.1] did not include SMTPUTF8 +1999-03-02 09:44:33 U=CALLER F= rejected RCPT : Sender verify failed +1999-03-02 09:44:33 U=CALLER sender verify fail for : response to "EHLO the.local.host.name" from 127.0.0.1 [127.0.0.1] did not include SMTPUTF8 +1999-03-02 09:44:33 U=CALLER F= rejected RCPT : Sender verify failed diff --git a/test/rejectlog/4201 b/test/rejectlog/4201 index efd8f1576..a8ced2cc1 100644 --- a/test/rejectlog/4201 +++ b/test/rejectlog/4201 @@ -1,3 +1,8 @@ 1999-03-02 09:44:33 H=localhost (the.local.host.name) [127.0.0.1] F=<> rejected RCPT : relay not permitted 1999-03-02 09:44:33 U=CALLER F= rejected RCPT : response to "EHLO the.local.host.name" from 127.0.0.1 [127.0.0.1] did not include SMTPUTF8 1999-03-02 09:44:33 U=CALLER F= rejected RCPT : response to "EHLO the.local.host.name" from 127.0.0.1 [127.0.0.1] did not include SMTPUTF8 +1999-03-02 09:44:33 H=localhost (the.local.host.name) [127.0.0.1] F=<> rejected RCPT : relay not permitted +1999-03-02 09:44:33 U=CALLER sender verify fail for : response to "EHLO the.local.host.name" from 127.0.0.1 [127.0.0.1] did not include SMTPUTF8 +1999-03-02 09:44:33 U=CALLER F= rejected RCPT : Sender verify failed +1999-03-02 09:44:33 U=CALLER sender verify fail for : response to "EHLO the.local.host.name" from 127.0.0.1 [127.0.0.1] did not include SMTPUTF8 +1999-03-02 09:44:33 U=CALLER F= rejected RCPT : Sender verify failed diff --git a/test/scripts/4200-International/4201 b/test/scripts/4200-International/4201 index c984f1c34..946bc3e93 100644 --- a/test/scripts/4200-International/4201 +++ b/test/scripts/4200-International/4201 @@ -188,3 +188,56 @@ exim -DSERVER=server -qqff **** # # +exim -DSERVER=server -bd -oX PORT_D +**** +# +# sender verify callout, pass +exim -bs -odi -DCONTROL="verify=sender/callout" +EHLO client.bh +MAIL FROM: SMTPUTF8 +RCPT TO: +DATA +Subject: test + +body +. +QUIT +**** +# sender+random verify callout, pass +exim -bs -odi -DCONTROL="verify=sender/callout=random" +EHLO client.bh +MAIL FROM: SMTPUTF8 +RCPT TO: +DATA +Subject: test + +body +. +QUIT +**** +# +killdaemon +exim -DSERVER=server -qqff +**** +# +# +# +# +exim -DSERVER=server -DOPTION="" -bd -oX PORT_D +**** +# sender verify callout, fail +exim -bs -odi -DCONTROL="verify=sender/callout" +EHLO client.sfail +MAIL FROM: SMTPUTF8 +RCPT TO: +QUIT +**** +# sender+random verify callout, fail +exim -bs -odi -DCONTROL="verify=sender/callout=random" +EHLO client.sfail +MAIL FROM: SMTPUTF8 +RCPT TO: +QUIT +**** +# +killdaemon diff --git a/test/scripts/4200-International/REQUIRES b/test/scripts/4200-International/REQUIRES new file mode 100644 index 000000000..c66f68046 --- /dev/null +++ b/test/scripts/4200-International/REQUIRES @@ -0,0 +1 @@ +support Experimental_International diff --git a/test/stdout/4201 b/test/stdout/4201 index 9cc30f216..64517ef33 100644 --- a/test/stdout/4201 +++ b/test/stdout/4201 @@ -148,3 +148,61 @@ End of script 354 Enter message, ending with "." on a line by itself 250 OK id=10HmbH-0005vi-00 221 the.local.host.name closing connection +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 client.bh +250-SIZE 52428800 +250-8BITMIME +250-PIPELINING +250-SMTPUTF8 +250 HELP +250 OK +250 Accepted +354 Enter message, ending with "." on a line by itself +250 OK id=10HmbJ-0005vi-00 +221 the.local.host.name closing connection +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 client.bh +250-SIZE 52428800 +250-8BITMIME +250-PIPELINING +250-SMTPUTF8 +250 HELP +250 OK +250 Accepted +354 Enter message, ending with "." on a line by itself +250 OK id=10HmbL-0005vi-00 +221 the.local.host.name closing connection +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 client.sfail +250-SIZE 52428800 +250-8BITMIME +250-PIPELINING +250-SMTPUTF8 +250 HELP +250 OK +550-Callback setup failed while verifying +550-533 mailbox name not allowed +550-The initial connection, or a HELO or MAIL FROM:<> command was +550-rejected. Refusing MAIL FROM:<> does not help fight spam, disregards +550-RFC requirements, and stops you from receiving standard bounce +550-messages. This host does not accept mail from domains whose servers +550-refuse bounces. +550 Sender verify failed +221 the.local.host.name closing connection +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 client.sfail +250-SIZE 52428800 +250-8BITMIME +250-PIPELINING +250-SMTPUTF8 +250 HELP +250 OK +550-Callback setup failed while verifying +550-533 mailbox name not allowed +550-The initial connection, or a HELO or MAIL FROM:<> command was +550-rejected. Refusing MAIL FROM:<> does not help fight spam, disregards +550-RFC requirements, and stops you from receiving standard bounce +550-messages. This host does not accept mail from domains whose servers +550-refuse bounces. +550 Sender verify failed +221 the.local.host.name closing connection -- 2.39.2