Diagnosing Error for postfix/mysql virt users

Discussion in 'Server Operation' started by Puthuff, Apr 14, 2008.

  1. Puthuff

    Puthuff New Member

    I've been scanning the forums for awhile and nobody replies after they fix the error or the solutions posted dont work for me.

    My system is setup from the perfect deb etch setup and i followed Virtual Users And Domains With Postfix, Courier And MySQL (Debian Etch) to create the mail system

    output from mail.log
    Code:
    Apr 13 20:38:49 pengu postfix/master[2941]: daemon started -- version 2.3.8, configuration /etc/postfix
    Apr 13 20:39:51 pengu imapd: Connection, ip=[::ffff:127.0.0.1]
    Apr 13 20:39:51 pengu imapd: chdir evilputty.com/puthuff/: No such file or directory
    Apr 13 20:40:06 pengu courierpop3login: Connection, ip=[::ffff:24.10.59.241]
    Apr 13 20:40:06 pengu courierpop3login: chdir evilputty.com/puthuff/: No such file or directory
    Apr 13 20:45:43 pengu courierpop3login: Connection, ip=[::ffff:24.10.59.241]
    Apr 13 20:45:43 pengu courierpop3login: chdir evilputty.com/puthuff/: No such file or directory
    Apr 13 20:46:14 pengu postfix/master[2941]: terminating on signal 15
    Apr 13 20:46:17 pengu postfix/master[3211]: daemon started -- version 2.3.8, configuration /etc/postfix
    Apr 13 20:50:02 pengu authdaemond: stopping authdaemond children
    Apr 13 20:50:02 pengu authdaemond: modules="authmysql", daemons=5
    Apr 13 20:50:02 pengu authdaemond: Installing libauthmysql
    Apr 13 20:50:02 pengu authdaemond: Installation complete: authmysql
    Apr 13 20:51:27 pengu imapd: Connection, ip=[::ffff:127.0.0.1]
    Apr 13 20:51:27 pengu imapd: chdir evilputty.com/puthuff/: No such file or directory
    Apr 13 20:51:37 pengu courierpop3login: Connection, ip=[::ffff:24.10.59.241]
    Apr 13 20:51:37 pengu courierpop3login: chdir evilputty.com/puthuff/: No such file or directory
    
    main.cf
    Code:
    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/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
    
    # See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
    # information on enabling SSL in the smtp client.
    
    myhostname = pengu.evilputty.com
    alias_maps = hash:/etc/aliases
    alias_database = hash:/etc/aliases
    myorigin = /etc/mailname
    mydestination = pengu.evilputty.com, localhost, localhost.localdomain
    relayhost =
    mynetworks = 127.0.0.0/8
    mailbox_command =
    mailbox_size_limit = 0
    recipient_delimiter = +
    inet_interfaces = all
    inet_protocols = all
    smtpd_sasl_local_domain =
    smtpd_sasl_auth_enable = yes
    smtpd_sasl_security_options = noanonymous
    broken_sasl_auth_clients = yes
    smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
    smtpd_tls_auth_only = no
    smtp_use_tls = yes
    smtp_tls_note_starttls_offer = yes
    smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
    smtpd_tls_loglevel = 1
    smtpd_tls_received_header = yes
    smtpd_tls_session_cache_timeout = 3600s
    tls_random_source = dev:/dev/urandom
    home_mailbox = Maildir/
    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
    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
    content_filter = amavis:[127.0.0.1]:10024
    receive_override_options = no_address_mappings
    
    ehlo on port 25
    Code:
    220 pengu.evilputty.com ESMTP Postfix (Debian/GNU)
    ehlo localhost
    250-pengu.evilputty.com
    250-PIPELINING
    250-SIZE 10240000
    250-VRFY
    250-ETRN
    250-STARTTLS
    250-AUTH PLAIN LOGIN
    250-AUTH=PLAIN LOGIN
    250-ENHANCEDSTATUSCODES
    250-8BITMIME
    250 DSN
    
    postconf -n
    Code:
    pengu:~# 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
    home_mailbox = Maildir/
    inet_interfaces = all
    inet_protocols = all
    mailbox_command =
    mailbox_size_limit = 0
    mydestination = pengu.evilputty.com, localhost, localhost.localdomain
    myhostname = pengu.evilputty.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
    receive_override_options = no_address_mappings
    recipient_delimiter = +
    relayhost =
    smtp_tls_note_starttls_offer = yes
    smtp_tls_session_cache_database = btree:${queue_directory}/smtp_scache
    smtp_use_tls = yes
    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_local_domain =
    smtpd_sasl_security_options = noanonymous
    smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
    smtpd_tls_auth_only = no
    smtpd_tls_cert_file = /etc/postfix/smtpd.cert
    smtpd_tls_key_file = /etc/postfix/smtpd.key
    smtpd_tls_loglevel = 1
    smtpd_tls_received_header = yes
    smtpd_tls_session_cache_database = btree:${queue_directory}/smtpd_scache
    smtpd_tls_session_cache_timeout = 3600s
    smtpd_use_tls = yes
    tls_random_source = dev:/dev/urandom
    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_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
    virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
    virtual_uid_maps = static:5000
    

    mail.log after trying to send mail using telnet using external address at first then using localhost.
    Code:
    Apr 13 21:22:11 pengu postfix/smtpd[3379]: connect from pengu.evilputty.com[64.62.231.176]
    Apr 13 21:22:54 pengu postfix/smtpd[3379]: NOQUEUE: reject: RCPT from pengu.evilputty.com[64.62.231.176]: 554 5.7.1 <pu                                                                       [email protected]>: Relay access denied; from=<[email protected]> to=<[email protected]> proto=SMTP helo=<evilpu                                                                       tty.com>
    Apr 13 21:23:00 pengu postfix/smtpd[3379]: disconnect from pengu.evilputty.com[64.62.231.176]
    Apr 13 21:23:05 pengu postfix/smtpd[3379]: connect from pengu.evilputty.com[64.62.231.176]
    Apr 13 21:23:08 pengu postfix/smtpd[3379]: disconnect from pengu.evilputty.com[64.62.231.176]
    Apr 13 21:23:15 pengu postfix/smtpd[3379]: connect from localhost[127.0.0.1]
    Apr 13 21:23:49 pengu postfix/smtpd[3379]: NOQUEUE: reject: RCPT from localhost[127.0.0.1]: 550 5.1.1 <puthuff>: Recipi                                                                       ent address rejected: User unknown in local recipient table; from=<[email protected]> to=<puthuff> proto=SMTP helo=<ev                                                                       ilputty.com>
    Apr 13 21:24:13 pengu postfix/smtpd[3379]: 317D618C3B: client=localhost[127.0.0.1]
    Apr 13 21:24:32 pengu postfix/cleanup[3391]: 317D618C3B: message-id=<[email protected]>
    Apr 13 21:24:32 pengu postfix/qmgr[3213]: 317D618C3B: from=<[email protected]>, size=370, nrcpt=1 (queue active)
    Apr 13 21:24:33 pengu postfix/smtpd[3395]: connect from localhost[127.0.0.1]
    Apr 13 21:24:33 pengu postfix/smtpd[3395]: 039CD18C3D: client=localhost[127.0.0.1]
    Apr 13 21:24:33 pengu postfix/cleanup[3391]: 039CD18C3D: message-id=<[email protected]>
    Apr 13 21:24:33 pengu postfix/qmgr[3213]: 039CD18C3D: from=<[email protected]>, size=832, nrcpt=1 (queue active)
    Apr 13 21:24:33 pengu amavis[2604]: (02604-01) Passed CLEAN, LOCAL [127.0.0.1] [127.0.0.1] <[email protected]> -> <put                                                                       [email protected]>, Message-ID: <[email protected]>, mail_id: Owin+aUcEnhU, Hits: -, queue                                                                       d_as: 039CD18C3D, 383 ms
    Apr 13 21:24:33 pengu postfix/smtpd[3395]: disconnect from localhost[127.0.0.1]
    Apr 13 21:24:33 pengu postfix/smtp[3392]: 317D618C3B: to=<[email protected]>, relay=127.0.0.1[127.0.0.1]:10024, del                                                                       ay=64, delays=64/0.04/0.02/0.38, dsn=2.6.0, status=sent (250 2.6.0 Ok, id=02604-01, from MTA([127.0.0.1]:10025): 250 2.                                                                       0.0 Ok: queued as 039CD18C3D)
    Apr 13 21:24:33 pengu postfix/qmgr[3213]: 317D618C3B: removed
    Apr 13 21:24:33 pengu postfix/smtp[3397]: 039CD18C3D: to=<[email protected]>, relay=none, delay=0.1, delays=0.06/0.                                                                       03/0.02/0, dsn=5.4.6, status=bounced (mail for evilputty.com loops back to myself)
    Apr 13 21:24:33 pengu postfix/cleanup[3391]: 2834618C3E: message-id=<[email protected]>
    Apr 13 21:24:33 pengu postfix/qmgr[3213]: 2834618C3E: from=<>, size=2644, nrcpt=1 (queue active)
    Apr 13 21:24:33 pengu postfix/bounce[3398]: 039CD18C3D: sender non-delivery notification: 2834618C3E
    Apr 13 21:24:33 pengu postfix/qmgr[3213]: 039CD18C3D: removed
    Apr 13 21:24:33 pengu postfix/smtp[3397]: 2834618C3E: to=<[email protected]>, relay=none, delay=0.03, delays=0.02/0/0/                                                                       0, dsn=5.4.6, status=bounced (mail for evilputty.com loops back to myself)
    Apr 13 21:24:33 pengu postfix/qmgr[3213]: 2834618C3E: removed
    Apr 13 21:24:35 pengu postfix/smtpd[3379]: disconnect from localhost[127.0.0.1]
    
     
  2. falko

    falko Super Moderator Howtoforge Staff

    You must send an email first to a new account before you can fetch mails with POP3/IMAP. The directories are created automatically when the first email arrives.
     
  3. Puthuff

    Puthuff New Member

    i thought i did

    i did
    Code:
    maildirmake puthuff
    maildirmake [email protected]
    is that the correct method of doing it with a virtual user setup?

    i was rooting around in my system and did a testauth on [email protected]
    Code:
    pengu:/evilputty.com/puthuff# authtest [email protected]
    Authentication succeeded.
    
         Authenticated: [email protected]  (uid 5000, gid 5000)
        Home Directory: /home/vmail
               Maildir: evilputty.com/puthuff/
                 Quota: 10485760
    Encrypted Password: xxxxxxxxxxxxxx
    Cleartext Password: (none)
               Options: (none)
    
    shouldnt /home/vmail/puthuff be the mail dir? i dont understand where it's looking for the maildir her as a folder evilputty.com/puthuff doesnt exist on my system :(
     
    Last edited: Apr 14, 2008
  4. topdog

    topdog Active Member

    The setup places users directories inside the domain directory
     
  5. Puthuff

    Puthuff New Member

    something is f'ed up then i cant send mail locally, if you look in my log it shows a return to sender. that shouldnt be normal should it? i've tried sending emails to accounts in my mysql table. could it be a permissions thing?
     
  6. Puthuff

    Puthuff New Member

    i think im missing here im getting a message when trying to send an email to my user created virtual mailbox "[email protected]"

    and i get a return to sender saying the user does not exist.
     
  7. falko

    falko Super Moderator Howtoforge Staff

    Is evilputty.com listed in the domains table, and is [email protected] listed in the users table?

    What's the exact error message you're getting?
     
  8. Puthuff

    Puthuff New Member

    yes i just checked my username is in the database as well as evilputty.com in domains.

    Returned MDS-Error message
    quote from mail.log
     
    Last edited: Apr 16, 2008
  9. Puthuff

    Puthuff New Member

    I dont know if this helps buy i am able to send email to REAL users i just tested it and it sends mail to their /home/Maildir directory
     
  10. falko

    falko Super Moderator Howtoforge Staff

    Are you using the correct username and password in the mysql*.cf files? Are there maybe any special characters in the passwords?
     
  11. Puthuff

    Puthuff New Member

    pengu:/# cat /etc/postfix/mysql-virtual_* > ~/log_postfix

    i just logged in with the account and the exact password, they were all the same. :()
     
    Last edited: Apr 17, 2008
  12. Puthuff

    Puthuff New Member

    alright i created /home/vmail/evilputty.com/ then did maildirmake [email protected]

    now i can access my email via roundcube and send mail, but i cant recieve mail to my virt user
     
  13. falko

    falko Super Moderator Howtoforge Staff

    What's in the mail log when you send an email to the virtual user?
     
  14. Puthuff

    Puthuff New Member

    the same error as before the user puthuff does not exist
     
  15. falko

    falko Super Moderator Howtoforge Staff

    I suggest you compare your configuration again with the one from the tutorial. Something must be different on your system...
     
  16. Puthuff

    Puthuff New Member

    atleast it knows where the mail should go what files would be checked for authentication of users? in the .cf files?
     
  17. falko

    falko Super Moderator Howtoforge Staff

    Please check all the files mentioned in the tutorial.
     

Share This Page