sendmail config / send with specific ip

Discussion in 'Installation/Configuration' started by penguinol, Jan 21, 2006.

  1. penguinol

    penguinol New Member

    Hello, is anyone aware of an option that forces sendmail to send using a specific ip address on a machine?

    Thanks.
     
  2. falko

    falko Super Moderator

  3. themachine

    themachine HowtoForge Supporter

    minor adjustment to what falko said... you do not want to make changes to the "sendmail.cf".... the file you want to make changes to is the "sendmail.mc". Always think of the ".mc" and "Make Changes" and you'll never forget. When you make changes to the sendmail.mc... you then need to "make" the changes active. This depends on you distro and everything... but usually 'cd'ing into '/etc/mail' and running "make" will work... or something like "make -m4 /etc/mail" or something stupid like that.

    note... i hate sendmail and recommend postfix!!!! ;)
     
  4. penguinol

    penguinol New Member

    Yes, before I posted here I had tried editing the port options, and changing the listening smtp ip address was successful, however, mail was still sent via a different ip. Is this a routing issue?
     
  5. falko

    falko Super Moderator

    Is your system behind a router or directly connected to the internet?
     
  6. penguinol

    penguinol New Member

    It's a dedicated server at a datacenter.
     
  7. falko

    falko Super Moderator

    How do you know the mail was sent via a different IP address?

    What's in the header of such a mail?
     
  8. penguinol

    penguinol New Member

    Received: from unknown (HELO host.domain) ([x.x.x.x])

    where host.domain is the localhost name, and x.x.x.x is the incorrect IP. For example, when i set y.y.y.y as the listening IP in the smtp portions and netstat, it shows that it is listening on y.y.y.y. However, when the mail is sent, the header shows that it was received from x.x.x.x as in above.
     
  9. falko

    falko Super Moderator

    I think the problem is that host.domain's DNS record points to x.x.x.x, not y.y.y.y. That's why x.x.x.x appears in the mail header.
     
  10. penguinol

    penguinol New Member

    I use my own nameservers, and it resolves forward and reverse. :/
     
  11. falko

    falko Super Moderator

    Yes, but is host.domain pointing to x.x.x.x or y.y.y.y?
     
  12. penguinol

    penguinol New Member

    host.domain resolves to x.x.x.x. Anyway, it's not that big of a deal. Thanks for trying, though.
     
  13. falko

    falko Super Moderator

    Then you must change host.domain's A record so that it points to y.y.y.y instead of x.x.x.x. Then it will work.
     
  14. ayuu

    ayuu New Member

    Scripts cannot send out mail to external

    Hi All

    I have just simple bash script to send out email to my external email.
    I configure sendmail.cf smart relay to IP of my smtp server (running qmail).
    I can see the mail are qued not delievered.
    How can I make the email are sent.


    I tried sending email from command line.
    /var/log/maillog showed
    ......................
    May 3 18:21:49 S106PU02 sendmail[15436]: l43ALnfI015436: from=root, size=45, class=0, nrcpts=1, msgid=<200705031021.l43ALnfI015436@localhost.localdomain>, relay=root@localhost
    May 3 18:21:49 S106PU02 sendmail[15436]: l43ALnfI015436: to=me@xxxxx.com, delay=00:00:00, mailer=esmtp, pri=30045, dsn=4.4.3, stat=queued
    .........................................

    /var/spool/clientqueue showed

    root@ttttt [/var/spool/clientmqueue]
    # more qfl43ALnfI015436
    V8
    T1178187709
    K1178187709
    N1
    P30045
    Mhost map: lookup (xxxxx.com): deferred
    Fbs
    $_root@localhost
    ${daemon_flags}c u
    Sroot
    Aroot@localhost.localdomain
    rRFC822; me@xxxxx.com
    RPFD:me@xxxxx.com
    H?P?Return-Path: <g>
    H??Received: (from root@localhost)
    by localhost.localdomain (8.13.1/8.13.1/Submit) id l43ALnfI015436
    for me@xxxxx.com; Thu, 3 May 2007 18:21:49 +0800
    H?D?Date: Thu, 3 May 2007 18:21:49 +0800
    H?F?From: root <root>
    H?x?Full-Name: root
    H?M?Message-Id: <200705031021.l43ALnfI015436@localhost.localdomain>
    H??To: me@xxxxx.com
    H??Subject: TEST


    Any help is appreciated. Pls advise.
    Thans in deed. Regards, Ayuu.
     
  15. ayuu

    ayuu New Member

    I managed to get mail sent from the server, but I did not receive the email.
    I am not sure smtp server is relaying or not.
    any guidance how to check?
     
  16. falko

    falko Super Moderator

    Did you see any activity in the receiving server's mail log when you sent the mail?
     

Share This Page