Migrating postifx

Discussion in 'Server Operation' started by mgideon, May 12, 2006.

  1. mgideon

    mgideon New Member

    I'm getting rid of an older server and trying to migrate/setup a new server. This new machine is Mandrake 10.1. I have almost everything over, but I'm having problems with Postfix. I did a postconf on the old one and added what I thought was right to the new main.cf. Here is that postconf -n

    alias_maps = hash:/etc/postfix/aliases, hash:/var/lib/mailman/data/aliases
    command_directory = /usr/sbin
    config_directory = /etc/postfix
    daemon_directory = /usr/lib/postfix
    delay_warning_time = 4h
    html_directory = /usr/share/doc/postfix-2.1.4/html
    inet_interfaces = localhost
    mail_owner = postfix
    mailq_path = /usr/bin/mailq.postfix
    manpage_directory = /usr/share/man
    mydestination = $myhostname, localhost.$mydomain, $mydomain, mydomain.com
    myhostname = gate.mydomain.com
    mynetworks_style = subnet
    myorigin = $mydomain
    newaliases_path = /usr/bin/newaliases.postfix
    owner_request_special = no
    queue_directory = /var/spool/postfix
    readme_directory = /usr/share/doc/postfix-2.1.4/README_FILES
    recipient_delimiter = +
    relayhost = [smtp.sbcglobal.net]
    sample_directory = /usr/share/doc/postfix-2.1.4/samples
    sendmail_path = /usr/sbin/sendmail.postfix
    setgid_group = postdrop
    smtp_sasl_auth_enable = yes
    smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
    smtp_sasl_security_options = noanonymous
    smtpd_banner = $myhostname ESMTP $mail_name ($mail_version) (Mandrake Linux)
    smtpd_sasl_path = /etc/postfix/sasl:/usr/lib/sasl2
    unknown_local_recipient_reject_code = 450

    Probably stupid, but I just copied the aliases and .db, sasl_passwd and .db, and transport and transport.db files over. I really don't get the post map thing. I remember the headaces of setting it up the first time.

    So I can send mail through the internet. I can't receive mail from the internet or other internal users. My domain and MX records seem okay ( I used to get mail from the other server ). There aren't any errors in my mail log. Info log shows the mail going out, but nothing is recorded when I try sending to my server. The old version of postfix was 2.0.13. My new one is 2.1.4.

    Can anyone steer me in the right direction?

    Thanks,
    Mike
     
  2. falko

    falko Super Moderator ISPConfig Developer

    There's nothing in the mail log when you send a mail to the server? This probably means that you use another server for sending. Please check the email client settings, especially the SMTP server, and double-check the MX records.
     
  3. mgideon

    mgideon New Member

    Connection Failed

    I finally got my messages bounce back. I'm not getting errors because the connection isn't even getting made. If I telnet myhost.com 25, I get "Could not open connection to host on port 25. Connection failed."

    netstat says
    tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN

    I did some research. Seems I need an external interface listening for smtp.
    I tried adding
    myhost.com:25 inet n - n - - smtpd
    to my master.cf, but postfix wont' run. postfix status says "master not running".

    From that machine I can telnet localhost 25 and get a connection. How to I allow for an external connection?

    Thanks!
     
  4. falko

    falko Super Moderator ISPConfig Developer

    Change the value of inet_interfaces to all in /etc/postfix/main.cf.

    Undo this change and restart Postfix.
     
  5. mgideon

    mgideon New Member

    Migrating postfix

    That made so much sense. But it didn't work. I still get connection refused and only

    [root@gate postfix]# netstat -nl | grep 25
    tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
    unix 2 [ ACC ] STREAM LISTENING 167825 private/lmtp-filter


    I reloaded postfix and the netowork interface.
     
  6. falko

    falko Super Moderator ISPConfig Developer

    What's in your /etc/postfix/main.cf (leave out the comments)?
     
  7. mgideon

    mgideon New Member

    Migrating Postfix

    here is my main.cf

    readme_directory = /usr/share/doc/postfix-2.1.4/README_FILES
    sample_directory = /usr/share/doc/postfix-2.1.4/samples
    html_directory = /usr/share/doc/postfix-2.1.4/html
    sendmail_path = /usr/sbin/sendmail.postfix
    setgid_group = postdrop
    command_directory = /usr/sbin
    manpage_directory = /usr/share/man
    daemon_directory = /usr/lib/postfix
    newaliases_path = /usr/bin/newaliases.postfix
    mailq_path = /usr/bin/mailq.postfix
    queue_directory = /var/spool/postfix
    mail_owner = postfix

    # User configurable parameters

    myhostname = gate.myhost.com
    myorigin = $mydomain
    mydestination = $myhostname, localhost.$mydomain, $mydomain, gideonweb.com
    mynetworks_style = subnet
    relayhost = [smtp.sbcglobal.net]

    smtp_sasl_auth_enable = yes
    smtp_sasl_security_options = noanonymous
    smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
    lbox_command = /usr/bin/procmail -Y -a $DOMAIN
    # inet_interfaces = localhost
    inet_interfaces = all
    delay_warning_time = 4h
    smtpd_banner = $myhostname ESMTP $mail_name ($mail_version) (Mandrake Linux)
    unknown_local_recipient_reject_code = 450
    smtp-filter_destination_concurrency_limit = 2
    lmtp-filter_destination_concurrency_limit = 2
    smtpd_sasl_path = /etc/postfix/sasl:/usr/lib/sasl2
    recipient_delimiter = +
    owner_request_special = no
    alias_maps = hash:/etc/postfix/aliases
     
  8. falko

    falko Super Moderator ISPConfig Developer

    That line should read
    Code:
    mailbox_command = /usr/bin/procmail -Y -a $DOMAIN
    Change it and restart Postfix.
     
  9. mgideon

    mgideon New Member

    Migrating postfix

    That was it. A cut and paste mistake. Dang I never would have found that. Thanks! My only other problem is all root mail is being delivered to the postfix account. BUT, at least it is going somewhere.

    Thanks again,
    Mike
     
  10. falko

    falko Super Moderator ISPConfig Developer

    Check out your /etc/aliases file.
     

Share This Page