| Linux - Server This forum is for the discussion of Linux Software used in a server related context. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
10-19-2009, 08:29 AM
|
#1
|
|
LQ Newbie
Registered: Oct 2009
Posts: 3
Rep:
|
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
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.
|
|
|
|
10-19-2009, 01:47 PM
|
#2
|
|
LQ 5k Club
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian Squeeze (server), Slackware 13.37 (netbook), Slackware64 14.0 (desktop),
Posts: 8,357
|
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!
|
|
|
|
10-19-2009, 03:02 PM
|
#3
|
|
LQ Newbie
Registered: Oct 2009
Posts: 3
Original Poster
Rep:
|
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.
|
|
|
|
10-19-2009, 03:15 PM
|
#4
|
|
LQ 5k Club
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian Squeeze (server), Slackware 13.37 (netbook), Slackware64 14.0 (desktop),
Posts: 8,357
|
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
|
|
|
|
10-19-2009, 03:49 PM
|
#5
|
|
LQ Newbie
Registered: Oct 2009
Posts: 3
Original Poster
Rep:
|
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.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 08:46 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|