How to import an mbox to an existing user as a new mailbox
Greetings. I have a bunch of mbox files that I want to import to an existing user, each into a new mailbox. That is, I want to import the file project1.mbox to user Foo, into a newly-created mailbox called "Project 1". Is there a dovecot tool to do this on the server?
--Paul Hoffman
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Sun, 2 Aug 2015, Paul Hoffman wrote:
Greetings. I have a bunch of mbox files that I want to import to an existing user, each into a new mailbox. That is, I want to import the file project1.mbox to user Foo, into a newly-created mailbox called "Project 1". Is there a dovecot tool to do this on the server?
do you have access to the file system of the mail storage? Can you call doveadm on the server? What mail storage do you use now, Maildir, mbox, ... ?
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1
iQEVAwUBVb8Jt3z1H7kL/d9rAQKCrAf9Em6faGXb0KFHcYp/kuf449P/Dxbinw4x 8aZKalHoarJzmPszQGWWqDxadaaKD0m61aCMWZ2ZM+FQrzPBA5nD/4ipRVtY9UZm hPXhnZ6ZDuMPosz9nNJlvqno6o17d4R8Gjf4EBjV1hva0cQr48FQv4d9K8bHCT/c 11WspPnT4EA0zYL3omygkA77d/8EUhxxp2Ju2eQ7ZVPH2UJUj2Ojfn4+NovqmqZs YYvIjzgDC+1B3+kvCgOm6o737XL1urozp3Rj1ccJ5zaB6dMkhUpbR172EHhZ4tM1 th1D0FsI1M7NawIsGsFmcl4m/ecH0oMv/voCU0IRLtWMjFXqWqCuew== =OutZ -----END PGP SIGNATURE-----
On 2 Aug 2015, at 23:27, Steffen Kaiser wrote:
On Sun, 2 Aug 2015, Paul Hoffman wrote:
Greetings. I have a bunch of mbox files that I want to import to an existing user, each into a new mailbox. That is, I want to import the file project1.mbox to user Foo, into a newly-created mailbox called "Project 1". Is there a dovecot tool to do this on the server?
do you have access to the file system of the mail storage? Can you call doveadm on the server? What mail storage do you use now, Maildir, mbox, ... ?
Sorry for being unclear earlier. Yes, yes, mbox.
So, I take it this is a doveadm command. :-) Will this be just "import", or a combination of "mailbox" and "import"?
--Paul Hoffman
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Mon, 3 Aug 2015, Paul Hoffman wrote:
On 2 Aug 2015, at 23:27, Steffen Kaiser wrote:
On Sun, 2 Aug 2015, Paul Hoffman wrote:
Greetings. I have a bunch of mbox files that I want to import to an existing user, each into a new mailbox. That is, I want to import the file project1.mbox to user Foo, into a newly-created mailbox called "Project 1". Is there a dovecot tool to do this on the server?
do you have access to the file system of the mail storage? Can you call doveadm on the server? What mail storage do you use now, Maildir, mbox, ... ?
Sorry for being unclear earlier. Yes, yes, mbox.
copy project1.mbox to '/path/to/user/mail/storage/Project 1.mbox' and make sure, the user has file system rights to access the file at all.
Maybe, you need to add the new mailbox to the user's subscription file, in order to have it show up.
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1
iQEVAwUBVb93wnz1H7kL/d9rAQIsaQf8DMKWBQkIDcpj5T7+c4Fo4hK8CcSllEq3 1bjERFLVDXxMnMzInhwtUjlcoCnjgSI0D7bC4xe6xaO/viXCSFi94H56nGMrApih 0wkD0e3Dd3P44T+C/X1hZl6eAj6PPKETvWt8z00amUrtyhXhpGWggVeqQYob2YyM qprG3SuYqdsxfDGX5wOUiq0xtkLfQUQl5m60mwOiSnsv7VOCPsUl6y7XSgfb3wKv CBD23kL6cnsbLmrtqNXxGxD9RAMrTqpKEBRYw6Tj8K1xRJxbC7ysblDXK6S9ZqCi gjIs4m7pll8Ap8I45xXBD6gEZFfUy7qfhSWzkom073KivesGgh5MSw== =BbrX -----END PGP SIGNATURE-----
On 3 Aug 2015, at 7:16, Steffen Kaiser wrote:
On Mon, 3 Aug 2015, Paul Hoffman wrote:
On 2 Aug 2015, at 23:27, Steffen Kaiser wrote:
On Sun, 2 Aug 2015, Paul Hoffman wrote:
Greetings. I have a bunch of mbox files that I want to import to an existing user, each into a new mailbox. That is, I want to import the file project1.mbox to user Foo, into a newly-created mailbox called "Project 1". Is there a dovecot tool to do this on the server?
do you have access to the file system of the mail storage? Can you call doveadm on the server? What mail storage do you use now, Maildir, mbox, ... ?
Sorry for being unclear earlier. Yes, yes, mbox.
copy project1.mbox to '/path/to/user/mail/storage/Project 1.mbox' and make sure, the user has file system rights to access the file at all.
Maybe, you need to add the new mailbox to the user's subscription file, in order to have it show up.
After a week, I'm at this again. Now having read up on doveadm, I am trying the following:
sudo doveadm import -u Foo mbox:/home/phoffman/project1.mbox "Project 1" all
However, that gets the result:
Initializing mail storage from mail_location parameter failed: mbox: mbox root directory can't be a file
Which bit am I missing here?
--Paul Hoffman
On 9 Aug 2015, at 8:46, Benny Pedersen wrote:
Paul Hoffman skrev den 2015-08-09 17:40:
Initializing mail storage from mail_location parameter failed: mbox: mbox root directory can't be a file
Which bit am I missing here?
sudo doveadm import -u Foo mbox:/home/phoffman/project1/ "Project 1" all
untested
When I try this:
Fatal: Import namespace initialization failed: Initializing mail
storage from mail_location parameter failed: mkdir(/home/phoffman/project1) failed: Permission denied (euid=1013(phoffprop) egid=1013(phoffprop) missing +w perm: /home/phoffman, dir owned by 1001:1001 mode=0755)
Does this error indicate that it is trying to write to the mbox file instead of reading it? If so, why?
--Paul Hoffman
Paul Hoffman skrev den 2015-08-09 20:20:
Fatal: Import namespace initialization failed: Initializing mail storage from mail_location parameter failed: mkdir(/home/phoffman/project1) failed: Permission denied (euid=1013(phoffprop) egid=1013(phoffprop) missing +w perm: /home/phoffman, dir owned by 1001:1001 mode=0755)
Does this error indicate that it is trying to write to the mbox file instead of reading it? If so, why?
nope, you have to tell dovecot auth backend more how to write to homedir of 'id proffprop'
uid and gid does not match
as i read it, proffprop have uid 1001 and dovecot tryed to write to 1013
search that error and solve it
Paul Hoffman skrev den 2015-08-09 20:20:
Fatal: Import namespace initialization failed: Initializing mail storage from mail_location parameter failed: mkdir(/home/phoffman/project1) failed: Permission denied (euid=1013(phoffprop) egid=1013(phoffprop) missing +w perm: /home/phoffman, dir owned by 1001:1001 mode=0755)
Does this error indicate that it is trying to write to the mbox file instead of reading it? If so, why?
nope, you have to tell dovecot auth backend more how to write to homedir of 'id proffprop'
uid and gid does not match
as i read it, proffprop have uid 1001 and dovecot tryed to write to 1013
search that error and solve it There are prob. a lot of ways around this, but the easiest would most
On 08/09/15 13:36, Benny Pedersen wrote: likely be something like: # chmod o+w /home/phoffman
Edgar Pettijohn skrev den 2015-08-09 20:58:
search that error and solve it There are prob. a lot of ways around this, but the easiest would most likely be something like: # chmod o+w /home/phoffman
why use dovecot ?
that will make it totaly insecure, dont do it !
i have here no access on groups and others not even on READS
post dovecot -n
and lets help solve it
On 08/09/15 14:13, Benny Pedersen wrote:
Edgar Pettijohn skrev den 2015-08-09 20:58:
search that error and solve it There are prob. a lot of ways around this, but the easiest would most likely be something like: # chmod o+w /home/phoffman
why use dovecot ?
that will make it totaly insecure, dont do it !
afterwards #chmod o-w /home/phoffman
i have here no access on groups and others not even on READS
post dovecot -n
and lets help solve it
participants (4)
-
Benny Pedersen
-
Edgar Pettijohn
-
Paul Hoffman
-
Steffen Kaiser