Home » Questions » Computers [ Ask a new question ]

How do I set up a email whitelist using only procmailrc to protect my kids from unwanted email?

How do I set up a email whitelist using only procmailrc to protect my kids from unwanted email?

How do I set up a email whitelist using only procmailrc to protect my kids from unwanted email?

Asked by: Guest | Views: 82
Total answers/comments: 2
Guest [Entry]

"procmail can filter by the From header, and there are many recipe examples.

# This one discards all mail sent from the address below.
:0
* ^From: idiot@somehost.com
/dev/null

But don't forget that procmail only works with locally delivered mail. It won't affect mailboxes accessed over IMAP or webmail."
Guest [Entry]

"I think we have not any solution yet, that exactly solves the initial problem. Therefore, I would like to provide a more explicit approach. Lets suppose, that our whitelist looks like this:

white.domain.tld
light.domain.tld

Then I would try the following reciept:

:0
* !^From.*@white\.domain\.tld
* !^From.*@light\.domain\.tld
/dev/null

This would send all emails that are not from somebody@white.domain.tld and not from somebody@light.domain.tld to /dev/null. The remaining emails are send to the default destination. Be aware to use \. in your pattern if you like to match a single dot. The pattern . matches a single character.

If you have a short whitelist, you could try to get an even shorter reciept by combining the patterns:

:0
* !^From.*@(white|light)\.domain\.tld
/dev/null

Be aware to use ( ) here. Using [ ] would be a mistake."