summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Lane2015-06-09 17:36:27 +0100
committerJohn Lane2015-06-09 17:36:27 +0100
commit99123dad0854539bd29a22d941c6ec6ada47f2ca (patch)
treed2f95471e07bb1bb5e9043a1162f438a9209f43d
downloadaur-99123dad0854539bd29a22d941c6ec6ada47f2ca.tar.gz
Initial import
-rw-r--r--.AURINFO25
-rw-r--r--.SRCINFO28
-rw-r--r--PKGBUILD50
-rw-r--r--auth_method_plain.patch94
-rw-r--r--opessl_crypto.patch21
5 files changed, 218 insertions, 0 deletions
diff --git a/.AURINFO b/.AURINFO
new file mode 100644
index 000000000000..e9208358c374
--- /dev/null
+++ b/.AURINFO
@@ -0,0 +1,25 @@
+pkgbase = ssmtp-plain
+ pkgdesc = Patched ssmtp MTA with support for PLAIN authentication
+ pkgver = 2.64
+ pkgrel = 1
+ url = http://packages.debian.org/stable/mail/ssmtp
+ arch = i686
+ arch = x86_64
+ license = GPL
+ depends = openssl
+ depends = inetutils
+ provides = smtp-forwarder
+ provides = ssmtp
+ conflicts = exim
+ conflicts = smtp-forwarder
+ conflicts = ssmtp
+ source = http://ftp.debian.org/debian/pool/main/s/ssmtp/ssmtp_2.64.orig.tar.bz2
+ source = opessl_crypto.patch
+ source = auth_method_plain.patch
+ options = !makeflags
+ options = !emptydirs
+ backup = etc/ssmtp/ssmtp.conf
+ backup = etc/ssmtp/revaliases
+
+pkgname = ssmtp-plain
+
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..b13d938245ca
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,28 @@
+pkgbase = ssmtp-plain
+ pkgdesc = Patched ssmtp MTA with support for PLAIN authentication
+ pkgver = 2.64
+ pkgrel = 1
+ url = http://packages.debian.org/stable/mail/ssmtp
+ arch = i686
+ arch = x86_64
+ license = GPL
+ depends = openssl
+ depends = inetutils
+ provides = smtp-forwarder
+ provides = ssmtp
+ conflicts = exim
+ conflicts = smtp-forwarder
+ conflicts = ssmtp
+ options = !makeflags
+ options = !emptydirs
+ backup = etc/ssmtp/ssmtp.conf
+ backup = etc/ssmtp/revaliases
+ source = http://ftp.debian.org/debian/pool/main/s/ssmtp/ssmtp_2.64.orig.tar.bz2
+ source = opessl_crypto.patch
+ source = auth_method_plain.patch
+ md5sums = 65b4e0df4934a6cd08c506cabcbe584f
+ md5sums = aeb4ed09a26eefea9a5f6ac755c4dff0
+ md5sums = eab8cd3124746a9c4d6664c8156b53e1
+
+pkgname = ssmtp-plain
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..9e3c7b14fd87
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,50 @@
+# $Id: PKGBUILD 194362 2013-09-14 19:32:55Z pierre $
+# Maintainer:
+
+pkgname=ssmtp-plain
+pkgupstream=ssmtp
+pkgver=2.64
+pkgrel=1
+pkgdesc="Patched ssmtp MTA with support for PLAIN authentication"
+arch=('i686' 'x86_64')
+license=('GPL')
+url="http://packages.debian.org/stable/mail/ssmtp"
+depends=('openssl' 'inetutils')
+conflicts=('exim' 'smtp-forwarder' 'ssmtp')
+provides=('smtp-forwarder' 'ssmtp')
+backup=('etc/ssmtp/ssmtp.conf' 'etc/ssmtp/revaliases')
+options=('!makeflags' '!emptydirs')
+source=("http://ftp.debian.org/debian/pool/main/s/ssmtp/${pkgupstream}_${pkgver}.orig.tar.bz2"
+ 'opessl_crypto.patch'
+ 'auth_method_plain.patch')
+md5sums=('65b4e0df4934a6cd08c506cabcbe584f'
+ 'aeb4ed09a26eefea9a5f6ac755c4dff0'
+ 'eab8cd3124746a9c4d6664c8156b53e1')
+
+## if you build in chroot, make sure the chroots fully qualified hostname is the same as in your real root system ##
+
+build() {
+ cd "${srcdir}/${pkgupstream}-${pkgver}"
+ patch -p1 -i "${srcdir}/opessl_crypto.patch"
+ patch -p1 -i "${srcdir}/auth_method_plain.patch"
+ autoreconf
+ ./configure --prefix=/usr \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --enable-md5auth --enable-ssl
+ make
+}
+
+package() {
+ cd "${srcdir}/${pkgupstream}-${pkgver}"
+ yes | make prefix="${pkgdir}/usr" mandir="${pkgdir}/usr/share/man/man8" etcdir="${pkgdir}/etc" install
+
+ install -D -m644 ssmtp.conf.5 "${pkgdir}/usr/share/man/man5/ssmtp.conf.5"
+
+ ln -s ssmtp "${pkgdir}/usr/sbin/sendmail"
+ ln -s ssmtp "${pkgdir}/usr/sbin/newaliases"
+ ln -s ssmtp "${pkgdir}/usr/sbin/mailq"
+ # usrmove
+ cd "$pkgdir"
+ mv usr/sbin usr/bin
+}
diff --git a/auth_method_plain.patch b/auth_method_plain.patch
new file mode 100644
index 000000000000..a92a79f2eceb
--- /dev/null
+++ b/auth_method_plain.patch
@@ -0,0 +1,94 @@
+From 8b38060ec5e73a0dbccb9a8687fcb5dc2ae9d1cf Mon Sep 17 00:00:00 2001
+From: Simon Elsbrock <else@butters.home.iodev.org>
+Date: Sat, 8 Jun 2013 23:13:55 +0200
+Subject: [PATCH] implement auth method PLAIN
+
+---
+ README | 1 +
+ ssmtp.8 | 2 +-
+ ssmtp.c | 20 ++++++++++++++++++++
+ ssmtp.conf.5 | 4 +++-
+ 4 files changed, 25 insertions(+), 2 deletions(-)
+
+diff --git a/README b/README
+index d66b8a3..c26da1e 100644
+--- a/README
++++ b/README
+@@ -41,6 +41,7 @@ Authors:
+ Christoph Lameter, clameter@debian.org, clameter@waterf.org, clameter@i-m-f.org
+ Hugo Haas, hugo@debian.org, hugo@larve.net, hugo@via.ecp.fr
+ Matt Ryan, mryan@debian.org, matt.ryan@banana.org.uk
++ Simon Elsbrock, simon@iodev.org
+
+ TLS support from Tobias Rundstrom <tobi@tobi.nu>
+ IPv6 support from Jun-ya Kato <kato@goto.info.waseda.ac.jp>
+diff --git a/ssmtp.8 b/ssmtp.8
+index 26f9c47..6c3acbc 100644
+--- a/ssmtp.8
++++ b/ssmtp.8
+@@ -61,7 +61,7 @@ Specifies password for SMTP authentication.
+
+ .TP
+ \fB\-am\fP\fImechanism\fP
+-Specifies mechanism for SMTP authentication. (Only LOGIN and CRAM-MD5)
++Specifies mechanism for SMTP authentication. (PLAIN, LOGIN or CRAM-MD5)
+
+ .TP
+ .B \-ba
+diff --git a/ssmtp.c b/ssmtp.c
+index af4d1e5..c6835a2 100644
+--- a/ssmtp.c
++++ b/ssmtp.c
+@@ -1507,6 +1507,25 @@ int ssmtp(char *argv[])
+ }
+ else {
+ #endif
++ if (auth_method && strcasecmp(auth_method, "plain") == 0) {
++ outbytes += smtp_write(sock, "AUTH PLAIN");
++ (void)alarm((unsigned) MEDWAIT);
++
++ if (smtp_read(sock, buf) != 3) {
++ die("Server rejected AUTH PLAIN (%s)", buf);
++ }
++ /* we assume server asked us for Username */
++ memset(buf, 0, bufsize);
++ /* the format is "authorization-id\0authentication-id\0passwd\0"
++ we assume authorization-id = authentication-id */
++ void *plainval = malloc(2 * strlen(auth_user) + strlen(auth_pass) + 2);
++ memcpy(plainval, auth_user, strlen(auth_user) + 1);
++ memcpy(plainval + strlen(auth_user) + 1, auth_user, strlen(auth_user) + 1);
++ memcpy(plainval + 2 * (strlen(auth_user) + 1), auth_pass, strlen(auth_pass));
++ to64frombits(buf, plainval, 2 * strlen(auth_user) + strlen(auth_pass) + 2);
++ free(plainval);
++ }
++ else {
+ memset(buf, 0, bufsize);
+ to64frombits(buf, auth_user, strlen(auth_user));
+ if (use_oldauth) {
+@@ -1531,6 +1550,7 @@ int ssmtp(char *argv[])
+ memset(buf, 0, bufsize);
+
+ to64frombits(buf, auth_pass, strlen(auth_pass));
++ }
+ #ifdef MD5AUTH
+ }
+ #endif
+diff --git a/ssmtp.conf.5 b/ssmtp.conf.5
+index 25f6ceb..54b11e0 100644
+--- a/ssmtp.conf.5
++++ b/ssmtp.conf.5
+@@ -64,8 +64,10 @@ The password to use for SMTP AUTH.
+ .Pp
+ .It Cm AuthMethod
+ The authorization method to use.
+-If unset, plain text is used.
++If unset, login is used.
+ May also be set to
++.Dq plain
++or
+ .Dq cram-md5 .
+ .Sh FILES
+ .Bl -tag -width Ds
+--
+1.7.10.4
+
diff --git a/opessl_crypto.patch b/opessl_crypto.patch
new file mode 100644
index 000000000000..e3055b2e712c
--- /dev/null
+++ b/opessl_crypto.patch
@@ -0,0 +1,21 @@
+Fix linking error:
+
+Undefined symbols:
+ "_X509_free", referenced from:
+ _smtp_open in ssmtp.o
+ld: symbol(s) not found
+
+
+Index: ssmtp-2.64/configure.in
+===================================================================
+--- ssmtp-2.64.orig/configure.in
++++ ssmtp-2.64/configure.in
+@@ -52,7 +52,7 @@ AC_ARG_ENABLE(ssl,
+ [ --enable-ssl support for secure connection to mail server])
+ if test x$enableval = xyes ; then
+ AC_DEFINE(HAVE_SSL)
+- LIBS="$LIBS -lssl"
++ LIBS="$LIBS -lssl -lcrypto"
+ fi
+ enableval=""
+