LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-27-2008, 04:47 AM   #1
Fernandoch
Member
 
Registered: Mar 2002
Location: Spain
Distribution: Debian, Cent OS, RHEL
Posts: 119

Rep: Reputation: 15
Simple sendmail configuration


Hello,

I want my server to be able to send emails. It is a Cent OS 5.1

When I try to send an email I get this error in /var/log/maillog:

Apr 27 11:29:50 localhost sendmail[3317]: m3R9CX14003315: to=<marcb@gmail.com>, ctladdr=<root@localhost.localdomain> (0/0), delay=00:17:17, xdelay=00:17:17, mailer=esmtp, pri=120567, relay=gmail.com., dsn=4.0.0, stat=Deferred: Name server: gmail.com.: host name lookup failure

What could I have done wrong?

I open sendmail.mc and modify just these lines following a manual:

I changed this line

DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl

to

DAEMON_OPTIONS(`Port=smtp, Name=MTA')dnl

and this line

FEATURE(`accept_unresolvable_domains')dnl

to this line

dnl FEATURE(`accept_unresolvable_domains')dnl

Then I ran

make -C /etc/mail

and service sendmail start

Any clues of what could be wrong?
 
Old 04-27-2008, 05:26 AM   #2
jakev383
QmailToaster Developer
 
Registered: Dec 2005
Location: Burlington, NC
Distribution: CentOS, Voyage, Debian, Fedora
Posts: 220

Rep: Reputation: 31
Quote:
Originally Posted by Fernandoch View Post
Hello,

I want my server to be able to send emails. It is a Cent OS 5.1

When I try to send an email I get this error in /var/log/maillog:

Apr 27 11:29:50 localhost sendmail[3317]: m3R9CX14003315: to=<marcb@gmail.com>, ctladdr=<root@localhost.localdomain> (0/0), delay=00:17:17, xdelay=00:17:17, mailer=esmtp, pri=120567, relay=gmail.com., dsn=4.0.0, stat=Deferred: Name server: gmail.com.: host name lookup failure

What could I have done wrong?
I don't know much about sendmail itself, but it says you're getting a host name lookup failure which will be DNS. Your machine may not be looking the name up successfully. Can you resolve gmail.com from the CLI?
 
Old 04-27-2008, 05:32 AM   #3
Fernandoch
Member
 
Registered: Mar 2002
Location: Spain
Distribution: Debian, Cent OS, RHEL
Posts: 119

Original Poster
Rep: Reputation: 15
I have no dns setup. I just connect to the internet through a router. Is that ok?

Check this ping:

[root@localhost etc]# ping gmail.com
PING gmail.com (64.233.161.83) 56(84) bytes of data.
64 bytes from gmail.com (64.233.161.83): icmp_seq=1 ttl=242 time=62.2 ms
64 bytes from gmail.com (64.233.161.83): icmp_seq=2 ttl=242 time=26.5 ms
64 bytes from gmail.com (64.233.161.83): icmp_seq=3 ttl=242 time=48.6 ms
64 bytes from gmail.com (64.233.161.83): icmp_seq=4 ttl=242 time=27.0 ms
64 bytes from gmail.com (64.233.161.83): icmp_seq=5 ttl=242 time=39.2 ms
64 bytes from gmail.com (64.233.161.83): icmp_seq=6 ttl=242 time=31.5 ms
64 bytes from gmail.com (64.233.161.83): icmp_seq=7 ttl=242 time=29.4 ms
64 bytes from gmail.com (64.233.161.83): icmp_seq=8 ttl=242 time=29.0 ms
64 bytes from gmail.com (64.233.161.83): icmp_seq=9 ttl=242 time=38.1 ms
64 bytes from gmail.com (64.233.161.83): icmp_seq=10 ttl=242 time=29.0 ms
64 bytes from gmail.com (64.233.161.83): icmp_seq=11 ttl=242 time=41.1 ms
64 bytes from gmail.com (64.233.161.83): icmp_seq=12 ttl=242 time=37.1 ms
64 bytes from gmail.com (64.233.161.83): icmp_seq=13 ttl=242 time=35.6 ms
64 bytes from gmail.com (64.233.161.83): icmp_seq=14 ttl=242 time=37.6 ms
64 bytes from gmail.com (64.233.161.83): icmp_seq=15 ttl=242 time=62.5 ms
64 bytes from gmail.com (64.233.161.83): icmp_seq=16 ttl=242 time=69.4 ms
64 bytes from gmail.com (64.233.161.83): icmp_seq=17 ttl=242 time=52.1 ms
64 bytes from gmail.com (64.233.161.83): icmp_seq=18 ttl=242 time=31.0 ms
 
Old 04-27-2008, 06:54 AM   #4
blacky_5251
Member
 
Registered: Oct 2004
Location: Adelaide Hills, South Australia
Distribution: RHEL 5&6 CentOS 5, 6 & 7
Posts: 572

Rep: Reputation: 56
It may be your network connection - i.e. dynamic DNS? If you use Dynamic DNS for your domain, then many email systems will reject email from you based on your server's public (and dynamic) IP address.

Are you using a SMART HOST? Using your ISP to send email is the way to avoid the problem I've just outlined. Your ISP will have a static IP address that other servers will "respect" and accept email from.

BTW: I prefer Postfix and would recommend you use it instead of Sendmail.

PS: It could also be that your server's hostname is incorrectly set for interacting publicly. The log message says your email is from root@localhost.localdomain which is OK in private, but no good when dealing with other servers like gmail.

Last edited by blacky_5251; 04-27-2008 at 07:02 AM.
 
Old 04-27-2008, 12:49 PM   #5
Fernandoch
Member
 
Registered: Mar 2002
Location: Spain
Distribution: Debian, Cent OS, RHEL
Posts: 119

Original Poster
Rep: Reputation: 15
Yes, I have dynamic DNS. Does that mean sendmail needs a fixed IP to work?

What is smart host?

Not having a hostname is also a problem for sendmail?
 
Old 04-27-2008, 04:43 PM   #6
blacky_5251
Member
 
Registered: Oct 2004
Location: Adelaide Hills, South Australia
Distribution: RHEL 5&6 CentOS 5, 6 & 7
Posts: 572

Rep: Reputation: 56
Hi,

Sendmail and Postfix don't require a fixed IP to "work", but some major email systems will reject email from IP addresses that are assigned dynamically. They do this because they "assume" that the email is being sent from a spambot, not from a correctly configured email server. This is an anti-spam measure and discriminates against those of us using dynamic DNS for our servers.

The solution though is SMART HOST. This is where you relay all out-bound email through your ISP's email server rather than sending the message directly. For example, if I sent an email to you, my server would send the message to my ISP first, who then sends it to your server.

Having said that, I still think the problem lies with your domain name settings in Sendmail. Sendmail is sending messages from "root@localhost.localdomain" and that won't work. It must be "root@your.domain.com" or whatever your domain name is.

Good luck.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple sendmail question sadarax Linux - General 2 06-14-2006 04:36 PM
simple sendmail help! paperdiesel Linux - Newbie 2 11-07-2003 03:01 PM
simple sendmail admin bananaman Linux - Software 1 05-19-2003 08:12 AM
A simple Sendmail configuration question J_Szucs Linux - Newbie 2 11-12-2002 03:33 PM
sendmail over simple network clk777 Linux - Networking 1 07-08-2002 11:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:11 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration