From c456a05512840cc1882ddcb29e2c2d8fb1b97889 Mon Sep 17 00:00:00 2001 From: Jay Larson Date: Fri, 8 Jun 2018 09:28:52 -0500 Subject: [PATCH] The following changes were made: * Added patch routine * Added patch to disable nis in default config * Updated init script to use status_of_proc * usher will now restart postfix if running --- Makefile | 10 ++++++++-- SNAP/postfix.init | 8 +------- SNAP/usher | 4 ++++ SRC/patches/01_remove-nis.patch | 12 ++++++++++++ 4 files changed, 25 insertions(+), 9 deletions(-) create mode 100644 SRC/patches/01_remove-nis.patch diff --git a/Makefile b/Makefile index a64a46b..eec273a 100644 --- a/Makefile +++ b/Makefile @@ -70,7 +70,7 @@ REPO = main BRIEF = The Postfix MTA DESC = The Postfix MTA (Mail Transport Agent) was written as an alternative \ to the widely-used Sendmail program -SNAPVER = 0 +SNAPVER = 1 ARCHIVE := $(PWD)/SRC/$(shell ls SRC|egrep '(bz2|gz|tar|xz)$$'|tail -1) TYPE := $(shell file -ib $(ARCHIVE)|cut -d';' -f1|tr -d '\n') @@ -101,6 +101,10 @@ $(SRCDIR)/Makefile: $(ARCHIVE) # be re-executed even if it isn't necessary $(SRCDIR)/bin/postfix: $(SRCDIR)/Makefile + @cd $(SRCDIR) && \ + for patch in `find $(PATCHDIR) -name \*.patch|sort`; do \ + patch --verbose -Np1 -i $$patch; \ + done @cd $(SRCDIR) && make CCARGS="-DUSE_SASL_AUTH -DUSE_CYRUS_SASL \ -I/usr/include/sasl -DHAS_LDAP -DUSE_TLS" AUXLIBS="-lsasl2 \ -lldap -llber -lssl -lcrypto" makefiles && make @@ -120,9 +124,11 @@ $(ROOT): $(SRCDIR)/bin/postfix readme_directory=/usr/share/doc/postfix/readme && \ install -v -d -m 0755 $(ROOT)/etc/init.d && \ install -v -d -m 0755 $(ROOT)/usr/share/postfix/etc && \ + install -v -d -m 0755 $(ROOT)/var/spool && \ install -v -m 0755 $(SNAPDIR)/postfix.init \ $(ROOT)/etc/init.d/postfix && \ - mv -v $(ROOT)/etc/postfix/* $(ROOT)/usr/share/postfix/etc + mv -v $(ROOT)/etc/postfix/* $(ROOT)/usr/share/postfix/etc && \ + ln -sfv ../mail $(ROOT)/var/spool/mail test: $(ROOT) @cd $(SRCDIR); \ diff --git a/SNAP/postfix.init b/SNAP/postfix.init index 4927f02..06225ba 100755 --- a/SNAP/postfix.init +++ b/SNAP/postfix.init @@ -37,13 +37,7 @@ case "$1" in $0 start ;; status) - pid=$(pidofproc -p "$PIDFILE" "$BINFILE"); - - if [ "$?" -ne 0 ]; then - echo "postfix is not runing" - else - echo "postfix running with PID: $pid" - fi + status_of_proc -p "$PIDFILE" "$DAEMON" ;; *) echo "Usage: $0 {start|stop|reload|restart|status}" diff --git a/SNAP/usher b/SNAP/usher index adbddba..fcb7bb7 100755 --- a/SNAP/usher +++ b/SNAP/usher @@ -31,6 +31,10 @@ case $1 in /var/spool/postfix/maildrop chmod 2555 /usr/sbin/postqueue \ /usr/sbin/postdrop + + /etc/init.d/postfix status 2>&1 > /dev/null && /etc/init.d/postfix restart + + exit 0 ;; prerm) exit 0 diff --git a/SRC/patches/01_remove-nis.patch b/SRC/patches/01_remove-nis.patch new file mode 100644 index 0000000..a0d5e63 --- /dev/null +++ b/SRC/patches/01_remove-nis.patch @@ -0,0 +1,12 @@ +diff -Naur a/conf/main.cf b/conf/main.cf +--- a/conf/main.cf 2017-02-18 19:58:20.000000000 -0600 ++++ b/conf/main.cf 2018-06-06 18:43:23.134275240 -0500 +@@ -398,7 +398,7 @@ + # "postfix reload" to eliminate the delay. + # + #alias_maps = dbm:/etc/aliases +-#alias_maps = hash:/etc/aliases ++alias_maps = hash:/etc/aliases + #alias_maps = hash:/etc/aliases, nis:mail.aliases + #alias_maps = netinfo:/aliases +