[stunnel-users] Timeout issue I think

Ben Bazian bbazian at mbopartners.com
Wed Aug 16 17:04:06 CEST 2017

I have a legacy server that uses IMAP but does not support TLS.  I am using stunnel and since implementation I am getting errors when an email has a larger attachment.  My application process these attachments and when done (sometimes can take 5-10 minutes) it marks the message for deletion.  When all messages are completed it purges the emails from the box.  My app is throwing an error when it tries to delete the message (see below).  I think it may be due to stunnel closing the connection to the server?  Not quite sure.

at com.sun.mail.imap.IMAPMessage.getProtocol(IMAPMessage.java:105)
at com.sun.mail.imap.IMAPMessage.loadEnvelope(IMAPMessage.java:941)
at com.sun.mail.imap.IMAPMessage.getSubject(IMAPMessage.java:238)
at com.softlinx.docurouter.source.email.EmailSourceConnector.processMess
at com.softlinx.docurouter.source.email.EmailSourceConnector.process(Ema
at com.softlinx.docurouter.source.email.EmailSourceConnector.main(EmailS

My configuration is pretty simple.  I saw somewhere that I could put a timeoutidle on the connector but that does not seem to help.  Any ideas are appreciated.  Here is the config.

# Stunnel configuration file for Office 365 SMTP and POP3

# Author: MessageOps, www.messageops.com<http://www.messageops.com>


client = yes

output = /etc/stunnel/stunnel-log.txt


# taskbar=yes


[POP3 Incoming]
accept = 110
connect = outlook.office365.com:995
timeoutidle = 14400

[SMTP Outgoing]
protocol = smtp
accept = 25
connect = outlook.office365.com:587

accept = 143
connect = outlook.office365.com:993
timeoutidle = 14400

Here is a printout of the global options.
Global options:
debug                  = daemon.notice
pid                    = /var/run/stunnel.pid
RNDbytes               = 64
RNDfile                = /dev/urandom
RNDoverwrite           = yes

Service-level options:
ciphers                = FIPS (with "fips = yes")
ciphers                = ALL:!SSLv2:!aNULL:!EXP:!LOW:-MEDIUM:RC4:+HIGH (with "fips = no")
curve                  = prime256v1
sessionCacheSize       = 1000
sessionCacheTimeout    = 300 seconds
sslVersion             = TLSv1 (with "fips = yes")
sslVersion             = TLSv1 for client, all for server (with "fips = no")
stack                  = 65536 bytes
TIMEOUTbusy            = 300 seconds
TIMEOUTclose           = 60 seconds
TIMEOUTconnect         = 10 seconds
TIMEOUTidle            = 43200 seconds
verify                 = none

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.stunnel.org/pipermail/stunnel-users/attachments/20170816/ce55959f/attachment.html>

More information about the stunnel-users mailing list