View Full Version : sendmail not working for relaying messages
Jaws
6th September 2004, 07:49 PM
Hi all. I am having a very aggrivating problem with sendmail...I am able to recieve messages fine, but when I want to send anything, I get this error:
550 5.7.1 <willieej2002@consolidated.net>... Relaying denied. IP name lookup failed [216.176.67.98]
my resolv.conf has the proper DNS and all, so why wont it resolve?
Please help, im very confused.
-jaws
fjleal
6th September 2004, 09:09 PM
As root, edit /etc/mail/sendmail.mc and comment out the line that reads "DAEMON_OPYIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA') dnl" (write "dnl" on the beginning). This line makes sendmail accept mail only from localhost. Also edit /etc/mail/access and add your subnet IPs, like "Connect: 10 RELAY" to be able to send mail from any 10.x.x.x machine, or "Connect: user@domain.com RELAY". (It is better to use IP numbers.)
Then "cd /etc/mail", "make all" (to create the database files) and restart sendmail ("/etc/init.d/sendmail reload").
Please also note: if you're trying to contact your SMTP mail server from the outside (the Internet, for the IP you mention is a public one), then you're trying to relay from a different domain, and no SMTP server should allow it!
Jaws
6th September 2004, 09:55 PM
As root, edit /etc/mail/sendmail.mc and comment out the line that reads "DAEMON_OPYIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA') dnl" (write "dnl" on the beginning). This line makes sendmail accept mail only from localhost. Also edit /etc/mail/access and add your subnet IPs, like "Connect: 10 RELAY" to be able to send mail from any 10.x.x.x machine, or "Connect: user@domain.com RELAY". (It is better to use IP numbers.)
Then "cd /etc/mail", "make all" (to create the database files) and restart sendmail ("/etc/init.d/sendmail reload").
Please also note: if you're trying to contact your SMTP mail server from the outside (the Internet, for the IP you mention is a public one), then you're trying to relay from a different domain, and no SMTP server should allow it!
I followed your first instructions .. and it made no difference. Can you give me an example of the access file you describe?
In my access file I have:
allprogramming.net RELAY
localhost RELAY
thanks...
-jaws
fjleal
6th September 2004, 10:58 PM
Sure!
Example /etc/mail/access file:
"
localhost.localdomain RELAY
localhost RELAY
127.0.0.1 RELAY
Connect: 192.168.10 RELAY
Connect: 10 RELAY
Connect: <know-spammer-domain-name>.com REJECT
From: <known-login>@<my-domain-name>.com RELAY
To: <known-login>@<my-domain-name>.com RELAY
To: <former-worker-login>@<our-company-domain-name>.com ERROR: <former-worker-login> no longer works here!
"
Got the idea? You may use the RELAY, REJECT, DISCARD and ERROR: <msg> keywords. Please remember filtering by the "from" and/or "to" fields is not reliable, so you better use IP numbers when possible.
Hope it helps. ;)
Jaws
6th September 2004, 11:02 PM
Sure!
Example /etc/mail/access file:
"
localhost.localdomain RELAY
localhost RELAY
127.0.0.1 RELAY
Connect: 192.168.10 RELAY
Connect: 10 RELAY
Connect: <know-spammer-domain-name>.com REJECT
From: <known-login>@<my-domain-name>.com RELAY
To: <known-login>@<my-domain-name>.com RELAY
To: <former-worker-login>@<our-company-domain-name>.com ERROR: <former-worker-login> no longer works here!
"
Got the idea? You may use the RELAY, REJECT, DISCARD and ERROR: <msg> keywords. Please remember filtering by the "from" and/or "to" fields is not reliable, so you better use IP numbers when possible.
Hope it helps. ;)
Hey there! Thanks for the example, it helps a bit. :-)
However, I run a public SMTP server, and since I host many people that send emails to many different places ... I dont know that restricted relay will work well! What options do I have that will still keep people from spoofing their addresses?
Thanks yet again. :)
-Jaws
janu_sun
3rd May 2005, 06:00 PM
Hello,
This is the contents of the /etc/mail/access file
localhost.localdomain RELAY
localhost RELAY
127.0.0.1 RELAY
192.168.x.x RELAY
Connect:192.168.10 RELAY
And still the mail server does not send email to other than @mydomain.com , any clues , as to what might be the problem?
gavinw6662
5th May 2005, 07:00 AM
i would assume you have an MX record setup and what not for your domain. But in the end i had to add this line to resolve (i think) the same issue:
DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')
DAEMON_OPTIONS(`Port=smtp,Addr=IP of your server, Name=MTA')
then remake the config file:
cd /etc/mail
make -C /etc/mail
which makes sendmail listen on the loopback, and the actual eth0 interface.
vBulletin® v3.8.7, Copyright ©2000-2013, vBulletin Solutions, Inc.