diff options
author | Jeremy Harris <jgh146exb@wizmail.org> | 2021-04-07 21:34:42 +0100 |
---|---|---|
committer | Jeremy Harris <jgh146exb@wizmail.org> | 2021-04-07 21:34:42 +0100 |
commit | 2081aac24b67f3f3f34389aadc06354abcad0cad (patch) | |
tree | 7a44809cf11d053d00d10741b4f46dadfb92d464 /src | |
parent | d901e231acd1917d24b688cbd7823efc2bed45c4 (diff) |
Pass proxy addresses/ports to continued trasnports. Bug 2710
Diffstat (limited to 'src')
-rw-r--r-- | src/src/exim.c | 20 | ||||
-rw-r--r-- | src/src/transport.c | 13 |
2 files changed, 32 insertions, 1 deletions
diff --git a/src/src/exim.c b/src/src/exim.c index cb11a2a38..1244aee0b 100644 --- a/src/src/exim.c +++ b/src/src/exim.c @@ -2793,6 +2793,26 @@ on the second character (the one after '-'), to save some effort. */ 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) */ diff --git a/src/src/transport.c b/src/src/transport.c index 31edb9692..39b8c411a 100644 --- a/src/src/transport.c +++ b/src/src/transport.c @@ -1880,7 +1880,7 @@ void 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, @@ -1923,6 +1923,17 @@ if (queue_run_pid != (pid_t)0) 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; |