Postfix + Dovecot + Mysql + Sasld

Discussion in 'Installation/Configuration' started by hmbsandman, Sep 18, 2009.

  1. hmbsandman

    hmbsandman New Member

    Hello,
    I followed the howto outlined here, pretty much to the letter, except I don't want to use roundcube:
    http://www.howtoforge.com/isp-mailserver-with-virtual-users-domains-postfix-dovecot-mysql-centos5.0

    I use gmail as my client. When I give gmail my pop3s account, I get a message that POP3 access was denied for my username and password. Earlier I had it working with usernames/passwords stored in /etc/passwd and shadow. But I want to use mysql.

    Anyway, here are my configs. Any help would be greatly appreciated. I use the traditional UNIX style mbox formats (1 mailbox/user in /var/mail)

    Here are the versions:
    dovecot: 1.0.7
    postfix: 2.6.5
    saslauthd: from cyrus-sasl-lib-2.1.22-4
    mysql: 5.0.22


    dovecot.conf
    ==========
    base_dir = /var/run/dovecot/
    protocols = pop3s
    listen = <IP ADDR OF MY POP3 HOST>
    disable_plaintext_auth = yes
    shutdown_clients = yes
    log_path = /var/log/dovecot.log
    log_timestamp = "%b %d %H:%M:%S "
    ssl_disable = no
    ssl_cert_file = /etc/pki/dovecot/certs/dovecot.pem
    ssl_key_file = /etc/pki/dovecot/private/dovecot.pem
    ssl_verify_client_cert = no
    ssl_parameters_regenerate = 168
    ssl_cipher_list = ALL:!LOW:!SSLv2
    verbose_ssl = yes
    login_dir = /var/run/dovecot/login
    login_chroot = yes
    login_user = dovecot
    login_process_size = 64
    login_process_per_connection = yes
    login_processes_count = 3
    login_max_processes_count = 128
    login_max_connections = 256
    login_greeting = Dovecot ready.
    login_log_format_elements = user=<%u> method=%m rip=%r lip=%l %c
    login_log_format = %$: %s
    mail_location = mbox:~/mail:INBOX=/var/mail/%n
    mail_privileged_group = mail
    mail_full_filesystem_access = no
    mail_debug = no
    mail_log_prefix = "%Us(%u): "
    mail_log_max_lines_per_sec = 10
    mmap_disable = no
    mmap_no_write = no
    dotlock_use_excl = yes
    fsync_disable = no
    lock_method = fcntl
    mail_drop_priv_before_exec = no
    verbose_proctitle = yes
    first_valid_uid = 150
    first_valid_gid = 150
    max_mail_processes = 1024
    mail_process_size = 256
    mail_max_keyword_length = 50
    valid_chroot_dirs = /var/mail:/home
    maildir_copy_with_hardlinks = yes
    mbox_read_locks = fcntl
    mbox_write_locks = fcntl
    mbox_lock_timeout = 300
    mbox_dotlock_change_timeout = 120
    mbox_dirty_syncs = yes
    mbox_lazy_writes = yes
    mbox_min_index_size = 0
    protocol imap {
    }
    protocol pop3 {
    login_executable = /usr/libexec/dovecot/pop3-login
    mail_executable = /usr/libexec/dovecot/pop3
    pop3_no_flag_updates = no
    pop3_enable_last = no
    pop3_reuse_xuidl = no
    pop3_lock_session = no
    pop3_uidl_format = %08Xu%08Xv
    pop3_logout_format = top=%t/%p, retr=%r/%b, del=%d/%m, size=%s
    ssl_listen = <MY IP ADDR>:995
    }

    protocol lda {
    postmaster_address = postmaster@<MY DOMAINNAME>
    hostname = <MY HOSTNAME>
    sendmail_path = /usr/sbin/sendmail
    auth_socket_path = /var/run/dovecot/auth-master
    }

    auth_executable = /usr/libexec/dovecot/dovecot-auth
    auth_process_size = 256
    auth_cache_size = 0
    auth_cache_ttl = 3600
    auth_username_chars = abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890
    auth_worker_max_count = 30
    auth_gssapi_hostname = <POP3 HOSTNAME>
    auth default {
    mechanisms = plain
    passdb sql {
    args = /etc/dovecot/mysql.conf
    }
    userdb sql {
    args = /etc/dovecot/mysql.conf
    }
    user = nobody
    socket listen {
    master {
    path = /var/run/dovecot/auth-master
    mode = 0600
    user = vmail
    group = mail
    }
    client {
    path = /var/spool/postfix/private/auth
    mode = 0600
    user = vmail
    group = mail
    }
    client {
    path = /var/spool/postfix/private/auth
    mode = 0660
    user = postfix
    group = postfix
    }
    }
    }
    dict {
    }
    plugin {
    }

    /etc/dovecot/mysql.conf:
    ===================
    driver = mysql
    default_pass_scheme = plain
    connect = host=<IP OF MY DB SERVER> port=3306 dbname=mail user=mail password=<MY PWD>
    user_query = SELECT 'mbox:~/mail:INBOX=/var/mail/%n' as mail, 150 AS uid, 12 AS gid FROM mailbox WHERE username ='%u' AND active ='1'
    password_query = SELECT password FROM mailbox WHERE username = '%u'

    /usr/lib/sasl2/smtpd.conf:
    ===================
    pwcheck_method: saslauthd
    mech_list: plain login



    Thanks!
    Sandman
     
    Last edited: Sep 18, 2009
  2. falko

    falko Super Moderator ISPConfig Developer

    Any errors in the mail log?
     
  3. hmbsandman

    hmbsandman New Member

    yes

    I turned verbose logging on and found there was an error in mysql. Fixed it.

    Thanks :)
    Sandman
     

Share This Page