aboutsummaryrefslogtreecommitdiffstats
path: root/pullimap
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2016-03-07 23:34:08 +0100
committerGuilhem Moulin <guilhem@fripost.org>2016-03-07 23:54:50 +0100
commita9a0501bc0ce2c5937e6e47cc0db8f2f0ac4ec18 (patch)
treeaf86954c19ffc1f9196d9510288d7b1f707c74ff /pullimap
parent8097c83d95aca78d946516435627d62001f7a10b (diff)
pullimap: add section name in debug messages.
Diffstat (limited to 'pullimap')
-rwxr-xr-xpullimap4
1 files changed, 2 insertions, 2 deletions
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'};