Re: Unexpected record type 'X'

2022-10-06 Thread John Alex.
In my case, a single alias was used that expands to 5000 or more addresses in a 
virtual_alias_maps table (after increasing virtual_alias_expansion_limit).


The error is reproduced both when sending an email to this alias address and when just 
checking with 'sendmail -bv'.


John

On 10/6/22 16:37, Wietse Venema wrote:

How was your Postfix queue file with 5000 recipients created?
- with Postfix virtual_alias_maps expansion,
- with Postfix alias_maps expansion (/etc/aliases),
- by submitting a message with 5000 recipients over SMTP?
- ??


Re: Unexpected record type 'X'

2022-10-06 Thread John Alex.
Hi, I encountered the same issue on two FreeBSD 13.1 + Postfix 3.7.2 installations. It 
only occurs when trying to send an email with >4999 recipients (the mail queue is 
otherwise empty). This issue does not happen on another machine with FreeBSD 13.0 + 
Postfix 3.6.3.


After some search I found that it is caused by the following addition in qmgr_message.c in 
3.7 (line 441):


if (strchr(expected_rec_types, rec_type) == 0) {
msg_warn("Unexpected record type '%c' at offset %ld",
 rec_type, (long) curr_offset);
rec_type = REC_TYPE_ERROR;
break;
}

in combination with the pre-existing (line 385):

/* Keep interrupt latency in check. */
if (recipient_limit > 5000)
recipient_limit = 5000;


If I remove the code that was introduced in 3.7, the mail is delivered without issue. I 
also tried changing 5000 to 10001 and the email was again succesfully delivered to up to 
1 recipients.


So it seems this issue occurs whenever the mail queue total recipient count reaches 5000 
addresses.


John

On 8/30/22 10:20, Frank Brendel wrote:

Hi,

sporadically I get the error
   Unexpected record type 'X' at offset ...
and the message is moved to the corrupt queue.

E.g.
postfix/smtpd[19574] 010EDD6443: client=unknown[1.2.3.4]
postfix/cleanup[98995] 010EDD6443: message-id=<>
postfix/qmgr[63719] 010EDD6443: from=,
size=14197, nrcpt=24 (queue active)
postfix/qmgr[63719] warning: Unexpected record type 'X' at offset 17542
postfix/qmgr[63719] warning: saving corrupt file "010EDD6443" from
queue "active" to queue "corrupt"

The message looks OK to me. It is multipart/mixed with multiple
recipients. The offset is always at the end of the message.

postcat -do 010EDD6443
...
17481  78 boundary_641_fc5671dc-1c1d-438e-a827-019b96ffe19b--
17538  78
17540  78
17542  88 *** HEADER EXTRACTED 010EDD6443 ***
17544  69 *** MESSAGE FILE END 010EDD6443 ***

Postfix version is 3.7.0 and runs on FreeBSD 12.3.

I have no idea what HEADER EXTRACTED means an why it appears or why it
shouldn't.
Messages were sent with different email clients.

So what could be wrong with the message?


Thanks
Frank


  Frank Brendel
Administrator Rechenzentrum

Telefon:  +49 811 9595-157
Telefax:  +49 811 9595-199
Internet: https://www.eurolog.com

EURO-LOG AG
Am Söldnermoos 17, D-85399 Hallbergmoos
Vorstand: Jörg Fürbacher
Aufsichtsratsvorsitzender: Markus Quicken
Registergericht: AG München HRB 140857
Steuer-Nr.: 115/118/10169
Ust-ID-Nr.: DE 811547361

Diese E-Mail könnte vertrauliche und/oder rechtlich geschützte Informationen 
enthalten. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail 
irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und 
vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte 
Weitergabe dieser Mail sind nicht gestattet. This e-mail may contain 
confidential and/or privileged information. If you are not the intended 
recipient (or have received this e-mail in error) please notify the sender 
immediately and destroy this e-mail. Any unauthorized copying, disclosure or 
distribution of the material in this e-mail is strictly forbidden.