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
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
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
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