Archive for the 'Mailserver' Category
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/prio.sh “$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 prio.sh script.
So what then.
echo “$1” >> /etc/postgrey/whitelist_recipients
/bin/cat /etc/postgrey/whitelist_recipients | eval “/bin/sed -e \ ‘/^”$1″$/d’ > /etc/postgrey/whitelist_recipients”
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