You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Scott Mcdermott <sm...@questra.com> on 2004/04/26 21:22:00 UTC
how not to check mails traversing only intranet relays
I need to instruct spamassassin to, if the mail has only
traversed relays in a certain netblock, not check the mail
(or give a high negative score).
There isn't any clear way to do exactly this, so I've tried
using a combination of trusted_networks and
whitelist_from_rcvd instead.
I have listed all private networks as trusted:
trusted_networks 192.168/16
trusted_networks 10/8
trusted_networks 127/8
all the hosts the mails in question traverse will be in
these networks.
I have listed every internal mail relay that we have as a
whitelist_from_rcvd:
whitelist_from_rcvd *@questra.com my_internal_relay_host1
whitelist_from_rcvd *@questra.com my_internal_relay_host2
...
this does not work. Mails sent internally which never
traverse publically routable relay hosts, and also come from
machines in trusted_networks as the origin point, still get
checked for spam.
I have a feeling it's because the MX records for questra.com
resolve to routable IPs, and we don't use MX records
internally (we just set SMTP hostnames in the users' MUAs).
Does anyone know how to configure spamassassin appropriately
for this setup? I am looking for something that says "if
every hop this mail took was in trusted_networks, don't
check it" regardless of the MX hosts for the destination
domain. I.e. just disable DNS checking entirely (except
maybe to resolve the A record of a relay), calculate all
hops based on `Received:' headers, and unconditionally allow
the mails if all `Received:' hosts are in trusted_networks.
Any help is greatly appreciated.
Re: how not to check mails traversing only intranet relays
Posted by Scott Mcdermott <sm...@questra.com>.
Justin Mason on Mon 26/04 12:54 -0700:
> > > I have listed all private networks as trusted:
> > >
> > > trusted_networks 192.168/16
> > > trusted_networks 10/8
> > > trusted_networks 127/8
> >
> > Stop. Do NOT list all your IP's as "trusted". ONLY list
> > mailservers which will insert Received: headers in these
> > blocks.
> >
> > Listing client IP ranges will prevent
> > whitelist_from_rcvd from working properly, as SA will
> > consider the "rcvd" address to be non-existant.
ok, I have this working now; all my internal MTAs (and
*only* them) are listed in trusted_networks, and
whitelist_from_rcvd is "*@questra.com questra.com". Now
every internal host that sends mail using one of the MTAs
specified in trusted_networks gets a -100 score as expected.
Thanks very much for helping me with that.
However, this now generates a new problem: the relay hosts
themselves now are getting FORGED_IN_WHITELIST and do not
get the -100 score from passing whitelist_from_rcvd test.
Presumably this is because there is no boundary between
trusted and untrusted for them, and SA will "consider the
rcvd address to be non-existant" for them as you say.
So how to allow the relays to send mails themselves and not
just relay mail?
Re: how not to check mails traversing only intranet relays
Posted by Scott Mcdermott <sm...@questra.com>.
Matt Kettler on Mon 26/04 17:44 -0400:
> > ok I am actually using 3.0.0 from CVS as of 20040330.
> > Does this mean that your message about what
> > trusted_networks and whitelist_from_rcvd really mean is
> > still accurate and these configuration directives are
> > still as you described them?
>
> Well, it means Justin believes that in the _current_ 3.0
> SVN version the problem is fixed and you can include
> clients in trusted_networks.
>
> However, I don't know what date that fix went in, so your
> version may require the 2.63 type handling where you have
> to only list servers. From what you've described, it does
> sounds like you're suffering from the 2.63 type behavior.
It does seem that my version works with the old behavior,
but the new behavior you describe would solve the
relays-cant-originate-mail-themselves problem that I
submitted in a followup message. Because of this, I'd like
to use the new behavior instead. It also means I won't have
to track my internal relay IPs in the spamassassin
configuration file, so I think I like this approach better.
However, I just checked `Changes' from the SVN trunk and I
don't see anything related to `trusted_networks' any time
this year save for some stuff about trusted_networks
interacting with the Bayes, and about adding automatic
trusted_networks determination based on MX.
I wonder if Justin knows more specifically which commit
added the new behavior?
Re: how not to check mails traversing only intranet relays
Posted by Matt Kettler <mk...@evi-inc.com>.
At 04:24 PM 4/26/2004, Scott Mcdermott wrote:
>ok I am actually using 3.0.0 from CVS as of 20040330. Does
>this mean that your message about what trusted_networks
>and whitelist_from_rcvd really mean is still accurate and
>these configuration directives are still as you described
>them?
Well, it means Justin believes that in the _current_ 3.0 SVN version the
problem is fixed and you can include clients in trusted_networks.
However, I don't know what date that fix went in, so your version may
require the 2.63 type handling where you have to only list servers. From
what you've described, it does sounds like you're suffering from the 2.63
type behavior.
I'd suggest trying it, if it's practical, and see if your whitelists start
working.
Re: how not to check mails traversing only intranet relays
Posted by Scott Mcdermott <sm...@questra.com>.
Matt Kettler on Mon 26/04 16:02 -0400:
> > > See above.. your use of trusted_networks is breaking
> > > whitelist_from_rcvd.
> >
> > BTW, I *think* this is a bug that's fixed in 3.0.0....
>
> Justin, that's good to know, I've been hoping 3.0 would be
> a bit less difficult to explain.
>
> It's a slightly counter-intuitive behavior in 2.63. A lot
> of admins think of "trust" in terms of "my network" and
> "not my network". (classic ingress-only-firewall thinking
> though it may be, it is quite common).
ok I am actually using 3.0.0 from CVS as of 20040330. Does
this mean that your message about what trusted_networks
and whitelist_from_rcvd really mean is still accurate and
these configuration directives are still as you described
them?
Re: how not to check mails traversing only intranet relays
Posted by Matt Kettler <mk...@evi-inc.com>.
At 03:54 PM 4/26/2004, Justin Mason wrote:
> > SA is looking for an untrusted host dropping off to a trusted server to
> > determine the submitter of the message. If the client machine itself is
> > trusted, SA will not find a rcvd address to match against, and this
> > whitelist_from_rcvd will fail.
> >
> > >I have listed every internal mail relay that we have as a
> > >whitelist_from_rcvd:
> > >
> > > whitelist_from_rcvd *@questra.com my_internal_relay_host1
> > > whitelist_from_rcvd *@questra.com my_internal_relay_host2
> >
> > See above.. your use of trusted_networks is breaking whitelist_from_rcvd.
>
>BTW, I *think* this is a bug that's fixed in 3.0.0....
Justin, that's good to know, I've been hoping 3.0 would be a bit less
difficult to explain.
It's a slightly counter-intuitive behavior in 2.63. A lot of admins think
of "trust" in terms of "my network" and "not my network". (classic
ingress-only-firewall thinking though it may be, it is quite common).
Re: how not to check mails traversing only intranet relays
Posted by Matt Kettler <mk...@evi-inc.com>.
At 03:22 PM 4/26/2004, Scott Mcdermott wrote:
>I have listed all private networks as trusted:
>
> trusted_networks 192.168/16
> trusted_networks 10/8
> trusted_networks 127/8
Stop. Do NOT list all your IP's as "trusted". ONLY list mailservers which
will insert Received: headers in these blocks. Think of trusted_networks as
"trusted_relay_networks" not "my_entire_network". Also be sure to not list
exchange servers, and other servers which fail to insert Received: headers.
Listing client IP ranges will prevent whitelist_from_rcvd from working
properly, as SA will consider the "rcvd" address to be non-existant.
SA is looking for an untrusted host dropping off to a trusted server to
determine the submitter of the message. If the client machine itself is
trusted, SA will not find a rcvd address to match against, and this
whitelist_from_rcvd will fail.
>I have listed every internal mail relay that we have as a
>whitelist_from_rcvd:
>
> whitelist_from_rcvd *@questra.com my_internal_relay_host1
> whitelist_from_rcvd *@questra.com my_internal_relay_host2
See above.. your use of trusted_networks is breaking whitelist_from_rcvd.
Re: how not to check mails traversing only intranet relays
Posted by Scott Mcdermott <sm...@questra.com>.
Theo Van Dinter on Mon 26/04 15:32 -0400:
> > for this setup? I am looking for something that says
> > "if every hop this mail took was in trusted_networks,
> > don't check it" regardless of the MX hosts for the
> > destination domain. I.e. just disable DNS checking
> > entirely (except
>
> There is no way to have SpamAssassin do this. Anything
> you send to SA will be checked by SA. You want to build
> logic in whatever you use to call SA that says "don't send
> this to SA if X, Y, Z, etc."
It's fine if it's checked, it can just score it -100 like it
does with whitelist_from_rcvd/trusted_networks combination,
if the above conditions are met.
Re: how not to check mails traversing only intranet relays
Posted by Theo Van Dinter <fe...@kluge.net>.
On Mon, Apr 26, 2004 at 03:22:00PM -0400, Scott Mcdermott wrote:
> for this setup? I am looking for something that says "if
> every hop this mail took was in trusted_networks, don't
> check it" regardless of the MX hosts for the destination
> domain. I.e. just disable DNS checking entirely (except
There is no way to have SpamAssassin do this. Anything you send to SA
will be checked by SA. You want to build logic in whatever you use to
call SA that says "don't send this to SA if X, Y, Z, etc."
--
Randomly Generated Tagline:
"I think there's a fine line between character flaws and whackjobs..."
-John Talbot