On Wed, Apr 08, 2015 at 08:59:41AM +0200, Louis-David Mitterrand wrote: > I manage a web site that sends price change alerts to subscribers using > postfix with VERP to detect failed deliveries. When a bounce comes in it > is fed to a perl script (through procmail) which increments the email's > error count in the database until that count reaches 4 and the email is > disabled. > > My problem is that sometimes delivery errors are transient (server > change, etc.) but the error count is never reset on a successful > delivery. > > What strategy could I use to detect a successful delivery in order to > reset the error count?
A simple counter design is likely too naive. Instead track each messages sent with a timestamp, and any bounces received. Drop only users whose most recent non-bounced message *and* first bounce after that are both sufficiently far in the past, and who since then have accumulated enough bounces. Apply a more stringent test for newly added users, dropping them if the first ~2 mails bounce regardless of how much time has elapsed. -- Viktor.