Quota backscatter prevention with Cyrus IMAPd

I use Cyrus IMAPd to provide access to mail over IMAP and POP3. For some domains I have also enabled quotas (since, unlike Google, I don’t have unlimited disk space yet). Unfortunately, this leads to a problem: my MTA, postfix, doesn’t www gratis pokeronline poker dsftexas holdem anleitungpoker kostenlos online spielengratis poker ohne anmeldungkostenloser online pokertilt poker bonus codepoker bonus ohne einzahlungspiele bankonline poker anbieterpoker 50 gratispoker online spiel kostenlospoker deposit bonus codepoker regeln 5poker java gamepoker umsonst spielenonline poker geldtexas holdem no limitwww poker spielen destrip poker regelnpoker 10 bonuspoker tippstexas holdem oddspoker game softwarepoker sign up bonus codepoker com bonus codeguida poker onlinepoker tour italiagiochi di poker on lineworld tour pokerplay poker on linegioco poker gratisfree 7 card studchips di pokergiocare onlinegiochi di poker per pcpoker gamespoker gratis da giocaretexas holdem poker onlinegioco poker gratuitogame pokerpoker on line gratispoker gratis in italianogiochi poker gratis on lineset pokerbonus code party pokerregolamento gioco pokervideo poker on line gratispoker tour gamepoker da scaricare know anything about a users’ quota, it will carry on trying to deliver mail to Cyrus regardless. When Cyrus receives the message it will reject it with a 4xx error (temporary failure). At this point the message will go into postfix’s deferred queue for 5 days, unless the user frees up some space it will be bounced back to the sender (which may be forged) - a prime opportunity for backscatter to be generated (abusive bounces sent to forged senders who never sent the original message).

I spent some time researching ways of enabling postfix to verify that a user had sufficient space available before delivering the message to Cyrus - unfortunately I came up empty.

So, I knocked up a little script in perl called chkquota that acts as a postfix policy daemon. It looks at the recipient address and uses IMAP::Admin by Eric Estabrooks to query Cyrus for the users’ current quota and only allow the message to be delivered if there is enough space for the message to be delivered. If there is not enough space it instructs postfix to defer the message, since the sender is still connected while this is happening there is no chance for backscatter to be sent to innocent third parties.

chkquota has several issues though:

  • It is single threaded - it works fine on my low (couple thousand messages a day) mail load, it probably will not scale up very well, as usual YMMV
  • It creates a new connection to the IMAP server for each message - this is grossly inefficient, but I failed to find a way of sharing connections that worked reliably. This may be fixed in future.
  • It works for Cyrus and postfix - IMAP::Admin supports several other IMAP daemons but they may not have been tested much, again YMMV. I may turn it into a milter in future (both sendmail and postfix support the milter protocol)..

It also has several dependencies:

Having said all that, you can download chkquota 0.004 here. I’d appreciate any feedback.

There are no comments on this post

Leave a Reply