Skip to main content

Ralsina.Me — Roberto Alsina's website

Posts about qmail (old posts, page 2)

Qmail Address Lister

It has been way too long with­out post­ing a longer item, so... I re­ci­cled a script I wrote for a cus­tomer, and here it is:

A python script that lists (al­most) all email ad­dress­es in a qmail sys­tem.

Al­so, a slight­ly tweaked CSS, thanks to Georg!

Useful qmail patch

Adds tarpit­ting to qmail-smt­pd, which is al­most manda­to­ry for a mod­ern large SMTP serv­er.

Too bad it's not pro­gres­sive tarpit­ting, but that's easy to fix :-)

Now all I need is a patch to make qmail-smt­pd check lo­cal rcp­t's va­lid­i­ty and I'm com­plete­ly trou­ble-free with it.

Ugly hack at noon

I just spent the af­ter­noon at a clien­t's hack­ing qmail+­couri­er to work stor­ing mail on a NT serv­er.

Why? Well, mi­gra­tion is­sues, from NT to Lin­ux.

And what had to be hacked? Lot­s.

  • You can't chmod over SMB

  • You can't link() over SMB (y­ou can un­link(), though), so in or­der to have atom­­ic mes­sage moves from Maildir/tmp to Maildir/new and what­ev­er, re­­name()

  • Good thing this was a sin­­gle-UID qmail sys­tem: you can't chown ei­ther ;-)

  • Couri­er's meta­­da­­ta is cre­at­ed on Maildir/tmp and moved: same prob­lem as above

  • Cranky per­mis­­sion checks fixed via uid,gid,f­­mask mount op­­tion­s.

  • It had to work with a canned we­b­­mail thing, which ex­pects all mail to be in one fold­er on disk, so Maildir/cur and Maildir/new have to be sym­links to a sin­­gle fold­er.

  • Since you can't have sym­links on SM­B, Maildir is lo­­cal, but sub­­dirs of it are sym­links to the SM­B-­­moun­t­ed thing

  • Then couri­er's pop does­n't work be­­cause you can't re­­name from Maildir/tmp (over SM­B) to maildir/­­couri­er­pop­what­ev­er (lo­­cal), so hack couri­er to use mk­stemp or what­ev­er

  • Then couri­er got each mail twice. Looks like it sees two UIDLs for the same file, de­pend­ing on whether it's read or not (my guess: be­­cause we are mix­ing Maildir/cur and Maildir/new on one fold­er). Make couri­er use al­ter­­na­­tive UIDL for­­mat and it work­s.

And so on. About two hours, and I am pret­ty sure noone has ev­er done some­thing like this be­fore. On the oth­er hand, when noone has done some­thing like this be­fore, they usu­al­ly had a very good rea­son!

Qmail RPMs

I have been us­ing Bruce Guenter's nice Qmail rpms for years, but he does­n't seem to be work­ing on them much.

So, I just fixed a cou­ple of is­sues:

  • TLS Sup­­port

  • er­rno fix (for glibc 2.3)

  • svc-add smt­pd (sil­­ly)

So, it now builds out­-of-the-box on RH8 and RH9.

I should open a sf.net site for them, prob­a­bly. Add CRAM-MD5 au­then­ti­ca­tion (I have it work­ing with a plain file, LDAP would be nicer), a work­ing couri­er RPM (tricky to build some­times), a lit­tle ex­tra stuff (an­tivirus, spa­mas­sas­s­in, au­tore­spon­der) and it's re­al­ly a nice mail serv­er in a box.

Fighting Spam with Qmail (part II)

Part II of the se­ries. In this ar­ti­cle, we re­place qmail-smt­pd with qpsmt­pd, which is more flex­i­ble and spam-aware.


Contents © 2000-2023 Roberto Alsina