ports/71995: [PATCH] update and fix Cyrus lookup features of mail/sendmail
Michael O. Boev
mike at tric.tomsk.gov.ru
Wed Sep 22 13:40:25 UTC 2004
>Number: 71995
>Category: ports
>Synopsis: [PATCH] update and fix Cyrus lookup features of mail/sendmail
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: update
>Submitter-Id: current-users
>Arrival-Date: Wed Sep 22 13:40:21 GMT 2004
>Closed-Date:
>Last-Modified:
>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 at 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 at 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 at 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:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list