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 '_';
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');
$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);