diff options
author | Guilhem Moulin <guilhem@fripost.org> | 2016-03-08 17:49:47 +0100 |
---|---|---|
committer | Guilhem Moulin <guilhem@fripost.org> | 2016-03-08 17:49:47 +0100 |
commit | 69e2f637222f81fd538809ef48f77d5334ef9c71 (patch) | |
tree | 148ac622467c6baff05cb6304a6295f4397b7899 | |
parent | f8387c281f2a73343fcca9e599d29bd93ece4524 (diff) |
pullimap: don't FETCH messages BODY if --no-delivery is set.
-rwxr-xr-x | pullimap | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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]; |