You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Stefan Jakobs <st...@rus.uni-stuttgart.de> on 2008/05/06 21:32:49 UTC

whitelist mail from own host

Hello list,

here is a part of the header from a mail I like to whitelist:

X-Spam-Status: Yes, score=6.958 tagged_above=-999 required=5
	tests=[BAYES_00=-2.599, NO_RELAYS=-0.001, SPOOF_COM2COM=2.272,
	SPOOF_COM2OTH=2.044, URIBL_BLACK=1.955, URIBL_PH_SURBL=1.787,
	URIBL_WS_SURBL=1.5]
Received: from server.mydomain.tld ([127.0.0.1])
	by localhost (server.mydomain.tld [127.0.0.1]) (amavisd-new, port 10024)
	with LMTP id YNy7nG6dpfBy for <ro...@server.mydomain.tld>;
	Tue,  6 May 2008 03:06:45 +0200 (CEST)
Received: by server.mydomain.tld (Postfix, from userid 0)
	id 158EE552D2F; Tue,  6 May 2008 03:06:45 +0200 (CEST)
To: root@server.mydomain.tld
From: stats@server.mydomain.tld

The mail contains some mail statistics and therefore sometimes some URIs which 
are blacklisted. I can not change the content. That's why I like to use:
whitelist_from_rcvd stats@server.mydomain.tld mydomain.tld

But that will not work! How can I whitelist this mail without 
using 'whitelist_from  stats@server.mydomain.tld'?

Thanks
Stefan

Re: whitelist mail from own host

Posted by Stefan Jakobs <st...@rus.uni-stuttgart.de>.
On Tuesday 06 May 2008 23:06, mouss wrote:

<snip>

> I see from your headers that you use postfix and amavdis-new, and that
> such messages are submitted with the sendmail command. if you trust the
> machine (no php mail to outside), then you can skip filtering for mail
> submitted via sendmail. to do so, just add
>     -o content_filter=
> to the "pickup" service in master.cf

That's a very good solution. Also saves me for equal problems in the future.
Thanks mouss!

