Captive mailbox in Cyrus IMAP?

Greg A. Woods woods-cyrus at weird.com
Wed Nov 29 16:17:19 EST 2006


At Wed, 29 Nov 2006 09:56:04 -0500,
Nik Conwell wrote:
> 
> Thanks to all for the suggestions.  They were very good so I ignored  
> them.  :)
> 
> I've patched imapd.c (cmd_login and cmd_authenticate) so that the  
> presence and contents of {config_dir}/captive/{username} indicate the  
> actual user that should be logged in (providing it begins with  
> disabled).  So for example if /var/lib/imap/captive/smith contains  
> "disabled-archiving", then when smith logs in, it will really be  
> taken as disabled-archiving is logging in.   disabled-archiving has  
> previously been primed with a message and has an ACL of lr to prevent  
> updates.

That sounds like a nice and nasty little hack!  It should work very fine
and it nicely separates the issues of showing the user a read-only
message (without worrying about decent MOTD support in the client, or
even that it's an IMAP client) from the issues of whether or not
incoming mail for the user is allowed to continue or is bounced, etc.

The only thing I don't like is use of a file in the filesystem as a flag
instead of using a proper configuration file whos contents can be
version controlled and more easily backed up, restored, documented,
centralized, shared, and understood.  I.e. tables in files are much
better suited to this use.  (unless perhaps you happen to have a brain
that is twisted into the kind of insanity that resulted in qmail and its
ilk :-))

(and don't worry about searching such a table -- a straight linear
search of a simple table in a normal text file will be fast enough and
quite obviously much simpler than anything more sophisticated, at least
until you've got many thousands of entries.  "Premature optimization is
the root of all evil in programming." -- C.A.R. Hoare, who said that a
very long time ago (in IT-years) and it's still 100% true, if not even
more so)


> I've tried swapping things back and forth with Apple Mail and  
> Mulberry and things seem to work OK.  I don't know how this will work  
> with a murder.

That could either be tricky, or relatively transparent so long as you
create the flag file on all backend machines.

Did you do anything about the "seen" state of the unread message?  Maybe
I'm just ignorant of how a read-only inbox will behave though -- perhaps
the message will always appear new (and a POP client will always
download it anew too) and so nothing need be done special?

-- 
						Greg A. Woods

H:+1 416 218-0098 W:+1 416 489-5852 x122 VE3TCP RoboHack <woods at robohack.ca>
Planix, Inc. <woods at planix.com>       Secrets of the Weird <woods at weird.com>


More information about the Info-cyrus mailing list