Wietse Venema:
> Wietse Venema:
> > > So it seems this issue occurs whenever the mail queue total recipient 
> > > count reaches 5000 
> > > addresses.
> > 
> > Thanks, that is very useful. This appears to be a corner-case error,
> > and that would explain why the problem was difficult to reproduce.
> 
> This reproduces 100% with the Postfix smtp-source test program and
> a test system with empty Postfix queue.

Postfix 3.7 introduced special handling of the "start of message
content" queue file record. That code could be skipped under sone
conditions. The patch addresses the inconsistency.

        Wietse

20221006

        Bugfix (introduced: Postfix 3.7). Messages could falsely
        be flagged as corrupt with "warning: Unexpected record type
        'X'". These messages were moved to the "corrupt" queue
        directory, where they may still be found.

        This could happen for messages with 500 or more recipients,
        or with fewer recipients on a busy mail server. Problem
        reported by Frank Brendel, reproduced by John Alex. Files:
        qmgr/qmgr_message.c, oqmgr/qmgr_message.c.

        A file in the "corrupt" queue directory may be inspected
        with the command "postcat /var/spool/postfix/corrupt/<filename>.
        If delivery of the file is still desired, the file can be
        moved back to /var/spool/postfix/incoming.

diff -ur /var/tmp/postfix-3.8-20220816/src/oqmgr/qmgr_message.c 
./src/oqmgr/qmgr_message.c
--- /var/tmp/postfix-3.8-20220816/src/oqmgr/qmgr_message.c      2021-11-13 
09:56:41.000000000 -0500
+++ ./src/oqmgr/qmgr_message.c  2022-10-06 17:53:23.138241428 -0400
@@ -466,8 +466,8 @@
                        break;
                    }
                    /* Examine non-recipient records in extracted segment. */
-                   if (vstream_fseek(message->fp, message->data_offset
-                                     + message->data_size, SEEK_SET) < 0)
+                   if (vstream_fseek(message->fp, message->data_offset,
+                                     SEEK_SET) < 0)
                        msg_fatal("seek file %s: %m", 
VSTREAM_PATH(message->fp));
                    continue;
                }
diff -ur /var/tmp/postfix-3.8-20220816/src/qmgr/qmgr_message.c 
./src/qmgr/qmgr_message.c
--- /var/tmp/postfix-3.8-20220816/src/qmgr/qmgr_message.c       2021-11-13 
09:57:06.000000000 -0500
+++ ./src/qmgr/qmgr_message.c   2022-10-06 17:53:23.152241629 -0400
@@ -506,8 +506,8 @@
                        break;
                    }
                    /* Examine non-recipient records in extracted segment. */
-                   if (vstream_fseek(message->fp, message->data_offset
-                                     + message->data_size, SEEK_SET) < 0)
+                   if (vstream_fseek(message->fp, message->data_offset,
+                                     SEEK_SET) < 0)
                        msg_fatal("seek file %s: %m", 
VSTREAM_PATH(message->fp));
                    continue;
                }

Reply via email to