by Exim in conjunction with the &%-MC%& option. It signifies that the server to
which Exim is connected supports pipelining.
+.new
+.vitem &%-MCp%&
+.oindex "&%-MCp%&"
+This option is not intended for use by external callers. It is used internally
+by Exim in conjunction with the &%-MC%& option. It signifies that the connection
+t a remote server is via a SOCKS proxy, using addresses and ports given by
+the following four arguments.
+.wen
+
.vitem &%-MCQ%&&~<&'process&~id'&>&~<&'pipe&~fd'&>
.oindex "&%-MCQ%&"
This option is not intended for use by external callers. It is used internally
for GnuTLS. Previously the name started "%s" which, while not a bug,
looked as if if might be one.
+JH/49 Bug 2710: when using SOCKS for additional messages after the first (a
+ "continued connection") make the $proxy_* variables available. Previously
+ the information was not passed across the exec() call for subsequent
+ transport executions. This also mean that the log lines for the
+ messages can show the proxy information.
case 'P': smtp_peer_options |= OPTION_PIPE; break;
+#ifdef SUPPORT_SOCKS
+ /* -MCp: Socks proxy in use; nearside IP, port, external IP, port */
+ case 'p': proxy_session = TRUE;
+ if (++i < argc)
+ {
+ proxy_local_address = string_copy_taint(argv[i], TRUE);
+ if (++i < argc)
+ {
+ proxy_local_port = Uatoi(argv[i]);
+ if (++i < argc)
+ {
+ proxy_external_address = string_copy_taint(argv[i], TRUE);
+ if (++i < argc)
+ {
+ proxy_external_port = Uatoi(argv[i]);
+ break;
+ } } } }
+ badarg = TRUE;
+ break;
+#endif
/* -MCQ: pass on the pid of the queue-running process that started
this chain of deliveries and the fd of its synchronizing pipe; this
is useful only when it precedes -MC (see above) */
transport_do_pass_socket(const uschar *transport_name, const uschar *hostname,
const uschar *hostaddress, uschar *id, int socket_fd)
{
-int i = 22;
+int i = 27;
const uschar **argv;
/* Set up the calling arguments; use the standard function for the basics,
argv[i++] = string_sprintf("%d", queue_run_pipe);
}
+#ifdef SUPPORT_SOCKS
+if (proxy_session)
+ {
+ argv[i++] = US"-MCp";
+ argv[i++] = proxy_local_address;
+ argv[i++] = string_sprintf("%d", proxy_local_port);
+ argv[i++] = proxy_external_address;
+ argv[i++] = string_sprintf("%d", proxy_external_port);
+ }
+#endif
+
argv[i++] = US"-MC";
argv[i++] = US transport_name;
argv[i++] = US hostname;
.include DIR/aux-var/std_conf_prefix
primary_hostname = myhost.test.ex
+queue_run_in_order
# ----- Main settings -----
acl_smtp_rcpt = accept
+# ----- ACL -----
+
+begin acl
+
+logger:
+ accept logwrite = pla $proxy_local_address plp $proxy_local_port pea $proxy_external_address pep $proxy_external_port
+
# ----- Routers -----
begin routers
driver = smtp
interface = HOSTIPV4
port = PORT_S
- hide socks_proxy = 127.0.0.1 port=PORT_D OPT
+ hide socks_proxy = HOSTIPV4 port=PORT_D OPT
hosts_try_fastopen = ${if eq {$local_part}{user_tfo} {*}}
debug_print = transport_name <$transport_name>
+ event_action = ${if eq {smtp:connect}{$event_name} {${acl {logger}}} {}}
# End
--- /dev/null
+4020
\ No newline at end of file
1999-03-02 09:44:33 10HmaX-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local-esmtp S=sss
-1999-03-02 09:44:33 10HmaX-0005vi-00 => userx@test.ex R=my_main_router T=my_smtp H=127.0.0.1 [127.0.0.1]:PORT_S PRX=[127.0.0.1]:PORT_D C="250 accepted OK"
+1999-03-02 09:44:33 10HmaX-0005vi-00 pla ip4.ip4.ip4.ip4 plp 1225 pea 127.0.0.1 pep 48879
+1999-03-02 09:44:33 10HmaX-0005vi-00 => userx@test.ex R=my_main_router T=my_smtp H=127.0.0.1 [127.0.0.1]:PORT_S PRX=[ip4.ip4.ip4.ip4]:PORT_D C="250 accepted OK"
1999-03-02 09:44:33 10HmaX-0005vi-00 Completed
1999-03-02 09:44:33 10HmaY-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local-esmtp S=sss
-1999-03-02 09:44:33 10HmaY-0005vi-00 => userx@test.ex R=my_main_router T=my_smtp H=127.0.0.1 [127.0.0.1]:PORT_S PRX=[127.0.0.1]:PORT_D C="250 accepted OK"
+1999-03-02 09:44:33 10HmaY-0005vi-00 pla ip4.ip4.ip4.ip4 plp 1225 pea 127.0.0.1 pep 48879
+1999-03-02 09:44:33 10HmaY-0005vi-00 => userx@test.ex R=my_main_router T=my_smtp H=127.0.0.1 [127.0.0.1]:PORT_S PRX=[ip4.ip4.ip4.ip4]:PORT_D C="250 accepted OK"
1999-03-02 09:44:33 10HmaY-0005vi-00 Completed
--- /dev/null
+1999-03-02 09:44:33 10HmaX-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local-esmtp S=sss
+1999-03-02 09:44:33 10HmaY-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local-esmtp S=sss
+1999-03-02 09:44:33 Start queue run: pid=pppp -qq
+1999-03-02 09:44:33 10HmaX-0005vi-00 pla ip4.ip4.ip4.ip4 plp 1225 pea 127.0.0.1 pep 48879
+1999-03-02 09:44:33 10HmaX-0005vi-00 => userx@test.ex R=my_main_router T=my_smtp H=127.0.0.1 [127.0.0.1]:PORT_S PRX=[ip4.ip4.ip4.ip4]:PORT_D C="250 message accepted OK"
+1999-03-02 09:44:33 10HmaX-0005vi-00 Completed
+1999-03-02 09:44:33 10HmaY-0005vi-00 => usery@test.ex R=my_main_router T=my_smtp H=127.0.0.1 [127.0.0.1]:PORT_S* PRX=[ip4.ip4.ip4.ip4]:PORT_D C="250 second message accepted OK"
+1999-03-02 09:44:33 10HmaY-0005vi-00 Completed
+1999-03-02 09:44:33 End queue run: pid=pppp -qq
1999-03-02 09:44:33 10HmaX-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local-esmtp S=sss
-1999-03-02 09:44:33 10HmaX-0005vi-00 => user_tfo@test.ex R=my_main_router T=my_smtp H=127.0.0.1 [127.0.0.1]:PORT_S PRX=[127.0.0.1]:PORT_D C="250 accepted OK"
+1999-03-02 09:44:33 10HmaX-0005vi-00 pla ip4.ip4.ip4.ip4 plp 1225 pea 127.0.0.1 pep 48879
+1999-03-02 09:44:33 10HmaX-0005vi-00 => user_tfo@test.ex R=my_main_router T=my_smtp H=127.0.0.1 [127.0.0.1]:PORT_S PRX=[ip4.ip4.ip4.ip4]:PORT_D C="250 accepted OK"
1999-03-02 09:44:33 10HmaX-0005vi-00 Completed
1999-03-02 09:44:33 10HmaY-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local-esmtp S=sss
-1999-03-02 09:44:33 10HmaY-0005vi-00 => user_tfo@test.ex R=my_main_router T=my_smtp H=127.0.0.1 [127.0.0.1]:PORT_S PRX=[127.0.0.1]:PORT_D C="250 accepted OK"
+1999-03-02 09:44:33 10HmaY-0005vi-00 pla ip4.ip4.ip4.ip4 plp 1225 pea 127.0.0.1 pep 48879
+1999-03-02 09:44:33 10HmaY-0005vi-00 => user_tfo@test.ex R=my_main_router T=my_smtp H=127.0.0.1 [127.0.0.1]:PORT_S PRX=[ip4.ip4.ip4.ip4]:PORT_D C="250 accepted OK"
1999-03-02 09:44:33 10HmaY-0005vi-00 Completed
1999-03-02 09:44:33 10HmaZ-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local-esmtp S=sss
-1999-03-02 09:44:33 10HmaZ-0005vi-00 => user_tfo@test.ex R=my_main_router T=my_smtp H=127.0.0.1 [127.0.0.1]:PORT_S PRX=[127.0.0.1]:PORT_D TFO* C="250 accepted OK"
+1999-03-02 09:44:33 10HmaZ-0005vi-00 pla ip4.ip4.ip4.ip4 plp 1225 pea 127.0.0.1 pep 48879
+1999-03-02 09:44:33 10HmaZ-0005vi-00 => user_tfo@test.ex R=my_main_router T=my_smtp H=127.0.0.1 [127.0.0.1]:PORT_S PRX=[ip4.ip4.ip4.ip4]:PORT_D TFO* C="250 accepted OK"
1999-03-02 09:44:33 10HmaZ-0005vi-00 Completed
--- /dev/null
+# socks5 proxy on smtp transport, continued-connection
+#
+munge loopback
+#
+exim -odq -bs -DOPT=
+ehlo test.ex
+mail from:<>
+rcpt to:<userx@test.ex>
+data
+Date: Fri, 17 Dec 2004 14:35:01 +0100
+Subject: message should be queued
+
+Queued body
+.
+quit
+****
+exim -odq -bs -DOPT=
+ehlo test.ex
+mail from:<>
+rcpt to:<usery@test.ex>
+data
+Date: Fri, 17 Dec 2004 14:35:01 +0100
+Subject: message should be queud
+
+via null-auth proxy
+.
+quit
+****
+#
+#
+#
+# auth: null
+server PORT_D
+<<\x05\x01\x00
+>>\x05\x00
+<<\x05\x01\x00\x01\x7f\x00\x00\x01\x04\xc8
+>>\x05\x00\x00\x01\x7f\x00\x00\x01\xbe\xef
+220 Connected OK
+EHLO
+250-server id
+250
+MAIL FROM
+250 mail cmd ok
+RCPT TO
+250 rcpt cmd ok
+DATA
+354 hit me
+.
+250 message accepted OK
+MAIL FROM
+250 second mail cmd ok
+RCPT TO
+250 second rcpt cmd ok
+DATA
+354 hit me one more time
+.
+250 second message accepted OK
+QUIT
+220 bye
+****
+#
+#
+#
+exim -DOPT= -qq
+****
+#
+#
+# Ends
--- /dev/null
+220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000\r
+250-myhost.test.ex Hello CALLER at test.ex\r
+250-SIZE 52428800\r
+250-8BITMIME\r
+250-PIPELINING\r
+250 HELP\r
+250 OK\r
+250 Accepted\r
+354 Enter message, ending with "." on a line by itself\r
+250 OK id=10HmaX-0005vi-00\r
+221 myhost.test.ex closing connection\r
+220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000\r
+250-myhost.test.ex Hello CALLER at test.ex\r
+250-SIZE 52428800\r
+250-8BITMIME\r
+250-PIPELINING\r
+250 HELP\r
+250 OK\r
+250 Accepted\r
+354 Enter message, ending with "." on a line by itself\r
+250 OK id=10HmaY-0005vi-00\r
+221 myhost.test.ex closing connection\r
+
+******** SERVER ********
+Listening on port 1225 ...
+Connection request from [ip4.ip4.ip4.ip4]
+<<\x05\x01\x00
+>>\x05\x00
+<<\x05\x01\x00\x01\x7f\x00\x00\x01\x04\xc8
+>>\x05\x00\x00\x01\x7f\x00\x00\x01\xbe\xef
+220 Connected OK
+EHLO
+250-server id
+250
+MAIL FROM
+250 mail cmd ok
+RCPT TO
+250 rcpt cmd ok
+DATA
+354 hit me
+R
+250 message accepted OK
+MAIL FROM
+250 second mail cmd ok
+RCPT TO
+250 second rcpt cmd ok
+DATA
+354 hit me one more time
+R
+250 second message accepted OK
+QUIT
+220 bye
+End of script