[Dovecot] folders via softlink
I have recently switched from the UW imap server to dovecot and things seem to be working nicely. One thing that I can't seem to figure out however, is how to get dovecot to show folders that are a softlink.
We run SpamAssassin. Users can use both their own personal spam folder as well as a shared spam folder. For messages that everyone would consider spam, the user can simply drag the message to the shared spam folder (messages that are only "spam to them" would go into their own spam folder).
sa-learn is then run nightly for each user against both the shared spam folder and their personal spam folder.
The shared spam folder is simply a file that everyone has rwx access to and is softlinked to ~/mail/SharedSpam. This used to work fine with UW imap because it didn't seem to care that this was a softlink. However, apparently Dovecot DOES care because when the user resets their folder list and the user selects the folder and chooses "show", they get the error message: Could not show "SharedSpam". The server refused to show it. The folder might already be shown.
I have tried editing the .subscriptions file by hand and it does cause the folder to show up, but when the user trys to use it, they get the same error.
Is there a setting somewhere I'm missing?
--
- + + + + + + + + + + + + + + + + + + + + + + + + + + + Chris Barnes AOL IM: CNBarnes chris-barnes@tamu.edu Yahoo IM: chrisnbarnes Computer Systems Manager ph: 979-845-7801 Department of Physics fax: 979-845-2590 Texas A&M University
I would suggest that mail folders *should not* follow symlinks, for a host of security reasons and performance reasons such as the ability to crash IMAP clients that WU-imapd had when following those symlinks recursively and storing the incredibly deep directory tree locally.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Am Dienstag, 8. Juni 2004 18:23 schrieb Chris Barnes:
The shared spam folder is simply a file that everyone has rwx access to and is softlinked to ~/mail/SharedSpam. This used to work fine with UW
How about simply making a normal link instead? Untested by me, but I think it'd be worth a shot.
Greetings,
Gunter
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- http://aachen.uni-dsl.de/ - Der direkte Draht in's Hochschulnetz! + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Over the centuries, mankind has tried many ways of combating the forces of evil... prayer, fasting, good works and so on. Up until Doom, no one seemed to have thought about the double-barrel shotgun. Eat leaden death, demon... -- (Terry Pratchett, alt.fan.pratchett) +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux)PGP-verschlüsselte Mails bevorzugt! +
iD8DBQFAxsZm0ORHvREo8l8RAtaOAJ9lCHSArmLwuFrbEq3Ey5VAcBB0bACgjdXw T1LfXDSXMEyJKpBP60aY3sg= =A9ub -----END PGP SIGNATURE-----
On Wed, Jun 09, 2004 at 10:12:22AM +0200, Gunter Ohrner wrote:
Am Dienstag, 8. Juni 2004 18:23 schrieb Chris Barnes:
The shared spam folder is simply a file that everyone has rwx access to and is softlinked to ~/mail/SharedSpam. This used to work fine with UW
How about simply making a normal link instead? Untested by me, but I think it'd be worth a shot.
Hardlinking a directory is a very, VERY dangerous thing to do.
Please do not attempt it unless you enjoy using newfs and restoring your corrupted filesystem from a tape backup.
Brian.
Am Mittwoch, 9. Juni 2004 21:33 schrieb Brian Candler:
The shared spam folder is simply a file that everyone has rwx access to How about simply making a normal link instead? Untested by me, but I think it'd be worth a shot. Hardlinking a directory is a very, VERY dangerous thing to do.
Yes, but hardlinking a file is nothing unusual. You should not do it with your active lockfiles or postfix mailspool but for the spam collector file it could work, provided that it can be properly locked this way.
Greetings,
Gunter
-- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- http://aachen.uni-dsl.de/ - Der direkte Draht in's Hochschulnetz! + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Strong international Encryption: Triple-ROT13 (Carsten Lechte)
http://www.iks-jena.de/mitarb/lutz/usenet/Fachbegriffe.der.Informatik.htm l#192 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+PGP-verschlüsselte Mails bevorzugt! +
On Thu, Jun 10, 2004 at 02:42:58AM +0200, Gunter Ohrner wrote:
Am Mittwoch, 9. Juni 2004 21:33 schrieb Brian Candler:
The shared spam folder is simply a file that everyone has rwx access to How about simply making a normal link instead? Untested by me, but I think it'd be worth a shot. Hardlinking a directory is a very, VERY dangerous thing to do.
Yes, but hardlinking a file is nothing unusual. You should not do it with your active lockfiles or postfix mailspool but for the spam collector file it could work, provided that it can be properly locked this way.
Sorry, that was me thinking "Maildir" again. I still can't believe that people are still using mbox in production systems :-)
Hardlinking a file like this is clearly not going to work with dotlocks (because the two dotlocks will be created in different directories!), but then the same would have been true with symlinks. It will possibly work with fcntl/flock.
Regards,
Brian.
On Tue, 2004-06-08 at 19:23, Chris Barnes wrote:
I have recently switched from the UW imap server to dovecot and things seem to be working nicely. One thing that I can't seem to figure out however, is how to get dovecot to show folders that are a softlink.
Dovecot currently follows symlinks, so I think your problem isn't symlinks themselves but something else.
Could not show "SharedSpam". The server refused to show it. The folder might already be shown.
What do log files say?
Actually I think I know. Dovecot tries to use shared index files but the first user who created them owns them. If it even had the permission to create the .imap directory. Shared access to indexes isn't really recommended with 0.99.10, so you'd probably want something like:
default_mail_env = mbox:~/mail:INBOX=/var/mail/%u:INDEX=/home/%u/mail/.indexes/
(~ doesn't work after INDEX= I think)
-- Start of PGP signed section. ] On Tue, 2004-06-08 at 19:23, Chris Barnes wrote: ] > I have recently switched from the UW imap server to dovecot and things ] > seem to be working nicely. One thing that I can't seem to figure out ] > however, is how to get dovecot to show folders that are a softlink. ] ] Dovecot currently follows symlinks,
Does dovecot still follow symlinks to work out whether something is a mail folder, if the maildir-stat-dirs.patch is installed?
Should
be something likeelse if (d->d_type != DT_UNKNOWN)
else if (d->d_type != DT_UNKNOWN && d->d_type != DT_LNK)
David Keegel djk@cybersource.com.au http://www.cyber.com.au/users/djk/ Cybersource P/L: Linux/Unix Systems Administration Consulting/Contracting
Chris Barnes chris-barnes@tamu.edu wrote:
The shared spam folder is simply a file that everyone has rwx access to and is softlinked to ~/mail/SharedSpam.
The error was between the chair and the keyboard...
I forgot to reset the permissions on the soft linked folder. Once done, everything worked perfectly.
--
- + + + + + + + + + + + + + + + + + + + + + + + + + + + Chris Barnes AOL IM: CNBarnes chris-barnes@tamu.edu Yahoo IM: chrisnbarnes Computer Systems Manager ph: 979-845-7801 Department of Physics fax: 979-845-2590 Texas A&M University
participants (6)
-
Brian Candler
-
Chris Barnes
-
David Keegel
-
Gunter Ohrner
-
Nico Kadel-Garcia
-
Timo Sirainen