aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--interimap.18
-rwxr-xr-xpullimap10
-rw-r--r--pullimap.110
3 files changed, 16 insertions, 12 deletions
diff --git a/interimap.1 b/interimap.1
index 7058f62..e23b953 100644
--- a/interimap.1
+++ b/interimap.1
@@ -143,7 +143,7 @@ default all three targets are considered.
.TP
.B \fB\-\-watch\fR[\fB=\fR\fIseconds\fR]
Don't exit after a successful synchronization, and keep synchronizing
-forevever instead. Sleep for the given number of \fIseconds\fR (or
+forever instead. Sleep for the given number of \fIseconds\fR (or
\(lq60\(rq if omitted) between two synchronizations.
.TP
@@ -170,7 +170,7 @@ Unless told otherwise by the \fB\-\-config=\fR\fIFILE\fR option,
\fBInterIMAP\fR reads its configuration from
\fI$XDG_CONFIG_HOME/interimap\fR (or \fI~/.config/interimap\fR if the
XDG_CONFIG_HOME environment variable is unset) as an INI file.
-The syntax of the configuration file is a serie of
+The syntax of the configuration file is a series of
\fIOPTION\fR=\fIVALUE\fR lines organized under some \fI[SECTION]\fR;
lines starting with a \(oq#\(cq or \(oq;\(cq character are ignored as
comments.
@@ -293,7 +293,7 @@ mechanism.
.TP
.I compress
Whether to use the IMAP COMPRESS extension [RFC4978] for servers
-advertizing it.
+advertising it.
(Default: \(lqNO\(rq for the \(lq[local]\(rq section, \(lqYES\(rq for
the \(lq[remote]\(rq section.)
@@ -388,7 +388,7 @@ currently supported.
.IP \[bu]
\fBInterIMAP\fR will probably not work with non RFC-compliant servers.
In particular, no work-around are currently implemented beside the
-tunables in the \fBCONFIGURATION FILE\fR. Morever, few IMAP servers
+tunables in the \fBCONFIGURATION FILE\fR. Moreover, few IMAP servers
have been tested so far.
.SH AUTHOR
diff --git a/pullimap b/pullimap
index 27226d2..0e31a90 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;
@@ -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/} );
+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.
@@ -266,7 +270,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'};
diff --git a/pullimap.1 b/pullimap.1
index e0f1ec3..52a6152 100644
--- a/pullimap.1
+++ b/pullimap.1
@@ -10,7 +10,7 @@ PullIMAP \- Pull mails from an IMAP mailbox and deliver them to a SMTP session
.SH DESCRIPTION
.PP
-.B PullIMAP\fR retrives messages from an IMAP mailbox and deliver them
+.B PullIMAP\fR retrieves messages from an IMAP mailbox and deliver them
to a SMTP or LMTP transmission channel.
It can also remove delivered messages after a configurable retention
period.
@@ -68,7 +68,7 @@ Unless told otherwise by the \fB\-\-config=\fR\fIFILE\fR option,
\fBPullIMAP\fR reads its configuration from
\fI$XDG_CONFIG_HOME/pullimap\fR (or \fI~/.config/pullimap\fR if the
XDG_CONFIG_HOME environment variable is unset) as an INI file.
-The syntax of the configuration file is a serie of
+The syntax of the configuration file is a series of
\fIOPTION\fR=\fIVALUE\fR lines organized under some \fI[SECTION]\fR;
lines starting with a \(oq#\(cq or \(oq;\(cq character are ignored as
comments.
@@ -98,13 +98,13 @@ messages. Both SMTP [RFC 5321] and LMTP [RFC 2030] are supported.
.TP
.I deliver\-ehlo
-Hostname to use in EHLO or LHO commands.
+Hostname to use in EHLO or LHLO commands.
(Default: \(lq\fIlocalhost.localdomain\fR\)\(rq.)
.TP
.I deliver\-rcpt
-Message recpient.
+Message recipient.
(Default: the username associated with the effective uid of the
\fBpullimap\fR process.)
@@ -176,7 +176,7 @@ mechanism.
.TP
.I compress
Whether to use the IMAP COMPRESS extension [RFC4978] for servers
-advertizing it.
+advertising it.
(Default: \(lqYES\(rq.)
.TP