Mail delivered in wrong place

Discussion in 'HOWTO-Related Questions' started by mdhowle, Jun 29, 2009.

  1. mdhowle

    mdhowle New Member

    I followed the virtual-users-domains-postfix-courier-mysql-squirrelmail-debian-lenny tutorial sans the quota parts. When an email is sent to my server, it is delivered to /home/vmail/Maildir (a file; not directory). The directory /home/vmail/domain/user/Maildir exists. Here is the log file of sending an email from Yahoo.com to Example.com (my domain).

    Code:
    Jun 28 23:37:53 ariel postfix/smtpd[11978]: connect from web80012.mail.sp1.yahoo.com[69.147.92.118]
    Jun 28 23:37:53 ariel postfix/smtpd[11978]: 4E554C618: client=web80012.mail.sp1.yahoo.com[69.147.92.118]
    Jun 28 23:37:53 ariel postfix/cleanup[11983]: 4E554C618: message-id=<[email protected]>
    Jun 28 23:37:53 ariel postfix/qmgr[7003]: 4E554C618: from=<[email protected]>, size=1408, nrcpt=1 (queue active)
    Jun 28 23:37:53 ariel postfix/smtpd[11978]: disconnect from web80012.mail.sp1.yahoo.com[69.147.92.118]
    Jun 28 23:37:58 ariel postfix/smtpd[12000]: connect from localhost[127.0.0.1]
    Jun 28 23:37:58 ariel postfix/smtpd[12000]: CF2A8C9B8: client=localhost[127.0.0.1]
    Jun 28 23:37:58 ariel postfix/cleanup[11983]: CF2A8C9B8: message-id=<[email protected]>
    Jun 28 23:37:59 ariel postfix/qmgr[7003]: CF2A8C9B8: from=<[email protected]>, size=2059, nrcpt=1 (queue active)
    Jun 28 23:37:59 ariel postfix/smtpd[12000]: disconnect from localhost[127.0.0.1]
    Jun 28 23:37:59 ariel amavis[1693]: (01693-04) Passed CLEAN, [69.147.92.118] [71.15.152.135] <[email protected]> -> <[email protected]>, Message-ID: <[email protected]>, mail_id: evlrqYZVK7oa, Hits: 5.75, size: 1406, queued_as: CF2A8C9B8, 5410 ms
    Jun 28 23:37:59 ariel authdaemond: received userid lookup request: [email protected]
    Jun 28 23:37:59 ariel authdaemond: authmysql: trying this module
    Jun 28 23:37:59 ariel postfix/smtp[11986]: 4E554C618: to=<[email protected]>, relay=127.0.0.1[127.0.0.1]:10024, delay=5.8, delays=0.41/0.01/0/5.4, dsn=2.0.0, status=sent (250 2.0.0 Ok, id=01693-04, from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as CF2A8C9B8)
    Jun 28 23:37:59 ariel postfix/qmgr[7003]: 4E554C618: removed
    Jun 28 23:37:59 ariel authdaemond: authmysqllib: connected. Versions: header 50051, client 50051, server 50051
    Jun 28 23:37:59 ariel authdaemond: SQL query: SELECT email, password, "", 5001, 5001, "/home/vmail", CONCAT('/home/vmail/',SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/'), "", "", "" FROM users WHERE email = '[email protected]'
    Jun 28 23:37:59 ariel authdaemond: Authenticated: sysusername=<null>, sysuserid=5001, sysgroupid=5001, homedir=/home/vmail, [email protected], fullname=<null>, maildir=/home/vmail/example.com/xxxxxxxx/, quota=<null>, options=<null>
    Jun 28 23:37:59 ariel authdaemond: Authenticated: clearpasswd=<null>, passwd=B79FZcQAC9Vjf72A9
    Jun 28 23:38:00 ariel postfix/pipe[12001]: CF2A8C9B8: to=<[email protected]>, relay=maildrop, delay=1.2, delays=0.19/0.01/0/1, dsn=2.0.0, status=sent (delivered via maildrop service)
    Jun 28 23:38:00 ariel postfix/qmgr[7003]: CF2A8C9B8: removed
    postconf -n
    Code:
    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
    inet_interfaces = all
    mailbox_size_limit = 0
    message_size_limit = 30720000
    mydestination = $myhostname, localhost
    mydomain = example.com
    myhostname = mail.example.com
    mynetworks = 127.0.0.0/8
    myorigin = /etc/mailname
    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 = no
    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:5001
    virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
    virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
    virtual_transport = maildrop
    virtual_uid_maps = static:5001
    
    authmysqlrc
    Code:
    MYSQL_SERVER localhost
    MYSQL_USERNAME MYUSER
    MYSQL_PASSWORD MYPASSWORD
    MYSQL_PORT 0
    MYSQL_DATABASE mail
    MYSQL_USER_TABLE users
    MYSQL_CRYPT_PWFIELD password
    #MYSQL_CLEAR_PWFIELD password
    MYSQL_UID_FIELD 5001
    MYSQL_GID_FIELD 5001
    MYSQL_LOGIN_FIELD email
    MYSQL_HOME_FIELD "/home/vmail/"
    MYSQL_MAILDIR_FIELD CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/')
    #MYSQL_NAME_FIELD
    #MYSQL_QUOTA_FIELD quota
    
    I also tried MYSQL_MAILDIR_FIELD CONCAT('/home/vmail/',SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/')
     
    Last edited: Jun 29, 2009
  2. mdhowle

    mdhowle New Member

    After some more tinkering, it seems to be working now, and mutt finally sees it

    I removed courier-maildrop package and replaced it with maildrop to see what is the difference between the two. I was getting s_connect() errors with it, so I re-installed courier-maildrop. I also fiddled with the authmysqlrc some too

    Code:
    MYSQL_SERVER localhost
    MYSQL_USERNAME mail_admin
    MYSQL_PASSWORD mail_admin_password
    MYSQL_PORT 0
    MYSQL_DATABASE mail
    MYSQL_USER_TABLE users
    MYSQL_CRYPT_PWFIELD password
    MYSQL_UID_FIELD 5001
    MYSQL_GID_FIELD 5001
    MYSQL_LOGIN_FIELD email
    MYSQL_HOME_FIELD CONCAT('/home/vmail/',SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/')
    MYSQL_MAILDIR_FIELD "Maildir"
    
     
    Last edited: Jun 29, 2009

Share This Page