Postfix problems on Debian.

Discussion in 'HOWTO-Related Questions' started by sasho, Dec 12, 2013.

  1. sasho

    sasho New Member

    Hi there. I installed new postfix setup with this tutorial -> Virtual Users And Domains With Postfix, Courier, MySQL And SquirrelMail (Debian Wheezy).

    First of all, I want to say, that this was the best tutorial I ever found on the internet. Great work guys, and thanks for it. But i have a small problem. When i try to send welcome message to a newly created user in database (mailx [email protected]), I've got this in the /var/log/mail.log:

    Dec 12 16:01:40 mail postfix/pickup[3841]: A446740DA8: uid=0 from=<root>
    Dec 12 16:01:40 mail postfix/cleanup[3862]: A446740DA8: message-id=<[email protected]>
    Dec 12 16:01:40 mail postfix/qmgr[3843]: A446740DA8: from=<[email protected]>, size=445, nrcpt=1 (queue active)
    Dec 12 16:01:50 mail postfix/smtpd[3871]: connect from localhost[127.0.0.1]
    Dec 12 16:01:50 mail postfix/smtpd[3871]: A143540D82: client=localhost[127.0.0.1]
    Dec 12 16:01:50 mail postfix/cleanup[3862]: A143540D82: message-id=<[email protected]>
    Dec 12 16:01:50 mail postfix/qmgr[3843]: A143540D82: from=<[email protected]>, size=887, nrcpt=1 (queue active)
    Dec 12 16:01:50 mail postfix/smtpd[3871]: disconnect from localhost[127.0.0.1]
    Dec 12 16:01:50 mail amavis[2388]: (02388-02) Passed CLEAN {RelayedOpenRelay}, <[email protected]> -> <[email protected]>, Message-ID: <[email protected]>, mail_id: PWpzSLbLKAsp, Hits: -0.001, size: 445, queued_as: A143540D82, 10004 ms
    Dec 12 16:01:50 mail postfix/smtp[3866]: A446740DA8: to=<[email protected]>, relay=127.0.0.1[127.0.0.1]:10024, delay=10, delays=0.06/0.01/0.01/10, dsn=2.0.0, status=sent (250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as A143540D82)
    Dec 12 16:01:50 mail postfix/qmgr[3843]: A446740DA8: removed
    Dec 12 16:01:51 mail postfix/smtp[3876]: A143540D82: to=<[email protected]>, relay=none, delay=0.62, delays=0.04/0.02/0.56/0, dsn=5.4.6, status=bounced (mail for muzikata.bg loops back to myself)
    Dec 12 16:01:51 mail postfix/cleanup[3862]: 4736140DAE: message-id=<[email protected]>
    Dec 12 16:01:51 mail postfix/qmgr[3843]: 4736140DAE: from=<>, size=2743, nrcpt=1 (queue active)
    Dec 12 16:01:51 mail postfix/bounce[3877]: A143540D82: sender non-delivery notification: 4736140DAE
    Dec 12 16:01:51 mail postfix/qmgr[3843]: A143540D82: removed
    Dec 12 16:01:51 mail postfix/smtp[3876]: 4736140DAE: to=<[email protected]>, relay=none, delay=0.51, delays=0.17/0/0.34/0, dsn=5.4.6, status=bounced (mail for muzikata.bg loops back to myself)
    Dec 12 16:01:51 mail postfix/qmgr[3843]: 4736140DAE: removed


    --------------------------------------------------------
    I assume that the problem is this -> mail for muzikata.bg loops back to myself.

    I don't really know what this means.

    The second problem is that, when i try to log into squirrelmail i got this -> ERROR: Connection dropped by IMAP server.

    In the /var/log/mail.log i got this after the login try:

    Dec 12 16:13:28 mail imapd: Connection, ip=[::ffff:127.0.0.1]
    Dec 12 16:13:28 mail imapd: LOGIN FAILED, [email protected], ip=[::ffff:127.0.0.1]
    Dec 12 16:13:33 mail imapd: LOGOUT, ip=[::ffff:127.0.0.1], rcvd=53, sent=332
    Dec 12 16:13:44 mail imapd: Connection, ip=[::ffff:127.0.0.1]
    Dec 12 16:13:44 mail imapd: chdir muzikata.bg/sasho/: No such file or directory
    Dec 12 16:13:44 mail imapd: [email protected]: No such file or directory


    ---------------------------------------------------------
    I assume that the login problem is because /home/vmail is empty (no user directories in there). To create user directory mailx should be delivered, which is not happening.

    In my database "mail" i have added domain "muzikata.bg"

    I have in users: [email protected] with password and quoata set.

    Here is my postfix configuration:

    root@mail:/home/vmail# postconf -n
    alias_database = hash:/etc/aliases
    alias_maps = hash:/etc/aliases
    append_dot_mydomain = no
    biff = no
    broken_sasl_auth_clients = yes
    config_directory = /etc/postfix
    content_filter = amavis:[127.0.0.1]:10024
    html_directory = /usr/share/doc/postfix/html
    inet_interfaces = all
    mailbox_size_limit = 0
    mydestination = mail.muzikata.bg, localhost, localhost.localdomain
    mydomain = muzikata.bg
    myhostname = mail.muzikata.bg
    mynetworks = 127.0.0.0/8
    myorigin = $mydomain
    proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps
    readme_directory = /usr/share/doc/postfix
    receive_override_options = no_address_mappings
    recipient_delimiter = +
    relayhost =
    smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
    smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
    smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
    smtpd_sasl_auth_enable = yes
    smtpd_sasl_authenticated_header = yes
    smtpd_tls_cert_file = /etc/postfix/smtpd.cert
    smtpd_tls_key_file = /etc/postfix/smtpd.key
    smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
    smtpd_use_tls = yes
    transport_maps = proxy:mysql:/etc/postfix/mysql-virtual_transports.cf
    virtual_alias_domains =
    virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf
    virtual_gid_maps = static:5000
    virtual_mailbox_base = /home/vmail
    virtual_mailbox_limit_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailbox_limit_maps.cf
    virtual_mailbox_limit_override = yes
    virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
    virtual_maildir_extended = yes
    virtual_maildir_limit_message = "The user you are trying to reach is over quota."
    virtual_overquota_bounce = yes
    virtual_uid_maps = static:5000
    root@mail:/home/vmail#
    ------------------------------------------------------------

    Any suggestions or help? :(
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Change:

    mydomain = muzikata.bg

    to:

    mydomain = mail.muzikata.bg

    and restart postfix. A virtual email domain in postfix may not be listed as mydomain in main.cf.
     
  3. sasho

    sasho New Member

    I did change it, now my config looks like that:

    root@mail:/home/vmail# postconf -n
    alias_database = hash:/etc/aliases
    alias_maps = hash:/etc/aliases
    append_dot_mydomain = no
    biff = no
    broken_sasl_auth_clients = yes
    config_directory = /etc/postfix
    content_filter = amavis:[127.0.0.1]:10024
    html_directory = /usr/share/doc/postfix/html
    inet_interfaces = all
    mailbox_size_limit = 0
    mydestination = mail.muzikata.bg, localhost, localhost.localdomain
    mydomain = mail.muzikata.bg
    myhostname = mail.muzikata.bg
    mynetworks = 127.0.0.0/8
    myorigin = $mydomain
    proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps
    readme_directory = /usr/share/doc/postfix
    receive_override_options = no_address_mappings
    recipient_delimiter = +
    relayhost =
    smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
    smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
    smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
    smtpd_sasl_auth_enable = yes
    smtpd_sasl_authenticated_header = yes
    smtpd_tls_cert_file = /etc/postfix/smtpd.cert
    smtpd_tls_key_file = /etc/postfix/smtpd.key
    smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
    smtpd_use_tls = yes
    transport_maps = proxy:mysql:/etc/postfix/mysql-virtual_transports.cf
    virtual_alias_domains =
    virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf
    virtual_gid_maps = static:5000
    virtual_mailbox_base = /home/vmail
    virtual_mailbox_limit_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailbox_limit_maps.cf
    virtual_mailbox_limit_override = yes
    virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
    virtual_maildir_extended = yes
    virtual_maildir_limit_message = "The user you are trying to reach is over quota."
    virtual_overquota_bounce = yes
    virtual_uid_maps = static:5000
    root@mail:/home/vmail#


    ---------------------------------------------------------
    The problem stil exists. No welcome email recieved. Here's the log

    Dec 12 16:40:58 mail postfix/pickup[4671]: B0F0540D21: uid=0 from=<root>
    Dec 12 16:40:58 mail postfix/cleanup[4694]: B0F0540D21: message-id=<[email protected]>
    Dec 12 16:40:58 mail postfix/qmgr[4672]: B0F0540D21: from=<[email protected]>, size=456, nrcpt=1 (queue active)
    Dec 12 16:41:07 mail postfix/smtpd[4703]: connect from localhost[127.0.0.1]
    Dec 12 16:41:07 mail postfix/smtpd[4703]: 993E340A42: client=localhost[127.0.0.1]
    Dec 12 16:41:07 mail postfix/cleanup[4694]: 993E340A42: message-id=<[email protected]>
    Dec 12 16:41:07 mail postfix/qmgr[4672]: 993E340A42: from=<[email protected]>, size=898, nrcpt=1 (queue active)
    Dec 12 16:41:07 mail postfix/smtpd[4703]: disconnect from localhost[127.0.0.1]
    Dec 12 16:41:07 mail amavis[2388]: (02388-04) Passed CLEAN {RelayedOpenRelay}, <[email protected]> -> <[email protected]>, Message-ID: <[email protected]>, mail_id: HvRx4Yp8jxaD, Hits: -0.001, size: 456, queued_as: 993E340A42, 8899 ms
    Dec 12 16:41:07 mail postfix/smtp[4698]: B0F0540D21: to=<[email protected]>, relay=127.0.0.1[127.0.0.1]:10024, delay=9, delays=0.06/0.01/0/8.9, dsn=2.0.0, status=sent (250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as 993E340A42)
    Dec 12 16:41:07 mail postfix/qmgr[4672]: B0F0540D21: removed
    Dec 12 16:41:07 mail postfix/smtp[4706]: 993E340A42: to=<[email protected]>, relay=none, delay=0.26, delays=0.01/0.02/0.23/0, dsn=5.4.6, status=bounced (mail for muzikata.bg loops back to myself)
    Dec 12 16:41:07 mail postfix/cleanup[4694]: DC82940D54: message-id=<[email protected]>
    Dec 12 16:41:07 mail postfix/qmgr[4672]: DC82940D54: from=<>, size=2774, nrcpt=1 (queue active)
    Dec 12 16:41:07 mail postfix/bounce[4707]: 993E340A42: sender non-delivery notification: DC82940D54
    Dec 12 16:41:07 mail postfix/qmgr[4672]: 993E340A42: removed
    Dec 12 16:41:07 mail postfix/cleanup[4694]: E22F740A42: message-id=<[email protected]>
    Dec 12 16:41:07 mail postfix/qmgr[4672]: E22F740A42: from=<>, size=2907, nrcpt=1 (queue active)
    Dec 12 16:41:07 mail postfix/local[4709]: DC82940D54: to=<[email protected]>, relay=local, delay=0.04, delays=0.01/0.01/0/0.02, dsn=2.0.0, status=sent (forwarded as E22F740A42)
    Dec 12 16:41:07 mail postfix/qmgr[4672]: DC82940D54: removed
    Dec 12 16:41:13 mail postfix/smtp[4706]: E22F740A42: to=<[email protected]>, orig_to=<[email protected]>, relay=none, delay=5.3, delays=0.01/0/5.2/0, dsn=5.4.6, status=bounced (mail for muzikata.bg loops back to myself)
    Dec 12 16:41:13 mail postfix/qmgr[4672]: E22F740A42: removed
     
  4. sasho

    sasho New Member

    Ok, the only problem is in the query: query = SELECT CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/') FROM users WHERE email='%s'

    in file /etc/postfix/mysql-virtual_mailboxes.cf

    When i dump the mysql log i see this:

    215 Query SELECT CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/') FROM users WHERE email='muzikata.bg'

    And email field is always muzikata.bg or mail.muzikata.bg. If I hardcode

    CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/') FROM users WHERE email='[email protected]'

    it works. Any ideas why this '%s' it's not the full user email addres?
     

Share This Page