# 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.
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'};