Bug 2244

Summary: No proxy settings
Product: Claws Mail (GTK 2) Reporter: Richard Bogle <richard.bogle>
Component: OtherAssignee: users
Status: RESOLVED FIXED    
Severity: enhancement CC: neil.vandyke, rainexpected
Priority: P3    
Version: 3.12.0   
Hardware: All   
OS: All   
Attachments:
Description Flags
Add SOCKS proxy support, ported from Sylpheed/LibSylph
none
Add SOCKS proxy support, ported from Sylpheed/LibSylph
none
Add SOCKS proxy support, ported from Sylpheed/LibSylph, version 2 none

Description Richard Bogle 2010-08-10 07:41:50 UTC
There is no way to set the local HTTP proxy IP and port. This prevents the application from making any internet connections.
Comment 1 Ricardo Mones 2011-05-01 16:31:47 UTC
Have you tried using proxifier [0] or tsocks [1]?

[0] http://www.proxifier.com/
[1] http://tsocks.sourceforge.net/
Comment 2 Colin Leroy 2012-09-06 18:24:28 UTC
*** Bug 2330 has been marked as a duplicate of this bug. ***
Comment 3 khazarian 2014-01-23 17:18:18 UTC
How difficult would it be to import Proxy support from Sylpheed?
Comment 4 khazarian 2014-10-21 17:44:16 UTC
Claws Mail Developers, please kindly answer the following question.

Regardless to licensing issues, if any, how difficult would it be to import Proxy support from Sylpheed?

I am asking this because if there are licensing issues, I might form a tradeoff with the copyright owner, if they would agree, which in return to Proxy Code under Claws Mail compatible license Sylpheed would get Hebrew translation support as long as Claws Mail receives Hebrew translation updates by me.
Comment 5 khazarian 2015-07-04 09:21:23 UTC
Are there issues license issues or not?

I do not want to bother the developers of Sylpheed for nothing.
http://sylpheed.sraoss.jp/redmine/issues/224
Comment 6 khazarian 2015-07-04 09:21:56 UTC
Are there license issues or not? *
Comment 7 Charles E. Lehner 2015-07-11 05:21:30 UTC
(In reply to comment #6)
> Are there license issues or not? *

Licensing will not be a problem, because Sylpheed's GPLv2+ and LGPLv2+ code can be re-licensed under GPLv3+, the license that Claws uses. I am working now on porting the proxy support from Sylpheed to Claws Mail.
Comment 8 Charles E. Lehner 2015-07-11 19:24:57 UTC
Created attachment 1537 [details]
Add SOCKS proxy support, ported from Sylpheed/LibSylph

Here is proxy support! I've tested it with IMAP4, SMTP, NNTP, POP3, and ManageSieve, on Debian testing.

The SOCKS client implementation in socks.[ch] is from LibSylph with the license comment changed to GPLv3+. I added some wrappers for the libetPan's *_connect functions for IMAP and NNTP.
Comment 9 Charles E. Lehner 2015-07-11 19:28:37 UTC
Created attachment 1538 [details]
Add SOCKS proxy support, ported from Sylpheed/LibSylph

Here is proxy support! I've tested it with IMAP4, SMTP, NNTP, POP3, and ManageSieve, on Debian testing.

The SOCKS client implementation in socks.[ch] is from LibSylph with the license comment changed to GPLv3+. I added some wrappers for libetPan's *_connect functions for IMAP and NNTP.

The proxy client uses blocking IO when connecting, which is less than ideal, but that could be improved upon later.
Comment 10 Charles E. Lehner 2015-07-11 19:30:05 UTC
Sorry for duplicate post. I saw an error about the attachment so I thought the comment didn't go through.
Comment 11 Paul 2015-07-11 19:35:13 UTC
The content of attachment 1537 [details] has been deleted by
    Paul <paul@claws-mail.org>
who provided the following reason:

same as other attachment

The token used to delete this attachment was generated at 2015-07-11 21:34:57 CEST.
Comment 12 Andrej Kacian 2015-08-26 10:57:38 UTC
Two things come to mind:
1. The low-level networking code should be rewritten to use getaddrinfo() instead of obsolete gethostbyname().
2. How can this new SOCKS proxy support be used by plugins doing HTTP connections, such as vCalendar or RSSyl? Currently, I believe they are using their own proxy settings.
Comment 13 neil.vandyke 2016-09-29 03:32:45 UTC
I would love to have built-in SOCKS v5 support in claws-mail, if only for IMAP SSL (plugins not as important to me).  SOCKS is one of the two key missing features that's keeping me with a different MUA for most of my work right now.

(I know the honorable ancestor Sylpheed has SOCKS already, but I really want to move to claws-mail specifically.)
Comment 14 Andrej Kacian 2018-05-18 20:27:22 UTC
Created attachment 1873 [details]
Add SOCKS proxy support, ported from Sylpheed/LibSylph, version 2

Attaching an updated patch:
- rewritten SOCKS4 support to use getaddrinfo() instead of obsolete gethostbyname()
- no need for session_connect_full(), we can set the session->socks_info member directly and use that
- fixed some bugs in handling errors from proxy server
- added some connection-related debug output to hopefully help while troubleshooting connectivity
Comment 15 users 2018-06-10 10:40:04 UTC
Changes related to this bug have been committed.
Please check latest Git and update the bug accordingly.
You can also get the patch from:
http://git.claws-mail.org/

++ ChangeLog	2018-06-10 12:40:04.204641998 +0200
http://git.claws-mail.org/?p=claws.git;a=commitdiff;h=9aa05eed067fc6e39d8b2322e6c7711ffaf66653
Merge: 6415b23 d28d627
Author: Colin Leroy <colin@colino.net>
Date:   Sun Jun 10 12:40:03 2018 +0200

    Merge branch 'master' of file:///home/git/claws

http://git.claws-mail.org/?p=claws.git;a=commitdiff;h=d28d62772b7b621b8dfea91c743404e3deef7daa
Author: Andrej Kacian <ticho@claws-mail.org>
Date:   Fri May 18 20:27:52 2018 +0200

    Added SOCKS proxy support.
    
    Based on UI and network code from LibSylph/Sylpheed, rewritten
    to use getaddrinfo(), fixed some small bugs in handling errors.
    
    Added connect wrappers for etpan IMAP and NNTP, as well as for
    anything Session-based (POP3, SMTP, Managesieve).
    
    Adds support for global, as well as per-account proxy servers.
    
    Original patch by Charles Lehner <cel at celehner com>, from
    bug #2244.