From 8097c83d95aca78d946516435627d62001f7a10b Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Mon, 7 Mar 2016 23:33:45 +0100 Subject: pullimap: typo --- pullimap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pullimap') diff --git a/pullimap b/pullimap index 27226d2..235bc62 100755 --- a/pullimap +++ b/pullimap @@ -124,7 +124,7 @@ sub sendmail($$) { # the connection due to a timeout (RFC 5321 section 4.5.3.2) my ($fam, $addr) = (PF_INET, $CONF->{'deliver-method'} // 'smtp:[127.0.0.1]:25'); $addr =~ s/^([ls]mtp):// or die; - my $ehlo = $1 eq 'lmtp' ? 'LHO' : $1 eq 'smtp' ? 'EHLO' : die; + my $ehlo = $1 eq 'lmtp' ? 'LHLO' : $1 eq 'smtp' ? 'EHLO' : die; $ehlo .= ' '. ($CONF->{'deliver-ehlo'} // 'localhost.localdomain'); my $port = $addr =~ s/:(\d+)$// ? $1 : die; -- cgit v1.2.3 From a9a0501bc0ce2c5937e6e47cc0db8f2f0ac4ec18 Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Mon, 7 Mar 2016 23:34:08 +0100 Subject: pullimap: add section name in debug messages. --- pullimap | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pullimap') diff --git a/pullimap b/pullimap index 235bc62..db3090f 100755 --- a/pullimap +++ b/pullimap @@ -219,7 +219,7 @@ sub smtp_send(@) { # the remote mailbox # $CONF->{'logger-fd'} = \*STDERR if $CONFIG{debug}; -my $IMAP = Net::IMAP::InterIMAP::->new( %$CONF, %CONFIG{qw/quiet debug/} ); +my $IMAP = Net::IMAP::InterIMAP::->new( %$CONF, %CONFIG{qw/quiet debug/}, name => $ARGV[0] ); # Remove messages with UID < UIDNEXT and INTERNALDATE at most # $CONF->{'purge-after'} days ago. @@ -266,7 +266,7 @@ sub pull(;$) { my $uid = $mail->{UID}; my $from = first { defined $_ and @$_ } @{$mail->{ENVELOPE}}[2,3,4]; $from = (defined $from and @$from) ? $from->[0]->[2].'@'.$from->[0]->[3] : ''; - print STDERR "($MAILBOX): UID $uid from <$from> ($mail->{INTERNALDATE})\n" unless $CONFIG{quiet}; + $IMAP->log("UID $uid from <$from> ($mail->{INTERNALDATE})") unless $CONFIG{quiet}; sendmail($from, $mail->{RFC822}) unless $CONFIG{'no-delivery'}; -- cgit v1.2.3 From d0d439750b572250ae00b595d9a742ccbb7b8a4e Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Tue, 8 Mar 2016 00:01:02 +0100 Subject: pullimap: set keepalive options on socket. --- pullimap | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'pullimap') 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. -- cgit v1.2.3