summaryrefslogtreecommitdiff
path: root/community/exim
diff options
context:
space:
mode:
authorParabola <dev@list.parabolagnulinux.org>2011-04-05 14:26:38 +0000
committerParabola <dev@list.parabolagnulinux.org>2011-04-05 14:26:38 +0000
commit415856bdd4f48ab4f2732996f0bae58595092bbe (patch)
treeede2018b591f6dfb477fe9341ba17b9bc000fab9 /community/exim
Tue Apr 5 14:26:38 UTC 2011
Diffstat (limited to 'community/exim')
-rw-r--r--community/exim/PKGBUILD119
-rw-r--r--community/exim/aliases35
-rwxr-xr-xcommunity/exim/exim42
-rw-r--r--community/exim/exim.conf.d1
-rw-r--r--community/exim/exim.install22
-rw-r--r--community/exim/exim.logrotate5
-rwxr-xr-xcommunity/exim/newaliases2
7 files changed, 226 insertions, 0 deletions
diff --git a/community/exim/PKGBUILD b/community/exim/PKGBUILD
new file mode 100644
index 000000000..db94e4188
--- /dev/null
+++ b/community/exim/PKGBUILD
@@ -0,0 +1,119 @@
+# $Id: PKGBUILD 38427 2011-01-27 04:52:11Z angvp $
+# Maintainer: Angel Velasquez <angvp@archlinux.org>
+# Maintainer: judd <jvinet@zeroflux.org>
+pkgname=exim
+pkgver=4.74
+pkgrel=1
+pkgdesc="A Message Transfer Agent"
+arch=(i686 x86_64)
+url="http://www.exim.org/"
+license=('GPL')
+backup=(etc/mail/aliases etc/mail/exim.conf \
+ etc/logrotate.d/exim etc/conf.d/exim)
+install=exim.install
+depends=('db' 'pcre' 'pam' 'tcp_wrappers' 'openssl' 'libldap')
+makedepends=('sudo')
+provides=('smtp-server')
+conflicts=('smtp-server')
+options=('!makeflags')
+source=(ftp://mirrors.24-7-solutions.net/pub/exim/ftp/exim/exim4/exim-${pkgver}.tar.bz2
+ aliases
+ newaliases
+ exim
+ exim.logrotate
+ exim.conf.d)
+md5sums=('1d9c189940909303d914bbc4247dc861'
+ '4874006f0585253ddab027d441009757'
+ 'ea39f58bffc16f5e3bbe59dffcf09449'
+ '9aed772e87223213e8da9ca5e7376869'
+ 'd788c26f86a9d72a0aebb3b849fe74f2'
+ 'b75fe4c6e960a59a25b5f51e8f61ba3a')
+
+build() {
+ # An exim user is required to build this
+ if [ ! `egrep '^exim' /etc/passwd` ]; then
+ echo "==> Adding user/group exim (temporarily)"
+ sudo groupadd -g 79 exim
+ sudo useradd -u 79 -g exim -d /var/spool/exim -s /bin/false exim
+ cleanup=1
+ else
+ cleanup=0
+ fi
+
+ cd ${srcdir}/${pkgname}-${pkgver}
+ sed -i 's|tail -1|tail -n -1|g' scripts/Configure-config.h
+ # Make some configuration changes
+ sed 's|^BIN_DIRECTORY.*$|BIN_DIRECTORY=/usr/sbin|' src/EDITME | \
+ sed 's|^CONFIGURE_FILE.*$|CONFIGURE_FILE=/etc/mail/exim.conf|' | \
+ sed 's|^EXIM_USER.*$|EXIM_USER=exim|' | \
+ sed 's|^COMPRESS_COMMAND.*$|COMPRESS_COMMAND=/bin/gzip|' | \
+ sed 's|^ZCAT_COMMAND.*$|ZCAT_COMMAND=/bin/zcat|' | \
+ sed 's|^CHOWN_COMMAND.*$|CHOWN_COMMAND=/bin/chown|' | \
+ sed 's|^CHGRP_COMMAND.*$|CHGRP_COMMAND=/bin/chgrp|' | \
+ sed 's|^EXIM_MONITOR.*$||' | \
+ sed 's|^# MAX_NAMED_LIST.*$|MAX_NAMED_LIST=16|' | \
+ sed 's|^# SUPPORT_MAILDIR.*$|SUPPORT_MAILDIR=yes|' | \
+ sed 's|^# \(PID_FILE_PATH=/var\)/lock/exim.pid.*$|\1/run/exim.pid|' | \
+ sed 's|^# TRANSPORT_LMTP=yes|TRANSPORT_LMTP=yes|' | \
+ sed 's|^# LOOKUP_LDAP=yes|LOOKUP_LDAP=yes|' | \
+ sed 's|^# LDAP_LIB_TYPE=OPENLDAP2|LDAP_LIB_TYPE=OPENLDAP2|' | \
+ sed 's|^# LOOKUP_DSEARCH=yes|LOOKUP_DSEARCH=yes|' | \
+ sed 's|^# AUTH_CRAM_MD5=yes$|AUTH_CRAM_MD5=yes|' | \
+ sed 's|^# AUTH_PLAINTEXT=yes$|AUTH_PLAINTEXT=yes|' | \
+ sed 's|^# AUTH_SPA=yes$|AUTH_SPA=yes|' | \
+ sed 's|^# AUTH_DOVECOT=yes$|AUTH_DOVECOT=yes|' | \
+ sed 's|^# SUPPORT_PAM=yes$|SUPPORT_PAM=yes|' | \
+ sed 's|^# USE_TCP_WRAPPERS=yes$|USE_TCP_WRAPPERS=yes|' | \
+ sed 's|^EXIM_GROUP.*$|EXIM_GROUP=exim|' | \
+ sed 's|^# SUPPORT_TLS.*$|SUPPORT_TLS=yes|' | \
+ sed 's|^# TLS_LIBS.*$|TLS_LIBS=-L/usr/lib -lssl -lcrypto|' | \
+ sed 's|^# TLS_INCLUDE.*$|TLS_INCLUDE=-I/usr/include/openssl|' | \
+ sed 's|^# WITH_CONTENT_SCAN.*$|WITH_CONTENT_SCAN=yes|' | \
+ sed 's|^# WITH_OLD_DEMIME.*$|WITH_OLD_DEMIME=yes|' | \
+ sed "s|^SYSTEM_ALIASES_FILE=/etc/aliases|SYSTEM_ALIASES_FILE=${pkgdir}/etc/mail/aliases|" | \
+ sed 's|^# \(LOG_FILE_PATH=/var/log/exim\)_%slog.*$|\1/%slog|' >Local/Makefile
+ echo "HAVE_IPV6=YES" >> Local/Makefile
+ echo "LOOKUP_LIBS=-lldap" >> Local/Makefile
+ echo "EXTRALIBS_EXIM=-lwrap -lpam" >> Local/Makefile
+ make
+}
+
+package() {
+ cd $srcdir/$pkgname-$pkgver
+ install -D -m644 ../exim.logrotate ${pkgdir}/etc/logrotate.d/exim
+ install -D -m644 ../exim.conf.d ${pkgdir}/etc/conf.d/exim
+ install -D -m644 doc/exim.8 ${pkgdir}/usr/share/man/man8/exim.8
+ install -D -m755 ../exim ${pkgdir}/etc/rc.d/exim
+ mkdir -p ${pkgdir}/var/spool/exim/db ${pkgdir}/etc/mail \
+ ${pkgdir}/var/log/exim ${pkgdir}/usr/{lib,sbin}
+ chown root.exim ${pkgdir}/var/spool/exim ${pkgdir}/var/log/exim
+ chown exim.exim ${pkgdir}/var/spool/exim/db
+ chmod 770 ${pkgdir}/var/spool/exim ${pkgdir}/var/spool/exim/db ${pkgdir}/var/log/exim
+ cd build-Linux-*
+ inst_dest=${pkgdir}/usr/sbin inst_conf=${pkgdir}/etc/mail/exim.conf ../scripts/exim_install
+ cd ${srcdir}/exim-${pkgver}/src
+ sed "s|/etc/aliases|/etc/mail/aliases|g" configure.default | \
+ sed "s|SYSTEM_ALIASES_FILE|/etc/mail/aliases|g" \
+ >${pkgdir}/etc/mail/exim.conf
+
+ cp ${srcdir}/aliases ${pkgdir}/etc/mail
+ cp ${srcdir}/newaliases ${pkgdir}/usr/sbin
+ cd ${pkgdir}/usr/sbin
+ ln -s exim mailq
+ ln -s exim rmail
+ ln -s exim rsmtp
+ ln -s exim runq
+ ln -s exim sendmail
+ # fhs compliancy
+ ln -s ../sbin/exim ../lib/sendmail
+
+ mkdir -p ${pkgdir}/etc/rc.d
+ cp ${srcdir}/exim ${pkgdir}/etc/rc.d
+
+
+ if [ $cleanup -eq 1 ]; then
+ echo "==> Removing user/group exim"
+ sudo userdel exim
+ fi
+ return 0
+}
diff --git a/community/exim/aliases b/community/exim/aliases
new file mode 100644
index 000000000..5a76ff7d5
--- /dev/null
+++ b/community/exim/aliases
@@ -0,0 +1,35 @@
+#
+# /etc/mail/aliases
+#
+# NOTE: Make sure you run 'newaliases' after modifying this file
+#
+
+# Basic system aliases -- these MUST be present.
+MAILER-DAEMON: postmaster
+postmaster: root
+hostmaster: root
+webmaster: hostmaster
+ftpmaster: hostmaster
+admin: hostmaster
+administrator: hostmaster
+
+# General redirections for pseudo accounts.
+bin: root
+daemon: root
+games: root
+ingres: root
+nobody: root
+system: root
+toor: root
+uucp: root
+
+# Well-known aliases.
+manager: root
+dumper: root
+operator: root
+
+# trap decode to catch security attacks
+decode: root
+
+# Person who should get root's mail
+#root:
diff --git a/community/exim/exim b/community/exim/exim
new file mode 100755
index 000000000..8e9640b32
--- /dev/null
+++ b/community/exim/exim
@@ -0,0 +1,42 @@
+#!/bin/bash
+
+# source application-specific settings
+[ -f /etc/conf.d/exim ] && . /etc/conf.d/exim
+
+# general config
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+PID=`pidof -o %PPID /usr/sbin/exim`
+
+case "$1" in
+ start)
+ stat_busy "Starting Exim"
+ [ -z "$PID" ] && /usr/sbin/exim $EXIM_ARGS
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ add_daemon exim
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping Exim"
+ [ ! -z "$PID" ] && kill $PID &> /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm /var/run/exim.pid
+ rm_daemon exim
+ stat_done
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 2
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0
diff --git a/community/exim/exim.conf.d b/community/exim/exim.conf.d
new file mode 100644
index 000000000..b9bec4335
--- /dev/null
+++ b/community/exim/exim.conf.d
@@ -0,0 +1 @@
+EXIM_ARGS="-bd -q15m"
diff --git a/community/exim/exim.install b/community/exim/exim.install
new file mode 100644
index 000000000..132b33f14
--- /dev/null
+++ b/community/exim/exim.install
@@ -0,0 +1,22 @@
+# arg 1: the new package version
+post_install() {
+ getent group exim >/dev/null 2>&1 || groupadd -g 79 exim
+ if getent passwd exim > /dev/null 2>&1; then
+ usr/sbin/usermod -d /var/spool/exim -c 'Exim MTA' -s /sbin/nologin exim > /dev/null 2>&1
+ else
+ usr/sbin/useradd -c 'Exim MTA' -u 79 -g exim -d /var/spool/exim -s /sbin/nologin exim
+ fi
+ passwd -l exim > /dev/null
+}
+
+# arg 1: the new package version
+# arg 2: the old package version
+post_upgrade() {
+ post_install $1
+}
+
+# arg 1: the old package version
+pre_remove() {
+ getent passwd exim >/dev/null 2>&1 && userdel exim
+}
+
diff --git a/community/exim/exim.logrotate b/community/exim/exim.logrotate
new file mode 100644
index 000000000..ff38a1452
--- /dev/null
+++ b/community/exim/exim.logrotate
@@ -0,0 +1,5 @@
+/var/log/exim/*log {
+ missingok
+ notifempty
+ delaycompress
+}
diff --git a/community/exim/newaliases b/community/exim/newaliases
new file mode 100755
index 000000000..c7b0e383d
--- /dev/null
+++ b/community/exim/newaliases
@@ -0,0 +1,2 @@
+#!/bin/sh
+/usr/sbin/exim_dbmbuild /etc/mail/aliases /var/spool/exim/db/aliases && chown exim.exim /var/spool/exim/db/aliases