From m@isrv.tric.ru  Wed Sep 22 13:40:02 2004
Return-Path: <m@isrv.tric.ru>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 975E016A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 22 Sep 2004 13:40:02 +0000 (GMT)
Received: from relay.tric.ru (gw.tric.ru [213.183.106.14])
	by mx1.FreeBSD.org (Postfix) with ESMTP id A608043D41
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 22 Sep 2004 13:40:00 +0000 (GMT)
	(envelope-from m@isrv.tric.ru)
Received: from mail.tric.tomsk.gov.ru (mail.tric.tomsk.gov.ru [213.183.106.10])
	by relay.tric.ru (8.12.11/8.12.11) with ESMTP id i8MDeKnf005516
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 22 Sep 2004 20:39:58 +0659 (NOVST)
Received: from isrv.tric.ru
	by mail.tric.tomsk.gov.ru (8.13.1/8.13.1) with ESMTP id i8MDdjYh049683;
	Wed, 22 Sep 2004 20:39:46 +0700 (NOVST)
	(envelope-from m@isrv.tric.ru)
Received: (from m@localhost)
	by isrv.tric.ru (8.13.1/8.13.1/Submit) id i8MDdjNL049682;
	Wed, 22 Sep 2004 20:39:45 +0700 (NOVST)
	(envelope-from m)
