diff options
author | Guilhem Moulin <guilhem@fripost.org> | 2016-03-08 00:01:02 +0100 |
---|---|---|
committer | Guilhem Moulin <guilhem@fripost.org> | 2016-03-08 00:05:30 +0100 |
commit | d0d439750b572250ae00b595d9a742ccbb7b8a4e (patch) | |
tree | 9e127949b6a21763928bd6e524cf232a3c8430c4 | |
parent | a9a0501bc0ce2c5937e6e47cc0db8f2f0ac4ec18 (diff) |
pullimap: set keepalive options on socket.
-rwxr-xr-x | pullimap | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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. |