Archive for the 'Mailserver' Category

PGP encrypted mailinglist

Saturday, March 15th, 2008

Found a perlscript to manage pgp-encryption for mailinglists but had to tweek it some for my purpose. Original is found here:

Added support for Reply-To: My Patch

Postgrey bypass

Sunday, February 10th, 2008

So it seems that postgrey is an marvelous system to stop spammer, but howto when you need that password sent for you asap and do not want to wait the 5 minutes timeout + time for the mailing server to resend your mail?

Well, I come up with an solution using bash script and procmail.

Yes, I should say that my MX running postgrey and procmail on debian etch stable versions and all other likely email software

First I alter /etc/passwd “home” folder for already installed postgrey “user”


in that folder I put an .procmailrc file:



#start postgrey bypasscript
* ^Subject:.*\secretword:\/[^ ]+
| /var/lib/postgrey/ “$MATCH”
#dump all mail to /dev/null

So now will all mail to postgrey@myserver be forward to trashcan (/dev/null)

but all that have secretword:myemail@myserver in subject

will acivate script.

So what then.


for i
echo “$1” >> /etc/postgrey/whitelist_recipients
/etc/init.d/postgrey reload
/bin/sleep 300
/bin/cat /etc/postgrey/whitelist_recipients | eval “/bin/sed -e \ ‘/^”$1″$/d’ > /etc/postgrey/whitelist_recipients”
/etc/init.d/postgrey reload


notice that line 7 and 8 can all be on same line (7) remove last \ is so,

What is script doing:
first add the myemail@myserver to postgrey default whitelist for recipient
then reload postgrey so it will be affected.
sleep in 5 minutes

remove myemail@myserver from whitelist and reload postgrey

so you can enjoy postgrey stopping spam.

Hope you find my soultion usefull