Message-Id: <200409221339.i8MDdjNL049682@isrv.tric.ru>
Date: Wed, 22 Sep 2004 20:39:45 +0700 (NOVST)
From: "Michael O. Boev" <mike@tric.tomsk.gov.ru>
Reply-To: "Michael O. Boev" <mike@tric.tomsk.gov.ru>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [PATCH] update and fix Cyrus lookup features of mail/sendmail
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         71995
>Category:       ports
>Synopsis:       [PATCH] update and fix Cyrus lookup features of mail/sendmail
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    dinoex
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Wed Sep 22 13:40:21 GMT 2004
>Closed-Date:    Fri Oct 15 22:00:29 CEST 2004
>Last-Modified:  Fri Oct 15 22:00:29 CEST 2004
>Originator:     Michael O. Boev
>Release:        FreeBSD 4.10-RELEASE i386
>Organization:
Tomsk Regional Information Center
>Environment:
System: FreeBSD isrv.tric.ru 4.10-RELEASE FreeBSD 4.10-RELEASE #3: Fri May 28 14:45:40 NOVST 2004 root@isrv.tric.ru:/usr/obj/usr/src/sys/ISRV i386


	
>Description:
	Including patches containing $Log$ keywords seems erratic.
	as cvs grows $Log$ expansions, the patches break and real lines
	get truncated. So I regenerated Andrzej'z files, replacing
	$Log$ with a plain "Log".
	
	Also added a straightforward ruleset, FEATURE(`ckuser_cyrus'),
	which I believe works more transparently and fits default installations
	of Cyrus.
>How-To-Repeat:
	To see the breakage of mrs_* files, type a 
	cd /usr/ports/mail/sendmail && make SENDMAIL_WITH_CYRUSLOOKUP=yes patch
	and then compare cf/feature/mrs* with what's available at the original site.
>Fix:
	Please, consider the following diff:

--- sendmail.port begins here ---
diff -ruN sendmail.orig/files/CYRUS_LOOKUP sendmail/files/CYRUS_LOOKUP
--- sendmail.orig/files/CYRUS_LOOKUP	Wed Sep 22 19:56:41 2004
+++ sendmail/files/CYRUS_LOOKUP	Wed Sep 22 20:06:29 2004
@@ -8,16 +8,19 @@
 
 They are based on the idea and work by
 
-Andrzej Filip
+Andrzej Filip, http://anfi.homeunix.net/sendmail/rtcyrus2.html
+and
+Mike Boev, http://tric.ru/users/mike/ckuser_cyrus/
 
-published at
-
-http://anfi.homeunix.net/sendmail/rtcyrus2.html.
-
-Please, use this url to learn all configuration details
+Please, use these urls to learn all configuration details
 (although a quick recipe is provided below) and may be to give
-credits to the author.
-
+credits to the authors.
+******************************************************************
+IMPORTANT:
+Now that the mrs_cyrus.m4 has been updated, you may need to adjust
+the modifications you made to your .mc file if you used the old one! 
+See http://anfi.homeunix.net/sendmail/rtcyrus2.html for current 
+installation instructions.
 ******************************************************************
 
 HOW TO :
@@ -52,29 +55,25 @@
     and a couple of others.
 
 2.  As per the `install-configure' from Cyrus IMAP server's documentation,
-    in the simplest case, you add:
+    in the simplest case, you added:
     
     define(`confLOCAL_MAILER', `cyrusv2')dnl
     MAILER(`cyrusv2')dnl
     
     to your sendmail's .mc file to make local delivery to Cyrus mailboxes.    
-    Per the instructions, provided by Andrzej Filip (see the above URL),
-    these lines should become:
+    Now, simply add (somewhere near other FEATURES, before MAILER lines):
     
-    define(`LOCAL_RELAY',`mrs_cyrus_user:stripdom')dnl
-    FEATURE(`mrs')dnl
-    FEATURE(`mrs_cyrus')dnl
-    MODIFY_MAILER_FLAGS(`CYRUSV2',`-A5')dnl
-    MAILER(`cyrusv2')dnl
+    FEATURE(`ckuser_cyrus')dnl
     
     for sendmail to start rejecting local addresses for nonexisting and 
     full mailboxes. Rebuild your sendmail.cf, restart sendmail, and enjoy!
     
-    If your configuration is more complicated than the above two lines,
-    read Andrzej's article. It contains more examples.
+    If your configuration is more complicated than just defining Cyrus
+    as your local mailer, read Andrzej's article. It covers more of the 
+    other cases.
     
 ******************************************************************
 
-2004, April 8th
+2004, September 16th
 Michael O. Boev,
 mike@tric.ru.
diff -ruN sendmail.orig/files/cyruslookup.patch sendmail/files/cyruslookup.patch
--- sendmail.orig/files/cyruslookup.patch	Wed Sep 22 19:56:41 2004
+++ sendmail/files/cyruslookup.patch	Wed Sep 22 20:15:43 2004
@@ -1,23 +1,48 @@
-*** cf/m4/proto.m4	2004/03/09 15:49:38	1.1
---- cf/m4/proto.m4	2004/03/10 20:29:48
-***************
-*** 1299,1304 ****
---- 1299,1307 ----
-  R< error : $- : $+ > $*		$#error $@ $(dequote $1 $) $: $2
-  R< error : $+ > $*		$#error $: $1
-  R< local : $* > $*		$>CanonLocal < $1 > $2
-+ ifdef(`_MRS_RELAY_',`dnl
-+ R< $={MRS} : $* > $*	$@ $> $1 < $2 > $3
-+ dnl')
-  dnl it is $~[ instead of $- to avoid matches on IPv6 addresses
-  R< $~[ : $+ @ $+ > $*<$*>$*	$# $1 $@ $3 $: $2<@$3>	use literal user
-  R< $~[ : $+ > $*		$# $1 $@ $2 $: $3	try qualified mailer
---- /dev/null	Wed Apr  7 20:03:20 2004
-+++ cf/feature/mrs.m4	Tue Mar 23 14:00:30 2004
+diff -ruN cf.orig/feature/ckuser_cyrus.m4 cf/feature/ckuser_cyrus.m4
+--- cf.orig/feature/ckuser_cyrus.m4	Thu Jan  1 07:00:00 1970
++++ cf/feature/ckuser_cyrus.m4	Wed Sep 22 19:53:53 2004
+@@ -0,0 +1,34 @@
++divert(-1)
++# Written by Mike Boev <mike@tric.ru>, 2004.
++# Homepage: http://tric.ru/users/mike/ckuser_cyrus/
++# Inspired by: mrs_cyrus.m4 by Andrzej Adam Filip
++#
++# By using this file, you agree to the terms and conditions set
++# forth in the LICENSE file which can be found at the top level of
++# the sendmail distribution.
++#
++divert(0)
++VERSIONID(`Id: ckuser_cyrus.m4,v 1.4 2004/09/21 19:02:17 m Exp ')
++divert(-1)
++define(`CYRUS_SMMAPD_SOCKET',
++        ifelse(len(X`'_ARG_), `1', `local:/var/imap/socket/smmapd', _ARG_))
++
++MODIFY_MAILER_FLAGS(`CYRUSV2',`+5')
++
++LOCAL_CONFIG
++# Cyrus smmapd(8)'s map for verifying mailboxes of local recipients
++Kcyrus socket -a<OK> -T<TMPF> CYRUS_SMMAPD_SOCKET
++
++LOCAL_RULESETS
++SLocal_localaddr
++R$+			$: $> "ckuser_cyrus" $1
++
++Sckuser_cyrus
++#Query smmapd(8)
++R$+			$: <!> $1 $| $(cyrus $1 $: $)
++#Cyrus OK, skip
++R<!> $* $| $* <OK>	$@ $1					
++#Over quota or lookup failure
++R<!> $* $| $* <TMPF>	$# error $@ 4.3.0 $: "451 TEMPFAIL."	
++#Mailbox doesn't exist or its ACL forbids posting
++R<!> $* $| $*		$# error $@ 5.1.1 $: "550 Mailbox is not available."
+diff -ruN cf.orig/feature/mrs.m4 cf/feature/mrs.m4
+--- cf.orig/feature/mrs.m4	Thu Jan  1 07:00:00 1970
++++ cf/feature/mrs.m4	Wed Sep 22 19:54:56 2004
 @@ -0,0 +1,25 @@
 +divert(-1)
 +dnl
-+dnl Updates: http://anfi.homeunix.net/sendmail/mrs.html
++dnl Updates: http://anfi.webhop.net/sendmail/mrs.html
 +dnl
 +dnl By using this file, you agree to the terms and conditions set
 +dnl forth in the LICENSE file which can be found at the top level of
@@ -28,11 +53,7 @@
 +dnl THE FEATURE REQUIRES PATCHING cf/m4/proto.m4
 +dnl SEE THE LINK AFTER "Updates:"
 +dnl
-+dnl $Log: cyruslookup.patch,v $
-+dnl Revision 1.2  2004/05/03 04:04:06  dinoex
-+dnl - update URL in patch to new location
-+dnl Submitted by:	Adam Filip
-+dnl
++dnl Log: mrs.m4,v 
 +dnl Revision 8.3  2004/03/18 21:39:22  anfi
 +dnl Changed comments prefixes to dnl to avoid m4 expansions
 +dnl
@@ -40,13 +61,14 @@
 +dnl Added "Updates:" web link.
 +dnl
 +divert(0)
-+VERSIONID(`$Id: cyruslookup.patch,v 1.2 2004/05/03 04:04:06 dinoex Exp $')
++VERSIONID(`Id: mrs.m4,v 8.3 2004/03/18 21:39:22 anfi Exp ')
 +divert(-1)
 +
 +define(`_MRS_RELAY_', `')
---- /dev/null	Thu Apr  8 15:55:21 2004
-+++ cf/feature/mrs_cyrus.m4	Thu Apr  1 21:37:05 2004
-@@ -0,0 +1,74 @@
+diff -ruN cf.orig/feature/mrs_cyrus.m4 cf/feature/mrs_cyrus.m4
+--- cf.orig/feature/mrs_cyrus.m4	Thu Jan  1 07:00:00 1970
++++ cf/feature/mrs_cyrus.m4	Wed Sep 22 19:55:05 2004
+@@ -0,0 +1,77 @@
 +divert(-1)
 +dnl
 +dnl Updates: http://anfi.homeunix.net/sendmail/rtcyrus2.html
@@ -57,10 +79,9 @@
 +dnl
 +dnl	Contributed by Andrzej Filip
 +dnl
-+dnl $Log: cyruslookup.patch,v $
-+dnl Revision 1.2  2004/05/03 04:04:06  dinoex
-+dnl - update URL in patch to new location
-+dnl Submitted by:	Adam Filip
++dnl Log: mrs_cyrus.m4,v
++dnl Revision 8.8  2004/08/11 18:20:05  anfi
++dnl "stipdom" replaced by "dummy"
 +dnl
 +dnl Revision 8.7  2004/04/01 14:29:50  anfi
 +dnl Added "stripdom" handling in mrs_cyrus_user.
@@ -78,7 +99,7 @@
 +define(`_MRS_CYRUS_',`')
 +
 +divert(0)
-+VERSIONID(`$Id: cyruslookup.patch,v 1.2 2004/05/03 04:04:06 dinoex Exp $')
++VERSIONID(`Id: mrs_cyrus.m4,v 8.8 2004/08/11 18:20:05 anfi Exp ')
 +divert(-1)
 +define(`CYRUS_SMMAPD_SOCKET',
 +        ifelse(len(X`'_ARG_), `1', `/var/imap/socket/smmapd', _ARG_))
@@ -101,7 +122,7 @@
 +R<$*> $+ <@$*> $| $* <TMPF>	$# error $@ 4.3.0 $: "451 Temporary system failure. Please try again later."
 +R<$*> $+ <@$*> $| $* <OK>	$# cyrusv2 $@ dummy $: $4
 +R<$*> $+ <@$*> $| $*		$: <$1> $2 <@$3>
-+R<stripdom> $+ <@stripdom>	$@ $1
++R<dummy> $+ <@dummy>	$@ $1
 +R< $~[ : $* > $*		$>MailerToTriple < $1 : $2 > $3
 +R< $+ > $*			$>MailerToTriple < $1 > $2
 +R< > $*				$# error $@ 5.1.1 $: "550 User unknown"
@@ -125,3 +146,16 @@
 +R<dummy> $+ <@$={VirtCyrus}> $| $*		$# error $@ 5.1.1 $: "550 User unknown"
 +R<dummy> $=L <@$*>		$# ifdef(`confLOCAL_MAILER',confLOCAL_MAILER,`local') $: @$1
 +R<dummy> $* <@$*>		$# ifdef(`confLOCAL_MAILER',confLOCAL_MAILER,`local') $: $1
+diff -ruN cf.orig/m4/proto.m4 cf/m4/proto.m4
+--- cf.orig/m4/proto.m4	Wed Sep 22 20:15:04 2004
++++ cf/m4/proto.m4	Wed Sep 22 19:52:41 2004
+@@ -1315,6 +1315,9 @@
+ R< error : $- : $+ > $*		$#error $@ $(dequote $1 $) $: $2
+ R< error : $+ > $*		$#error $: $1
+ R< local : $* > $*		$>CanonLocal < $1 > $2
++ifdef(`_MRS_RELAY_',`dnl
++R< $={MRS} : $* > $*	$@ $> $1 < $2 > $3
++dnl')
+ dnl it is $~[ instead of $- to avoid matches on IPv6 addresses
+ R< $~[ : $+ @ $+ > $*<$*>$*	$# $1 $@ $3 $: $2<@$3>	use literal user
+ R< $~[ : $+ > $*		$# $1 $@ $2 $: $3	try qualified mailer
--- sendmail.port ends here ---
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->dinoex 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Fri Sep 24 05:17:32 GMT 2004 
Responsible-Changed-Why:  
Over to maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=71995 
State-Changed-From-To: open->feedback 
State-Changed-By: dinoex 
State-Changed-When: Fri Sep 24 08:09:51 CEST 2004 
State-Changed-Why:  


Your patches do not apply, 

Patching file files/cyruslookup.patch using Plan A... 
Hunk #1 succeeded at 1. 
Hunk #2 failed at 53. 
Hunk #3 failed at 61. 
Hunk #4 failed at 79. 
Hunk #5 failed at 99. 
Hunk #6 succeeded at 114 (offset -8 lines). 
Hunk #7 succeeded at 138 (offset -8 lines). 
4 out of 7 hunks failed--saving rejects to files/cyruslookup.patch.rej 
Hmm...  Ignoring the trailing garbage. 

Please cvsup and rediff. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=71995 

From: "Michael O. Boev" <mike@tric.tomsk.gov.ru>
To: Dirk Meyer <dinoex@FreeBSD.org>, freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: ports/71995: [PATCH] update and fix Cyrus lookup features of
 mail/sendmail
Date: Mon, 27 Sep 2004 09:20:30 +0700

 Hmm, very strange!
 
 OK, I did it again, i.e.
 cvs get, copied new files over the old ones, cvs diff. I wonder if it 
 sucks again. Should it happen, it must be the $log lines that seem to 
 break the very patches, and also patches for these patches. Thus, I put 
 the new files too, to be sure.
 
 The new patch is at:
 http://tric.ru/users/mike/20040927/sendmail.patch
 The new files are:
 http://tric.ru/users/mike/20040927/cyruslookup.patch
 http://tric.ru/users/mike/20040927/CYRUS_LOOKUP
 
 > Synopsis: [PATCH] update and fix Cyrus lookup features of mail/sendmail
 > 
 > State-Changed-From-To: open->feedback
 > State-Changed-By: dinoex
 > State-Changed-When: Fri Sep 24 08:09:51 CEST 2004
 > State-Changed-Why: 
 > 
 > 
 > Your patches do not apply,
 > 
 > Patching file files/cyruslookup.patch using Plan A...
 > Hunk #1 succeeded at 1.
 > Hunk #2 failed at 53.
 > Hunk #3 failed at 61.
 > Hunk #4 failed at 79.
 > Hunk #5 failed at 99.
 > Hunk #6 succeeded at 114 (offset -8 lines).
 > Hunk #7 succeeded at 138 (offset -8 lines).
 > 4 out of 7 hunks failed--saving rejects to files/cyruslookup.patch.rej
 > Hmm...  Ignoring the trailing garbage.
 > 
 > Please cvsup and rediff.
 > 
 > http://www.freebsd.org/cgi/query-pr.cgi?pr=71995
 
State-Changed-From-To: feedback->analyzed 
State-Changed-By: dinoex 
State-Changed-When: Mon Oct 11 08:10:49 CEST 2004 
State-Changed-Why:  
updated patch availible 
http://people.freebsd.org/~dinoex/ports/sendmail/files/cyruslookup.patch 

Will be commited once the freeze is lifted. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=71995 
State-Changed-From-To: analyzed->closed 
State-Changed-By: dinoex 
State-Changed-When: Tue Oct 12 06:21:41 CEST 2004 
State-Changed-Why:  
committed, thanks. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=71995 

From: Angelo Turetta <aturetta@commit.it>
To: freebsd-gnats-submit@FreeBSD.org, mike@tric.tomsk.gov.ru,
	dinoex@FreeBSD.org
Cc:  
Subject: Re: ports/71995: [PATCH] update and fix Cyrus lookup features of
 mail/sendmail
Date: Fri, 15 Oct 2004 21:31:55 +0200

 This is a multi-part message in MIME format.
 --------------010607070505010403010409
 Content-Type: text/plain; charset=us-ascii; format=flowed
 Content-Transfer-Encoding: 7bit
 
 (Dirk, sorry if you'll end up receiving two msgs, I'm not sure if GNATS 
 notifies responsible about follow-ups...)
 
 This was committed on Oct 12, but the resulting files/cyruslookup.patch 
 doesn't apply (from what I understand, some lines got duplicated)
 
 You can verify by:
 
      make -DSENDMAIL_WITH_CYRUSLOOKUP clean patch
 
 the attached diff fixes the 'patch' stage, but I can't judge whether the 
 resulting file is working as due. Please review.
 
 Hope this helps
 Angelo.
 
 --------------010607070505010403010409
 Content-Type: text/x-diff;
  name="patch-sendmail-cyrus.diff"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline;
  filename="patch-sendmail-cyrus.diff"
 
 Index: files/cyruslookup.patch
 ===================================================================
 RCS file: /home/ncvs/ports/mail/sendmail/files/cyruslookup.patch,v
 retrieving revision 1.3
 diff -u -r1.3 cyruslookup.patch
 --- files/cyruslookup.patch	12 Oct 2004 04:21:01 -0000	1.3
 +++ files/cyruslookup.patch	15 Oct 2004 12:41:34 -0000
 @@ -39,34 +39,6 @@
  diff -ruN cf.orig/feature/mrs_cyrus.m4 cf/feature/mrs_cyrus.m4
  --- cf.orig/feature/mrs_cyrus.m4      Thu Jan  1 07:00:00 1970
  +++ cf/feature/mrs_cyrus.m4   Wed Sep 22 19:55:05 2004
 -@@ -0,0 +1,77 @@
 -+divert(-1)
 -+dnl
 -+dnl Updates: http://anfi.webhop.net/sendmail/mrs.html
 -+dnl
 -+dnl By using this file, you agree to the terms and conditions set
 -+dnl forth in the LICENSE file which can be found at the top level of
 -+dnl the sendmail distribution (sendmail-8.12).
 -+dnl
 -+dnl	Contributed by Andrzej Filip
 -+dnl
 -+dnl THE FEATURE REQUIRES PATCHING cf/m4/proto.m4
 -+dnl SEE THE LINK AFTER "Updates:"
 -+dnl
 -+dnl $Log: mrs.m4,v $
 -+dnl Revision 8.3  2004/03/18 21:39:22  anfi
 -+dnl Changed comments prefixes to dnl to avoid m4 expansions
 -+dnl
 -+dnl Revision 8.2  2004/03/15 09:14:28  anfi
 -+dnl Added "Updates:" web link.
 -+dnl
 -+divert(0)
 -+VERSIONID(`$Id: mrs.m4,v 8.3 2004/03/18 21:39:22 anfi Exp $')
 -+divert(-1)
 -+
 -+define(`_MRS_RELAY_', `')
 ---- /dev/null	Thu Apr  8 15:55:21 2004
 -+++ cf/feature/mrs_cyrus.m4	Thu Apr  1 21:37:05 2004
  @@ -0,0 +1,74 @@
  +divert(-1)
  +dnl
 
 --------------010607070505010403010409--
 
State-Changed-From-To: closed->analyzed 
State-Changed-By: dinoex 
State-Changed-When: Fri Oct 15 21:56:33 CEST 2004 
State-Changed-Why:  
I will take care of it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=71995 
State-Changed-From-To: analyzed->closed 
State-Changed-By: dinoex 
State-Changed-When: Fri Oct 15 22:00:18 CEST 2004 
State-Changed-Why:  
committed, thanks. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=71995 
>Unformatted:
