Bug report: automatic mbox to dovecot converter doesn't set up permissions correctly

Webcart

Verified User
Joined
Jan 14, 2004
Messages
398
Hello,

This is a bug report for mbox to dovecot automatic conversion which is done during account restore: http://www.directadmin.com/features.php?id=689

Apparently, the conversion doesn't set up permissions correctly so mailboxes of the restored accounts don't receive any mails until permissions are fixed with ./set_permissions.sh email
 
Hello,

Which version of DA was used to create the backup and which version of DA was used to restore the backup?

I recall adressing that a while back.
I tried to duplicate it on our build systems (both 1.32.1) but user:mail permissions were ok after the automatic restore conversion.

John
 
Hello,

Thank you for the prompt response,

Which version of DA was used to create the backup
Version 1.27.2 compiled on CentOS 4.1 64-bit

which version of DA was used to restore the backup?
Version 1.31.5 compiled on CentOS 5.0 64-bit

I recall adressing that a while back.
I tried to duplicate it on our build systems (both 1.32.1) but user:mail permissions were ok after the automatic restore conversion.
I've checked http://www.directadmin.com/versions.php but didn't find any reference to this problem between versions 1.31.5 and 1.321.

Thank you.
 
I think I figured this out: it happens when account which previously used a dedicated IP (on the old box) is restored with a shared IP. Here are how permissions of imap directories look like:
Code:
755 drwxr-xr-x root:root /
711 drwx--x--x root:root /home
711 drwx--x--x user:user /home/user
770 drwxrwx--- user:mail /home/user/imap
770 drwxrwx--- user:mail /home/user/imap/example.com
770 drwxrwx--- [COLOR="Blue"]root:root[/COLOR] /home/user/imap/example.com/support
770 drwxrwx--- user:mail /home/user/imap/example.com/support/Maildir
770 drwxrwx--- user:mail /home/user/imap/example.com/support/Maildir/cur
 
I think I've found the spot in the code. The convertor function lowers it's access permission to "nobody" before it exits, then after the function DA was calling the recursive permission setting, but it didn't have root access when doing it, thus nothing happened. The convertor function did set the permissions on all files it convered *within* the Maildir folder, which is why it's correct from Maildir down, but just not at the user folder.

If anyone wants to try out this fix, let me know, else it will just be avaiable for the next release. I've already added the simple 1 liner theoretical fix in the code. Based on where it is, it will happen if the old system was using mbox, and the new one isn't, but nailing down the extact conditions may be tricky.. the IP used *shouldn't* have anything to do with it, but stranger things have happened before ;) We'll see if this find fixes it anyway (I haven't been able to duplicate the issue here, hence I put theoretical fix)

John
 
Back
Top