pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pkgsrc/mail/sendmail anomalies



I come back with an update on my findings.

First, I agree with the observations that the paths documented in pkgsrc/mail/sendmail/Makefile should be largely applied.

The supplied files break this philosophy and generate, frankly speaking, a mess; definitely not intuitive when perusing the pkgsrc sendmail bits.

(I do believe that the local /usr/sbin/sendmail is a special case, but in reality it really doesn't seem to affect anything directly in the pkgsrc bits, THAT, like any pkgsrc bits, is a different local issue)

On the same note, I'm not entirely OKAY with /etc/mail being used instead of ${PKG_SYSCONFBASE}/mail, I suggest that it be re-evaluated,
but I don't propose any patches here at the moment.

The attached patch puts certain critical cf files in order, as well as cf/ostypes/solaris8.mc which is my particular target at the moment.

Do note that cf/cf is built now in order to supply the updates for install.

By the way, the other files in cf/ostypes are also candidates to upgrade, just do
        
        grep -E "bin|etc|var" cf/ostypes/*

but if this approach is selected, perhaps it would be better to more specifically replace with the m4 parameter name (e.g. confEBINDIR) as part of the selection.

With this patch, the pid file is correctly placed where /etc/rc.d/sendmail expects it, and the various directories and files are also in the place created during pkgsrc make install (namely in ${VARBASE}.

MTA to MTA testing seems ok, now I will tackle the MTA/UA part where I hope there is nothing special anymore to do in sendmail...

here are some pertinent outputs:

richard@devzoneX:~$ pfexec /etc/rc.d/sendmail status
sendmail is running as pid 20707.
richard@devzoneX:~$ telnet localhost 25
Trying ::1...
Connected to localhost.
Escape character is '^]'.
220 devzoneX.baou.fr ESMTP Sendmail 8.14.5/8.14.5; Tue, 25 Dec 2012 16:38:01 +0100 (CET)
ehlo localhost
250-devzoneX.baou.fr Hello localhost [IPv6:::1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-EXPN
250-VERB
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-AUTH GSS-SPNEGO GSSAPI DIGEST-MD5 CRAM-MD5
250-STARTTLS
250-DELIVERBY
250 HELP
quit
221 2.0.0 devzoneX.baou.fr closing connection
Connection closed by foreign host.

This is with the following sendmail.mc file which simply adds the missing domain statements from solaris provided solaris-generic.m4, and adding GSS-SPNEGO and STARTTLS support (naturally I needed to install security/cy2-crammd5, cy2-digestmd5 and cy2-gssapi and recuperate my certificate files) :

divert(0)dnl
VERSIONID(`$Id: generic-solaris.mc,v 8.13 2001/06/27 21:46:30 gshapiro Exp $')
OSTYPE(solaris8)dnl
DOMAIN(generic)dnl
FEATURE(`nouucp', `reject')
FEATURE(`use_ct_file')dnl
FEATURE(`accept_unqualified_senders')dnl
FEATURE(`accept_unresolvable_domains')dnl
FEATURE(`relay_entire_domain')dnl
dnl set SASL options
TRUST_AUTH_MECH(`GSS-SPNEGO GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN')dnl
define(`confAUTH_MECHANISMS', `GSS-SPNEGO GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN')dnl
define(`confCACERT_PATH', `/etc/mail/certs')dnl
define(`confCACERT', `/etc/mail/certs/CAcert.pem')dnl
define(`confSERVER_CERT', `/etc/mail/certs/MYcert.pem')dnl
define(`confSERVER_KEY', `/etc/mail/certs/MYkey.pem')dnl
define(`confCRL', `/etc/mail/certs/revoke.crl')
define(`confCLIENT_CERT', `/etc/mail/certs/MYcert.pem')dnl
define(`confCLIENT_KEY', `/etc/mail/certs/MYkey.pem')dnl
MAILER(local)dnl
MAILER(smtp)dnl


Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/mail/sendmail/Makefile,v
retrieving revision 1.112
diff -u -p -r1.112 Makefile
--- Makefile    16 Dec 2012 01:52:23 -0000      1.112
+++ Makefile    25 Dec 2012 15:03:30 -0000
@@ -7,6 +7,8 @@ PKGREVISION=    2
 CONFLICTS+=    courier-mta-[0-9]* fastforward>=0.51nb2 postfix-[0-9]*
 CONFLICTS+=    esmtp>=1.2
 
+PKG_DESTDIR_SUPPORT=destdir
+
 .include "options.mk"
 .include "../../mail/sendmail/Makefile.common"
 
@@ -33,7 +35,8 @@ PKG_GROUPS=           smmsp
 PKG_USERS=             smmsp:smmsp
 PKG_GECOS.smmsp=       Sendmail Message Submission Program
 
-SUBST_CLASSES+=                paths
+SUBST_CLASSES+=                paths cf-paths
+
 SUBST_STAGE.paths=     pre-configure
 SUBST_FILES.paths=     ../mailer.conf smrsh/smrsh.8 cf/cf/Makefile
 SUBST_SED.paths+=      -e "s|@@BINGRP@@|${BINGRP}|g"
@@ -43,6 +46,13 @@ SUBST_SED.paths+=    -e "s|@@PREFIX@@|${PRE
 SUBST_SED.paths+=      -e "s|@@SMRSH_CMDDIR@@|${SMRSH_CMDDIR}|g"
 SUBST_MESSAGE.paths=   Fixing paths.
 
+SUBST_STAGE.cf-paths=  pre-configure
+SUBST_FILES.cf-paths=  cf/m4/proto.m4 cf/feature/msp.m4 cf/feature/smrsh.m4 
cf/feature/local_lmtp.m4 cf/ostype/solaris8.m4
+SUBST_SED.cf-paths+=   -e "s|/var/spool|${VARBASE}/spool|g"
+SUBST_SED.cf-paths+=   -e "s|/var/run|${VARBASE}/run|g"
+SUBST_SED.cf-paths+=   -e "s|/usr/libexec|${PREFIX}/libexec/sendmail|g"
+SUBST_SED.cf-paths+=   -e "s|/usr/lib|${PREFIX}/libexec/sendmail|g"
+
 REPLACE_PERL=          contrib/socketmapClient.pl contrib/socketmapServer.pl
 
 INSTALLATION_DIRS=     bin lib sbin
@@ -75,7 +85,8 @@ post-extract:
        cp ${FILESDIR}/mailer.conf ${WRKDIR}/mailer.conf
 
 do-build:
-       (cd ${WRKSRC} && env ${MAKE_ENV} ./Build)
+       (cd ${WRKSRC} && env ${MAKE_ENV} ./Build); \
+       (cd ${WRKSRC}/cf/cf && env ${MAKE_ENV} ./Build)
 
 post-build:
        cp ${PKGDIR}/MESSAGE ${MESSAGE_SRC}
Index: files/sendmail.sh
===================================================================
RCS file: /cvsroot/pkgsrc/mail/sendmail/files/sendmail.sh,v
retrieving revision 1.2
diff -u -p -r1.2 sendmail.sh
--- files/sendmail.sh   27 Jul 2012 17:46:01 -0000      1.2
+++ files/sendmail.sh   25 Dec 2012 15:03:30 -0000
@@ -13,7 +13,6 @@
 
 name="sendmail"
 rcvar=$name
-command="/usr/sbin/${name}"
 pidfile="@VARBASE@/run/${name}.pid"
 required_files="/etc/mail/sendmail.cf"
 start_precmd="sendmail_precmd"
@@ -24,6 +23,7 @@ newaliases="@PREFIX@/bin/newaliases"
 smbin="@PREFIX@/libexec/sendmail/sendmail"
 check_files="aliases access genericstable virtusertable domaintable 
mailertable"
 sendmail_flags="-Lsm-mta -bd -q30m"
+command=$smbin
 
 sendmail_precmd()
 {
Index: files/smmsp.sh
===================================================================
RCS file: /cvsroot/pkgsrc/mail/sendmail/files/smmsp.sh,v
retrieving revision 1.2
diff -u -p -r1.2 smmsp.sh
--- files/smmsp.sh      27 Jul 2012 17:46:01 -0000      1.2
+++ files/smmsp.sh      25 Dec 2012 15:03:30 -0000
@@ -18,13 +18,13 @@
 
 name="smmsp"
 rcvar=$name
-command="/usr/sbin/sendmail"
 pidfile="@VARBASE@/spool/clientmqueue/sm-client.pid"
 required_files="/etc/mail/submit.cf"
 extra_commands="reload"
 
 smbin="@PREFIX@/libexec/sendmail/sendmail"
 smmsp_flags="-Lsm-msp-queue -Ac -q30m"
+command=$smbin
 
 load_rc_config $name
 run_rc_command "$1"


Home | Main Index | Thread Index | Old Index