0

I am using sendmail in Redhat linux where mail stored in /var/spool/mail. I migrated all the email users related files to Centos where i have configured postfix/dovecot with the help of the following site ; http://www.krizna.com/centos/setup-mail-server-in-centos-6/

When i m creating new user, the mail system is working fine. But for the migrated user it is not working. I gave the configuration:
In /etc/postfix/main.cf --> home_mailbox = mail/
And under /etc/dovecot/dovecot.conf --> mail_location = maildir:~/mail and pop3_uidl_format = %08Xu%08Xv

For migrated users there is no directory named mail under /home/user. what is the easiest way to resolve the problem. Giving the following error:

postfix/local[3522]: warning: maildir access problem for UID/GID=500/500: create maildir file /home/rony/mail/tmp/1473118580.P3522.mail.it.ivoryajmiree.com: Permission denied
Sep 6 05:36:20 mail postfix/qmgr[2283]: 1F7A6348034E: from=<>, size=2775, nrcpt=1 (queue active)
Sep 6 05:36:20 mail postfix/bounce[3523]: E0B52348034C: sender non-delivery notification: 1F7A6348034E
Sep 6 05:36:20 mail postfix/qmgr[2283]: E0B52348034C: removed
Sep 6 05:36:20 mail postfix/local[3522]: warning: maildir access problem for UID/GID=500/500: create maildir file /home/rony/mail/tmp/1473118580.P3522.mail.it.ivoryajmiree.com: Permission denied
Sep 6 05:36:20 mail postfix/local[3522]: warning: perhaps you need to create the maildirs in advance

  • The easiest way to solve your problem is to actually read the error message you copied into your question "you need to create the maildirs" i.e. create the cur/ new/ tmp/ subdirectories required for the Maildir message store in ~mail/ – HBruijn Sep 6 '16 at 18:16
  • I have 400+ users. Actually need to know how could i create essential directories with appropriate permission for all users in easiest way. – Shamsul Alam Sep 6 '16 at 18:58
  • The easiest way would have been to consider that beforehand and add the necessary directories to the /etc/skel home directory template, then they would have been added when you created your users. Since that is probably water under the bridge, depending on your homedir ownerships a trivial for-loop: cd /home; for USER in * ; do echo "mkdir -p /home/$USER/maildir/{cur,new,tmp} ; chown -R $USER:GID /home/$USER/maildir/ ; chmod 0700 /home/$USER/maildir/" ; done – HBruijn Sep 6 '16 at 20:19
  • @HBruijn, thanks for your greatest effort. When i give the command "mkdir -p /home/$USER/maildir/{cur,new,tmp}" it only applies on root user. but instead of $USER when i give a user name like "rony" it applies for that user. But for that specific user “rony”, the command : chown -R rony:GID /home/rony/maildir/ ; is not working, giving the message " chown: invalid group: 'rony:GID' ". – Shamsul Alam Sep 7 '16 at 10:08
  • please note that all of my migrated users are member of "mail" group the ID of mail group is 12. In /etc/passwd file information for migrated user “rony” is ; rony:x:501:12:Shamsul Alam:/home/rony:/bin/false; and information for newly created user “ bobby:x:501:501::/home/bobby:/sbin/nologin ”. how could I declare all the folders under /home through one command?? – Shamsul Alam Sep 7 '16 at 10:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.