Accept mail where From: is one specific domain.

Accept mail where From: is one specific domain.

am 15.01.2008 01:04:36 von Noah

I need to configure Sendmail so that it will accept mail
only from a specific domain name. That is, the From: header
should be from "example.com" and nothing else.

This is for a ticket system that receives requests via mail
(Mantis). Somehow the internal support email address has
gotten onto a spam or virus list. Only people within our
organization are supposed to use this address, so I don't
need to handle email from anyone else. I want to accept
only email where the From: header is from our own domain.

I can't block based on IP address. I tried accepting email
only from a few specific IP addresses (I did this with
iptables), but it turns out that spam is getting routed
through one of our upstream email servers that I don't have
access to. This is the same email server that route legit
email.

I realize that a spammer can easily forge the From: header
address, but this doesn't happen often and I only need to
cut down on the quantity of spam, so even a 75% reduction
would be acceptable.

Maybe this is something that should be done with Procmail,
but I thought that there might be an easy way to do this at
the Sendmail server level. Since this is just a ticket server
I was hoping to avoid the hassle of installing something like
Spam Assassin. I think a simple From: rule would take care
of most of my problems.

--
Noah

Re: Accept mail where From: is one specific domain.

am 15.01.2008 01:48:45 von lewis.bergman

On Jan 14, 6:04 pm, Noah wrote:
> I need to configure Sendmail so that it will accept mail
> only from a specific domain name. That is, the From: header
> should be from "example.com" and nothing else.
>
The standard way would be to add the domain to the /etc/mail/relay-
domains file making sure no IP's are listed in the access file except
for the default entries for the localhost.

You could try the access file. Use FEATURE(`blacklist_recipients')dnl
after you define the access db(probably already done) then in the
access file try putting:
From: REJECT
From:example.com RELAY

Accept mail where From: is one specific domain.

am 15.01.2008 18:44:05 von Joseph Brennan

> You could try the access file. Use FEATURE(`blacklist_recipients')dnl
> after you define the access db(probably already done) then in the
> access file try putting:
> From: =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0REJECT
> From:example.com =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0RELAY

No, that works on the envelope sender. He wants to act based on the
header From:.
In spam the two quite often are different.

Look at cf/README in the section called "Header Checks".

This could be done more easily with Procmail, if this mail is handled
by procmail .

Joseph Brennan
Columbia University IT

Re: Accept mail where From: is one specific domain.

am 18.01.2008 21:21:56 von Noah

On Jan 15, 9:44 am, Joe Brennan wrote:
> This could be done more easily with Procmail, if this mail is handled
> by procmail .
> Joseph Brennan
> Columbia University IT

Yes, I ended up using Procmail. I was punishing myself for no reason.
It just seemed like such a simple filter that I thought I could do it
in sendmail.
--
Noah