doveadm import - strange warning
I'm using the doveadm import command to extract mails from my backup:
% doveadm import -u restore@backup.invalid mdbox:/home/copymail/mdbox ""
mailbox INBOX header Delivered-To backup+$SEARCHPATTERN@backup.invalid
This works like a charm, I'm getting all the mails, and I can access the newly generated mailbox.
But when executing the command I'm getting an annoying warning:
doveadm(restore@backup.invalid): Error: chdir(/root/) failed: Permission denied (euid=1001(copymail) egid=1001(copymail) missing +x perm: /root, dir owned by 0:0 mode=0700) doveadm(restore@backup.invalid): Error: chdir(/root) failed: Permission denied
I'm using a file based authentication:
# cat passwd restore@backup.invalid:{SHA}+/...the.hash...:1001:1001:(gecos):/home/restore::
So why is "restore@backup.invalid" being associated with /root?
I'm using 2:2.2.18-1~auto+91, but the warning has been around for ages :)
-- [*] sys4 AG
http://sys4.de, +49 (89) 30 90 46 64 Franziskanerstraße 15, 81669 München
Sitz der Gesellschaft: München, Amtsgericht München: HRB 199263 Vorstand: Patrick Ben Koetter, Marc Schiffbauer Aufsichtsratsvorsitzender: Florian Kirstein
Anybody seen this before? Seems easy to reproduce...
- Ralf Hildebrandt <r@sys4.de>:
I'm using the doveadm import command to extract mails from my backup:
% doveadm import -u restore@backup.invalid mdbox:/home/copymail/mdbox ""
mailbox INBOX header Delivered-To backup+$SEARCHPATTERN@backup.invalidThis works like a charm, I'm getting all the mails, and I can access the newly generated mailbox.
But when executing the command I'm getting an annoying warning:
doveadm(restore@backup.invalid): Error: chdir(/root/) failed: Permission denied (euid=1001(copymail) egid=1001(copymail) missing +x perm: /root, dir owned by 0:0 mode=0700) doveadm(restore@backup.invalid): Error: chdir(/root) failed: Permission denied
-- [*] sys4 AG
http://sys4.de, +49 (89) 30 90 46 64 Franziskanerstraße 15, 81669 München
Sitz der Gesellschaft: München, Amtsgericht München: HRB 199263 Vorstand: Patrick Ben Koetter, Marc Schiffbauer Aufsichtsratsvorsitzender: Florian Kirstein
On Mon Jul 27 10:51:16 2015, Ralf Hildebrandt wrote:
Anybody seen this before? Seems easy to reproduce...
- Ralf Hildebrandt <r@sys4.de>:
I'm using the doveadm import command to extract mails from my backup:
% doveadm import -u restore@backup.invalid mdbox:/home/copymail/mdbox ""
mailbox INBOX header Delivered-To backup+$SEARCHPATTERN@backup.invalidThis works like a charm, I'm getting all the mails, and I can access the newly generated mailbox.
But when executing the command I'm getting an annoying warning:
doveadm(restore@backup.invalid): Error: chdir(/root/) failed: Permission denied (euid=1001(copymail) egid=1001(copymail) missing +x perm: /root, dir owned by 0:0 mode=0700) doveadm(restore@backup.invalid): Error: chdir(/root) failed: Permission denied
Same happened to me. It seems doveadm is changing uids and then chdirs to the original home directory.
I made it go away by using "sudo". This will not fit all situations.
Yours Jost Krieger
| Jost.Krieger+sig@ruhr-uni-bochum.de Please help stamp out spam! | | Postmaster, JAPH, resident answer machine at RUB Comp. Center | | Sincere words are not sweet, sweet words are not sincere. | | Lao Tse, Tao Te King 81 |
Am 27.07.2015 um 10:51 schrieb Ralf Hildebrandt:
Anybody seen this before? Seems easy to reproduce...
- Ralf Hildebrandt <r@sys4.de>:
I'm using the doveadm import command to extract mails from my backup:
% doveadm import -u restore@backup.invalid mdbox:/home/copymail/mdbox ""
mailbox INBOX header Delivered-To backup+$SEARCHPATTERN@backup.invalidThis works like a charm, I'm getting all the mails, and I can access the newly generated mailbox.
But when executing the command I'm getting an annoying warning:
doveadm(restore@backup.invalid): Error: chdir(/root/) failed: Permission denied (euid=1001(copymail) egid=1001(copymail) missing +x perm: /root, dir owned by 0:0 mode=0700) doveadm(restore@backup.invalid): Error: chdir(/root) failed: Permission denied
Just guessing…
The signature of the command is: doveadm [-Dv] import [-S socket_path] [-s] -u user source_location dest_parent search_query
You supply "" as dest_parent which I guess could mean ".", and that may be "/root" when run as root. Try "INBOX" or "restore_folder" and see if the error vanishes.
- Daniel Tröder <troeder@univention.de>:
Just guessing…
The signature of the command is: doveadm [-Dv] import [-S socket_path] [-s] -u user source_location dest_parent search_query
You supply "" as dest_parent which I guess could mean ".", and that may be "/root" when run as root. Try "INBOX" or "restore_folder" and see if the error vanishes.
With "INBOX", nothing changes on the output (although the script doesn't restore properly anymore)
With ".", I get:
doveadm(restore@backup.invalid): Error: chdir(/root/) failed: Permission denied (euid=1001(theid) egid=1001(theid) missing +x perm: /root, dir owned by 0:0 mode=0700) doveadm(restore@backup.invalid): Error: chdir(/root) failed: Permission denied doveadm(restore@backup.invalid): Error: Couldn't create mailbox ./INBOX: Invalid mailbox name: Contains '.' part
I still think this is an obscure bug :)
[*] sys4 AG
http://sys4.de, +49 (89) 30 90 46 64 Franziskanerstraße 15, 81669 München
Sitz der Gesellschaft: München, Amtsgericht München: HRB 199263 Vorstand: Patrick Ben Koetter, Marc Schiffbauer Aufsichtsratsvorsitzender: Florian Kirstein
Am 27.07.2015 um 11:41 schrieb Ralf Hildebrandt:
- Daniel Tröder <troeder@univention.de>:
Just guessing…
The signature of the command is: doveadm [-Dv] import [-S socket_path] [-s] -u user source_location dest_parent search_query
You supply "" as dest_parent which I guess could mean ".", and that may be "/root" when run as root. Try "INBOX" or "restore_folder" and see if the error vanishes.
With "INBOX", nothing changes on the output (although the script doesn't restore properly anymore)
With ".", I get:
I think there are two independent errors. First:
doveadm(restore@backup.invalid): Error: chdir(/root/) failed: Permission denied (euid=1001(theid) egid=1001(theid) missing +x perm: /root, dir owned by 0:0 mode=0700) doveadm(restore@backup.invalid): Error: chdir(/root) failed: Permission denied Here I think doveadm import tries to do a chdir to the users HOME Directory and does it wrong. It uses the bash environment variable $HOME instead of the users home information as shown by doveadm user.
Why do I think so, because if I manually export the bash environment HOME to the Home Directory of the user I want to import to I don't receive this error anymore.
Example: export HOME="/mailhome/userA" doveadm import -u userA maildir:/backup/userA Backup ALL; -> No Error export HOME="/root" doveadm import -u userA maildir:/backup/userA Backup ALL; -> Error as seen above.
Second:
doveadm(restore@backup.invalid): Error: Couldn't create mailbox ./INBOX: Invalid mailbox name: Contains '.' part This error is dependent on your namespace. If using standard maildir with "/" as separator then "./INBOX" isn't a correct Mailbox name, because dot is not allowed. In this case it should only be "INBOX". But as I said before this depends on your configuration. If I'm not sure, I check the notation by using doveadm mailbox list -u userA.
I still think this is an obscure bug :)
If the first error is a bug or a feature I don't know, but doveadm import works correct with or without this error shown. At least for the things I have done.
doveadm(restore@backup.invalid): Error: chdir(/root/) failed: Permission denied (euid=1001(theid) egid=1001(theid) missing +x perm: /root, dir owned by 0:0 mode=0700) doveadm(restore@backup.invalid): Error: chdir(/root) failed: Permission denied Here I think doveadm import tries to do a chdir to the users HOME Directory and does it wrong. It uses the bash environment variable $HOME instead of
I think there are two independent errors. First: the users home information as shown by doveadm user.
Why do I think so, because if I manually export the bash environment HOME to the Home Directory of the user I want to import to I don't receive this error anymore.
Example: export HOME="/mailhome/userA" doveadm import -u userA maildir:/backup/userA Backup ALL; -> No Error export HOME="/root" doveadm import -u userA maildir:/backup/userA Backup ALL; -> Error as seen above.
Yes, this was my actual problem. So doveadm is really doing something wrong.
Second: That was not my original problem :)
If the first error is a bug or a feature I don't know, but doveadm import works correct with or without this error shown. At least for the things I have done.
Yes, it works. But personally I think it shouldn't emit errors if everything works as expected...
I'll just work around it.
-- Ralf Hildebrandt Geschäftsbereich IT | Abteilung Netzwerk Charité - Universitätsmedizin Berlin Campus Benjamin Franklin Hindenburgdamm 30 | D-12203 Berlin Tel. +49 30 450 570 155 | Fax: +49 30 450 570 962 ralf.hildebrandt@charite.de | http://www.charite.de
- Ralf Hildebrandt <r@sys4.de>:
I'm using 2:2.2.18-1~auto+91, but the warning has been around for ages :)
Gone at least since 2:2.2.21-1~auto+18
-- Ralf Hildebrandt Geschäftsbereich IT | Abteilung Netzwerk Charité - Universitätsmedizin Berlin Campus Benjamin Franklin Hindenburgdamm 30 | D-12203 Berlin Tel. +49 30 450 570 155 | Fax: +49 30 450 570 962 ralf.hildebrandt@charite.de | http://www.charite.de
participants (5)
-
Daniel Tröder
-
Jost Krieger
-
Philipp Faeustlin
-
Ralf Hildebrandt
-
Ralf Hildebrandt