Postfix not sending mails to any outside domain except my own

Discussion in 'Server Operation' started by lazacom, Sep 6, 2012.

  1. lazacom

    lazacom New Member

    Postfix is sending emails only for my domain, nemogucamisija.com. But not to gmail or any other. User however can receive emails from any mail servers (gmail, yahoo... ). Here is /var/log/maillog output:

    Any idea? Thanks in advance!
     
  2. TiTex

    TiTex Member

    post the output of postconf -n ... or the content of main.cf
     
    Last edited: Sep 6, 2012
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    There are some config files missing.

    If you use ISPConfig then download ispconfig again, unpack it and run the update.php script which is in the install folder. Choose yes when the updater asks you if the services shall be reconfigured.

    If your setup is not a ispconfig server, then you might want to redo the guide that you used to setupthe server and create the missing config files manually.
     
  4. lazacom

    lazacom New Member

    postconf -n

    Yes, I have tried ISPConfig, but it could not install, so i decided not to go ISPConfig route. I instead installed webmin+virtualmin.
     
  5. lazacom

    lazacom New Member

    And yes, this is postfix 2.9.4 on Ceont0s 6 x86_64, built from source (as root). Had to remove 2.6 cause of ISPConfig ...
     
  6. TiTex

    TiTex Member

    if i'm not mistaken
    should be
    Code:
    transport_maps = hash:/etc/postfix/transport
    but first run this command
    Code:
    postmap /etc/postfix/transport
    and then restart postfix
     
  7. lazacom

    lazacom New Member

    Tried, but got error:
     
  8. lazacom

    lazacom New Member

    Also, I created all missing files from first post, chown-ed them to postfix:postfix, but now i got some other errors (restart postfix + mail delivery):
    Any way to reset settings to default or some command to rebuild config files?
     
    Last edited: Sep 6, 2012
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    You said above in #5 that you use ispconfig and I explained in #3 how o reset the config files on a ispconfig server.
     
  10. lazacom

    lazacom New Member

    I perhaps didn't explained it right - I tried to install ISPConfig, but installation failed. Then, I uninstaled ISPConfig and deleted what left and installed webmin+virtualmin. Because some settings still was left from ISP, I removed postfix (yum remove postfix) and then build postfix 2.9.4 from source as root.

    Unfortunately, server gone live, web site must be running so some switch to ISPconfig is not a option now. Is there some own postfix solution to rebuild settings, or something in webmin/virtualmin?
     
  11. gscales

    gscales New Member

    Hi lazacom;

    I am having send problems on my new server as well, so take what I say with a grain of salt. I have done so much reading attempting to solve my problem, that I can readily see some problems with yours.

    1. When you move from ispconfig to virtualmin (or from any panel to another for that matter), always do a complete re-install first. Different panels access system files differenly and you don't want the remains of one interfering with another.

    2. Postfix should run as root. Here is a directory listing of a server that is running virtualmin/postfix/dovecot:

    # ls -l
    total 100
    -rwxr-xr-x 1 root root 0 2012-01-09 16:45 bcc
    -rw-r--r-- 1 root root 12288 2012-02-24 14:24 bcc.db
    -rw-r--r-- 1 root root 370 2012-01-09 16:41 dynamicmaps.cf
    -rw-r--r-- 1 root root 1737 2012-05-09 18:23 main.cf
    -rw-r--r-- 1 root root 5357 2012-01-09 16:46 master.cf
    -rw-r--r-- 1 root root 18992 2011-05-10 08:47 postfix-files
    -rwxr-xr-x 1 root root 8729 2011-05-10 08:47 postfix-script
    -rwxr-xr-x 1 root root 24256 2011-05-10 08:47 post-install
    drwxr-xr-x 2 root root 4096 2012-01-09 16:46 sasl
    -rwxr-xr-x 1 root root 3690 2012-05-09 18:23 virtual
    -rw-r--r-- 1 root root 12288 2012-05-09 18:23 virtual.db

    notice that everything is chowned root:root. It's not exactly the same on ispconfig, but you are using virtualmin, not ispconfig, so I would think yours should look more like the above.
     
  12. lazacom

    lazacom New Member

    Tnx, tried to chown it to root, and errors reduced to half. Now I just get:

    Pretty good progress but still not sending emails to any other domain except mine. Any idea what to put in files above, I just created all of them, so they are blank.
     
  13. TiTex

    TiTex Member

    you misconfigured something in /etc/postfix/mysql-virtual_mailboxes.cf maybe a typo or something similar
     
  14. gscales

    gscales New Member

    Hi lazacom;

    That setting is a left over from ISPConfig3. Here is the postconf -n command output from a virtualmin server I have access to:

    /etc/postfix# postconf -n
    alias_database = hash:/etc/aliases
    alias_maps = hash:/etc/aliases
    allow_percent_hack = no
    append_dot_mydomain = no
    biff = no
    broken_sasl_auth_clients = yes
    config_directory = /etc/postfix
    home_mailbox = Maildir/
    mailbox_command = /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME
    mailbox_size_limit = 0
    message_size_limit = 40960000
    milter_default_action = accept
    milter_protocol = 2
    mydestination = $myhostname, localhost.$mydomain, $mydomain
    mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
    non_smtpd_milters = inet:localhost:8891
    readme_directory = no
    recipient_delimiter = +
    sender_bcc_maps = hash:/etc/postfix/bcc
    smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
    smtpd_banner = mail.noahidenations.com ESMTP $mail_name (Ubuntu)
    smtpd_milters = inet:localhost:8891
    smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination
    smtpd_sasl_auth_enable = yes
    smtpd_sasl_security_options = noanonymous
    smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
    smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
    smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
    smtpd_use_tls = yes
    virtual_alias_maps = hash:/etc/postfix/virtual

    Notice that the mail directory is not virutal, but home_mailbox = Maildir/ ... the mail directory on this server is /home/domainName/Maildir. Basically, the mailbox configurations are handled differently in virtualmin than ispconfg.
     
  15. gscales

    gscales New Member

    "Pretty good progress but still not sending emails to any other domain except mine. Any idea what to put in files above, I just created all of them, so they are blank."

    It's not really that simple. Those file configure how to set up mailboxes that are maintained in mysql like ispconfig does it. I don't think that's what you are actually after.

    Let me ask you this, can you send to other domains with webmail or not?

    Greg
     
  16. lazacom

    lazacom New Member

    Not tried webmail, but I can install squirrelmail and check it... :)
     
  17. TiTex

    TiTex Member

    Last edited: Sep 6, 2012
  18. gscales

    gscales New Member

    Go for it!
     
  19. gscales

    gscales New Member

    I think he's trying to do the same thing I am: Using a mail client such as Outlook or Thunderbird, connected from outside of $mynetworks, send to a domain that is not $mydomain. Do you know how to do that?
     
  20. TiTex

    TiTex Member

    1. yes i know how to do that but i wont explain this here since it has been posted in the HowTo's section http://www.howtoforge.com/howtos/email/postfix many times with all kind/type of configurations.

    2. i've posted above the link for the oficial postfix documentation did you even bother to click on it ? ... there are some examples on how to configure postfix with or without virtual users

    3. postfix alone will not work because you'll need an imap,pop service to interact with the postfix MTA when you're sending mail from a mail client , or webmail ... dovecot,cyrus and/or courier will do that

    4. to make this easy for you guys there are some very good all in one packages out there
    (smtp,pop3,imap,webmail) like iRedMail , Zimbra both are using postfix as their MTA, or Axigen Free Edition that has it's own proprietary mail system with everything.

    These being said , when you don't know how something works ... read the documentation!
    Have fun!
     
    Last edited: Sep 6, 2012

Share This Page