LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 10-19-2009, 08:29 AM   #1
kadimi
LQ Newbie
 
Registered: Oct 2009
Posts: 3

Rep: Reputation: 0
Question Sendmail and network configuration


Hello,

I'm a web-programmer, a Linux noob as of now, I'm trying to configure sendmail to work properly for testing my PHP scripts.

The script work fine, and to remove all doubts I test the mail command first, It doesn't work:
Quote:
# mail root
subject: test
Test message
ctrl+D 2 times
#
This shows no errors but I can find this on the mail log (added line breaks for better readability):

Quote:
Oct 19 08:48:16 www sendmail[5265]: n9JCmGaG005265: from=root, size=30, class=0, nrcpts=1, msgid=<200910191248.n9JCmGaG005265@www.local.com>, relay=root@localhost

Oct 19 08:48:16 www sendmail[5269]: n9JCmGRn005269: from=<root@www.local.com>, size=304, class=0, nrcpts=1, msgid=<200910191248.n9JCmGaG005265@www.local.com>, proto=ESMTP, daemon=MTA, relay=www.local.com [127.0.0.1]

Oct 19 08:48:16 www sendmail[5265]: n9JCmGaG005265: to=root, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30030, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (n9JCmGRn005269 Message accepted for delivery)

Oct 19 08:48:19 www sendmail[5271]: n9JCmGRn005269: to=<root@www.local.com>, delay=00:00:03, xdelay=00:00:03, mailer=esmtp, pri=120304, relay=a1461.b.akamai.net. [212.73.194.25], dsn=4.0.0, stat=Deferred: Connection refused by a1461.b.akamai.net.


here is my etc/hosts
Quote:
127.0.0.1 www.local.com localhost.localdomain localhost
127.0.0.1 www.local.com local.com www
192.168.1.80 www.local.com local.com www


192.168.1.80 local.com
192.168.1.80 www.local.com
How can I tell sendmail that www.local.com is 127.0.0.1, it looks like it doesn't read the etc/hosts file

Please advice, thank you very much in advance.

Nabil.
 
Old 10-19-2009, 01:47 PM   #2
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,544
Blog Entries: 28

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
The problem may be that sendmail is not logging on to akamai. akamai should (TM) tell you their requirements.

Please take a backup of any files that are changed iif you try the following steps.

Typically you need to find the .mc file that your /etc/mail/sendmail.cf is built from, modify it adding these lines (the backquote ` must be a backquote)
Code:
define(`SMART_HOST',`<FQDN of akamai's SMTP server>')
FEATURE(authinfo)
Then, as root, process it into /etc/mail/sendmail.cf using something like
Code:
m4 <whatever>.mc > /etc/mail/sendmail.cf
Then create /etc/mail/authinfo, readable only by root containing
Code:
AuthInfo: "U:<your akamai logon name>" "P:<your akamai logon password>" "M:PLAIN"
Then, as root, process it into /etc/mail/authinfo.db:
Code:
root:/etc/mail# makemap hash authinfo < authinfo
Restart sendmail and try again.

This time sendmail should be able to log on to akamai but they may check the from address and reject "local.com" as invalid. My blog has a partial solution to this problem -- "good enough" if it's OK for sendmail to hang for ~1 minute when it starts and every time it sends a mail!

Finally, the root account is special; I found I had to use mailx's -f option to give a fuller "From" address; sending mail from a non-root address was straightforward.

This is a "work in progress" for me; I am very interested to know what you find out and to find out how to make sendmail work while keeping the /etc/hosts entry for the local machine as localhost and localhost,localdomain

Good fortune!
 
Old 10-19-2009, 03:02 PM   #3
kadimi
LQ Newbie
 
Registered: Oct 2009
Posts: 3

Original Poster
Rep: Reputation: 0
Thank you for your reply.

The problem is that my machine should not go to xyz.akamai.net, I mean I'm using the domain name www.local.com as a FQDN for my server over my LAN, xyz.akamai.net is what www.local.com resolve to, in my case, I want it to resolve to 127.0.0.1, all other programs including the webserver see www.local.com as the local server but sendmail sees it as the real www.local.com !!!

as I said, it looks like sendmail is not interested in the /etc/hosts file

Please advise.
 
Old 10-19-2009, 03:15 PM   #4
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,544
Blog Entries: 28

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Sorry I misunderstood. Here's from Linux Home Networking

Configure the /etc/resolv.conf File

The sendmail program expects DNS to be configured correctly on the DNS server. The MX record for your domain must point to the IP address of the mail server.

The program also expects the files used by the mail server's DNS client to be configured correctly. The first one is the /etc/resolv.conf file in which there must be a domain directive that matches one of the domains the mail server is expected to handle mail for.

Finally, sendmail expects a nameserver directive that points to the IP address of the DNS server the mail server should use to get its DNS information.

For example, if the mail server is handling mail for my-site.com and the IP address of the DNS server is 192.168.1.100, there must be directives that look like this:

domain my-site.com
nameserver 192.168.1.100
 
Old 10-19-2009, 03:49 PM   #5
kadimi
LQ Newbie
 
Registered: Oct 2009
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks again, I'll read that

Edit:
Finally worked, thank you for the link, it really helped.

Last edited by kadimi; 10-19-2009 at 04:28 PM.
 
  


Reply

Tags
sendmail


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
ifconfig configuration changes are not reflected in the network configuration GUI nkd Linux - Networking 4 12-25-2008 01:17 PM
Sendmail configuration shan_nathan Linux - Server 2 10-05-2007 12:11 AM
Sendmail configuration AMMullan Linux - Networking 4 09-30-2004 01:51 PM
Sendmail configuration gruger Linux - Networking 4 05-11-2004 09:47 PM
Sendmail configuration lapthorn Linux - Newbie 2 12-09-2003 08:13 PM


All times are GMT -5. The time now is 06:54 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration