Bug 1566

Summary: too short I/O timeout on OpenBSD
Product: Claws Mail (GTK 2) Reporter: Brad Smith <brad>
Component: SMTPAssignee: users
Status: RESOLVED INVALID    
Severity: major CC: mir
Priority: P3    
Version: 3.3.1   
Hardware: PC   
OS: OpenBSD   
Attachments:
Description Flags
Claws Mail debug log
none
Normal ipv6 connection
none
Connection falling back to ipv4
none
open a warning pop-up none

Description Brad Smith 2008-04-04 09:58:35 UTC
If claws mail is configured with a FQDN for an SMTP server that has both a AAAA record and a A record and claws mail is not able to connect to the server via IPv6 (say a tunnel is down or improperly configured fw, etc.) claws mail will not fallback to the IPv4 address and fail to send e-mail via the configured SMTP server.
Comment 1 Colin Leroy 2008-04-04 11:28:22 UTC
Strange, that should work. Can you include a full --debug log (from the console: 'claws-mail --debug') showing such a try?
Comment 2 Brad Smith 2008-04-05 03:40:44 UTC
Created attachment 566 [details]
Claws Mail debug log
Comment 3 Colin Leroy 2008-04-06 18:45:16 UTC
That shows that the connection succeeds, but timeouts. It's different from being unable to connect on IPv6. 

After testing, connection does fallback to IPv4 if the SMTP server has an AAAA record but the connection fails on IPv6.

I'm resolving that bug as INVALID, because it's a network issue. 
Comment 4 Brad Smith 2008-04-06 18:52:12 UTC
It does NOT connect properly. Running a tcpdump on the client shows claws-mail does not even attempt a connection via the v4 address. This is NOT a network problem.
Comment 5 Colin Leroy 2008-04-06 19:01:39 UTC
(In reply to comment #4)
> It does NOT connect properly. Running a tcpdump on the client shows claws-mail
> does not even attempt a connection via the v4 address.

But, in my opinion, it does show a connection (> SYN, < SYN/ACK, > ACK) on ipv6, doesn't it? 
Comment 6 Brad Smith 2008-04-06 19:09:30 UTC
No. My mail server has intentionally been disabled from listening on IPv6 to test whether apps properly fallback. Claws Mail does fallback for POP3/IMAP connections but not for SMTP.
Comment 7 Colin Leroy 2008-04-06 19:35:08 UTC
(In reply to comment #6)
> No. My mail server has intentionally been disabled from listening on IPv6 to
> test whether apps properly fallback. Claws Mail does fallback for POP3/IMAP
> connections but not for SMTP.

OK, I've done a bit more tests, and that is due to the fact that connections are non-blocking. Still, it works as intended for me. See attached screenshots. Maybe your socket I/O timeout is too low?
Comment 8 Colin Leroy 2008-04-06 19:35:31 UTC
Created attachment 567 [details]
Normal ipv6 connection
Comment 9 Colin Leroy 2008-04-06 19:35:51 UTC
Created attachment 568 [details]
Connection falling back to ipv4
Comment 10 Brad Smith 2008-04-06 19:51:21 UTC
I haven't adjusted anything in claws mail other than just setting up the mail server. Where is this tunable?
Comment 11 Colin Leroy 2008-04-07 07:41:22 UTC
In Preferences/Other
Comment 12 Brad Smith 2008-04-10 12:57:19 UTC
Yes, the default timeout is too short and should be bumped up to at least 76 secs.
Comment 13 Colin Leroy 2008-04-10 13:06:51 UTC
That also depends on the OS, its network stack and its configuration. For me, 20 seconds is enough.
Comment 14 Michael Rasmussen 2008-04-22 01:32:29 UTC
Hi Brad,

Could you try the patch and see if this will satisfy your need. Timeout cannot be optimized dynamically but with this patch at least the user is notified by the fact that the timeout maybe is configured to low and recovery might be possible if this setting is increased.
Comment 15 Michael Rasmussen 2008-04-22 01:34:42 UTC
Created attachment 570 [details]
open a warning pop-up

Instead of "silently" bail out with a timeout written to log the user will now
see a pop-up alertpanel explaining that timeout was reached and that
the situation might be recoverable by increasing Socket IO timeout.
Comment 16 users 2008-04-22 08:38:45 UTC
Changes related to this bug have been committed.
Please check latest CVS and update the bug accordingly.
You can also get the patch from:
http://www.colino.net/claws-mail/

2008-04-22 [colin]	3.4.0cvs4

	* src/inc.c
	* src/prefs_common.c
	* src/send_message.c
		Fix bug 1566, 'too short I/O timeout on OpenBSD'
		Set the default timeout to 75 seconds