Operating System - Linux
1828301 Members
3520 Online
109975 Solutions
New Discussion

Re: Sendmail: receive but no send

 
Chris H_3
Advisor

Sendmail: receive but no send

Hi all,

Currently I have a webmail server that can send and receive from anywhere. I'd like to shutdown all sending of email, and receive only on a couple specified domains.

For the receiving, can I just DENY all domains by default in access.db and ACCEPT only the domains I want to receive from?

Any ideas on what to do about stopping all sending?

Thanks for any tips!

CH
4 REPLIES 4
Seth Parker
Trusted Contributor

Re: Sendmail: receive but no send

Interesting question. I did a little looking and it doesn't seem like there's an easy way to reject all incoming mail. The only suggestion I saw in my quick research was to add something like

connect:1 REJECT
connect:2 REJECT
connect:3 REJECT
...
connect:255 REJECT

to your access file. You'd then add some OK entries to override the REJECTS for the domains you want to accept mail from. I don't have a way to check any of this right now, so I've got no idea if it will really work.

Good luck,
Seth
Senthilmurugan
Frequent Advisor

Re: Sendmail: receive but no send

Hello,

Yes, you can use "access.db" file to ACCEPT or DENY the recieving mails.

You can also use the same "access.db" file for stopping the sending mails.

By default the later versions of sendmail the RELAYs only the localhost. You cannot send mails to any other the domains other than the same domain. That is, For eg. if your domain is abc.com you can only send mails to the abc.com from abc.com you cannot send mails to the other domains. If you want to do so, you can add an entry in the access file as

RELAY

For eg. if your network is 200.10.1.X then the /etc/mail/access file entry will look like:

200.10.1 RELAY

First 3 values of the IP Address is enough. This will allow all the mails sending from this network.

As your need, By default it should only allow localhost to RELAY the mails.



NOTE: After entering an entry in th /etc/mail/access file don't forget to give

#cd /etc/mail/
#makemap hash access.db
This will create the access.db file. After that restart the sendmail service

#/etc/rc.d/init.d/sendmail restart


Regards,
Senthil Murugan
sambaiah
Occasional Advisor

Re: Sendmail: receive but no send


You can generate .mc file with
FEATURE(relay-domain) and make the
file empty and put the domins you wanted
in access file.

This will solve your problem.
Steven E. Protter
Exalted Contributor

Re: Sendmail: receive but no send

Best way to do this is by changing the sendmail.mc file and adding appropriate entries to the /etc/mail/access database.

The script I'm attaching will process the .mc file, build a sendmail.cf file and the access.db database.

For more on the access.db file http://www.sendmail.org

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com