aboutsummaryrefslogtreecommitdiffstats
path: root/pullimap
diff options
context:
space:
mode:
Diffstat (limited to 'pullimap')
-rwxr-xr-xpullimap6
1 files changed, 3 insertions, 3 deletions
diff --git a/pullimap b/pullimap
index 2b81d8f..692ec38 100755
--- a/pullimap
+++ b/pullimap
@@ -47,7 +47,7 @@ sub usage(;$) {
exit $rv;
}
-usage(1) unless GetOptions(\%CONFIG, qw/config=s quiet|q debug help|h idle:i/);
+usage(1) unless GetOptions(\%CONFIG, qw/config=s quiet|q debug help|h idle:i no-delivery/);
usage(0) if $CONFIG{help};
usage(1) unless $#ARGV == 0 and $ARGV[0] ne '_';
@@ -134,7 +134,7 @@ sub sendmail($$) {
unless (defined $SMTP) {
# TODO we need to be able to reconnect when the server closes
# the connection due to a timeout (RFC 5321 section 4.5.3.2)
- my ($fam, $addr, $port) = (PF_INET, $CONF->{'deliver-method'}, 25);
+ my ($fam, $addr, $port) = (PF_INET, $CONF->{'deliver-method'} // 'smtp:[127.0.0.1]:10024', 25);
$addr =~ s/^([ls]mtp):// or die;
my $ehlo = $1 eq 'lmtp' ? 'LHO' : $1 eq 'smtp' ? 'EHLO' : die;
$ehlo .= ' '. ($CONF->{'deliver-ehlo'} // 'localhost.localdomain');
@@ -252,7 +252,7 @@ sub pull(;$) {
$from = (defined $from and @$from) ? $from->[0]->[2].'@'.$from->[0]->[3] : '';
print STDERR "($MAILBOX): UID $uid from <$from> ($mail->{INTERNALDATE})\n" unless $CONFIG{quiet};
- sendmail($from, $mail->{RFC822});
+ sendmail($from, $mail->{RFC822}) unless $CONFIG{'no-delivery'};
push @uid, $uid;
writeUID($uid);