Results 1 to 7 of 7
  1. #1

    Setting sendmail hostname

    When I look at the headers for an email sent from my server, it calls my server "server.server.com", and I found out that's because that's what's in my hosts file:

    127.0.0.1 server.server.com server localhost.localdomain localhost

    Apparently it takes whatever's the first thing in the hosts file, so if I change my hosts file to:

    127.0.0.1 www.(mydomain).com server.server.com server localhost.localdomain localhost

    then sendmail will use www.mydomain.com.

    What is the sendmail setting to pick a different hostname rather than just the first on the list?

    (I'm not using a control panel.)

    thanks

  2. #2
    Join Date
    Sep 2004
    Location
    New Jersey
    Posts
    104
    If you want to change it the best way is by just adding www.mydoman.com to the beginning of the hostname list for 127.0.0.1 as you mentioned. That's the recommended way to fix it. It might be possible to use one of the masquerading features of Sendmail to accomplish this otherwise, but it's a little convoluted. Other than that I dont believe there's a way to force it through configuration.

    Brian
    Colynx, LLC. (http://www.colynx.com)
    Providing inexpensive Web, email, DNS hosting, and more. Now offering $8/yr domain registrations. Name your own price for hosting. Hosting should be on YOUR terms.

  3. #3
    But when I changed it I started getting error emails from a cron:

    awk: /usr/local/SystemStats2/parser.awk:40: warning: escape sequence `\*' treated as plain `*'

    every five minutes. That's not some special cron that I made, that's part of fedora core 2 (stable).

    There has to be a way to set the hostname, for machines that have multiple hostnames, like mine, like most. So that sendmail can use one hostname like mail.mydoman.com instead of www.mydomain.com, etc.

    thanks,
    rw

  4. #4
    Join Date
    Jan 2004
    Location
    Greece
    Posts
    2,079
    You can make a new sendmail.cf using a sendmail.mc file. There you can choose the hostname you want to be used by sendmail. Read sendmail's documentation for more information.

  5. #5
    Originally posted by CretaForce
    You can make a new sendmail.cf using a sendmail.mc file. There you can choose the hostname you want to be used by sendmail. Read sendmail's documentation for more information.
    Thanks, but my question was: "What is the sendmail setting to pick a different hostname rather than just the first on the list?"

  6. #6
    Join Date
    Sep 2004
    Location
    New Jersey
    Posts
    104
    Actually, try this. Add define(`confDOMAIN_NAME', `mail.yourdomain.com')dnl to both your sendmail.mc and your submit.mc (if you have one). Then rebuild the Sendmail config files and restart Sendmail.

    If you dont use your .mc files then you can add the following definition to your sendmail.cf and submit.cf:
    Djmail.yourdomain.com

    This will also change the default domain appended to non-FQDNs on emails you send/receive to mail.yourdomain.com.

    Brian
    Colynx, LLC. (http://www.colynx.com)
    Providing inexpensive Web, email, DNS hosting, and more. Now offering $8/yr domain registrations. Name your own price for hosting. Hosting should be on YOUR terms.

  7. #7
    So far, so good! It changed in the headers, and there's no cron errors every five minutes yet. thanks Changeling

  8. Newsletters

    Subscribe Now & Get The WHT Quick Start Guide!

Related Posts from theWHIR.com

Posting Permissions

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