aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Changelog1
-rwxr-xr-xinterimap5
2 files changed, 5 insertions, 1 deletions
diff --git a/Changelog b/Changelog
index f0c9e50..88181b2 100644
--- a/Changelog
+++ b/Changelog
@@ -105,6 +105,7 @@ interimap (0.5) upstream;
- interimap: for the reason explained above, limit number of messages
to 128 per APPEND command (only on servers advertizing MULTIAPPEND,
for other servers the number remains 1).
+ - interimap: gracefully ignore messages with NIL RFC822 attribute.
-- Guilhem Moulin <guilhem@fripost.org> Fri, 10 May 2019 00:58:14 +0200
diff --git a/interimap b/interimap
index 386492e..f9be72d 100755
--- a/interimap
+++ b/interimap
@@ -1154,8 +1154,11 @@ sub callback_new_message($$$$;$$$) {
my ($idx, $mailbox, $name, $mail, $UIDs, $buff, $bufflen) = @_;
return unless exists $mail->{RFC822}; # not for us
- my $length = length ${$mail->{RFC822}};
+ my $length = length(${$mail->{RFC822}} // "");
if ($length == 0) {
+ # the RFC822 attribute can be NIL or empty (it's an nstring), however
+ # NIL can't be used in APPEND commands, and RFC 3502 sec. 6.3.11
+ # explicitly forbids zero-length messages, so we ignore these here
msg2($name => $mailbox, "WARNING: Ignoring new 0-length message (UID $mail->{UID})");
return;
}