LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-28-2010, 02:43 PM   #1
unix1adm
Member
 
Registered: Oct 2008
Posts: 688

Rep: Reputation: 32
sendmail sending localhost.localdomain


So I am getting something strange. Some systems get the correct mail header and some do not. They are configured the same way and use DHCP

I researched and found this article :
https://www.linuxquestions.org/quest...domain-484792/

But this is inconstant in my environment. I have this in my host file on a working system (no modification to sendmail.cf file (default one)

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6

We use dhcp
hostname shows :

farscape.mydomain.com

Mail comes to me like this (as I expect it to)

From: logwatch@farscape.mydomain.com [mailto:logwatch@farscape.mydomain.com]
Sent: Thursday, January 28, 2010 12:24 PM
To: root@farscape.mydomain.com
Subject: Logwatch for farscape.mydomain.com(Linux)

No i have the same file on another system the same way and I get this:
From: root_farscape2 [mailto:root@localhost.localdomain]
Sent: Thursday, January 28, 2010 3:31 PM
To: root@localhost.localdomain
Subject: test

I made the changes to sendmail.cf file and that did not work either.
I then updated the host to add farscape2.mydomain.com along with the sendmail.cf file and it worked on those systems that had an issue. I dont understand why or what is happening.

sendmail.cf

cd /etc/mail
cp /etc/mail/sendmail.cf sendmail.cf.date
vi /etc/mail/sendmail.cf
Search for #Dj$w.Foo.com
Add new line
Dj$w.farscape2.mydomain.com

The one that works has not been modified.
Any help would be appreciated.

Last edited by unix1adm; 01-28-2010 at 02:45 PM.
 
Old 01-29-2010, 06:28 AM   #2
unix1adm
Member
 
Registered: Oct 2008
Posts: 688

Original Poster
Rep: Reputation: 32
any thoughts on why this is not working?
seem strange both systems are the exact same build and cfg.

I am wondering why the default cfg works on 1 system and not on another. (we have several systems that work and several that do not)

The problem I am having too is this is DHCP not fixed IP addr so I cannot use the solution as it is written. Adding the host name and IP in the /etc/host file wont work because of DHCP

Last edited by unix1adm; 01-29-2010 at 06:42 AM.
 
Old 01-29-2010, 07:38 AM   #3
unix1adm
Member
 
Registered: Oct 2008
Posts: 688

Original Poster
Rep: Reputation: 32
tried this document and got an error

http://www.linuxserverhowto.com/linu...g-apt-get.html
m4 sendmail.mc >sendmail.cf
sendmail.mc:10: m4: cannot open `/usr/share/sendmail-cf/m4/cf.m4': No such file or directory
 
Old 01-29-2010, 08:02 AM   #4
unix1adm
Member
 
Registered: Oct 2008
Posts: 688

Original Poster
Rep: Reputation: 32
So I made some progress. bette rbut still not 100%

I modified /etc/mail/local-host-names and added the server name of

# local-host-names - include all aliases for your machine here.
farscape2

Now I get

From: root_farscape2 [mailto:root@localhost.farscape2.mydomain.com]
Sent: Friday, January 29, 2010 8:55 AM
To: root@localhost.farscape2.mydomain.com
Subject: test2

test
 
Old 01-29-2010, 08:21 AM   #5
unix1adm
Member
 
Registered: Oct 2008
Posts: 688

Original Poster
Rep: Reputation: 32
hmmm


/usr/lib/sendmail -d0.1 -bt < /dev/null
Version 8.13.8
Compiled with: DNSMAP HESIOD HES_GETMAILHOST LDAPMAP LOG MAP_REGEX
MATCHGECOS MILTER MIME7TO8 MIME8TO7 NAMED_BIND NETINET NETINET6
NETUNIX NEWDB NIS PIPELINING SASLv2 SCANF SOCKETMAP STARTTLS
TCPWRAPPERS USERDB USE_LDAP_INIT

============ SYSTEM IDENTITY (after readcf) ============
(short domain name) $w = localhost
(canonical domain name) $j = $w.farscape2.mydomain.com
(subdomain name) $m = localdomain
(node name) $k = farscape2
========================================================

ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
Enter <ruleset> <address>


Working system...

/usr/lib/sendmail -d0.1 -bt < /dev/null
Version 8.13.8
Compiled with: DNSMAP HESIOD HES_GETMAILHOST LDAPMAP LOG MAP_REGEX
MATCHGECOS MILTER MIME7TO8 MIME8TO7 NAMED_BIND NETINET NETINET6
NETUNIX NEWDB NIS PIPELINING SASLv2 SCANF SOCKETMAP STARTTLS
TCPWRAPPERS USERDB USE_LDAP_INIT

============ SYSTEM IDENTITY (after readcf) ============
(short domain name) $w = farscape
(canonical domain name) $j = farscape.mydomain.com
(subdomain name) $m = mydomain.com
(node name) $k = farscape.mydomain.com
========================================================

ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
Enter <ruleset> <address>


So the question is where is the $w and the $m being picked up from....
 
Old 01-29-2010, 08:47 AM   #6
unix1adm
Member
 
Registered: Oct 2008
Posts: 688

Original Poster
Rep: Reputation: 32
So I put my sendmail.cf back to defaults and I get this now.
/usr/lib/sendmail -d0.1 -bt < /dev/null
Version 8.13.8
Compiled with: DNSMAP HESIOD HES_GETMAILHOST LDAPMAP LOG MAP_REGEX
MATCHGECOS MILTER MIME7TO8 MIME8TO7 NAMED_BIND NETINET NETINET6
NETUNIX NEWDB NIS PIPELINING SASLv2 SCANF SOCKETMAP STARTTLS
TCPWRAPPERS USERDB USE_LDAP_INIT

============ SYSTEM IDENTITY (after readcf) ============
(short domain name) $w = localhost
(canonical domain name) $j = localhost.localdomain
(subdomain name) $m = localdomain
(node name) $k = farscape2
========================================================

ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
Enter <ruleset> <address>


I did a diff on the sendmail.cf from the working system to the non working system and get no diffrences
 
Old 01-29-2010, 09:05 AM   #7
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

You must define the hostname (and maybe domainname). Run
Code:
hostname
to see what your hostname is, and
Code:
hostname farscape2.mydomain.com
to change it.
To make changes permanent edit /etc/hosts
 
Old 01-29-2010, 09:24 AM   #8
unix1adm
Member
 
Registered: Oct 2008
Posts: 688

Original Poster
Rep: Reputation: 32
hostname is set as
hostname
farscape2

the machine gets a dhcp address so how is editing /etc/hosts going ot help?

also the working system and the non working system have similar host files (ie dhcp and no domains listed)

non working machine:
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 farscape2 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
xxx.xxx.xxx.xxx discovery.mydomain.com

working machine host file

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
xxx.xxx.xxx.xxx discovery discovery.fpl.com

Last edited by unix1adm; 01-29-2010 at 09:43 AM.
 
Old 01-29-2010, 09:39 AM   #9
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Is should be a fully qualified domain name, like farscape2.mydomain.com.
If your dhcp server cannot provide it, consider using masquerading

Regards
 
Old 01-29-2010, 09:41 AM   #10
unix1adm
Member
 
Registered: Oct 2008
Posts: 688

Original Poster
Rep: Reputation: 32
Ok I am not sure really why this worked but I did. I changed my host file to be this.

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
xxx.xxx.xxx.xxx discovery.mydomain.com


Notice the absence of the server name in the 127.x line.
restarted and it works now.
 
Old 01-29-2010, 09:48 AM   #11
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
It works because the 1st argument after the IP is the important in /etc/hosts. The others are considered aliases.
 
Old 01-29-2010, 09:53 AM   #12
Dave_Devnull
Member
 
Registered: May 2009
Posts: 142

Rep: Reputation: 24
This has tickled my interest. Is sendmail seeing the connection as coming from 127.0.0.1 or xxx.xxx.xxx.xxx? Do the logs show it as the localhost IP or the actual IP of the sending machine?
 
Old 01-29-2010, 11:55 AM   #13
unix1adm
Member
 
Registered: Oct 2008
Posts: 688

Original Poster
Rep: Reputation: 32
yes i understand that but for some reason from the onset it did not work thats why I put the farscape2 2 in the host file. I restarted sendmail.

I then removed it and restarted sendmail and it works now. Thats was puzzling
 
Old 02-15-2010, 07:17 AM   #14
unix1adm
Member
 
Registered: Oct 2008
Posts: 688

Original Poster
Rep: Reputation: 32
well i am back to having this issue on another system. this time I tried

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 farscape3 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6

And I get this in email...
From: logwatch@localhost.localdomain [mailto:logwatch@localhost.localdomain]
Sent: Monday, February 15, 2010 4:02 AM
To: root@localhost.localdomain
Subject: Logwatch for farscap3 (Linux)

So by the above statement because i have the host name first localhost should be ignored.
But it is not.
 
  


Reply



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
Mail from root@localhost.localdomain thru relay=localhost.localdomain[216.24.138.1] rshartog Linux - Server 2 02-02-2009 10:35 PM
sendmail from address is root@localhost.localdomain procfs Linux - Software 9 09-26-2006 10:42 AM
Sendmail--changing domain from localhost.localdomain andrewstr Linux - Software 3 02-21-2006 01:19 PM
sendmail using localhost.localdomain joe.biz Linux - Software 1 10-27-2005 05:47 PM
sendmail and @localhost.localdomain deadlock Linux - Networking 4 12-17-2003 08:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:41 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
Open Source Consulting | Domain Registration