Postfix, dovecot, mysql no email coming to mysql

Discussion in 'Server Operation' started by abcinc, Jan 2, 2013.

  1. abcinc

    abcinc New Member

    I have ubuntu 10.04 with postfix, mysql dovecot and squirrelmail

    All mail sent from outside to a client goes into a postfix mailbox and not to dovecot imap or squirrelmail. Both are using mysql.

    main.cf from Postfix

    myorigin = /etc/mailname
    biff = no
    append_dot_mydomain = no
    readme_directory = no
    mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
    mynetworks_style = host
    mailbox_size_limit = 0
    virtual_mailbox_limit = 0
    recipient_delimiter = +
    message_size_limit = 0

    # SMTP Authentication (SASL)

    smtpd_sasl_auth_enable = yes
    broken_sasl_auth_clients = yes
    smtpd_sasl_security_options = noanonymous
    smtpd_sasl_local_domain =

    # Encrypted transfer (SSL/TLS)

    smtp_use_tls = yes
    smtpd_use_tls = yes
    smtpd_tls_cert_file = /etc/ssl/private/mail5.mydomain.com,.crt
    smtpd_tls_key_file = /etc/ssl/private/mail5.mydomain.com,.key
    smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
    smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

    # Basic SPAM prevention

    smtpd_helo_required = yes
    smtpd_delay_reject = yes
    disable_vrfy_command = yes

    # Force incoming mail to go through Amavis

    content_filter = amavis:[127.0.0.1]:10024
    receive_override_options = no_address_mappings

    # Virtual user mappings

    alias_maps = hash:/etc/aliases
    alias_database = hash:/etc/aliases
    virtual_mailbox_base = /var/spool/mail/virtual
    virtual_mailbox_maps = mysql:/etc/postfix/maps/user.cf
    virtual_uid_maps = static:5000
    virtual_gid_maps = static:5000
    virtual_alias_maps = mysql:/etc/postfix/maps/alias.cf
    virtual_mailbox_domains = mysql:/etc/postfix/maps/domain.cf

    smtpd_tls_loglevel = 1


    mydestination = mydomain.com,mydomain1.com,mydomain2.com,
     
    Last edited: Jan 2, 2013
  2. falko

    falko Super Moderator Howtoforge Staff

    Are there any errors in your mail log (in the /var/log/ directory)?
     
  3. abcinc

    abcinc New Member

    Hi Falko, thanks for looking. /var/log/mail.log has no new errors after sending an email to a user.

    Hi I also found in var/mail the accounts where mail is going to postfix. Also a folder called virtual where two domain accounts which have mail going to mysql
    also in /var/log/mail.warn there is this error. warning: do not list domain mydomain1.com in BOTH mydestination and virtual_alias_domains

    However if I take mydomain1.com out from mydestination then send and email to mydomain1.com then I get this error in my gmail.
    550 550 5.1.1 <[email protected]>: Recipient address rejected: User unknown in virtual alias table (state 13).

    However that address is in mysql alias table
     
    Last edited: Jan 3, 2013
  4. falko

    falko Super Moderator Howtoforge Staff

    Can you post a log excerpt from the time where you send an email to your server?
     
  5. abcinc

    abcinc New Member

    The var/log/mail.log is empty every time so no data to post

    Hi I also found in var/mail the accounts where mail is going to postfix. Also a folder called virtual where two domain accounts which have mail going to mysql
    also in /var/log/mail.warn there is this error. warning: do not list domain mydomain1.com in BOTH mydestination and virtual_alias_domains

    However if I take mydomain1.com out from mydestination then send and email to mydomain1.com then I get this error in my gmail.
    550 550 5.1.1 <[email protected]>: Recipient address rejected: User unknown in virtual alias table (state 13).

    However that address is in mysql alias table

    here is the contents of etc/postfix/maps/alias.cf. The usrname and password for mysql login works fine
    user=xxx
    password=xxx
    dbname=mail
    table=alias
    select_field=destination
    where_field=source
    hosts=127.0.0.1
    additional_conditions=and enabled = 1
     
    Last edited: Jan 4, 2013

Share This Page