Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have setup a local user called postman and logged into it using Thunderbird (IMAP). Following is being shown in the mail error log.

Dec 14 23:45:18 ams1 dovecot: lda(root): Fatal: Invalid user settings. Refer to server    log for more information.
Dec 14 23:45:18 ams1 dovecot: lda(root): Error: chdir(/root/) failed: Permission denied (euid=65534(nobody) egid=65534(nogroup) missing +x perm: /root, dir owned by 0:0 mode=0700)
Dec 14 23:45:18 ams1 dovecot: lda(root): Error: chdir(/root) failed: Permission denied
Dec 14 23:45:18 ams1 dovecot: lda(root): Error: user root: Initialization failed:    Initializing mail storage from mail_location setting failed: stat(/root/Maildir) failed:    Permission denied (euid=65534(nobody) egid=65534(nogroup) missing +x perm: /root, dir owned by 0:0 mode=0700)

How to solve it and how to exclude root from using mail?

/etc/dovecot/conf.d/10-mail.conf

mail_location = maildir:~/Maildir

/etc/postfix/main.cf

home_mailbox = Maildir/

Is there a better way of storing emails rather than in /home?

share|improve this question
    
Are you connecting to the IMAP server using the user 'root'? Can you screenpaste your thunderbird settings. –  tdk2fe Dec 14 '13 at 23:39
    
No, I am using a local user called 'postman'. Nothing special in the thunderbird setting. Default settings using STARTTLS –  Mellnik Dec 14 '13 at 23:46
    
maybe the user postman doesn't has a home, grep postman /etc/passwd and check the postman exists –  c4f4t0r Dec 15 '13 at 12:20
    
It does exist. Andrzej's answer worked. –  Mellnik Dec 15 '13 at 15:38

2 Answers 2

up vote 1 down vote accepted

Delivery of email for root (MTA alias)

Standard security recommendation states that email to root should be redirected to non privileged user -> In postfix configuration create alias for root.

http://www.postfix.org/aliases.5.html

BTW AFAIR some file system (NFS?) map user root to user nobody.

share|improve this answer
    
Thanks a lot this fixed it. I have a standard file system, nothing special. –  Mellnik Dec 15 '13 at 15:36

Dovecot has configuration options:

first_valid_uid         = 26
last_valid_uid          = 0

first_valid_gid         = 6
last_valid_gid          = 0

All uids/gids below that values are treated as unacceptable and cause delivery fault. Sure you can easily change first valid uid to zero but, as mentioned above, much better to alias all root and system mail to the some nonprivileged account, preferrably virtual.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.