Opened 21 years ago

Closed 17 years ago

Last modified 8 years ago

#272 closed enhancement (invalid)

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:

Description (last modified by ryandesign (Ryan Carsten Schmidt))

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

Change History (9)

comment:1 Changed 21 years ago by eric@…

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.

comment:2 Changed 21 years ago by jpm@…

alternate set of instructions for building sendmail with smtp auth: http://www.opendarwin.org/~kevin/smtpauth.html

:0)

comment:3 Changed 21 years ago by landonf@…

Owner: changed from kevin@… to eric@…

comment:4 Changed 21 years ago by eric@…

Owner: changed from eric@… to kevin@…

comment:5 Changed 19 years ago by kevin@…

Owner: changed from kevin@… to darwinports-bugs@…

Reassigning bugs in my queue to where they belong.

comment:6 Changed 19 years ago by mww@…

Summary: authorized sendmail should be in portsRFE: authorized sendmail should be in ports

comment:7 Changed 18 years ago by rhwood@…

severity: normalenhancement

Make the list of bugs easier to scan.

comment:8 Changed 17 years ago by markd@…

Resolution: invalid
Status: newclosed

I think this can be closed as obsolete.

comment:9 Changed 8 years ago by ryandesign (Ryan Carsten Schmidt)

Description: modified (diff)
Priority: HighNormal
Note: See TracTickets for help on using tickets.