Package: postfix
Version: 3.1.12-0+deb9u1
Severity: grave
Affects: procmail
Justfication: causes data loss (after a few days), breaks (more or less) 
unrelated packages (procmail)

Dear Debian Postfix Maintainers,

   * What led up to the situation?

Since a few minutes after upgrading Postfix on Stretch from
3.1.9-0+deb9u2 to 3.1.12-0+deb9u1, procmail (!) on my server has been
unable to deliver mails to mailboxes bigger than some threshold:

procmail: Error while writing to "/home/abe/mbox"
procmail: Truncated file to former size
procmail: Error while writing to "/var/mail/abe"
procmail: Truncated file to former size

procmail itself has last been updated with the dist-upgrade of that box
from Jessie to Stretch.

This threshold seems somewhere between 472 MB and 609 MB (see below), so
I suspect it to be 500 MB or 512 MB, as the examples of mailboxes to
which or to which not procmail could deliver mail are clearly separated
by their size:

Postfix via procmail has delivered mails into these mailboxes since the
upgrade:

$ tail -42720 procmail-log.2019-04 | egrep "Folder: [^*]" | awk '{print $2}' | 
sort -u | xargs ls -lhSr --
-rw------- 1 abe users 4.4M Apr 29 04:49 -spam.4
-rw------- 1 abe users 7.9M Apr 29 10:15 -spam.3
-rw------- 1 abe users  11M Apr 29 13:09 -spam.2
-rw------- 1 abe users  16M Apr 29 12:10 -spam.20
-rw------- 1 abe users  48M Apr 28 16:43 -pkg-xen-devel
-rw------- 1 abe users  74M Apr 29 07:30 -debian-www
-rw------- 1 abe users  77M Apr 29 06:31 -debian-apt
-rw------- 1 abe users 110M Apr 28 20:24 -zsh
-rw------- 1 abe users 115M Apr 29 13:58 -spam.5
-rw------- 1 abe users 128M Apr 29 09:42 -debian-lintian
-rw------- 1 abe users 138M Apr 29 12:13 -debian-sparc
-rw------- 1 abe users 183M Apr 29 08:18 -debian-qa
-rw------- 1 abe users 438M Apr 28 19:43 -spam.15
-rw------- 1 abe users 472M Apr 29 09:17 -news

Postfix via procmail wasn't able to deliver mails into these mailboxes
since the upgrade:

$ tail -42720 procmail-log.2019-04 | fgrep "Error while writing to" | sort -u | 
awk -F'"' '{print $2}' | xargs ls -lhSr --
lrwxrwxrwx 1 abe users   13 Jun 25  2018 /home/abe/mbox -> /var/mail/abe
-rw------- 1 abe users 606M Apr 29 13:25 -debian-arm
-rw------- 1 abe users 612M Apr 29 13:24 -debian-boot
-rw------- 1 abe users 737M Apr 29 13:25 -debian-release
-rw------- 1 abe users 838M Apr 29 08:00 -spam.10
-rw------- 1 abe users 952M Apr 29 13:52 -debian
-rw--w---- 1 abe mail  1.4G Apr 29 13:53 /var/mail/abe
-rw------- 1 abe users 5.9G Apr 29 13:33 -logcheck

This is IMHO sufficiently enough statistically relevant data to show
that the imposed limit is somewhere around 500 MB.

The more recent timestamps of the files procmail couldn't deliver mail
to are explained by it stating that it tried to append something (which
failed) and trunkated the file to its original size — which doesn't
reset the timestamp.

Mutt on the same system can easily write to mailboxes at the size of up
to at least 1.8 GB, so it's not a system-wide issue.

   * What exactly did you do (or not do) that was effective (or
     ineffective)?

Upgrading postfix on Stretch from 3.1.9-0+deb9u2 to 3.1.12-0+deb9u1 via
aptitude-robot (similar to unattended-upgrades, just with more
flexibility).

   * What was the outcome of this action?

Since then my procmail log shows error messages like these for any
mailbox bigger than approx. 500 MB:

>From MAILER-DAEMON  Mon Apr 29 13:33:45 2019
 Subject: Delayed Mail (still being retried)
  Folder: **Requeued**                                                     2898
procmail: Extraneous locallockfile ignored
procmail: Error while writing to "/home/abe/mbox"
procmail: Truncated file to former size
procmail: Error while writing to "/var/mail/abe"
procmail: Truncated file to former size
>From MAILER-DAEMON  Mon Apr 29 13:38:45 2019
 Subject: Delayed Mail (still being retried)
  Folder: **Requeued**                                                     2900
