Mail Loop To Myself With Postfix, Courier, MySQL Setup

Discussion in 'Server Operation' started by asyadiqin, Feb 22, 2007.

  1. asyadiqin

    asyadiqin New Member

    Hi,

    I've just recently fresh-installed my server using the "The Perfect Setup - Fedora Core 5" guide, and then followed the guide "Virtual Users And Domains With Postfix, Courier And MySQL (Fedora Core 5)".

    Everything seems to be working fine. I next added a domain and user into the MySQL table to see if everything is working. Next I changed the domain DNS setup to point the domain MX record to the new server IP address and everything resolves fine.

    However, when I tried to check and then send a test email to that email address, I get an error in the maillog.

    I assumed that the whole setup guide would be enough to have a mailserver and that it would do everything once I added the details to the MySQL database. I've read and re-read the guide and there is nothing else in there to specify that I need to do something else to make this mailserver work. Can anyone tell me is there something else that need to be done?.. eg, create the mail folders manually, add domain to bind, dns or something, etc...

    I am not very knowledgeable when it comes to mailservers, so if anyone can help me, please provide as much details as possible.

    Regards,

    A. Syadiqin
     
  2. falko

    falko Super Moderator Howtoforge Staff

    Please add localhost to /etc/hosts and mail.ezxcess.com to the mydestination line in /etc/postfix/main.cf and restart Postfix.
     
  3. asyadiqin

    asyadiqin New Member

    Hi Falko and thanks for replying.

    localhost was always in the /etc/hosts file and I still don't know what was the problem.

    Anyway, I've modified the mailserver to use postfixadmin and everything works fine now, except for the localhost issue

    This is what is listed on my /etc/hosts

    Any ideas?
     
  4. martinfst

    martinfst Member Moderator

    fc5-g1.domain1.com and fc5-g1 can only be on one interface. You have now defined it at both 127.0.0.1 and 89.xxx.xxx.xxx. You should always have a one on one relation between your name and IP number (except with rDNS, but we're not discussing rDNS now).
     
  5. asyadiqin

    asyadiqin New Member

    I've modified /etc/hosts

    Reloaded postfix but still getting that error.

    Any other suggestions?
     
  6. falko

    falko Super Moderator Howtoforge Staff

    Please try this:
    Code:
    postconf -e 'smtp_host_lookup = native'
    /etc/init.d/postfix restart
     
  7. asyadiqin

    asyadiqin New Member

    Tried that. Still getting the same error.

    Any other reason why Postfix is not recognising localhost as 127.0.0.1?

    This is starting to be really frustrating.
     
  8. falko

    falko Super Moderator Howtoforge Staff

    What's in /etc/hosts and /etc/postfix/main.cf (please strip out the comments)?
     
  9. asyadiqin

    asyadiqin New Member

    Content of /etc/hosts

    Content of /etc/postfic/main.cf

     
  10. falko

    falko Super Moderator Howtoforge Staff

    Please remove 127.0.0.1 from the mydestination line in /etc/postfix/main.cf and restart Postfix.
     
  11. asyadiqin

    asyadiqin New Member

    Did that. Same errors.

    Any other suggestions?
     
  12. falko

    falko Super Moderator Howtoforge Staff

    What's in /etc/hosts and /etc/postfix/main.cf now? What's in /etc/host.conf? Should look like this:
    Code:
    order hosts,bind
    multi on
     
  13. asyadiqin

    asyadiqin New Member

    Added the entry into /etc/host.conf, restart named, apache, postfix, everything...... Still the same error.

    The content of both /etc/hosts and /etc/postfix/main.cf is still as what i posted before but with the changes you mentioned. Still no go.

    sigh~
     
  14. EThaiZone

    EThaiZone New Member

    Hi, I want to make postfix can mail loopback to localhost too.

    This's how I config postfix and It's work.
    My server IP is 192.168.2.10
    On ubuntu 9.10. Install with apt-get

    /etc/postfix/main.cf

    mydomain = localdomain.localhost
    mydestination = ubuntu.192.168.2.10 localhost

    /etc/hosts
    /var/spool/postfix/etc/hosts
    (Comment: This 2 files must be same data or Postfix will show warning about it.)

    127.0.0.1 localhost
    127.0.0.1 ubuntu.192.168.2.10 ubuntu


    I hope this can be some help for other too.
     

Share This Page