Results 1 to 3 of 3

Thread: E-Mail won't send to other (internal) server, Postfix and /etc/hosts

  1. #1
    Join Date
    Dec 2011

    E-Mail won't send to other (internal) server, Postfix and /etc/hosts

    Hey Every1!

    I'm running two Ubuntu 12.04 servers here and they both are installed fine and dandy, running all services.

    They both are connected to the same router with two different outside IP's (through 1-on-1 NAT).

    They have similer inside ip's (server1:, server2:;

    I have my hosts setup correctly so that the servers should go to their other respective internal ip's and that works when i need to call to the other servers in PHP, but not when i try to send mail from one e-mail address on server1 to another e-mail address on server2.

    In my mail.log:
    Aug 23 11:46:34 server2 postfix/smtp[8030]: connect to[XXX.XXX.XXX.XXX]:25: Connection refused

    And where the XXX.XXX.XXX.XXX is the correct Outside IP of my server1, it is the same in reverse when i send the other way.
    So the problem is, is that postfix doesn't listen to my /etc/hosts

    I've been reading, and it seems i might need to do something with either "mydestination" or with alias' but i'm not sure what....

    I found one thing that said to go something in /etc/postfix/virtual but that dir doesn't exist on my installation of either server.

    Any help in any direction would be greatly appreciated.


  2. #2
    Join Date
    Nov 2008
    Metro Boston
    Kubuntu 14.04 Trusty Tahr

    Re: E-Mail won't send to other (internal) server, Postfix and /etc/hosts

    Mail routing relies on MX records in most instances. That's why Postfix is ignoring entries in /etc/hosts.

    Do you have an internal DNS server for your domain on either of these machines? If so, adjust the MX and A records to use the machines' internal addresses. If not, you might consider setting one up.

    I don't use Postfix so I can't help with that. In sendmail, you can override MX records with an entry in /etc/mail/mailertable. For instance, a mailertable entry like

    Code:     relay:[]     relay:[]
    would direct mail for to
    Last edited by SeijiSensei; August 23rd, 2012 at 05:04 PM.

  3. #3
    Join Date
    Dec 2011

    Re: E-Mail won't send to other (internal) server, Postfix and /etc/hosts

    The actual DNS runs externally, but you did get in the direction of postmap, which i have no clue about yet, but i'll prolly find more.

    if anyone has an example of how i would add a specific line to postmap that would be great cause what ive tried up to now comes back with

    postmap: fatal: open /etc/postfix/transport: No such file or directory

    which according to postfix should be the location for this...

    i do see a "" which makes me think i can create a transport file, but then in what file would i reference my new transport file? or am i thinking wrong here?

Tags for this Thread


Posting Permissions

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