[Dovecot] Shared Mailboxes, Per User SEEN flag and Mailing lists

Peter Fern dovecot at obfusc8.org
Sat Nov 19 18:13:19 EET 2005


Are you familiar with symlinking/hardlinking under unix?  If not, it's 
fairly straight forward, and yes - they are like file aliases.  I 
suggest you google for it to see how it works, or 'man ln'.  You'll need 
to understand this to make the solution below work.

For your scenario, linking individual files into user's mailboxes 
probably isn't the best method - better to use the inbuilt shared folder 
support in dovecot.  There are two methods of provisioning shared 
mailboxes in dovecot - using the namespace configuration directives, or 
symlinking the folders in.  The namespace method will make shared 
folders available to *all* mail users, so if you want opt-in/-out you'll 
need to use the symlink method, so for your setup, this would be the 
easiest method.

A quick outline on how to make this happen:

1.  Create a central store somewhere containing your folders to be shared.
eg:
/var/mail/public/.MySQL
/var/mail/public/.PostgreSQL
etc...
2.  In each of these folders create a file called 'dovecot-shared' and 
set file permissions to 0644 and set the group to one that your mail 
users will be members of - this will determine the permissions of mails 
within the folder.
3.  When a user signs up to the folder, create a symlink to the relevant 
folder under the user's maildir.

Then just drop mails into these maildirs.  This is all a little 
off-the-cuff, so if anyone disagrees yell out.

Cheers,
Pete

Reikan - Sidney Ferreira wrote:

>     Well, here's an example of what I have in mind:
>
>     Suppose a programmers server, each one has Inbox, Outbox, etc. 
> Now, we also have the following shared boxes: C/C++, PHP/Perl, 
> HTML/CSS, MySQL, PostGreSQL.
>     Each user may signup for one or more of this shared boxes, being 
> able to mark what they read and what they didn't read.
>     The reason, as I said, is to sabe space. Imagine 12000 users, 5 
> mailboxes, 2 messages a day, it would be 117MB a day!
>     If I understood properly (what I don't think I did), this hardlink 
> would be like the file aliases, so, I woul have 1 original message of 
> 1KB and 12000 aliases to this message, wich wouldn't use much space.
>     The main point is that I want make it all web based, so, no 
> downloading-and-deleting work, but, syncronizing.
>
>     I hope this help you to help me ^^
>
> Peter Fern wrote:
>
>> If all you need is to deliver a single mail to many users at once, 
>> you might consider hardlinking the message into the mailbox - you may 
>> lose a little space (never more than one block) as the filename entry 
>> in the filesystem will require nominal space, but it's likely to be 
>> quite efficient.  Symlinking won't use any additional filespace for 
>> each link, but will use inodes... I'm not sure whether dovecot will 
>> handle a symlink for an actual mail message though - I would assume 
>> not.  In any case, this will only work properly if you are using 
>> maildirs, but then if you're not, why not? ;)
>>
>> Alternatively, the 1.0 series of dovecot does support shared folders, 
>> and I believe per-user flags are supported, though I'd like someone 
>> to confirm?  Again, this will only work easily on maildirs due to 
>> filesystem permissions and such...
>>
>> Reikan - Sidney Ferreira wrote:
>>
>>>     Hi!
>>>     Im making a small research about IMAP servers and it's features. 
>>> As the subject suggests, I want make a shared mailbox, with per user 
>>> \seen flag to work like a mailin-list works.
>>>     The reason to use 1 shared folder is simple: Imagine 12k users 
>>> sending 1KB messages each week, it will be 12+ MB of useless 
>>> information.
>>>     Many people told me that IMAP could do this, but now seem that 
>>> it is a little harder then what they made it look like.
>>>     Finally, some EXIM users told me that Dovecot could handle it a 
>>> little better than Courier, so, Im here to try to find more 
>>> information about it.
>>>     Follows the mail that I received from an EXIM user.
>>>
>>>         Sidney
>>>
>>> Bill Hacker wrote:
>>> > Reikan - Sidney Ferreira wrote:
>>> >
>>> >>     Does Exim works as IMAP?
>>> >>     Does it allow public folders?
>>> >>     The SEEN control is made by USER or MESSAGE?
>>> >>
>>> >>
>>> >
>>> > Exim is an MTA, not an IMAP (or POP) server.
>>> >
>>> > It works well with most, perhaps all, POP and IMAP servers.
>>> >
>>> > Two widely-used IMAP partners are courier-IMAP and Dovecot.
>>> > Both of these support POP as well as IMAP.
>>> > There are several others known to work.
>>> >
>>> > Folder sharing can be complex.  IMAP is more appropriate than POP, 
>>> even
>>> > if other users are on POP.
>>> >
>>> > Exim can use Maildir MBox, and other storage types, can use 
>>> several at
>>> > once, can select  the storage location, storage type, UID, GID, and
>>> > privilege mask from hard-coded, flat-file, db or RDBMS lookup, and 
>>> can
>>> > create the storage if it does not already exist.
>>> >
>>> > All/any of the above can be done on a per-user, per-domain or 
>>> per-sender
>>> > basis, and/or on combinations of the above.
>>> >
>>> > The rest is up to the IMAP and client configuration(s).
>>> >
>>> > Dovecot can handle Maildir, MBox and other.  Courier-IMAP is 
>>> optimized
>>> > for Maildirs.
>>> >
>>> > Message state assignments are the responsibility of the retrieval 
>>> agent
>>> > (IMAP/POP + MUA).
>>> > The MTA is not involved once the message has been delivered to 
>>> storage
>>> > 9or distant server).
>>> >
>>> > As an MTA may process multiple valid messages per valid 
>>> connection, not
>>> > all for the same valid user, or even same destination server, Exim 
>>> does
>>> > routing and delivery in an area that is essentially per-user OR
>>> > per-destination sensitive, but always per-message relevant, i.e. -
>>> > normally handled one at a time at the 'decision making' points.
>>> >
>>> > HTH,
>>> >
>>> > Bill Hacker
>>
>>
>>
>>
>>
>>
>>
>


More information about the dovecot mailing list