"chdir Maildir failed"

Discussion in 'Server Operation' started by Jürgen, Mar 16, 2009.

  1. Jürgen

    Jürgen New Member

    Hello,

    I installed a server on the basis of "The Perfect Setup". The system is running with Debian Etch 4.0.

    During the installtion there were no errors, everything worked. I get, however, an error when I try to establish a new pop3 connection. The error message of my mail programm is:

    So, I checked the server and connection settings and read some threads about this error, but I still cannot find the bug.

    Thanks for your help!
     
  2. Flash

    Flash New Member

    Did you send a message to that mail account, you usually need to send one before you can use pop3 or imap as it needs to create the folder structure. (if it doesnt, give the postfix user write access to the main dir)
     
  3. Jürgen

    Jürgen New Member

    Thanks for your response.

    Sending a mail to the mail account doesn't help.

    The users and their mail addresses are listed in /etc/postfix/virtusertable.

    The mails are also received and saved in /var/mail/{username}. These files have got the right owner and reading permissions as well.

    Any other idea? Thanks!
     
  4. Jürgen

    Jürgen New Member

    Do you think that it makes sense to remove postfix and to re-install it? Could there be any problems with ISPConfig?

    Thanks.
     
  5. falko

    falko Super Moderator Howtoforge Staff

    You must enable Maildir in ISPConfig (Management > Server > Settings > Email) (and/or run
    Code:
    postconf -e 'home_mailbox = Maildir/'
    postconf -e 'mailbox_command ='
    /etc/init.d/postfix restart
    )
     
  6. Jürgen

    Jürgen New Member

    Ah! Got it!
    I forgot to active the checkbox "Maildir" in ISPConfig.
    Why isn't it activated by default?
    I have never done it before and it always worked well.

    Anyway: Thank you very much! I love this community!
     
  7. falko

    falko Super Moderator Howtoforge Staff

    Because then the users that use mbox would complain. ;)
     
  8. pineapple

    pineapple New Member

    Same problem

    Hello

    I am having the same problem on my server but only with one domain - each day the users cannot log in because of the rejection message chdir Maildir failed. If I reset their passwords they can access their email but only for another day.

    Can anyone think of what has gone wrong?

    Thanks and regards

    Andrew
     
  9. falko

    falko Super Moderator Howtoforge Staff

    Do you use ISPConfig 2? What tutorial (URL) did you use to set up the system?
     
  10. pineapple

    pineapple New Member

    More info

    I followed the Debian Lenny tutorial and am using ISPConfig Version: 2.2.35. We have been running the server for about five months without any issues until now.
     
  11. falko

    falko Super Moderator Howtoforge Staff

    Any errors in your mail log?
    What's in /etc/postfix/main.cf?
    Did you enable Maildir in ISPConfig?
     
  12. pineapple

    pineapple New Member

    I have tried deleting the users and recreating them but the same problem occurs - initially they can log in and then a few hours later they can't.

    main.cf looks like this:

    # 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

    readme_directory = no

    # TLS parameters
    smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt
    smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key
    smtpd_use_tls = yes
    smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
    smtp_tls_session_cache_database = btree:${data_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 = first.form3.com.au
    alias_maps = hash:/etc/aliases
    alias_database = hash:/etc/aliases
    myorigin = /etc/mailname
    #mydestination = mail.form3.com.au, first.form3.com.au, localhost.form3.com.au, localhost.localdomain, localhost
    relayhost =
    mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
    mailbox_command = procmail -a "$EXTENSION"
    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_sasl_authenticated_header = yes
    smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,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

    virtual_maps = hash:/etc/postfix/virtusertable

    mydestination = /etc/postfix/local-host-names

    # code added by AW July 12 to block spam before it hits the server

    smtpd_helo_required = yes
    disable_vrfy_command = yes
    strict_rfc821_envelopes = yes
    invalid_hostname_reject_code = 554
    multi_recipient_bounce_reject_code = 554
    non_fqdn_reject_code = 554
    relay_domains_reject_code = 554
    unknown_address_reject_code = 554
    unknown_client_reject_code = 554
    unknown_hostname_reject_code = 554
    unknown_local_recipient_reject_code = 554
    unknown_relay_recipient_reject_code = 554
    unknown_sender_reject_code = 554
    unknown_virtual_alias_reject_code = 554
    unknown_virtual_mailbox_reject_code = 554
    unverified_recipient_reject_code = 554
    unverified_sender_reject_code = 554

    smtpd_recipient_restrictions =
    reject_invalid_hostname,
    reject_unknown_recipient_domain,
    reject_unauth_pipelining,
    permit_mynetworks,
    permit_sasl_authenticated,
    reject_unauth_destination,
    reject_rbl_client multi.uribl.com,
    reject_rbl_client dsn.rfc-ignorant.org,
    reject_rbl_client dul.dnsbl.sorbs.net,
    reject_rbl_client list.dsbl.org,
    reject_rbl_client sbl-xbl.spamhaus.org,
    reject_rbl_client bl.spamcop.net,
    reject_rbl_client dnsbl.sorbs.net,
    reject_rbl_client cbl.abuseat.org,
    reject_rbl_client ix.dnsbl.manitu.net,
    reject_rbl_client combined.rbl.msrbl.net,
    reject_rbl_client rabl.nuclearelephant.com,
    permit


    I did a send and receive on one of the accounts and this is what appears in the log file (you can also see the successful send and receive underneath on the same server):

    Feb 10 08:18:29 first pop3d-ssl: Connection, ip=[::ffff:203.171.75.54]
    Feb 10 08:18:36 first pop3d-ssl: chdir Maildir: Permission denied
    Feb 10 08:18:58 first pop3d-ssl: Connection, ip=[::ffff:203.171.75.54]
    Feb 10 08:18:59 first pop3d-ssl: LOGIN, user=1_andrew, ip=[::ffff:203.171.75.54], port=[62253]
    Feb 10 08:19:00 first pop3d-ssl: LOGOUT, user=1_andrew, ip=[::ffff:203.171.75.54], port=[62253], top=0, retr=0, rcvd=24, sent=2881, time=1

    Maildir is definitely enabled.

    regards

    Andrew
     
  13. falko

    falko Super Moderator Howtoforge Staff

    Can you check the permissions of the Maildir? Is it owned by the correct user?
     
  14. pineapple

    pineapple New Member

    Solved!

    No, the directories did not have the correct ownership settings! You're a legend - thanks very much.
     
  15. pandusetiawan

    pandusetiawan New Member

    Hi...I just install postfix....it doesn't have a problem when I use mbox...the mail are delivered (using localhost test setup), i want to change it into maildir system, but after I run

    Code:
    postconf -e 'home_mailbox = Maildir/'
    postconf -e 'mailbox_command ='
    /etc/init.d/postfix restart
    
    the mail are failed to arrived...although in the smtp are queued. Any help will be very appreciate.
    Thanks.
     
  16. falko

    falko Super Moderator Howtoforge Staff

    Any errors in your mail log?
     

Share This Page