Simple "mail" thinks I'm at localhost.localdomain

Discussion in 'Linux Networking' started by Ed Skinner, Sep 2, 2004.

  1. Ed Skinner

    Ed Skinner Guest

    Using simple "mail" in a script, it says I am
    "" (and the relaying system is rejecting the
    message) even though all other facets of the networking software appear to
    be properly configured. I wrote a couple of quickies and verified that
    gethostname(2) and so forth are all returning the configured values, not
    "localhost.localdomain".
    One final clue: I can use "nail" (not "mail") with a "-r
    " (using the correct values) and get the relay system to
    accept and forward the message.
    Anyone know where "mail" gets the host's name and domain? ("nail"
    will do the same if I omit the "-r " option.)
    Thanks!
     
    Ed Skinner, Sep 2, 2004
    #1
    1. Advertisements

  2. Ed Skinner

    ynotssor Guest

    You need to configure sendmail properly. In your sendmail.mc file, somewhere
    _above_ the MAILER() definitions:

    MASQUERADE_AS(`host.com')dnl
    FEATURE(`masquerade_envelope')dnl
    FEATURE(`allmasquerade')dnl

    Rebuild the sendmail.cf file and restart sendmail. Please see
    http://www.sendmail.org/m4/masquerading.html for further information, as
    well as reading the cf/README in your distribution.


    tony
     
    ynotssor, Sep 2, 2004
    #2
    1. Advertisements

  3. -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1
    NotDashEscaped: You need GnuPG to verify this message

    Mail doesn't know anything about it, sounds like your MTA for any
    further help, you need to tell us which one you run or even
    better repost with full information to the proper ng
    comp.mail.sendmail, if you are running sendmail.

    --
    Michael Heiming (GPG-Key ID: 0xEDD27B94)
    mail: echo | perl -pe 'y/a-z/n-za-m/'
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.2.4 (GNU/Linux)

    iD8DBQFBN4ZsAkPEju3Se5QRAlp5AKCqjZDnxI18O+deEKBzJZ0IM0Z+oQCg1aP2
    SgxJLKgInHJMIb05vEUjvUs=
    =e7mA
    -----END PGP SIGNATURE-----
     
    Michael Heiming, Sep 2, 2004
    #3
  4. Ed Skinner

    Ed Skinner Guest

    Thanks Tony, that did it. I was not aware that "mail" is *supposed* to say
    the message is coming from "" and that the
    MTA (such as sendmail) is going to be doing the rewriting (as a
    masqueraded host) so my "blame" of "mail" for the problem was wrong. Lucky
    for me you understood my problem and gave the correct solution.
    Thanks again for your right-on answer!
     
    Ed Skinner, Sep 3, 2004
    #4
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.