postfix +mysql =table lookup problem

Discussion in 'Installation/Configuration' started by mopsos, Feb 27, 2007.

  1. mopsos

    mopsos New Member

    Hi,

    I installed postfix with mysql and sasl and courier. I'm on a debian.
    In addition I installed postfixadmin to create adress mail, domain and other.

    I can create an account (with postfixadmin). With phpmyadmin I see the database, and all is ok.

    But in the file mail.err :
    I see that :
    Code:
    Feb 27 15:33:45 sd-5581 postfix/trivial-rewrite[4170]: fatal: mysql:/etc/postfix/mysql/mysql_virtual_alias_maps.cf(0,lock|fold_fix): table lookup problem
    
    
    I don't understand where is the problem.
    Can you explain me?
    In addition I diseable the ligne
    Code:
    #alias_maps = hash:/etc/postfix/aliases
    
    I don't know if I do or not. And if this line is ok.
    main.cf:
    Code:
    # See /usr/share/postfix/main.cf.dist for a commented, more complete version
    
    
    # Debian specific:  Specifying a file name will cause the first
    # line of that file to be used as the name.  The Debian default
    # is /etc/mailname.
    #myorigin = /etc/mailname
    
    smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
    biff = no
    
    # appending .domain is the MUA's job.
    append_dot_mydomain = no
    
    # Uncomment the next line to generate "delayed mail" warnings
    #delay_warning_time = 4h
    
    # TLS parameters
    # smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
    # smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
    # smtpd_use_tls=yes
    smtpd_use_tls = yes
    smtpd_tls_key_file = /etc/postfix/certificats/server.key
    smtpd_tls_cert_file = /etc/postfix/certificats/server.crt
    smtpd_tls_CAfile = /etc/postfix/certificats/cacert.pem
    smtpd_tls_session_cache_database = btree:${queue_directory}/smtpd_scache
    smtp_tls_session_cache_database = btree:${queue_directory}/smtp_scache
    
    # sasl
    smtpd_sasl_auth_enable = yes
    smtpd_sasl_security_options = noanonymous
    broken_sasl_auth_clients = no
    smtpd_tls_auth_only = yes
    
    # See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
    # information on enabling SSL in the smtp client.
    # mysql info
    virtual_alias_maps = mysql:/etc/postfix/mysql/mysql_virtual_alias_maps.cf
    virtual_gid_maps = static:1029
    virtual_mailbox_base = /usr/local/virtual
    virtual_mailbox_domains = mysql:/etc/postfix/mysql/mysql_virtual_domains_maps.cf
    virtual_mailbox_maps = mysql:/etc/postfix/mysql/mysql_virtual_mailbox_maps.cf
    virtual_mailbox_limit = 51200000
    virtual_minimum_uid = 1029
    virtual_transport = virtual
    virtual_uid_maps = static:1029
    
    myhostname = mail.artwai.fr
    mydomain = artwai.fr
    #alias_maps = hash:/etc/postfix/aliases
    #alias_database = hash:/etc/postfix/mysql/aliases
    myorigin = /etc/mailname
    mydestination = $myhostname localhost.$mydomain $mydomain
    relayhost =
    mynetworks = 127.0.0.0/8, 88.191.38.133,localhost,localhost.localdomain
    mailbox_size_limit = 0
    recipient_delimiter = +
    inet_interfaces = all
    
    
     
    Last edited: Feb 27, 2007
  2. falko

    falko Super Moderator ISPConfig Developer

    What's in /etc/postfix/mysql/mysql_virtual_alias_maps.cf? What's the output of
    Code:
    postconf -d | grep mail_version
    ?
     
  3. mopsos

    mopsos New Member

    I format my server and follow the howto of howtoforge. And now the problem is ok.

    But now when I try to connect with my client thunderbir I have it:
    Code:
    Mar  1 00:19:04 sd-5581 imaplogin: LOGIN FAILED, ip=[::ffff:62.193.34.232]
    Mar  1 00:20:31 sd-5581 authdaemond.mysql: failed to connect to mysql server (server=localhost, userid=mail_admin)
    
    The userid is ok.
    I put mail_admin and mail_admin_password.
    Where is the problem?

    EDIT: If I put the ip of my personnal computer in "mynetwork" I can send mail . It's a problem with the configuration for courier. But I don't know where
     
    Last edited: Mar 1, 2007
  4. mopsos

    mopsos New Member

    I found a problem. I had a conflit with my version courier (stable) and my postfix (testing). I reinstalled courier (testing);
    Now I can recieve my mail.
    But the sending is impossible. "Relay acces denied".

    My main.cf
    Code:
    smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
    biff = no
    append_dot_mydomain = no
    
    # TLS parameters
    smtpd_tls_cert_file = /etc/postfix/smtpd.cert
    smtpd_tls_key_file = /etc/postfix/smtpd.key
    smtpd_use_tls = yes
    #smtpd_tls_session_cache_database = btree:${queue_directory}/smtpd_scache
    #smtp_tls_session_cache_database = btree:${queue_directory}/smtp_scache
    
    
    myhostname = mail.artwai.fr
    alias_maps = hash:/etc/aliases
    alias_database = hash:/etc/aliases
    myorigin = /etc/mailname
    mydestination = mail.artwai.fr, localhost, localhost.localdomain
    relayhost =
    mynetworks = 127.0.0.0/8,ipserver,localhost,localhost.localdomain
    mailbox_size_limit = 0
    recipient_delimiter = +
    inet_interfaces = all
    virtual_alias_domains =
    virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf
    virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
    virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
    virtual_mailbox_base = /home/vmail
    virtual_uid_maps = static:5000
    virtual_gid_maps = static:5000
    smtpd_sasl_auth_enable = yes
    broken_sasl_auth_clients = yes
    smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
    #mailbox_command =
    #home_mailbox = Maildir/
    transport_maps = proxy:mysql:/etc/postfix/mysql-virtual_transports.cf
    virtual_create_maildirsize = yes
    virtual_mailbox_extended = yes
    #virtual_mailbox_limit_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailbox_limit_maps.cf
    #virtual_mailbox_limit_override = yes
    #virtual_maildir_limit_message = "The user you are trying to reach is over quota."
    #virtual_overquota_bounce = yes
    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
    
    I think is a problem with le TLS. But I don't know where is.

    In my mail.info, I can see that :
    Code:
    Mar  1 15:16:10 sd-5581 postfix/smtpd[4154]: warning: SASL authentication failure: Password verification failed
    Mar  1 15:16:10 sd-5581 postfix/smtpd[4154]: warning: unknown[62.193.34.232]: SASL PLAIN authentication failed: generic failure
    
     
    Last edited: Mar 1, 2007
  5. falko

    falko Super Moderator ISPConfig Developer

    What's in /etc/pam.d/smtp and /etc/postfix/sasl/smtpd.conf?
     
  6. mopsos

    mopsos New Member

    In my /etc/pam.d/smpt
    Code:
    auth    required   pam_mysql.so
    user= root
    passwd= password
    host=127.0.0.1
    db=mail
    table=users
    usercolumn=email
    passwdcolumn=password
    crypt=1
    account sufficient pam_mysql.so
    user= root
    passwd= password
    host=127.0.0.1
    db=mail
    table=users
    usercolumn=email
    passwdcolumn=password
    crypt=1
    
    And in my /etc/postfix/sasl/smtpd
    Code:
    pwcheck_method: saslauthd
    mech_list: plain login
    allow_plaintext: true
    auxprop_plugin: mysql
    sql_hostnames: 127.0.0.1
    sql_user: root
    sql_passwd: password
    sql_database: mail
    sql_select: select password from users where email = '%u'
    
    Regards.
     
    Last edited: Mar 2, 2007
  7. falko

    falko Super Moderator ISPConfig Developer

    It's /etc/pam.d/smtp, not /etc/pam.d/smpt, and it must have only two lines:

    Code:
    auth    required   pam_mysql.so user=mail_admin passwd=mail_admin_password host=127.0.0.1 db=mail table=users usercolumn=email passwdcolumn=password crypt=1
    account sufficient pam_mysql.so user=mail_admin passwd=mail_admin_password host=127.0.0.1 db=mail table=users usercolumn=email passwdcolumn=password crypt=1
     
  8. mopsos

    mopsos New Member

    Thank you very much. It's because I had writen my smtp files in pam.d with more than 2 lines and I had a space between user and root and passwd ans password.

    Regards.
     

Share This Page