4

I'm running Ubuntu Server 12.04.2 LTS as an ActiveDirectory connected mail server using dovecot and postfix. All works fine on this part.

Now we want to export the mail storage for backup purposes. I installed samba and joined it to the domain. This is what my samba share looks like:

[global]
        mangled names = No

[MailStore]
        comment = Mail Storage
        path = /srv/vmail
        valid users = Administrator
        force user = vmail
        force group = vmail

I can now access the mail storage with the Administrator account (which is the one used by the backup application).

When browsing the mail storage I see filenames containing ":" which is invalid for Windows. Dovecot uses it for adding some sort of status info to the filenames in the maildirs. I want to leave it that way. But Windows cannot read those files.

So after some googling I found the following solution supposed to fix it:

[MailStore]
        vfs objects = catia
        catia:mappings = 0x22:0xa8,0x2a:0xa4,0x2f:0xf8,0x3a:0xf7,0x3c:0xab,0x3e:0xbb,0x3f:0xbf,0x5c:0xff,0x7c:0xa6,0x20:0xb1

But although the ":" (0x3a) is mapped, it has no effect on the filenames when browsing the share with Windows Explorer. The filenames are not changed.

I've tried mangled names = Yes but that does only clobber up the filenames till unusuability. It converts all filenames with illegal characters into 8.3 format - we cannot use this for recovery. And I don't think it would have an effect on VFS settings anyway.

So why does samba not use the VFS module? I can see no errors about it in the logs. And "locate" reveals the respective library vfs_catia.so installed. The samba version is supposed to support this configuration according to docs:

# smbd -V
Version 3.6.3

1 Answers1

4

I had the same problem with 12.04 and dovecot, went Googling and have a solution.

Found a patch in this post:

Downloaded the patch (as attachment.bin) and then followed these (old) instructions: http://www.cmiss.org/cmgui/wiki/BuildingUbuntuPackagesFromSource on building an Ubuntu package from source. You want the 'samba' package.....

(create a folder somewhere with space to download 23MB....)

apt-get source samba
apt-get build-dep samba

Now you want to apply the downloaded patch to the file: source3/modules/vfs_catia.c in the samba-3.6.3 folder. I couldn't work out how to apply the diff using 'patch' so applied it manually - it's only 3 lines. Rebuild the samba package, in the samba-3.6.3/ folder:

dpkg-buildpackage -rfakeroot -b

My build borked, but it did create:

samba-3.6.3/source3/bin/catia.so

which when copied into

/usr/lib/samba/vfs/catia.so

and restarting Samba gives proper vfs catia character mapping :-)

Thanks to Günter Kukkukk for the patch!!!

Braiam
  • 69,112
JerryL
  • 56