> if you don't trust the machine, things get a bit more complex but it's
> still feasible.
>
> alternatively, use amavisd-new (policy banks, whitelists, ...). but if
> you rely on the sender address, make sure to reject it in your smtpd
> (you don't want to give spammers an open road).

Greetings
Stefan

Re: whitelist mail from own host

Posted by mouss <mo...@netoyen.net>.
Benny Pedersen wrote:
> On Tue, May 6, 2008 23:06, mouss wrote:
>
>   
>> you rely on the sender address, make sure to reject it in your smtpd
>> (you don't want to give spammers an open road).
>>     
>
> that was why i sugested spf
>   

blocking a sender in postfix is trivial. adding SPF support requires 
additionnal software (and configuration...).

also, he can block a set of "internal/reserved" senders, and still allow 
the domain (In contrast, SPF applies to the whole domain).






Re: whitelist mail from own host

Posted by Benny Pedersen <me...@junc.org>.
On Tue, May 6, 2008 23:06, mouss wrote:

> you rely on the sender address, make sure to reject it in your smtpd
> (you don't want to give spammers an open road).

that was why i sugested spf


Benny Pedersen
Need more webspace ? http://www.servage.net/?coupon=cust37098


Re: whitelist mail from own host

Posted by mouss <mo...@netoyen.net>.
Stefan Jakobs wrote:
> Hello list,
>
> here is a part of the header from a mail I like to whitelist:
>
> X-Spam-Status: Yes, score=6.958 tagged_above=-999 required=5
> 	tests=[BAYES_00=-2.599, NO_RELAYS=-0.001, SPOOF_COM2COM=2.272,
> 	SPOOF_COM2OTH=2.044, URIBL_BLACK=1.955, URIBL_PH_SURBL=1.787,
> 	URIBL_WS_SURBL=1.5]
> Received: from server.mydomain.tld ([127.0.0.1])
> 	by localhost (server.mydomain.tld [127.0.0.1]) (amavisd-new, port 10024)
> 	with LMTP id YNy7nG6dpfBy for <ro...@server.mydomain.tld>;
> 	Tue,  6 May 2008 03:06:45 +0200 (CEST)
> Received: by server.mydomain.tld (Postfix, from userid 0)
> 	id 158EE552D2F; Tue,  6 May 2008 03:06:45 +0200 (CEST)
> To: root@server.mydomain.tld
> From: stats@server.mydomain.tld
>
> The mail contains some mail statistics and therefore sometimes some URIs which 
> are blacklisted. I can not change the content. That's why I like to use:
> whitelist_from_rcvd stats@server.mydomain.tld mydomain.tld
>
> But that will not work! How can I whitelist this mail without 
> using 'whitelist_from  stats@server.mydomain.tld'?
>   

I see from your headers that you use postfix and amavdis-new, and that 
such messages are submitted with the sendmail command. if you trust the 
machine (no php mail to outside), then you can skip filtering for mail 
submitted via sendmail. to do so, just add
    -o content_filter=
to the "pickup" service in master.cf

if you don't trust the machine, things get a bit more complex but it's 
still feasible.

alternatively, use amavisd-new (policy banks, whitelists, ...). but if 
you rely on the sender address, make sure to reject it in your smtpd 
(you don't want to give spammers an open road).




Re: whitelist mail from own host

Posted by mouss <mo...@netoyen.net>.
Benny Pedersen wrote:
> On Tue, May 6, 2008 23:02, Stefan Jakobs wrote:
>
>   
>> Yes, that's a possibility, but I can not do that. At least not in the near
>> future. Any other ideas?
>>     
>
> depends, but i like to know why spf can't work for you ?
>   

I don't speak for OP, but here is an example:

I want to be able to also send mail via my ISP (free.fr) using my own 
email address, and since my ISP doesn't publish SPF records nor a list 
of official outgoing servers, I can't afford to guess them (if one of 
the authorized IP is later allocated to a spammer, this may ruin my 
domain reputation. and if a new outgoing server is added, some servers 
may block may mail).

Of course, I won't use a +all, because this is generally a sign spam (at 
least this is how it is considered).

Now, OP can use DKIM, which doesn't interfere with relaying.

Re: whitelist mail from own host

Posted by Benny Pedersen <me...@junc.org>.
On Tue, May 6, 2008 23:02, Stefan Jakobs wrote:

> Yes, that's a possibility, but I can not do that. At least not in the near
> future. Any other ideas?

depends, but i like to know why spf can't work for you ?


Benny Pedersen
Need more webspace ? http://www.servage.net/?coupon=cust37098


Re: whitelist mail from own host

Posted by Stefan Jakobs <st...@rus.uni-stuttgart.de>.
On Tuesday 06 May 2008 22:00, Benny Pedersen wrote:
> On Tue, May 6, 2008 21:32, Stefan Jakobs wrote:
> > From: stats@server.mydomain.tld
>
> add a spf record for this domain incl the subdomain :-)

Yes, that's a possibility, but I can not do that. At least not in the near 
future. Any other ideas?

<snip>
>
>
> Benny Pedersen

Greetings
Stefan

Re: whitelist mail from own host

Posted by Benny Pedersen <me...@junc.org>.
On Tue, May 6, 2008 21:32, Stefan Jakobs wrote:

> From: stats@server.mydomain.tld

add a spf record for this domain incl the subdomain :-)

then whitelist_auth *@server.mydomain.tld

adjust the whitelist score so it not default -100 but enough to get the mail
through

def_whitelist_auth *@mydomain.tld
whitelist_auth *@server.mydomain.tld

or

unwhitelist_auth *@mydomain.tld
whitelist_auth user@mydomain.tld

but add apf for a start

use this to be safe:

v=spf1 mx +all

i know some will say this is bad with +all, but think one more time then :-)


Benny Pedersen
Need more webspace ? http://www.servage.net/?coupon=cust37098