grommunio / gromox

Groupware server backend for the grommunio Distribution, supporting MAPI/HTTP, RPC/HTTP, EWS, IMAP, POP3 protocols, PHP-MAPI bindings, and import from PST/OST/MSG/CDFV2/TNEF, EML/ICAL/VCF, Kopano, Zarafa

Home Page:https://gromox.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Gromox-delivery inserting an extra \r\n after the first header.

moosty-moo opened this issue · comments

Hi,
gromox-delivery seems to be putting an extra \r\n when writing out the /mess queue file.
It messes up the received email. It happens for certain emails but not all. I can't see a pattern.

I ran an 'strace' on the delivery program, below.
When reading the queue file the message does not have the extra \r\n

[pid 13327] openat(AT_FDCWD, "/var/lib/gromox/queue/mess/18", O_RDONLY <unfinished ...>
[pid 13327] <... openat resumed> ) = 8
[pid 13327] <... read resumed> "\21\23\0\0\0\0\0\0X-Lasthop: ::ffff:127.0.0.1\r\nReceived: from localhost (unknown [IPv6:::ffff:127.0.0.1])\r\n\tby office-vm.local with LMTP;\r\n\tTue, 11 Apr 2023 17:49:14 +0100\r\nFrom 010201877137f

However, when delivering the message it inserts an extra \r\n giving "0100\r\n\r\nFrom 01020"

[pid 13331] write(8, "X-Lasthop: ::ffff:127.0.0.1\r\nReceived: from localhost (unknown [IPv6:::ffff:127.0.0.1])\r\n\tby office-vm.local with LMTP;\r\n\tTue, 11 Apr 2023 17:49:14 +0100\r\n\r\n", 165) = 165
[pid 13331] write(8, "From 010201877137f240

Any ideas what may be the problem?
This is the current master branch. It also happened on an older branch.

The 'problem' was caused by my MTA inserting a UNIX style From_ header.
The delivery agent would insert "\r\n" before it if the From_ line was greater than 92 chars.
Hence the confusion when it would sometimes work.
This is a non-issue as a From_ header not a recognised header.

But why 92? From would/should be considered a non-header simply because of the lack of ':' after the first word.