diff options
-rw-r--r-- | .AURINFO | 26 | ||||
-rw-r--r-- | .SRCINFO | 34 | ||||
-rw-r--r-- | PKGBUILD | 79 | ||||
-rw-r--r-- | sendmail.conf | 2 | ||||
-rw-r--r-- | sendmail.install | 29 | ||||
-rw-r--r-- | sendmail.service | 15 | ||||
-rw-r--r-- | sm-client.service | 15 |
7 files changed, 200 insertions, 0 deletions
diff --git a/.AURINFO b/.AURINFO new file mode 100644 index 000000000000..0c87ea1ee066 --- /dev/null +++ b/.AURINFO @@ -0,0 +1,26 @@ +pkgbase = sendmail + pkgdesc = The sendmail MTA + pkgver = 8.14.9 + pkgrel = 1 + url = http://www.sendmail.org + install = sendmail.install + arch = i686 + arch = x86_64 + license = Sendmail License + depends = db + depends = cyrus-sasl + provides = sendmail=8.14 + conflicts = msmtp-mta + conflicts = postfix + conflicts = exim + conflicts = opensmtpd + source = ftp://ftp.sendmail.org/pub/sendmail/sendmail.8.14.9.tar.gz + source = sendmail.service + source = sendmail.conf + source = sm-client.service + backup = etc/conf.d/sendmail + backup = etc/mail/aliases + backup = etc/mail/sendmail.cf + +pkgname = sendmail + diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..5e7818c27211 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,34 @@ +pkgbase = sendmail + pkgdesc = The sendmail MTA + pkgver = 8.14.9 + pkgrel = 1 + url = http://www.sendmail.org + install = sendmail.install + arch = i686 + arch = x86_64 + license = Sendmail License + depends = db + depends = cyrus-sasl + provides = sendmail=8.14 + conflicts = msmtp-mta + conflicts = postfix + conflicts = exim + conflicts = opensmtpd + backup = etc/conf.d/sendmail + backup = etc/mail/aliases + backup = etc/mail/sendmail.cf + source = ftp://ftp.sendmail.org/pub/sendmail/sendmail.8.14.9.tar.gz + source = sendmail.service + source = sendmail.conf + source = sm-client.service + md5sums = 6a3bdceffa592316f830be289a4bd783 + md5sums = a11b2aabaa97305431220c38c486081c + md5sums = 4b60270921f77772d1ba941d831b732d + md5sums = 3c95e29825ea97fc425e2e1ac42d1f22 + sha256sums = f5a497151abd8f341cca0736c3f9bd703d574d93146b2989689dff6d7a445d75 + sha256sums = 380edeb289dfdfc5b0d4ea38df3a0fd35e6f83eeee76254ec7b3506eadfb674f + sha256sums = 39730f2be66bb1f1e6bc7fff61911db632ecf4b891d348df525abe2020274580 + sha256sums = ecbd0a27e868d73d87fcfec292c19ea9479d0a8e9783788596d9add5e012218f + +pkgname = sendmail + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..97d09dc2da8b --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,79 @@ +# Maintainer chrisl echo archlinux@c2h0r1i2s4t5o6p7h8e9r-l3u4n1a.com|sed 's/[0-9]//g' +# Maintainer mazieres +# Contributor doze_worm <shuimao@gmail.com> the original port. + +pkgname="sendmail" +pkgver=8.14.9 +pkgrel=1 +pkgdesc="The sendmail MTA" +arch=('i686' 'x86_64') +license=('Sendmail License') +provides=('sendmail=8.14') +conflicts=( +'msmtp-mta' +'postfix' +'exim' +'opensmtpd' +) +backup=( +'etc/conf.d/sendmail' +'etc/mail/aliases' +'etc/mail/sendmail.cf' +) +source=("ftp://ftp.sendmail.org/pub/sendmail/${pkgname}.${pkgver}.tar.gz" +"sendmail.service" +"sendmail.conf" +"sm-client.service" +) +url="http://www.sendmail.org" +depends=('db' 'cyrus-sasl') +md5sums=('6a3bdceffa592316f830be289a4bd783' +'a11b2aabaa97305431220c38c486081c' +'4b60270921f77772d1ba941d831b732d' +'3c95e29825ea97fc425e2e1ac42d1f22') +sha256sums=('f5a497151abd8f341cca0736c3f9bd703d574d93146b2989689dff6d7a445d75' +'380edeb289dfdfc5b0d4ea38df3a0fd35e6f83eeee76254ec7b3506eadfb674f' +'39730f2be66bb1f1e6bc7fff61911db632ecf4b891d348df525abe2020274580' +'ecbd0a27e868d73d87fcfec292c19ea9479d0a8e9783788596d9add5e012218f') + +install="${pkgname}.install" + +build(){ + cd "$srcdir/${pkgname}-${pkgver}" || return 1 + # Add support for SASL2 + chmod +w devtools/OS/Linux + echo -e "define(\`confSTDIO_TYPE', \`portable')\nAPPENDDEF(\`conf_sendmail_ENVDEF', \`-DSTARTTLS')\nAPPENDDEF(\`conf_sendmail_LIBS', \`-lssl -lcrypto')\n">>devtools/OS/Linux + echo "APPENDDEF(\`conf_sendmail_ENVDEF', \`-DNETINET6 -DSASL=2')" >>devtools/OS/Linux + echo "APPENDDEF(\`conf_sendmail_LIBS', \`-lresolv -lsasl2')" >>devtools/OS/Linux + echo "APPENDDEF(\`confLIBS', \`-ldb')" >>devtools/OS/Linux + echo "APPENDDEF(\`confMAPDEF', \`-DNEWDB')" >>devtools/OS/Linux + + sed -i -e '58 s/^/dnl /' -e '59 s/^/dnl /' sendmail/Makefile.m4 # Sendmail expects user and group smmsp to exists before make install, this line prevent errors from that + ./Build || return 1 + sed -i -e '449 s/-o [^}]*}[^}]*}//' -e '449 s/-m .{GBINMODE}/-m 755/' obj.*/sendmail/Makefile # Sendmail expects user and group smmsp to exists before make install, this line prevent errors from that + GROFF_NO_SGR=1 make -C doc/op op.txt op.ps +} + +package(){ + mkdir -p $pkgdir/etc/conf.d/ + mkdir -p $pkgdir/usr/{bin,sbin,share/man,share/doc/sendmail,/lib/systemd/system} \ + $pkgdir/usr/man/man{1,5,8} $pkgdir/var/spool/mqueue \ + || return 1 + cp sendmail.service sm-client.service $pkgdir/usr/lib/systemd/system + cp sendmail.conf $pkgdir/etc/conf.d/sendmail + cd "$srcdir/${pkgname}-${pkgver}" || return 1 + make install DESTDIR="$pkgdir" || return 1 + make -C mail.local force-install DESTDIR="$pkgdir" || return 1 + make -C rmail force-install DESTDIR="$pkgdir" || return 1 + mv $pkgdir/usr/man/* $pkgdir/usr/share/man/ + rmdir $pkgdir/usr/man + cp -r cf $pkgdir/usr/share/sendmail-cf + cp sendmail/aliases $pkgdir/etc/mail/aliases + cp cf/cf/generic-linux.cf $pkgdir/etc/mail/sendmail.cf + cp doc/op/op.{ps,txt} $pkgdir/usr/share/doc/sendmail/ + install -D -m644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" + find $pkgdir -user bin -print | xargs chown root + find $pkgdir -group bin -print | xargs chgrp root + mv $pkgdir/usr/sbin/* $pkgdir/usr/bin/ + rmdir $pkgdir/usr/sbin +} diff --git a/sendmail.conf b/sendmail.conf new file mode 100644 index 000000000000..2add5c005f06 --- /dev/null +++ b/sendmail.conf @@ -0,0 +1,2 @@ +SENDMAIL_OPTS="-bd -q30m -L sm-mta" +CLIENTMQUEUE_OPTS="-Ac -q30m -L sm-cm" diff --git a/sendmail.install b/sendmail.install new file mode 100644 index 000000000000..0c7fb25f9cd0 --- /dev/null +++ b/sendmail.install @@ -0,0 +1,29 @@ +post_install() { + if grep -q "^smmsp:" /etc/group &> /dev/null ; then + groupmod -g 25 -n smmsp smmsp &> /dev/null + else + groupadd -g 25 smmsp &> /dev/null + fi + + if grep -q "^smmsp:" /etc/passwd 2> /dev/null ; then + usermod -s /bin/false -c "sendmail user" -d /var/spool/mail -u 150 -g smmsp smmsp &> /dev/null + else + useradd -s /bin/false -c "sendmail user" -d /var/spool/mail -u 150 -g smmsp -r smmsp &> /dev/null + fi + chown smmsp:smmsp /var/spool/clientmqueue + chown root:smmsp /usr/bin/sendmail + chmod 2555 /usr/bin/sendmail +} +post_upgrade() { + post_install $1 +} + +pre_remove() { + systemctl stop sendmail|| : + systemctl stop sm-client|| : + killall sendmail || /bin/true + userdel smmsp &> /dev/null + rm -f /etc/mail/aliases.db || /bin/true + groupdel smmsp &> /dev/null || /bin/true + rmdir --ignore-fail-on-non-empty /var/spool/mqueue &> /dev/null || /bin/true +} diff --git a/sendmail.service b/sendmail.service new file mode 100644 index 000000000000..28e49ea67e39 --- /dev/null +++ b/sendmail.service @@ -0,0 +1,15 @@ +[Unit] +Description=Sendmail Mail Transport Agent +After=syslog.target network.target +Conflicts=postfix.service exim.service +Wants=sm-client.service + +[Service] +Type=forking +PIDFile=/var/run/sendmail.pid +EnvironmentFile=/etc/conf.d/sendmail +ExecStartPre=-/usr/bin/newaliases > /dev/null 2>&1 +ExecStart=/usr/sbin/sendmail -bd $SENDMAIL_OPTS $SENDMAIL_OPTARG + +[Install] +WantedBy=multi-user.target diff --git a/sm-client.service b/sm-client.service new file mode 100644 index 000000000000..12f9bbc69846 --- /dev/null +++ b/sm-client.service @@ -0,0 +1,15 @@ +[Unit] +Description=Sendmail Mail Transport Client +After=syslog.target network.target sendmail.service +Wants=sendmail.service +BindsTo=sendmail.service + +[Service] +Type=forking +PIDFile=/var/spool/clientmqueue/sm-client.pid +EnvironmentFile=/etc/conf.d/sendmail +ExecStartPre=/usr/bin/rm -f /var/spool/mqueue/xf* +ExecStart=/usr/sbin/sendmail $CLIENTMQUEUE_OPTS > /dev/null 2>&1 + +[Install] +WantedBy=multi-user.target |