Configuring my sendmail to only send to certain domains
Hi,
Here’s the Linux config … Code:
[dalvarado@mymachine ~]$ uname -a Code:
sudo vim /etc/mail/access Code:
Connect:localhost.localdomain RELAY Thanks, - Dave |
Relaying is rejected by default. The only messages that will be relayed through your system are by those that you specifically allow.
In your example, a message to ANY domain that originates from localhost will be allowed. But, if you tried to connect from another network to send a message, it would get rejected. Now, if you wanted mail sent to domain example.com, for example, you could have : Code:
To:Example.com RELAY Now keep in mind, this could open you up to backscatter. What we do to avoid that is we populate all valid e-mail accounts in the access file. So ours looks like: Code:
To:example.com REJECT So basically it would reject all mail to example.com except for jim, sue and anyone else I specify. |
Hi,
I edited the file /etc/mail/access, and added Code:
To:mydomain.com RELAY Code:
sudo /etc/init.d/sendmail restart |
You have to re-build your access database. Something like:
Code:
makemap hash /etc/mail/access < /etc/mail/access |
Hi,
So I did this ... Code:
[dalvarado@mymachine ~]$ sudo makemap hash /etc/mail/access < /etc/mail/access Code:
Connect:localhost.localdomain RELAY |
Are you sending to gmail from the machine itself? Cause the connect lines allow you to send anything from the localhost.
EDIT Also, if you send mail from email-smtp.us-east-1.amazonaws.com and ses-smtp-prod-335357831.us-east-1.elb.amazonaws.com it will also allow you to send anywhere |
All times are GMT -5. The time now is 10:51 AM. |