RFE: authorized sendmail should be in ports
Reported by: |
eric@… |
Owned by: |
macports-tickets@… |
Priority:
|
Normal
|
Milestone:
|
|
Component:
|
ports
|
Version:
|
1.0
|
Keywords:
|
|
Cc:
|
|
Port:
|
|
|
|
It would be nice to be able to enable authorized sendmail from ports. This is probably
best by first completing a sendmail port, then adding a sasl variant, but it could be done
any number of ways.
Here are the instructions for building the software. Hopefully patching dlcompat is not
needed, if it is then it should either be verified that the patch is compatible with everything
else that uses dlcompat or a custom version should be installed with a different name.
Hopefully authorization can also be enabled for a released version of sendmail as well
as sendmail from cvs.
$ cvs -d cvs.opendarwin.org:/cvs/od co dlcompat
$ cd dlcompat; sudo make install
$ curl -O ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/cyrus-sasl-1.5.27.tar.gz
$ tar xzf cyrus-sasl-1.5.27.tar.gz
$ cd cyrus-sasl-1.5.27/config/
$ cp /usr/libexec/config* ./
$ curl -O http://fink.sourceforge.net/files/ltconfig
$ curl -O http://fink.sourceforge.net/files/ltmain.sh
$ cd ..
$ ./configure --with-plugindir=/usr/local/lib/sasl --libdir=/usr/local/lib --mandir=/usr/share/man --disable-krb4 --disable-gssapi --enable-login
$ vi plugins/Makefile
--
-plugins/Makefile: LDFLAGS = -L/usr/local/lib -export-dynamic -rpath $(plugindir)
+plugins/Makefile: LDFLAGS = -L/usr/local/lib -export-dynamic -module -rpath $(plugindir)
--
$ vi lib/dlopen.c lib/saslutil.c
----- begin patch -----
--- cyrus-sasl-1.5.27/lib/dlopen.c Sun Aug 13 18:44:02 2000
+++ cyrus-sasl-1.5.27-modified/lib/dlopen.c Mon May 13 16:06:01
2002
@@ -158,7 +158,7 @@
int flag;
void *library;
void *entry_point;
-#if __OpenBSD__
+#if __OpenBSD__ || __APPLE__
char adj_entryname[1024];
#else
#define adj_entryname entryname
@@ -179,7 +179,7 @@
return SASL_FAIL;
}
-#if __OpenBSD__
+#if __OpenBSD__ || __APPLE__
snprintf(adj_entryname, sizeof adj_entryname, "_%s", entryname);
#endif
---- end patch -----
---- begin patch -----
--- cyrus-sasl-1.5.27/lib/saslutil.c Wed Dec 20 22:03:43 2000
+++ cyrus-sasl-1.5.27-modified/lib/saslutil.c Mon May 13 16:18:12
2002
@@ -358,6 +358,12 @@
if (!rpool->initialized) {
getranddata(rpool->pool);
rpool->initialized = 1;
+#ifdef __APPLE__
+ {
+ long *foo = (long *)rpool->pool;
+ srandom(*foo);
+ }
+#endif /* __APPLE__ */
}
}
@@ -370,6 +376,11 @@
/* init if necessary */
randinit(rpool);
+#ifdef __APPLE__
+ for (lup=0;lup<len;lup++) {
+ buf[lup] = (char) (random() >> 8);
+ }
+#else /* __APPLE__ */
#ifdef WIN32
for (lup=0;lup<len;lup++)
buf[lup] = (char) (rand() >> 8);
@@ -377,6 +388,7 @@
for (lup=0; lup<len; lup++)
buf[lup] = (char) (jrand48(rpool->pool) >> 8);
#endif /* WIN32 */
+#endif /* __APPLE__ */
}
/* this function is just a bad idea all around, since we're not trying to
----- end patch -----
$ sudo make install
$ vi /usr/local/lib/sasl/Sendmail.conf
----- Use the system password database for authentication ------
pwcheck_method: passwd
-----
$ cvs -d cvs.opendarwin.org:/cvs/Apple co sendmail
$ vi sendmail/devtools/Site/site.config.m4
------
APPENDDEF(`confENVDEF', `-DSASL')
APPENDDEF(`conf_sendmail_LIBS', `-lsasl -ldl')
------
$ mkdir /tmp/sendmail.obj
$ mkdir /tmp/sendmail.dst
$ sudo make DSTROOT=/tmp/sendmail.dst OBJROOT=/tmp/sendmail.obj RC_ARCHS=ppc install
$ cp -Rp /tmp/sendmail.dst/* /
-- edit sendmail.cf m4 -- trust authenticated users for relaying
define(`confAUTH_MECHANISMS', `PLAIN LOGIN')
TRUST_AUTH_MECH(`PLAIN LOGIN')
[references]
http://www.sendmail.org/~ca/email/auth.html
http://asg.web.cmu.edu/archive/message.php?mailbox=archive.cyrus-sasl&msg=1001
Also note that the ltconfig13 and ltmain13 hosted on opendarwin.org with other port distfiles can probably be used instead of the files listed in the instructions, which would be nice because most ports users probably already have those two files in their distfiles directories.