procmail: Extraneous locallockfile ignored
procmail: Error while writing to "/home/abe/mbox"
procmail: Truncated file to former size
procmail: Error while writing to "/var/mail/abe"
procmail: Truncated file to former size

   * What outcome did you expect instead?

- Same limits as before.

- Honor the mailbox_size_limit set in /etc/postfix/main.cf as before.
  (According to
  https://www.mhonarc.org/archive/html/procmail/2003-01/msg00224.html
  postfix's mailbox_size_limit affects delivery via procmail.)
- Don't have any previously not existent effect on procmail.

JFTR:

~ → fgrep mailbox_size_limit /etc/postfix/main.cf
mailbox_size_limit = 0

Downgrading Postfix to 3.1.9-0+deb9u2 again (without touching the
procmail package or any configuration setting besides setting VERBOSE=1
in .procmailrc for debugging) fixed the issue for me. Now mails are
delivered again to mailbox up to at least 6.0 GB.

Unfortunately I haven't found anything which seemed relevant in the
3.1.12-0+deb9u1 debian/changelog entry, upstream changelog (HISTORY)
entires nor in the debdiff provided at https://bugs.debian.org/926190

-- System Information:
Debian Release: 9.9
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable'), (500, 'oldstable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.9.0-8-amd64 (SMP w/6 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_DE:en_US:en_GB:en (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages postfix depends on:
ii  adduser                3.115
ii  cpio                   2.11+dfsg-6
ii  debconf [debconf-2.0]  1.5.61
ii  dpkg                   1.18.25
ii  init-system-helpers    1.48
ii  libc6                  2.24-11+deb9u4
ii  libdb5.3               5.3.28-12+deb9u1
ii  libicu57               57.1-6+deb9u2
ii  libsasl2-2             2.1.27~101-g0780600+dfsg-3
ii  libssl1.1              1.1.0j-1~deb9u1
ii  lsb-base               9.20161125
ii  netbase                5.4
ii  postfix-sqlite         3.1.12-0+deb9u1
ii  ssl-cert               1.0.39

Versions of packages postfix recommends:
ii  python3  3.5.3-1

Versions of packages postfix suggests:
ii  bsd-mailx [mail-reader]        8.1.2-0.20160123cvs-4
ii  dovecot-core [dovecot-common]  1:2.2.27-3+deb9u4
ii  emacs24-nox [mail-reader]      24.5+1-11+deb9u1
ii  emacs25-nox [mail-reader]      25.1+1-4+deb9u1
ii  libsasl2-modules               2.1.27~101-g0780600+dfsg-3
ii  mutt [mail-reader]             1.7.2-1+deb9u1
pn  postfix-cdb                    <none>
ii  postfix-doc                    3.1.12-0+deb9u1
pn  postfix-ldap                   <none>
pn  postfix-lmdb                   <none>
pn  postfix-mysql                  <none>
ii  postfix-pcre                   3.1.12-0+deb9u1
pn  postfix-pgsql                  <none>
ii  procmail                       3.22-25+deb9u1
pn  resolvconf                     <none>
ii  sasl2-bin                      2.1.27~101-g0780600+dfsg-3
ii  sup-mail [mail-reader]         0.22.1-2
pn  ufw                            <none>

-- debconf information:
* postfix/retry_upgrade_warning: true
  postfix/kernel_version_warning:
  postfix/db_upgrade_warning: true
  postfix/dynamicmaps_upgrade_warning:
  postfix/mydomain_warning:
* postfix/mailname: sym
* postfix/mynetworks: 127.0.0.0/8 78.46.73.207/32, [2a01:4f8:120:4161::4]/128, 
78.46.73.201/32, [2a01:4f8:120:4161::2]/128
* postfix/protocols: all
  postfix/tlsmgr_upgrade_warning:
  postfix/not_configured:
  postfix/transport_map_warning:
* postfix/relay_restrictions_warning: true
  postfix/rfc1035_violation: false
* postfix/main_mailer_type: Internet Site
  postfix/relayhost:
* postfix/recipient_delim: +
  postfix/dynamicmaps_conversion_warning:
* postfix/mailbox_limit: 0
* postfix/procmail: true
  postfix/master_upgrade_warning:
* postfix/destinations: sym, sym2, sym.noone.org, localhost, 
localhost.localdomain, localhost.noone.org, sym2.noone.org, 
symlink.to.noone.org, someone.noone.org, xenlink.noone.org
* postfix/chattr: false
* postfix/compat_conversion_warning: true
  postfix/nqmgr_upgrade_warning:
  postfix/lmtp_retired_warning: true
* postfix/root_address: abe
* postfix/sqlite_warning: true
  postfix/main_cf_conversion_warning: true
  postfix/bad_recipient_delimiter:

Reply via email to