Alternative ways of sendmail & cyrus integration [Was: Virtual domains, user@domain.com: Mailbox unknown]

Andrzej Filip anfi at priv.onet.pl
Sat Feb 28 15:05:04 EST 2004


Sebastian Hagedorn wrote:
> Andrzej Filip <anfi at priv.onet.pl> wrote:  
>>>> 3) Real Time Cyrus Integration
>>>> http://anfi.webhop.net/sendmail/rtcyrus.html
>>>
>>> if I understand the description correctly, this approach doesn't
>>> currently handle hashed spools, does it?
>>
>> It can't handle hashed spools *NOW*.
>> Making sendmail support hashing based on first letter of mailbox is
>> simple.
> 
> I don't think I'll take this route, but for completeness' sake, that's 
> not the kind of hashing Cyrus uses ... I guess you'd actually have to 
> read mailboxes.db to find out where a given user's folder is.

Cyrus supports two schemes of mailbox hashing. The old one I wrote about is 
based on first letter of mailbox name, I have not dug out algorithm used by 
the new one.

BTW checking directory presence requires much less systems call than socket 
map with its TCP session overhead.

>> Another way of "real time sendmail & cyrus integration is to make
>> sendmail use   "socket map" daemon available in CVS of Cyrus or creating
>> custom "socket map" daemon.
> 
>> Please let me know which option would you like to use yourself:
>> a) making sendmail to use regex map [regular expressions] to generate
>> "hashed" path to cyrus mailboxes
> 
> I don't think that's feasible.
> 
>> b) patching sendmail 8.12 (socketmap patch) and
> 
> I'd be OK with that. 

WARNING: patch for sendmail 8.12 does not behave properly when cyrus "socket 
map" socket is not active - the map returns "no match" (no mailbox).
I have not checked if sendmail 8.13.0.Alpha0 behaves differently.

http://www.sendmail.org/~ca/email/smenhanced.html
http://www.sendmail.org/~ca/email/patches/sendmail-8.12.7-socketmap-v4.patch
MD5=a58fecf644231d65f44226b394bea1bf  sendmail-8.12.7-socketmap-v4.patch

>> b1) using CVS version of cyrus
> 
> If I understand Ken correctly, standard Cyrus 2.2.3 supports this. It's 
> not necessary to use a version from CVS.

You understood him correctly - my memory was "too good" :)

>> b2) using custom "socket map" daemon
> 
> I'll have to think about that some more. Migrating to Cyrus 2.2 is on my 
> TODO list anyway. I guess I'll build a patched sendmail and play around 
> with the socket map feature.
> 
> -- Andrzej Filip <anfi at priv.onet.pl> is rumored to have mumbled on 
> Donnerstag, 26. Februar 2004 18:10 Uhr +0100 regarding Re: Alternative 
> ways of sendmail & cyrus integration [Was: Virtual domains, 
> user at domain.com: Mailbox unknown]:
> 
>> Below please find modified sendmail.mc lines to make sendmail check cyrus
>> mailbox existence using socket map [instead of fstat map]:
>> ----->
>> dnl
>> dnl *.mc file modifications for real time integration of cyrus and
>> sendmail
>> dnl
>> dnl It makes sendmail define user map in sendmail.cf
>> define(`LUSER_RELAY')
>> LOCAL_CONFIG
>> # cyrus - map for file stat checking
>> Kcyrus socket local:_path_to_smmapd_socket_
>> dnl
>> dnl
>> LOCAL_RULESETS
>> SLocal_localaddr
>> # Treat system mailboxes as usual
>> R$+             $: $(user $1 $)
>> R$+ <>          $@
>  
> I suppose I'd leave these two rules out, there are no system mailboxes.
> 
>> # Detect cyrus mailboxes - deliver via cyrus mailer
>> R$+             $: $1 <$(cyrus $1 $: $)>
>> R$<$+>          $# cyrus $: @$1
>> # Treat remaining as usual
>> R$*             $@
>> <-----

It needs some fixes:
cyrus map should report temporary failures
	Kcyrus socket -T<TMPF> local:_path_to_smmapd_socket_
and the rules should look for <TMPF> marker [but see the warning above]

>> I hope will publish next version next week:
>> * capable to support cyrus virtual domains
>> * milter-sender friendly
>> [current version creates problems with checking local address validity]
>  
> Could you elaborate on that? What exactly is the problem?

* cyrus virtual domains
The current version is located in rule sets which gets only user part of 
recipient address (domain is stripped).
* milter-sender
Milter-sender checks mailer selected *before* alias expansion. If cyrus* is 
selected then user is valid if local mailer is selected then OS account 
presence is checked.
The current version selects cyrus mailer in rule set called *after* alias 
expansion, so milter sender sees always local mailer even if the rule set will 
change it to cyrus later.

-- 
Andrzej [en:Andrew] Adam Filip anfi at priv.onet.pl anfi at xl.wp.pl
http://anfi.webhop.net http://slashdot.org/~anfi
---
Home Page: http://asg.web.cmu.edu/cyrus
Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html




More information about the Info-cyrus mailing list