Block fake sender in sendmail

541 views
Skip to first unread message

Raja

unread,
Oct 7, 2005, 9:06:47 AM10/7/05
to RedHat Techies from Chandigarh
I have sendmail for All out going mails, for incomming I have
Antivirus. I want to stop all fake sender in sendmail except @mydomain.

Rajan

sandeep....@gmail.com

unread,
Oct 7, 2005, 12:34:33 PM10/7/05
to RedHat Techies from Chandigarh
Hello Rajan,

Can you be a little more specific about what you want to do, coz there
are lot of ways to do things like this in sendmail. There are may ways
you can block domains or allow only perticular domains to send mail,
etc, etc.

please let me know what you exactly want to do.. block sender from you
own network to send mails outside with fake domains or what ?

Thanks
Sandeep Pal

Raja

unread,
Oct 8, 2005, 12:18:28 AM10/8/05
to RedHat Techies from Chandigarh
I want to allow only particular domains in "From: us...@mydomain.com"

In my network there are mass-mailer virus which sends mail from the
network, which sends mail with fake mail address.
The mails contain:
To: some...@yahoo.com
From: some...@hotmail.com <--------- Fake Address.

From: should be @mydomain insted of @hotmail.com

sandeep....@gmail.com

unread,
Oct 8, 2005, 8:19:39 AM10/8/05
to RedHat Techies from Chandigarh
Okay, Here is the solution, I hope you are using RHEL4 or RHEL3 at
least....although, I think that should not create any problem.

In the sendmail's mc file which is located at "/etc/mail/sendmail.mc"
there is a directive which allows mails to be sent from unresolveable
domains.

(it is actually used to allow yours dialup users to send mails through
your server, cause otherwise they won't be able to do so, i hope u also
don't need it).

You will have to change this directive and recomplie the mc file using
m4, which will update your sendmail.cf file..

1. Open the configuration file. /etc/mail/sendmail.mc and look for the
following
---------------------------------------------------------------------------------------------------------
dnl Accept mails from IP addresses that do not have a reverse DNS
lookup
FEATURE (`accept_unresolveable_domains`) dnl
---------------------------------------------------------------------------------------------------------

2. Add the "dnl" in front of the FEATURE line, this will comment it.
like
---------------------------------------------------------------------------------
dnl FEATURE (`accept_unresolveable_domains`) dnl
---------------------------------------------------------------------------------

3. now compile sendmail's config file again and restart the service. I
hope you know how to complie mc file using m4, as you are running
sendmail.

I think this should solve your problem. Please feel free to write if
you have any other questions.

Thanks
Sandeep Pal

Raja

unread,
Oct 8, 2005, 8:27:08 AM10/8/05
to RedHat Techies from Chandigarh
Thank you very much.

Raja

unread,
Oct 8, 2005, 8:53:00 AM10/8/05
to RedHat Techies from Chandigarh
Will this check in "To:" or only "From:"
Will there be any case where the address in To: will not resolve and
the mail is dropped.

sandeep....@gmail.com

unread,
Oct 9, 2005, 1:59:27 AM10/9/05
to RedHat Techies from Chandigarh
Hi,

The above will check only "From:" But, if you want to check To also
then there is a file named "/etc/mail/access". You can specify certain
address in this file which will be processed arroding to the setting in
this file. Any rule put in this file will apply to both From and To.
format of the file is following.

/etc/mail/access
-----------------------------------------------------------------------------
some...@hotmail.com REJECT
domain.com REJECT
someuser@ REJECT

or even you can specific IP or network subnet address.

on the place of REJECT you can use few other keywords also, like OK,
DISCARD, RELAY, etc. you look for them in docs.

(Any user who matches here and is REJECT will be blacklisted in the
sendmail for sending or recieving mails.)

Don't forgot to restart the service after making changes.
(restarting sendmail with service command automatically runbuild this
file, which is necessary for changes to take effect, otherwise, you can
use the command "Make" while at the /etc/mail folder that will also
solve the problems if in case)

Thanks
Sandeep Pal

Reply all
Reply to author
Forward
0 new messages