Configure sendmail to only allow outgoing email from server IP/hostname
Hello.
How do I check/setup that only the server can send mail (maybe by IP or hostname)? I have a debian server that sends mail through the PHP mail() function with no problems. The server uses sendmail. My concern is how do I make sure only the server itself can send mails through that server. Because it would be bad if spammers would use it as a relay server. System: - Debian Lenny - PHP5 - Apache2 - MySQL 5 - PHPmyadmin - Sendmail |
Hi,
In most distros sendmail is configure to listen only on the local loopback interface. Run: Code:
netstat -tan|grep 25 In this case only localhost can use it as a relay to send mail. You can also use /etc/mail/relay-domains to add the hosts/IPs you want to use your server as a relay. Another possibility is to use /etc/mail/access to allow relay based on hosts, IPs, the "From:" field, etc Regards |
...
Thanks for the quick reply. I did what you said and I get this. Is that ok?
Code:
netstat -tan|grep 25 |
Yes, since it's listening only on 127.0.0.1:25 it can be used from localhost only
Regards |
Thank you very much. Have a nice day.
|
All times are GMT -5. The time now is 07:08 PM. |