diff options
author | Guilhem Moulin <guilhem@fripost.org> | 2019-11-15 22:25:11 +0100 |
---|---|---|
committer | Guilhem Moulin <guilhem@fripost.org> | 2019-11-17 16:52:27 +0100 |
commit | 5d55a14fa52981ae2a8bb6e65a65bf410c773464 (patch) | |
tree | f8f9869ead76397805aa15c18dc0b19c6cf87f81 /interimap | |
parent | 51336e88f2de76c56b513de23d06677461742454 (diff) |
interimap: Gracefully ignore messages with NIL RFC822 attribute.
Like we do for zero-length messages.
Closes: #944812.
Diffstat (limited to 'interimap')
-rwxr-xr-x | interimap | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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; } |