spool move/rename question
Hi folks. Our mail server's spools are structured like this:
/var/mail/<domain>/<user>
We have an existing user with a lot of mail that we need to move from one domain to another. Our mail system is database-backed so changing the account is trivial, but can I just move the <user> directory from the structure above from one <domain> directory to another and expect everything to be ok? Or is there a better approach? (of course I'll do a backup first)
Thanks,
-Dave
-- Dave McGuire, AK4HZ New Kensington, PA
On 10/8/23 11:27, Dave McGuire wrote:
Hi folks. Our mail server's spools are structured like this:
/var/mail/<domain>/<user>
We have an existing user with a lot of mail that we need to move from one domain to another. Our mail system is database-backed so changing the account is trivial, but can I just move the <user> directory from the structure above from one <domain> directory to another and expect everything to be ok? Or is there a better approach? (of course I'll do a backup first)
I probably should've mentioned that the only thing that touches the spools is dovecot; I'm using dovecot's lda for receiving mail.
-Dave
-- Dave McGuire, AK4HZ New Kensington, PA
On Sun, 2023-10-08 at 11:27 -0400, Dave McGuire wrote:
We have an existing user with a lot of mail that we need to move from one domain to another. Our mail system is database-backed so changing the account is trivial, but can I just move the <user> directory from the structure above from one <domain> directory to another and expect everything to be ok? Or is there a better approach? (of course I'll do a backup first)
Moving the directory works fine.
The database part can be trickier than it seems at first. Don't forget to update the aliases both to and from the renamed user. You might also need to update the databases for any webmail or caldav/carddav applications you run. And if you're using mysql, I haven't checked in a few years, but it didn't used to enforce foreign key constraints or support cascading updates, so beware that updating one table may not automatically update dependent tables.
On 10/8/23 20:40, Michael Orlitzky wrote:
We have an existing user with a lot of mail that we need to move from
one domain to another. Our mail system is database-backed so changing the account is trivial, but can I just move the <user> directory from the structure above from one <domain> directory to another and expect everything to be ok? Or is there a better approach? (of course I'll do a backup first)
Moving the directory works fine.
Perfect, that's exactly what I needed to know. Thanks!
The database part can be trickier than it seems at first. Don't forget to update the aliases both to and from the renamed user. You might also need to update the databases for any webmail or caldav/carddav applications you run. And if you're using mysql, I haven't checked in a few years, but it didn't used to enforce foreign key constraints or support cascading updates, so beware that updating one table may not automatically update dependent tables.
The database part isn't an issue; I designed the schema. Thanks for the heads-up though.
Thanks,
-Dave
-- Dave McGuire, AK4HZ New Kensington, PA
participants (2)
-
Dave McGuire
-
Michael Orlitzky