I want to transfer my root mail to another user (his nick's userto). I do not want to forward mail, because of userto's home directory locate at encryption HDD which I mount when I use it and dismount when I don't use it. Therefore if I will forward mail to userto they will lose if the HDD will not mount. And I don't need it, because root mail has a system message.

I wanted to transfer mail via command line when I need it.

I have set PostFix and DoveCot (mailbox).

I have tried to use dovecot but it hasn't let me get access to root mail. For check I use doveadm search -u root ALL.

I have had an error:

Error: Invalid settings in userdb: userdb returned 0 as uid
Error: User lookup failed: Invalid user settings. Refer to server log for more information.

Maybe I need to use other tools that dovecot.

I only see one way, to create a new user (with nick's collectmail) and forward all mail from root to his mailbox. And from collectmail move mail to userto via command line when I need. But I don't think then that way is the best.


IMO I don't use spool.

I have mailboxes and all mail puts into ~Mailbox


Did you try copying them from root's directory to user's directory? Generally root's mail is stored in /var/mail

First, check the location where the root's mail is stored by

sudo env | grep MAIL

It is generally /var/mail/root or /var/spool/mail/root

Second, check the user's mail location by: env | grep MAIL It is also should be: /var/mail/$USER or /var/spool/mail/$USER

Now, just simply try copying them from root to $USER with root privilege.

| improve this answer | |
  • I use mailboxes, therefore all mail puts into ~Mailbox/ I do not use spool. – UnixUser May 14 '19 at 8:54

Your Answer

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

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