From: Guilhem Moulin Date: Tue, 8 Mar 2016 16:49:47 +0000 (+0100) Subject: pullimap: don't FETCH messages BODY if --no-delivery is set. X-Git-Url: https://git.g-eek.se/?a=commitdiff_plain;h=69e2f637222f81fd538809ef48f77d5334ef9c71;p=interimap.git pullimap: don't FETCH messages BODY if --no-delivery is set. --- diff --git a/pullimap b/pullimap index d2de66f..c3fd4a0 100755 --- a/pullimap +++ b/pullimap @@ -254,7 +254,8 @@ sub purge() { # Use BODY.PEEK[] so if something gets wrong, unpulled messages # won't be marked as \Seen in the mailbox -my $ATTRS = "ENVELOPE INTERNALDATE BODY.PEEK[]"; +my $ATTRS = "ENVELOPE INTERNALDATE"; +$ATTRS .= " BODY.PEEK[]" unless $CONFIG{'no-delivery'}; # Pull new messages from IMAP and deliver them to SMTP, then update the # statefile @@ -265,7 +266,7 @@ sub pull(;$) { # invariant: we're at pos 8 + 4*(1+$#ignore + 1+$#uids) in the statefile $IMAP->pull_new_messages($ATTRS, sub($) { my $mail = shift; - return unless exists $mail->{RFC822}; # not for us + return unless exists $mail->{RFC822} or $CONFIG{'no-delivery'}; # not for us my $uid = $mail->{UID}; my $from = first { defined $_ and @$_ } @{$mail->{ENVELOPE}}[2,3,4];