From: Guilhem Moulin Date: Mon, 7 Mar 2016 23:01:02 +0000 (+0100) Subject: pullimap: set keepalive options on socket. X-Git-Url: https://git.g-eek.se/?a=commitdiff_plain;h=d0d439750b572250ae00b595d9a742ccbb7b8a4e;p=interimap.git pullimap: set keepalive options on socket. --- diff --git a/pullimap b/pullimap index db3090f..0e31a90 100755 --- a/pullimap +++ b/pullimap @@ -219,7 +219,11 @@ sub smtp_send(@) { # the remote mailbox # $CONF->{'logger-fd'} = \*STDERR if $CONFIG{debug}; -my $IMAP = Net::IMAP::InterIMAP::->new( %$CONF, %CONFIG{qw/quiet debug/}, name => $ARGV[0] ); +my $IMAP = do { + my %config = (%$CONF, %CONFIG{qw/quiet debug/}, name => $ARGV[0]); + $config{keepalive} = 1 if defined $CONFIG{idle} and $config{type} ne 'tunnel'; + Net::IMAP::InterIMAP::->new( %config ); +}; # Remove messages with UID < UIDNEXT and INTERNALDATE at most # $CONF->{'purge-after'} days ago.