# 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
# 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];