From 2225753daf501f66ae45aec96a47ca76efffdf3b Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Thu, 13 May 2010 14:48:32 -0500 Subject: [PATCH] Use the SOCKS proxy in the smtp transport Signed-off-by: Federico Mena Quintero --- camel/providers/smtp/camel-smtp-transport.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/camel/providers/smtp/camel-smtp-transport.c b/camel/providers/smtp/camel-smtp-transport.c index 41bfbad..c1fc31f 100644 --- a/camel/providers/smtp/camel-smtp-transport.c +++ b/camel/providers/smtp/camel-smtp-transport.c @@ -189,6 +189,9 @@ connect_to_server (CamelService *service, CamelException *ex) { CamelSmtpTransport *transport = CAMEL_SMTP_TRANSPORT (service); + CamelSession *session; + char *socks_host; + int socks_port; CamelStream *tcp_stream; gchar *respbuf = NULL; gint ret; @@ -218,6 +221,14 @@ connect_to_server (CamelService *service, tcp_stream = camel_tcp_stream_raw_new (); } + session = camel_service_get_session (service); + camel_session_get_socks_proxy (session, &socks_host, &socks_port); + + if (socks_host) { + camel_tcp_stream_set_socks_proxy ((CamelTcpStream *) tcp_stream, socks_host, socks_port); + g_free (socks_host); + } + if ((ret = camel_tcp_stream_connect ((CamelTcpStream *) tcp_stream, ai)) == -1) { if (errno == EINTR) camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL, -- 2.7.4