From fcc8e04755fd6f211fd636e6c077ac41963ab0b9 Mon Sep 17 00:00:00 2001 From: Jeremy Harris Date: Sun, 19 May 2013 18:14:50 +0100 Subject: Support AUTH for verify-callout and cutthrough-delivery. Refactored smtp transport to pull out AUTH-related routines so they could be also called from the verify code. Bugs 321, 823. --- test/confs/0568 | 70 +++++++++++++++++++++++++++++++++++++ test/scripts/0000-Basic/0568 | 76 ++++++++++++++++++++++++++++++++++++++++ test/stderr/0398 | 1 + test/stderr/0432 | 2 ++ test/stderr/5410 | 3 ++ test/stdout/0568 | 82 ++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 234 insertions(+) create mode 100644 test/confs/0568 create mode 100644 test/scripts/0000-Basic/0568 create mode 100644 test/stdout/0568 (limited to 'test') diff --git a/test/confs/0568 b/test/confs/0568 new file mode 100644 index 000000000..dec5b0dbc --- /dev/null +++ b/test/confs/0568 @@ -0,0 +1,70 @@ +# Exim test configuration 0568 +# Recipient callout with AUTH + +exim_path = EXIM_PATH +host_lookup_order = bydns +primary_hostname = myhost.test.ex +rfc1413_query_timeout = 0s +spool_directory = DIR/spool +log_file_path = DIR/spool/log/%slog +gecos_pattern = "" +gecos_name = CALLER_NAME + +# ----- Main settings ----- + +acl_smtp_rcpt = check_rcpt + +queue_only + + +# ----- Authentication ----- + +begin authenticators + +plain: + driver = plaintext + public_name = PLAIN + client_send = ^userx^secret + server_advertise_condition = yes + server_prompts = : + server_condition = yes + server_set_id = $auth2 + + +# ----- ACLs ----- + +begin acl + +check_rcpt: + accept verify = recipient/callout + + +# ----- Routers ----- + +begin routers + +r1: + driver = accept + transport = ${if eq{force}{$domain} {t2}{t1}} + + +# ----- Transports ----- + +begin transports + +t1: + driver = smtp + hosts = 127.0.0.1 + port = PORT_S + allow_localhost + hosts_try_auth = * + +t2: + driver = smtp + hosts = 127.0.0.1 + port = PORT_S + allow_localhost + hosts_try_auth = * + authenticated_sender= brian + +# End diff --git a/test/scripts/0000-Basic/0568 b/test/scripts/0000-Basic/0568 new file mode 100644 index 000000000..2aa86f45d --- /dev/null +++ b/test/scripts/0000-Basic/0568 @@ -0,0 +1,76 @@ +# Recipient callout with AUTH +need_ipv4 +# +# Variant 1: using authenticated_sender on the transport. +server PORT_S 1 +220 Welcome +EHLO +250-wotcher mate +250-AUTH PLAIN +250 Hi +AUTH +250 Oh alright then +MAIL FROM +250 OK +RCPT TO +250 OK +QUIT +250 OK +**** +exim -odq -bs +EHLO the.client +mail from:<> +RCPT TO: +quit +**** +# +# +# Variant 2: Passing through an authenticated_sender from the MAIL FROM: +server PORT_S 1 +220 Welcome +EHLO +250-wotcher mate +250-AUTH PLAIN +250 Hi +AUTH +250 Oh alright then +MAIL FROM +250 OK +RCPT TO +250 OK +QUIT +250 OK +**** +exim -odq -bs +EHLO the.client +AUTH PLAIN AHVzZXJ4AHNlY3JldA== +mail from:<> AUTH=freddy +RCPT TO: +quit +**** +# +# +# Variant 3: An authenticated_sender option on the transport should override +# a value set by the MAIL FROM: +server PORT_S 1 +220 Welcome +EHLO +250-wotcher mate +250-AUTH PLAIN +250 Hi +AUTH +250 Oh alright then +MAIL FROM +250 OK +RCPT TO +250 OK +QUIT +250 OK +**** +exim -odq -bs +EHLO the.client +AUTH PLAIN AHVzZXJ4AHNlY3JldA== +mail from:<> AUTH=freddy +RCPT TO: +quit +**** diff --git a/test/stderr/0398 b/test/stderr/0398 index 4e97f4e00..0ad911345 100644 --- a/test/stderr/0398 +++ b/test/stderr/0398 @@ -129,6 +129,7 @@ Connecting to 127.0.0.1 [127.0.0.1]:1224 ... connected 127.0.0.1 in hosts_avoid_esmtp? no (option unset) SMTP>> EHLO mail.test.ex SMTP<< 250 OK +127.0.0.1 in hosts_require_auth? no (option unset) SMTP>> MAIL FROM:<> SMTP<< 250 OK SMTP>> RCPT TO: diff --git a/test/stderr/0432 b/test/stderr/0432 index 33e1b9892..759c9a819 100644 --- a/test/stderr/0432 +++ b/test/stderr/0432 @@ -92,6 +92,7 @@ Connecting to 127.0.0.1 [127.0.0.1]:1224 ... connected 127.0.0.1 in hosts_avoid_esmtp? no (option unset) SMTP>> EHLO myhost.test.ex SMTP<< 250 OK +127.0.0.1 in hosts_require_auth? no (option unset) SMTP>> MAIL FROM:<> SMTP<< 250 OK SMTP>> RCPT TO: @@ -246,6 +247,7 @@ MUNGED: ::1 will be omitted in what follows >>> 127.0.0.1 in hosts_avoid_esmtp? no (option unset) >>> SMTP>> EHLO myhost.test.ex >>> SMTP<< 250 OK +>>> 127.0.0.1 in hosts_require_auth? no (option unset) >>> SMTP>> MAIL FROM:<> >>> SMTP<< 250 OK >>> SMTP>> RCPT TO: diff --git a/test/stderr/5410 b/test/stderr/5410 index f8b31a750..40ef77c4a 100644 --- a/test/stderr/5410 +++ b/test/stderr/5410 @@ -86,6 +86,7 @@ expanding: ${if eq {$address_data}{userz}{*}{:}} 250-8BITMIME 250-PIPELINING 250 HELP +127.0.0.1 in hosts_require_auth? no (option unset) SMTP>> MAIL FROM: SMTP<< 250 OK SMTP>> RCPT TO: @@ -218,6 +219,7 @@ skipping: result is not used expanding: ${if eq {$address_data}{usery}{*}{:}} result: * 127.0.0.1 in hosts_avoid_tls? yes (matched "*") +127.0.0.1 in hosts_require_auth? no (option unset) SMTP>> MAIL FROM: SMTP<< 250 OK SMTP>> RCPT TO: @@ -350,6 +352,7 @@ skipping: result is not used expanding: ${if eq {$address_data}{usery}{*}{:}} result: * 127.0.0.1 in hosts_avoid_tls? yes (matched "*") +127.0.0.1 in hosts_require_auth? no (option unset) SMTP>> MAIL FROM: SMTP<< 250 OK SMTP>> RCPT TO: diff --git a/test/stdout/0568 b/test/stdout/0568 new file mode 100644 index 000000000..671998a86 --- /dev/null +++ b/test/stdout/0568 @@ -0,0 +1,82 @@ +220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000 +250-myhost.test.ex Hello CALLER at the.client +250-SIZE 52428800 +250-8BITMIME +250-PIPELINING +250-AUTH PLAIN +250 HELP +250 OK +250 Accepted +221 myhost.test.ex closing connection +220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000 +250-myhost.test.ex Hello CALLER at the.client +250-SIZE 52428800 +250-8BITMIME +250-PIPELINING +250-AUTH PLAIN +250 HELP +235 Authentication succeeded +250 OK +250 Accepted +221 myhost.test.ex closing connection +220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000 +250-myhost.test.ex Hello CALLER at the.client +250-SIZE 52428800 +250-8BITMIME +250-PIPELINING +250-AUTH PLAIN +250 HELP +235 Authentication succeeded +250 OK +250 Accepted +221 myhost.test.ex closing connection + +******** SERVER ******** +Listening on port 1224 ... +Connection request from [127.0.0.1] +220 Welcome +EHLO myhost.test.ex +250-wotcher mate +250-AUTH PLAIN +250 Hi +AUTH PLAIN AHVzZXJ4AHNlY3JldA== +250 Oh alright then +MAIL FROM:<> AUTH=brian +250 OK +RCPT TO: +250 OK +QUIT +250 OK +End of script +Listening on port 1224 ... +Connection request from [127.0.0.1] +220 Welcome +EHLO myhost.test.ex +250-wotcher mate +250-AUTH PLAIN +250 Hi +AUTH PLAIN AHVzZXJ4AHNlY3JldA== +250 Oh alright then +MAIL FROM:<> AUTH=freddy +250 OK +RCPT TO: +250 OK +QUIT +250 OK +End of script +Listening on port 1224 ... +Connection request from [127.0.0.1] +220 Welcome +EHLO myhost.test.ex +250-wotcher mate +250-AUTH PLAIN +250 Hi +AUTH PLAIN AHVzZXJ4AHNlY3JldA== +250 Oh alright then +MAIL FROM:<> AUTH=brian +250 OK +RCPT TO: +250 OK +QUIT +250 OK +End of script -- cgit v1.2.3