[TriLUG] Re: simple mail filter. best option?

Cristobal Palmer cristobalpalmer at gmail.com
Sun Jul 23 13:09:53 EDT 2006


Many thanks to Nathan Conrad for showing me how it's done in procmail:

--install procmail
--add this line to /etc/postfix/main.cf :
'mailbox_command = /usr/bin/procmail'
--assuming we don't want to drop rejected mail to /dev/null, we should
make a /var/log/procmail dir and set up a rotation for .junk files
--make an /etc/procmailrc file:

:0
* ^To:.*foo at bar.com
{
:0
* !^From:.*@foo.com
/var/log/procmail/foo.junk
}

:0
* ^To:.*baz at bar.com
{
:0
* !^From:.*@baz.com
/var/log/procmail/baz.junk
}

--??
--Profit!

-CMP

On 7/22/06, Cristobal Palmer <cristobalpalmer at gmail.com> wrote:
> I have a site, bar.com, that will be receiving mail from clients such
> as foo and baz who have their own domains, foo.com and baz.com.
>
> I want to set things up such that mail to foo at bar.com only gets
> through if it came from *@foo.com, likewise mail to baz at bar.com should
> be dropped if it didn't come from *@baz.com.
>
> What's the _best_ way to do this if I'm using postfix? Something
> directly in postfix? Procmail?
>
> TIA,
> CMP
>
> --
> Cristobal M. Palmer
> UNC-CH SILS Student
> TriLUG Vice Chair
> cristobalpalmer at gmail.com
> cmpalmer at ils.unc.edu
> ils.unc.edu/~cmpalmer
> "Television-free since 2003"
>
> <tarheelcoxn> iank has trouble with English. his native language is Python
> <iank> Yeah
> <iank>   I'm forced
> <iank>     To indent
> <iank>   My sentences
>


-- 
Cristobal M. Palmer
UNC-CH SILS Student
TriLUG Vice Chair
cristobalpalmer at gmail.com
cmpalmer at ils.unc.edu
ils.unc.edu/~cmpalmer
"Television-free since 2003"

<tarheelcoxn> iank has trouble with English. his native language is Python
<iank> Yeah
<iank>   I'm forced
<iank>     To indent
<iank>   My sentences



More information about the TriLUG mailing list