summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Hesse2015-06-30 15:53:07 +0200
committerChristian Hesse2015-06-30 15:53:07 +0200
commitd31f3ec599784223b64f3e95f66343c0df0baa88 (patch)
tree15507ae8aed506f68bc51a2feb15703059609741
downloadaur-smtpprox.tar.gz
initial import of smtpprox 1.2-7
-rw-r--r--.SRCINFO17
-rw-r--r--PKGBUILD36
-rw-r--r--smtpprox-tmpname-and-xforward.patch44
-rw-r--r--smtpprox.service10
4 files changed, 107 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..50da312ad14e
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,17 @@
+pkgbase = smtpprox
+ pkgdesc = Simple efficient SMTP proxy in perl
+ pkgver = 1.2
+ pkgrel = 7
+ url = http://bent.latency.net/smtpprox/
+ arch = any
+ license = GPL
+ depends = perl
+ source = http://bent.latency.net/smtpprox/smtpprox-1.2.tar.gz
+ source = smtpprox-tmpname-and-xforward.patch
+ source = smtpprox.service
+ sha256sums = 5c993a63fd5aa9e4580f023f6435f44c47e38823e6cd66435b3dedc206cc55fa
+ sha256sums = 913490c0a4d0dd23476d1c7059a49b9a059f0768b668faae81327159f78e277d
+ sha256sums = 6a3dc880118effcaaa982be48f25ffd5dbd75a5ac9c621611a2f047b0b3356fd
+
+pkgname = smtpprox
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..e98f0e57d94c
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,36 @@
+# Maintainer: Christian Hesse <mail@eworm.de>
+# Contributor: Paul Mattal <pjmattal@elys.com>
+
+pkgname=smtpprox
+pkgver=1.2
+pkgrel=7
+pkgdesc='Simple efficient SMTP proxy in perl'
+url='http://bent.latency.net/smtpprox/'
+arch=('any')
+license=('GPL')
+depends=('perl')
+source=("http://bent.latency.net/${pkgname}/${pkgname}-${pkgver}.tar.gz"
+ 'smtpprox-tmpname-and-xforward.patch'
+ 'smtpprox.service')
+sha256sums=('5c993a63fd5aa9e4580f023f6435f44c47e38823e6cd66435b3dedc206cc55fa'
+ '913490c0a4d0dd23476d1c7059a49b9a059f0768b668faae81327159f78e277d'
+ '6a3dc880118effcaaa982be48f25ffd5dbd75a5ac9c621611a2f047b0b3356fd')
+
+prepare() {
+ cd ${srcdir}/${pkgname}-${pkgver}
+
+ # patch to add xforward and predictable tempfile support
+ patch -Np1 -i ${srcdir}/smtpprox-tmpname-and-xforward.patch
+}
+
+package() {
+ cd ${srcdir}/${pkgname}-${pkgver}
+
+ # install
+ install -D -m0755 smtpprox ${pkgdir}/usr/bin/smtpprox
+ install -D -m0644 MSDW/SMTP/Client.pm ${pkgdir}/usr/share/perl5/vendor_perl/MSDW/SMTP/Client.pm
+ install -D -m0644 MSDW/SMTP/Server.pm ${pkgdir}/usr/share/perl5/vendor_perl/MSDW/SMTP/Server.pm
+
+ install -D -m0644 ${srcdir}/smtpprox.service ${pkgdir}/usr/lib/systemd/system/smtpprox.service
+}
+
diff --git a/smtpprox-tmpname-and-xforward.patch b/smtpprox-tmpname-and-xforward.patch
new file mode 100644
index 000000000000..5d8451cd1b77
--- /dev/null
+++ b/smtpprox-tmpname-and-xforward.patch
@@ -0,0 +1,44 @@
+diff -urN smtpprox-1.2/MSDW/SMTP/Server.pm smtpprox-1.2-fixed/MSDW/SMTP/Server.pm
+--- smtpprox-1.2/MSDW/SMTP/Server.pm 2003-03-09 13:52:24.000000000 -0500
++++ smtpprox-1.2-fixed/MSDW/SMTP/Server.pm 2007-01-18 13:27:44.000000000 -0500
+@@ -13,6 +13,7 @@
+ package MSDW::SMTP::Server;
+ use IO::Socket;
+ use IO::File;
++use File::Temp qw(mkstemp);
+
+ =head1 NAME
+
+@@ -183,13 +184,21 @@
+ return 0 unless defined($_ = $self->getline);
+ s/[\r\n]*$//;
+ $self->{state} = $_;
+- if (s/^helo\s+//i) {
++ if (s/^(helo|ehlo)\s+//i) {
+ s/\s*$//;s/\s+/ /g;
+ $self->{helo} = $_;
++ } elsif (s/^xforward\s*//i) {
++ my (@attr) = split(/\s+/, $_);
++ my ($attr);
++ foreach $attr (@attr) {
++ my ($name, $value) = ($attr =~ /^(.*?)=(.*)$/);
++ $self->{xforward}->{lc($name)} = $value;
++ }
+ } elsif (s/^rset\s*//i) {
+ delete $self->{to};
+ delete $self->{data};
+ delete $self->{recipients};
++ delete $self->{xforward};
+ } elsif (s/^mail\s+from:\s*//i) {
+ delete $self->{to};
+ delete $self->{data};
+@@ -208,7 +217,8 @@
+ $self->{data}->seek(0, 0);
+ $self->{data}->truncate(0);
+ } else {
+- $self->{data} = IO::File->new_tmpfile;
++ (undef, $self->{datafilename}) = mkstemp("/tmp/smtpproxXXXXXX");
++ $self->{data} = new IO::File $self->{datafilename}, "r+";
+ }
+ while (defined($_ = $self->getline)) {
+ if ($_ eq ".\r\n") {
diff --git a/smtpprox.service b/smtpprox.service
new file mode 100644
index 000000000000..459917d43955
--- /dev/null
+++ b/smtpprox.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=SMTP proxy in perl
+After=network.target
+
+[Service]
+User=nobody
+ExecStart=/usr/bin/smtpprox 127.0.0.1:10025 127.0.0.1:10026
+
+[Install]
+WantedBy=multi-user.target