Find the answer to your Linux question:
Results 1 to 9 of 9
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 ...
  1. #1
    Linux Newbie
    Join Date
    Oct 2008
    Posts
    163

    [SOLVED] 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.

    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
    Any help would be appreciated.

  2. #2
    Linux Newbie
    Join Date
    Oct 2008
    Posts
    163
    tried this document and got an error

    Linux Server How To - How to Install the Sendmail Using Apt-get
    m4 sendmail.mc >sendmail.cf
    sendmail.mc:10: m4: cannot open `/usr/share/sendmail-cf/m4/cf.m4': No such file or directory

  3. #3
    Linux Newbie
    Join Date
    Oct 2008
    Posts
    163
    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

  4. #4
    Linux Newbie
    Join Date
    Oct 2008
    Posts
    163
    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....

  5. #5
    Linux Newbie
    Join Date
    Oct 2008
    Posts
    163
    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

  6. #6
    Linux Newbie
    Join Date
    Oct 2008
    Posts
    163
    by the wya my host name is set ok
    hostname
    farscape2

  7. #7
    Linux Newbie
    Join Date
    Oct 2008
    Posts
    163
    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.

  8. #8
    Linux Newbie
    Join Date
    Oct 2008
    Posts
    163
    well yahoo is blocking my mail from the server. says my isp is on the black list for spam.

    So I tried to send the mail to another account. My personal domain. I get this as a bounce back.

    This i understand because its trying to bounce the mail back to my server root@localhost.localdomain and thats not valid. But what I dont understand is why is it not just accepting the mail and not trying to send it back.
    The original message was received at Wed, 3 Mar 2010 04:02:03 -0500
    from centos [127.0.0.1]

    ----- The following addresses had permanent fatal errors -----
    me@mydomain.com
    (reason: 550 5.1.0 Sender Refused - Address <root@localhost.localdomain>; - Sending Domain Name Invalid or Non-Existent A or MX Record)
    (expanded from: <root@localhost.localdomain>

    ----- Transcript of session follows -----
    ... while talking to mx01.register.com.:
    >>> MAIL From:<root@localhost.localdomain>; SIZE=9817
    <<< 550 5.1.0 Sender Refused - Address <root@localhost.localdomain>; - Sending Domain Name Invalid or Non-Existent A or MX Record
    554 5.0.0 Service unavailable

    May be I need to "spoof" my system to look like its coming from my domain? Not sure how or if thats the right thing to do.
    All i want to do is get logwatch off my system so I dont have to login to review it.

  9. #9
    Linux Newbie
    Join Date
    Oct 2008
    Posts
    163
    got this resolved in case any need this info

    /etc/sysconfig
    more network
    NETWORKING=yes
    NETWORKING_IPV6=no
    HOSTNAME=centos
    GATEWAY=192.168.1.1

    Looks OK

    I modified host file to be
    192.168.1.100 centos centos.mydomain.com


    I get this:

    mailx -v -s "test" root

    test



    .

    Cc:

    root... Connecting to [127.0.0.1] via relay...

    220 localhost.localdomain ESMTP Sendmail 8.13.8/8.13.8; Wed, 3 Mar 2010 11:36:34 -0500

    >>> EHLO centos.mydomain.com

    250-localhost.localdomain Hello localhost.localdomain [127.0.0.1], pleased to meet you

    250-ENHANCEDSTATUSCODES

    250-PIPELINING

    250-8BITMIME

    250-SIZE

    250-DSN

    250-ETRN

    250-AUTH DIGEST-MD5 CRAM-MD5

    250-DELIVERBY

    250 HELP

    >>> MAIL From:<root@centos.mydomain.com> SIZE=30 AUTH=root@centos.mydomain.com

    250 2.1.0 <root@centos.mydomain.com>... Sender ok

    >>> RCPT To:<root@centos.mydomain.com>

    >>> DATA

    250 2.1.5 <root@centos.mydomain.com>... Recipient ok

    354 Enter mail, end with "." on a line by itself

    >>> .

    250 2.0.0 o23GaYFv026440 Message accepted for delivery

    root... Sent (o23GaYFv026440 Message accepted for delivery)

    Closing connection to [127.0.0.1]

    >>> QUIT

    221 2.0.0 localhost.localdomain closing connection

    [root@centos etc]# mailq

    /var/spool/mqueue (1 request)

    -----Q-ID----- --Size-- -----Q-Time----- ------------Sender/Recipient-----------

    o23GaYFv026440* 6 Wed Mar 3 11:36 <root@centos.mydomain.com>

    <root@centos.mydomain.com>

    Total requests: 1

    so i changed my host file to read

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


    hostname
    centos

    so based on the other document I changed the host like yet again

    192.168.1.100 centos.mydomain.com centos


    Still the mail gets hung on the server.

    This is not dhcp by the way but fixed IP.

    i put this in the /etc/aliases file
    root: myid@mydomain.com

    newaliases
    I also did a service sendmail restart

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...