Mon, 06 Apr 2009 23:53:05 +0200
Import package vendor original specs for necessary manipulations.
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/postfix/fsl.postfix Mon Apr 06 23:53:05 2009 +0200 1.3 @@ -0,0 +1,16 @@ 1.4 +## 1.5 +## fsl.postfix -- OSSP fsl configuration 1.6 +## 1.7 + 1.8 +ident (postfix/.+)/.+ q{ 1.9 + prefix( 1.10 + prefix="%b %d %H:%M:%S %N <%L> $1[%P]: " 1.11 + ) 1.12 + -> { 1.13 + debug: file( 1.14 + path="@l_prefix@/var/postfix/log/postfix.log", 1.15 + perm=0644, monitor=3600 1.16 + ) 1.17 + } 1.18 +}; 1.19 +
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/postfix/postfix.patch Mon Apr 06 23:53:05 2009 +0200 2.3 @@ -0,0 +1,115 @@ 2.4 +Index: makedefs 2.5 +--- makedefs.orig 2008-01-15 21:20:24 +0100 2.6 ++++ makedefs 2008-01-24 12:31:48 +0100 2.7 +@@ -132,6 +132,10 @@ 2.8 + ;; 2.9 + FreeBSD.7*) SYSTYPE=FREEBSD7 2.10 + ;; 2.11 ++ FreeBSD.7*) SYSTYPE=FREEBSD7 2.12 ++ ;; 2.13 ++ FreeBSD.8*) SYSTYPE=FREEBSD8 2.14 ++ ;; 2.15 + OpenBSD.2*) SYSTYPE=OPENBSD2 2.16 + ;; 2.17 + OpenBSD.3*) SYSTYPE=OPENBSD3 2.18 +Index: src/util/file_limit.c 2.19 +--- src/util/file_limit.c.orig 2003-10-22 20:48:36 +0200 2.20 ++++ src/util/file_limit.c 2008-01-24 12:31:48 +0100 2.21 +@@ -80,12 +80,21 @@ 2.22 + void set_file_limit(off_t limit) 2.23 + { 2.24 + #ifdef USE_ULIMIT 2.25 ++#ifdef USE_SOFTLIMITONLY 2.26 ++#error "USE_ULIMIT and USE_SOFTLIMITONLY are mutual exclusive" 2.27 ++#endif 2.28 + if (ulimit(UL_SETFSIZE, limit / ULIMIT_BLOCK_SIZE) < 0) 2.29 + msg_fatal("ulimit: %m"); 2.30 + #else 2.31 + struct rlimit rlim; 2.32 + 2.33 ++#ifdef USE_SOFTLIMITONLY 2.34 ++ if (getrlimit(RLIMIT_FSIZE, &rlim) < 0) 2.35 ++ rlim.rlim_max = RLIM_INFINITY; 2.36 ++ rlim.rlim_cur = limit; 2.37 ++#else 2.38 + rlim.rlim_cur = rlim.rlim_max = limit; 2.39 ++#endif 2.40 + if (setrlimit(RLIMIT_FSIZE, &rlim) < 0) 2.41 + msg_fatal("setrlimit: %m"); 2.42 + #ifdef SIGXFSZ 2.43 +Index: src/util/msg_syslog.c 2.44 +--- src/util/msg_syslog.c.orig 2006-06-15 20:07:16 +0200 2.45 ++++ src/util/msg_syslog.c 2008-01-24 12:31:48 +0100 2.46 +@@ -50,6 +50,11 @@ 2.47 + #include <syslog.h> 2.48 + #include <string.h> 2.49 + #include <time.h> 2.50 ++#ifdef USE_SOFTLIMITONLY 2.51 ++#include <sys/time.h> 2.52 ++#include <sys/resource.h> 2.53 ++#include <signal.h> 2.54 ++#endif 2.55 + 2.56 + /* Application-specific. */ 2.57 + 2.58 +@@ -144,6 +149,9 @@ 2.59 + 2.60 + static void msg_syslog_print(int level, const char *text) 2.61 + { 2.62 ++#ifdef USE_SOFTLIMITONLY 2.63 ++ struct rlimit save, rlim; 2.64 ++#endif 2.65 + static int log_level[] = { 2.66 + LOG_INFO, LOG_WARNING, LOG_ERR, LOG_CRIT, LOG_CRIT, 2.67 + }; 2.68 +@@ -154,6 +162,15 @@ 2.69 + if (level < 0 || level >= (int) (sizeof(log_level) / sizeof(log_level[0]))) 2.70 + msg_panic("msg_syslog_print: invalid severity level: %d", level); 2.71 + 2.72 ++#ifdef USE_SOFTLIMITONLY 2.73 ++ if (getrlimit(RLIMIT_FSIZE, &save) < 0) { 2.74 ++ save.rlim_cur = RLIM_INFINITY; 2.75 ++ save.rlim_max = RLIM_INFINITY; 2.76 ++ } 2.77 ++ rlim.rlim_cur = save.rlim_max; 2.78 ++ rlim.rlim_max = save.rlim_max; 2.79 ++ (void)setrlimit(RLIMIT_FSIZE, &rlim); 2.80 ++#endif 2.81 + if (level == MSG_INFO) { 2.82 + syslog(syslog_facility | log_level[level], "%.*s", 2.83 + (int) MSG_SYSLOG_RECLEN, text); 2.84 +@@ -161,6 +178,9 @@ 2.85 + syslog(syslog_facility | log_level[level], "%s: %.*s", 2.86 + severity_name[level], (int) MSG_SYSLOG_RECLEN, text); 2.87 + } 2.88 ++#ifdef USE_SOFTLIMITONLY 2.89 ++ (void)setrlimit(RLIMIT_FSIZE, &save); 2.90 ++#endif 2.91 + } 2.92 + 2.93 + /* msg_syslog_init - initialize */ 2.94 +Index: src/util/sys_defs.h 2.95 +--- src/util/sys_defs.h.orig 2008-01-15 01:51:44 +0100 2.96 ++++ src/util/sys_defs.h 2008-01-24 12:32:41 +0100 2.97 +@@ -24,7 +24,7 @@ 2.98 + * 4.4BSD and close derivatives. 2.99 + */ 2.100 + #if defined(FREEBSD2) || defined(FREEBSD3) || defined(FREEBSD4) \ 2.101 +- || defined(FREEBSD5) || defined(FREEBSD6) || defined(FREEBSD7) \ 2.102 ++ || defined(FREEBSD5) || defined(FREEBSD6) || defined(FREEBSD7) || defined(FREEBSD8) \ 2.103 + || defined(BSDI2) || defined(BSDI3) || defined(BSDI4) \ 2.104 + || defined(OPENBSD2) || defined(OPENBSD3) || defined(OPENBSD4) \ 2.105 + || defined(NETBSD1) || defined(NETBSD2) || defined(NETBSD3) \ 2.106 +Index: src/smtp/smtp_reuse.c 2.107 +--- src/smtp/smtp_reuse.c.orig 2008-12-04 01:06:42 +0100 2.108 ++++ src/smtp/smtp_reuse.c 2009-01-04 11:11:45 +0100 2.109 +@@ -216,7 +216,9 @@ 2.110 + /* 2.111 + * Avoid poor performance when TCP MSS > VSTREAM_BUFSIZE. 2.112 + */ 2.113 ++#if 0 2.114 + vstream_tweak_sock(stream); 2.115 ++#endif 2.116 + 2.117 + /* 2.118 + * Update the list of used cached addresses.
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 3.2 +++ b/postfix/postfix.patch.pfls Mon Apr 06 23:53:05 2009 +0200 3.3 @@ -0,0 +1,71 @@ 3.4 +This patch makes Pflogsumm working with the particular format 3.5 +of the OSSP fsl based Postfix logfile and additionally allows 3.6 +one to specify a more flexible data format. 3.7 + 3.8 +Index: pflogsumm.1 3.9 +--- pflogsumm.1.orig 2007-04-06 16:11:28 +0200 3.10 ++++ pflogsumm.1 2007-04-06 17:35:12 +0200 3.11 +@@ -172,6 +172,8 @@ 3.12 + .Vb 2 3.13 + \& -d today generate report for just today 3.14 + \& -d yesterday generate report for just "yesterday" 3.15 ++\& -d YYYY-MM-DD generate report for just "YYYY-MM-DD" 3.16 ++\& (Really takes string Date::Parse will handle) 3.17 + .Ve 3.18 + .PP 3.19 + .Vb 1 3.20 +Index: pflogsumm.pl 3.21 +--- pflogsumm.pl.orig 2008-06-29 15:46:01 +0200 3.22 ++++ pflogsumm.pl 2008-06-29 19:39:07 +0200 3.23 +@@ -10,7 +10,7 @@ 3.24 + 3.25 + =head1 SYNOPSIS 3.26 + 3.27 +- pflogsumm.pl -[eq] [-d <today|yesterday>] [-h <cnt>] [-u <cnt>] 3.28 ++ pflogsumm.pl -[eq] [-d <today|yesterday|YYYY-MM-DD>] [-h <cnt>] [-u <cnt>] 3.29 + [--verp_mung[=<n>]] [--verbose_msg_detail] [--iso_date_time] 3.30 + [-m|--uucp_mung] [-i|--ignore_case] [--smtpd_stats] [--mailq] 3.31 + [--problems_first] [--rej_add_from] [--no_bounce_detail] 3.32 +@@ -37,6 +37,9 @@ 3.33 + 3.34 + -d today generate report for just today 3.35 + -d yesterday generate report for just "yesterday" 3.36 ++ -d YYYY-MM-DD generate report for just "YYYY-MM-DD" 3.37 ++ (Actually this will take any date string 3.38 ++ parsable by the perl Date::Parse module) 3.39 + 3.40 + -e extended (extreme? excessive?) detail 3.41 + 3.42 +@@ -359,6 +362,7 @@ 3.43 + use strict; 3.44 + use locale; 3.45 + use Getopt::Long; 3.46 ++use Date::Parse; 3.47 + eval { require Date::Calc }; 3.48 + my $hasDateCalc = $@ ? 0 : 1; 3.49 + 3.50 +@@ -542,8 +546,8 @@ 3.51 + my $logRmdr; 3.52 + next unless((($msgMonStr, $msgDay, $msgHr, $msgMin, $msgSec, $logRmdr) = 3.53 + /^(...) +(\d+) (..):(..):(..) \S+ (.+)$/o) == 6); 3.54 +- unless((($cmd, $qid) = $logRmdr =~ m#^(?:postfix|$syslogName)/([^\[:]*).*?: ([^:\s]+)#o) == 2 || 3.55 +- (($cmd, $qid) = $logRmdr =~ m#^((?:postfix)(?:-script)?)(?:\[\d+\])?: ([^:\s]+)#o) == 2) 3.56 ++ unless((($cmd, $qid) = $logRmdr =~ m#^<[a-z]+>\s+(?:postfix|$syslogName)/([^\[:]*).*?: ([^:\s]+)#o) == 2 || 3.57 ++ (($cmd, $qid) = $logRmdr =~ m#^<[a-z]+>\s+((?:postfix)(?:-script)?)(?:\[\d+\])?: ([^:\s]+)#o) == 2) 3.58 + { 3.59 + #print UNPROCD "$_"; 3.60 + next; 3.61 +@@ -1406,11 +1410,11 @@ 3.62 + # Back up to yesterday 3.63 + $time -= ((localtime($time))[2] + 2) * 3600; 3.64 + } elsif($dateOpt ne "today") { 3.65 +- die "$usageMsg\n"; 3.66 ++ $time = str2time($dateOpt); 3.67 + } 3.68 + my ($t_mday, $t_mon) = (localtime($time))[3,4]; 3.69 + 3.70 +- return sprintf("%s %2d", $monthNames[$t_mon], $t_mday); 3.71 ++ return sprintf("%s %02d", $monthNames[$t_mon], $t_mday); 3.72 + } 3.73 + 3.74 + # if there's a real domain: uses that. Otherwise uses the IP addr.
4.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 4.2 +++ b/postfix/postfix.spec Mon Apr 06 23:53:05 2009 +0200 4.3 @@ -0,0 +1,379 @@ 4.4 +## 4.5 +## postfix.spec -- OpenPKG RPM Package Specification 4.6 +## Copyright (c) 2000-2008 OpenPKG Foundation e.V. <http://openpkg.net/> 4.7 +## 4.8 +## Permission to use, copy, modify, and distribute this software for 4.9 +## any purpose with or without fee is hereby granted, provided that 4.10 +## the above copyright notice and this permission notice appear in all 4.11 +## copies. 4.12 +## 4.13 +## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED 4.14 +## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 4.15 +## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 4.16 +## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR 4.17 +## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 4.18 +## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 4.19 +## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 4.20 +## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 4.21 +## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 4.22 +## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 4.23 +## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 4.24 +## SUCH DAMAGE. 4.25 +## 4.26 + 4.27 +# package versions 4.28 +%define V_postfix 2.5.6 4.29 +%define V_pflogsumm 1.1.2 4.30 +%define V_whoson 2.4.0 4.31 + 4.32 +# package information 4.33 +Name: postfix 4.34 +Summary: Mail Transfer Agent (MTA) 4.35 +URL: http://www.postfix.org/ 4.36 +Vendor: Wietse Venema 4.37 +Packager: OpenPKG Foundation e.V. 4.38 +Distribution: OpenPKG Community 4.39 +Class: BASE 4.40 +Group: Mail 4.41 +License: IPL 4.42 +Version: %{V_postfix} 4.43 +Release: 20090104 4.44 + 4.45 +# package options 4.46 +%option with_fsl yes 4.47 +%option with_ssl no 4.48 +%option with_sasl no 4.49 +%option with_mysql no 4.50 +%option with_pgsql no 4.51 +%option with_ldap no 4.52 +%option with_whoson no 4.53 +%option with_fdsetsize no 4.54 + 4.55 +# list of sources 4.56 +Source0: ftp://ftp.porcupine.org/mirrors/postfix-release/official/postfix-%{V_postfix}.tar.gz 4.57 +Source1: http://jimsun.linxnet.com/downloads/pflogsumm-%{V_pflogsumm}.tar.gz 4.58 +Source2: postfix.txt 4.59 +Source3: fsl.postfix 4.60 +Source4: rc.postfix 4.61 +Patch0: postfix.patch 4.62 +Patch1: postfix.patch.pfls 4.63 +Patch2: ftp://ftp.openpkg.org/sources/CPY/postfix/postfix-%{V_whoson}-whoson.patch 4.64 + 4.65 +# build information 4.66 +Prefix: %{l_prefix} 4.67 +BuildRoot: %{l_buildroot} 4.68 +BuildPreReq: OpenPKG, openpkg >= 20060823, perl, gcc 4.69 +PreReq: OpenPKG, openpkg >= 20060823, perl, procmail, perl-time 4.70 +BuildPreReq: make, pcre, db 4.71 +PreReq: make, pcre, db 4.72 +%if "%{with_fsl}" == "yes" 4.73 +BuildPreReq: fsl 4.74 +PreReq: fsl 4.75 +%endif 4.76 +%if "%{with_ssl}" == "yes" 4.77 +BuildPreReq: openssl 4.78 +PreReq: openssl 4.79 +%endif 4.80 +%if "%{with_sasl}" == "yes" 4.81 +BuildPreReq: sasl 4.82 +PreReq: sasl 4.83 +%endif 4.84 +%if "%{with_mysql}" == "yes" 4.85 +BuildPreReq: mysql 4.86 +PreReq: mysql 4.87 +%endif 4.88 +%if "%{with_pgsql}" == "yes" 4.89 +BuildPreReq: postgresql, openssl 4.90 +PreReq: postgresql, openssl 4.91 +%endif 4.92 +%if "%{with_ldap}" == "yes" 4.93 +BuildPreReq: openldap, openssl 4.94 +PreReq: openldap, openssl 4.95 +%endif 4.96 +%if "%{with_whoson}" == "yes" 4.97 +BuildPreReq: whoson 4.98 +PreReq: whoson 4.99 +%endif 4.100 +AutoReq: no 4.101 +AutoReqProv: no 4.102 +Provides: MTA 4.103 +Conflicts: exim, sendmail, ssmtp 4.104 + 4.105 +%description 4.106 + Postfix is a new-generation Mail Transfer Agent (MTA) able to fully 4.107 + replace the Sendmail MTA. It is fully standards compliant and 4.108 + supports SMTP, ESMTP, LMTP over IPv4/IPv6 with optional TLS/SASL. 4.109 + 4.110 + Local specifics in this OpenPKG version: 4.111 + o Postfix delivers locally via Procmail 4.112 + o Postfix logs directly to the filesystem via OSSP fsl 4.113 + o Berkeley-DB dictionary support 4.114 + o PCRE matching support 4.115 + o Optional STARTTLS encryption support (see package options) 4.116 + o Optional SASL2 authentication support (see package options) 4.117 + o Optional MySQL dictionary support (see package options) 4.118 + o Optional PostgreSQL dictionary support (see package options) 4.119 + o Optional OpenLDAP dictionary support (see package options) 4.120 + o Optional WHOSON dictionary support (see package options) 4.121 + 4.122 +%track 4.123 + prog postfix = { 4.124 + version = %{V_postfix} 4.125 + url = ftp://ftp.porcupine.org/mirrors/postfix-release/official/ 4.126 + regex = postfix-(\d+\.\d+\.\d+)\.tar\.gz 4.127 + } 4.128 + prog postfix:pflogsumm = { 4.129 + version = %{V_pflogsumm} 4.130 + url = http://jimsun.linxnet.com/postfix_contrib.html 4.131 + regex = pflogsumm-(__VER__)\.tar\.gz 4.132 + } 4.133 + prog postfix:whoson = { 4.134 + version = %{V_whoson} 4.135 + url = ftp://ftp.openpkg.org/sources/CPY/postfix/ 4.136 + regex = postfix-(__VER__)-whoson.patch 4.137 + } 4.138 + 4.139 +%prep 4.140 + # unpack distribution files 4.141 + %setup -q 4.142 + %setup -q -T -D -a 1 4.143 + 4.144 + # apply OpenPKG patches 4.145 + %patch -p0 4.146 + ( cd pflogsumm-%{V_pflogsumm} && %{l_patch} -p0 -b <%{PATCH1} ) || exit $? 4.147 + 4.148 + # apply vendor WHOSON patch 4.149 +%if "%{with_whoson}" == "yes" 4.150 + %patch -p0 -P 2 4.151 +%endif 4.152 + 4.153 +%build 4.154 + # configure Postfix (hard-core part I) 4.155 + %{l_shtool} subst \ 4.156 + -e 's/var_config_dir, /var_command_dir, /' \ 4.157 + src/postfix/postfix.c 4.158 + %{l_shtool} subst \ 4.159 + -e 's;config_directory/postfix-script;command_directory/postfix-script;' \ 4.160 + -e 's;config_directory/post-install;command_directory/postfix-install;' \ 4.161 + conf/postfix-script 4.162 + %{l_shtool} subst \ 4.163 + -e 's;/usr/include;%{l_prefix}/include;g' \ 4.164 + makedefs 4.165 + 4.166 + # configure Postfix (regular part) 4.167 + unset LD_LIBRARY_PATH || true 4.168 + CCARGS="" 4.169 + CCARGS="$CCARGS %{l_cflags -O}" 4.170 + CCARGS="$CCARGS %{l_cppflags}" 4.171 + CCARGS="$CCARGS -DDEF_COMMAND_DIR=\\\"%{l_prefix}/sbin\\\"" 4.172 + CCARGS="$CCARGS -DDEF_SENDMAIL_PATH=\\\"%{l_prefix}/sbin/sendmail\\\"" 4.173 + CCARGS="$CCARGS -DDEF_CONFIG_DIR=\\\"%{l_prefix}/etc/postfix\\\"" 4.174 + CCARGS="$CCARGS -DDEF_DAEMON_DIR=\\\"%{l_prefix}/libexec/postfix\\\"" 4.175 + CCARGS="$CCARGS -DDEF_QUEUE_DIR=\\\"%{l_prefix}/var/postfix\\\"" 4.176 + CCARGS="$CCARGS -DDEF_DATA_DIR=\\\"%{l_prefix}/var/postfix/data\\\"" 4.177 + AUXLIBS="" 4.178 + AUXLIBS="$AUXLIBS %{l_ldflags}" 4.179 + CCARGS="$CCARGS -DHAS_DB" 4.180 + AUXLIBS="$AUXLIBS -ldb" 4.181 + CCARGS="$CCARGS -DHAS_PCRE" 4.182 + AUXLIBS="$AUXLIBS -lpcre" 4.183 +%if "%{with_mysql}" == "yes" 4.184 + CCARGS="$CCARGS -DHAS_MYSQL %{l_cppflags mysql .}" 4.185 + AUXLIBS="$AUXLIBS %{l_ldflags mysql .} -lmysqlclient -lz -lm" 4.186 +%endif 4.187 +%if "%{with_pgsql}" == "yes" 4.188 + CCARGS="$CCARGS -DHAS_PGSQL %{l_cppflags postgresql .}" 4.189 + AUXLIBS="$AUXLIBS -lpq -lssl -lcrypto -lcrypt" 4.190 +%endif 4.191 +%if "%{with_sasl}" == "yes" 4.192 + CCARGS="$CCARGS -DUSE_SASL_AUTH -DUSE_CYRUS_SASL %{l_cppflags sasl .}" 4.193 + AUXLIBS="$AUXLIBS -lsasl2 -lcrypt" 4.194 + if [ -f /usr/lib/libdl.so -o -f /usr/lib/libdl.a ]; then 4.195 + AUXLIBS="$AUXLIBS -ldl" 4.196 + fi 4.197 + if [ -f /usr/lib64/libdl.so -o -f /usr/lib64/libdl.a ]; then 4.198 + AUXLIBS="$AUXLIBS -ldl" 4.199 + fi 4.200 +%endif 4.201 +%if "%{with_ssl}" == "yes" 4.202 + CCARGS="$CCARGS -DUSE_TLS" 4.203 + AUXLIBS="$AUXLIBS -lssl -lcrypto" 4.204 +%endif 4.205 +%if "%{with_ldap}" == "yes" 4.206 + CCARGS="$CCARGS -DHAS_LDAP" 4.207 + AUXLIBS="$AUXLIBS -lldap -llber -lssl -lcrypto" 4.208 +%endif 4.209 +%if "%{with_fsl}" == "yes" 4.210 + AUXLIBS="$AUXLIBS %{l_fsl_ldflags} %{l_fsl_libs}" 4.211 + CCARGS="$CCARGS -DUSE_SOFTLIMITONLY" 4.212 +%endif 4.213 +%if "%{with_fdsetsize}" != "no" 4.214 +%if "%{with_fdsetsize}" == "yes" 4.215 + CCARGS="$CCARGS -DFD_SETSIZE=1024" 4.216 +%else 4.217 + CCARGS="$CCARGS -DFD_SETSIZE=%{with_fdsetsize}" 4.218 +%endif 4.219 +%endif 4.220 + case "%{l_platform -t}" in 4.221 + *-sunos* ) AUXLIBS="$AUXLIBS -lrt" ;; 4.222 + esac 4.223 + %{l_make} %{l_mflags} -f Makefile.init makefiles \ 4.224 + CC="%{l_cc}" CCARGS="$CCARGS" AUXLIBS="$AUXLIBS" 4.225 + 4.226 + # configure Postfix (hard-core part II) 4.227 + %{l_shtool} subst \ 4.228 + -e 's;#define HAS_DBM;#define HAS_DBM_DISABLED;' \ 4.229 + -e 's;#define HAS_DB;#define HAS_DB_DISABLED;' \ 4.230 + src/util/sys_defs.h 4.231 + 4.232 + # build Postfix 4.233 + %{l_make} %{l_mflags} 4.234 + 4.235 +%install 4.236 + rm -rf $RPM_BUILD_ROOT 4.237 + 4.238 + # perform standard installation procedure 4.239 + %{l_shtool} subst -e "s;chown;true;" postfix-install 4.240 + sh postfix-install -non-interactive \ 4.241 + install_root=$RPM_BUILD_ROOT \ 4.242 + config_directory=%{l_prefix}/etc/postfix \ 4.243 + daemon_directory=%{l_prefix}/libexec/postfix \ 4.244 + command_directory=%{l_prefix}/sbin \ 4.245 + queue_directory=%{l_prefix}/var/postfix \ 4.246 + data_directory=%{l_prefix}/var/postfix/data \ 4.247 + sendmail_path=%{l_prefix}/sbin/sendmail \ 4.248 + newaliases_path=%{l_prefix}/sbin/newaliases \ 4.249 + mailq_path=%{l_prefix}/sbin/mailq \ 4.250 + manpage_directory=%{l_prefix}/man \ 4.251 + mail_user=%{l_musr} \ 4.252 + setgid_group=%{l_rgrp} 4.253 + 4.254 + # post-adjust binaries 4.255 + rm -f $RPM_BUILD_ROOT%{l_prefix}/sbin/mailq 4.256 + ln $RPM_BUILD_ROOT%{l_prefix}/sbin/sendmail \ 4.257 + $RPM_BUILD_ROOT%{l_prefix}/sbin/mailq 4.258 + rm -f $RPM_BUILD_ROOT%{l_prefix}/sbin/newaliases 4.259 + ln $RPM_BUILD_ROOT%{l_prefix}/sbin/sendmail \ 4.260 + $RPM_BUILD_ROOT%{l_prefix}/sbin/newaliases 4.261 + strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true 4.262 + strip $RPM_BUILD_ROOT%{l_prefix}/libexec/postfix/* >/dev/null 2>&1 || true 4.263 + 4.264 + # post-adjust configuration 4.265 + for cfg in \ 4.266 + *LICENSE makedefs.out bounce.cf.default access aliases \ 4.267 + canonical header_checks relocated transport virtual \ 4.268 + main.cf master.cf main.cf.default; do 4.269 + rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/postfix/$cfg 4.270 + done 4.271 + mv $RPM_BUILD_ROOT%{l_prefix}/etc/postfix/postfix-script \ 4.272 + $RPM_BUILD_ROOT%{l_prefix}/sbin/postfix-script 4.273 + rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/postfix/postfix-script* 4.274 + mv $RPM_BUILD_ROOT%{l_prefix}/etc/postfix/post-install \ 4.275 + $RPM_BUILD_ROOT%{l_prefix}/sbin/postfix-install 4.276 + 4.277 + # install default configuration 4.278 + for name in `grep "^<file" %{SOURCE postfix.txt} | sed -e 's;^.*name=";;' -e 's;".*$;;'`; do 4.279 + (echo ""; cat %{SOURCE postfix.txt}; echo "") |\ 4.280 + sed -e "1,/^<file name=\"$name\">/d" -e "/<\/file>/,\$d" >$name 4.281 + %{l_shtool} install -c -m 644 %{l_value -s -a} \ 4.282 + $name $RPM_BUILD_ROOT%{l_prefix}/etc/postfix/ 4.283 + done 4.284 + 4.285 + # pre-create variable stuff 4.286 + ( cd $RPM_BUILD_ROOT%{l_prefix}/var/postfix 4.287 + %{l_shtool} mkdir -f -p -m 700 data 4.288 + %{l_shtool} mkdir -f -p -m 755 log 4.289 + ) || exit $? 4.290 + 4.291 + # install addons 4.292 + %{l_shtool} install -c -m 755 \ 4.293 + -e 's;/usr/sbin/sendmail;%{l_prefix}/sbin/sendmail;g' \ 4.294 + auxiliary/rmail/rmail $RPM_BUILD_ROOT%{l_prefix}/sbin/rmail 4.295 + %{l_shtool} install -c -m 755 \ 4.296 + -e 's;/usr/bin/perl;%{l_prefix}/bin/perl;g' \ 4.297 + -e 's;postconf -h;%{l_prefix}/sbin/postconf -h;' \ 4.298 + auxiliary/qshape/qshape.pl $RPM_BUILD_ROOT%{l_prefix}/sbin/qshape 4.299 + %{l_shtool} install -c -m 644 \ 4.300 + man/man1/qshape.1 $RPM_BUILD_ROOT%{l_prefix}/man/man8/qshape.8 4.301 + ( cd pflogsumm-%{V_pflogsumm} 4.302 + %{l_shtool} install -c -m 755 \ 4.303 + -e 's;/usr/bin/perl;%{l_prefix}/bin/perl;g' \ 4.304 + pflogsumm.pl $RPM_BUILD_ROOT%{l_prefix}/sbin/pflogsumm 4.305 + %{l_shtool} install -c -m 644 \ 4.306 + pflogsumm.1 $RPM_BUILD_ROOT%{l_prefix}/man/man1/ 4.307 + ) || exit $? 4.308 + 4.309 + # install run-command script 4.310 + %{l_shtool} mkdir -f -p -m 755 \ 4.311 + $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d 4.312 + %{l_shtool} install -c -m 755 %{l_value -s -a} \ 4.313 + %{SOURCE rc.postfix} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ 4.314 + 4.315 + # adjust installation to avoid file name conflicts 4.316 + ( cd $RPM_BUILD_ROOT%{l_prefix}/man/man8 4.317 + mv master.8 postfix_master.8 4.318 + ) || exit $? 4.319 + 4.320 + # install OSSP fsl configuration 4.321 + %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl 4.322 + %{l_shtool} install -c -m 644 %{l_value -s -a} \ 4.323 + %{SOURCE fsl.postfix} \ 4.324 + $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/ 4.325 + 4.326 + # generate file list 4.327 + %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ 4.328 + %{l_files_std} \ 4.329 + '%config %{l_prefix}/etc/fsl/fsl.postfix' \ 4.330 + '%attr(-,%{l_susr},%{l_mgrp}) %{l_prefix}/etc/postfix' \ 4.331 + '%config %attr(-,%{l_susr},%{l_mgrp}) %{l_prefix}/etc/postfix/*' \ 4.332 + '%attr(-,%{l_susr},%{l_mgrp}) %{l_prefix}/libexec/postfix/*' \ 4.333 + '%attr(2755,%{l_musr},%{l_rgrp}) %{l_prefix}/sbin/{postdrop,postqueue}' \ 4.334 + '%dir %attr(-,%{l_susr},%{l_mgrp}) %{l_prefix}/libexec/postfix' \ 4.335 + '%dir %attr(-,%{l_susr},%{l_mgrp}) %{l_prefix}/var/postfix' \ 4.336 + '%dir %attr(-,%{l_musr},%{l_rgrp}) %{l_prefix}/var/postfix/{maildrop,public}' 4.337 + 4.338 +%files -f files 4.339 + 4.340 +%clean 4.341 + rm -rf $RPM_BUILD_ROOT 4.342 + 4.343 +%pre 4.344 + # before upgrade, save status and stop service 4.345 + [ $1 -eq 2 ] || exit 0 4.346 + eval `%{l_rc} postfix status 2>/dev/null | tee %{l_tmpfile}` 4.347 + %{l_rc} postfix stop 2>/dev/null 4.348 + exit 0 4.349 + 4.350 +%post 4.351 + if [ $1 -eq 1 ]; then 4.352 + # after install, generate configuration 4.353 + ( cd $RPM_INSTALL_PREFIX/etc/postfix && %{l_make} all; true ) >/dev/null 2>&1 4.354 + fi 4.355 + if [ $1 -eq 2 ]; then 4.356 + # after upgrade, regenerate configuration 4.357 + ( cd $RPM_INSTALL_PREFIX/etc/postfix && %{l_make} clean all; true ) >/dev/null 2>&1 4.358 + # after upgrade, restore status 4.359 + eval `cat %{l_tmpfile}`; rm -f %{l_tmpfile} >/dev/null 2>&1 || true 4.360 + [ ".$postfix_active" = .yes ] && %{l_rc} postfix start 4.361 + fi 4.362 + exit 0 4.363 + 4.364 +%preun 4.365 + # before erase, stop service and remove log files 4.366 + [ $1 -eq 0 ] || exit 0 4.367 + %{l_rc} postfix stop 2>/dev/null 4.368 + rm -f $RPM_INSTALL_PREFIX/var/postfix/log/postfix.log* >/dev/null 2>&1 || true 4.369 + rm -f $RPM_INSTALL_PREFIX/var/postfix/log/postfix.sum* >/dev/null 2>&1 || true 4.370 + # remove generated configuration files 4.371 + ( cd $RPM_INSTALL_PREFIX/etc/postfix && %{l_make} clean >/dev/null 2>&1; true ) || true 4.372 + # remove generated run-time files and directories 4.373 + rm -rf $RPM_INSTALL_PREFIX/etc/postfix/data/* 4.374 + rm -rf $RPM_INSTALL_PREFIX/var/postfix/pid/* 4.375 + rm -rf $RPM_INSTALL_PREFIX/var/postfix/private/* 4.376 + rm -rf $RPM_INSTALL_PREFIX/var/postfix/public/* 4.377 + find $RPM_INSTALL_PREFIX/var/postfix/active/ -type d -print |\ 4.378 + xargs rmdir >/dev/null 2>&1 || true 4.379 + find $RPM_INSTALL_PREFIX/var/postfix/incoming/ -type d -print |\ 4.380 + xargs rmdir >/dev/null 2>&1 || true 4.381 + exit 0 4.382 +
5.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 5.2 +++ b/postfix/postfix.txt Mon Apr 06 23:53:05 2009 +0200 5.3 @@ -0,0 +1,340 @@ 5.4 +<file name="Makefile"> 5.5 +## 5.6 +## @l_prefix@/etc/postfix/Makefile -- maintainance procedures 5.7 +## 5.8 + 5.9 +# path configuration 5.10 +PREFIX = @l_prefix@ 5.11 +SBINDIR = $(PREFIX)/sbin 5.12 +ETCDIR = $(PREFIX)/etc 5.13 + 5.14 +# program configuration 5.15 +RC = $(ETCDIR)/rc 5.16 +POSTALIAS = $(SBINDIR)/postalias 5.17 +POSTMAP = $(SBINDIR)/postmap 5.18 +POSTFIX = $(SBINDIR)/postfix 5.19 + 5.20 +# table filename configuration 5.21 +T_ACCESS = access 5.22 +T_CANONICAL = canonical 5.23 +T_GENERIC = generic 5.24 +T_VIRTUAL = virtual 5.25 +T_RELOCATED = relocated 5.26 +T_TRANSPORT = transport 5.27 +T_ALIASES = aliases 5.28 + 5.29 +# dependency tracking 5.30 +TIMESTAMP = .up-to-date 5.31 +DEPENDENCIES = Makefile master.cf main.cf $(TABLES) 5.32 + 5.33 +# managed tables: 5.34 +# - use extension ".db" for hash tables ("hash") 5.35 +# - use no extension for regex tables ("pcre") 5.36 +TABLES = \ 5.37 + $(T_ACCESS).db \ 5.38 + $(T_CANONICAL).db \ 5.39 + $(T_GENERIC).db \ 5.40 + $(T_VIRTUAL).db \ 5.41 + $(T_RELOCATED).db \ 5.42 + $(T_TRANSPORT).db \ 5.43 + $(T_ALIASES).db 5.44 + 5.45 +# default target 5.46 +all: $(TABLES) $(TIMESTAMP) 5.47 + 5.48 +# implicit checking and reloading 5.49 +$(TIMESTAMP): $(DEPENDENCIES) 5.50 + $(POSTFIX) check 5.51 + $(POSTFIX) reload >/dev/null 2>&1 || true 5.52 + touch $(TIMESTAMP) && chmod 600 $(TIMESTAMP) 5.53 + 5.54 +# explicit checking 5.55 +check: 5.56 + $(POSTFIX) check 5.57 + 5.58 +# hash table update targets 5.59 +$(T_ACCESS).db: $(T_ACCESS) $(MAKEFILE) 5.60 + $(POSTMAP) hash:$(T_ACCESS) 5.61 +$(T_CANONICAL).db: $(T_CANONICAL) $(MAKEFILE) 5.62 + $(POSTMAP) hash:$(T_CANONICAL) 5.63 +$(T_GENERIC).db: $(T_GENERIC) $(MAKEFILE) 5.64 + $(POSTMAP) hash:$(T_GENERIC) 5.65 +$(T_VIRTUAL).db: $(T_VIRTUAL) $(MAKEFILE) 5.66 + $(POSTMAP) hash:$(T_VIRTUAL) 5.67 +$(T_RELOCATED).db: $(T_RELOCATED) $(MAKEFILE) 5.68 + $(POSTMAP) hash:$(T_RELOCATED) 5.69 +$(T_TRANSPORT).db: $(T_TRANSPORT) $(MAKEFILE) 5.70 + $(POSTMAP) hash:$(T_TRANSPORT) 5.71 +$(T_ALIASES).db: $(T_ALIASES) $(MAKEFILE) 5.72 + $(POSTALIAS) hash:$(T_ALIASES) 5.73 + 5.74 +# cleanup target 5.75 +clean: 5.76 + -rm -f $(TABLES) 5.77 + -rm -f $(TIMESTAMP) 5.78 + 5.79 +# process management 5.80 +start: 5.81 + $(RC) postfix start 5.82 +reload: 5.83 + $(RC) postfix reload 5.84 +stop: 5.85 + $(RC) postfix stop 5.86 + 5.87 +</file> 5.88 +<file name="master.cf"> 5.89 +## 5.90 +## @l_prefix@/etc/postfix/master.cf -- Postfix master process table 5.91 +## 5.92 +# ========================================================================== 5.93 +# service type private unpriv chroot wakeup maxproc command + args 5.94 +# (yes) (yes) (yes) (never) (100) 5.95 +# ========================================================================== 5.96 +smtp inet n - n - - smtpd 5.97 +#628 inet n - n - - qmqpd 5.98 +pickup fifo n - n 60 1 pickup 5.99 +cleanup unix n - n - 0 cleanup 5.100 +qmgr fifo n - n 300 1 qmgr 5.101 +tlsmgr unix - - n 1000? 1 tlsmgr 5.102 +rewrite unix - - n - - trivial-rewrite 5.103 +bounce unix - - n - 0 bounce 5.104 +defer unix - - n - 0 bounce 5.105 +trace unix - - n - 0 bounce 5.106 +verify unix - - n - 1 verify 5.107 +flush unix n - n 1000? 0 flush 5.108 +proxymap unix - - n - - proxymap 5.109 +proxywrite unix - - n - - proxymap 5.110 +smtp unix - - n - - smtp 5.111 +relay unix - - n - - smtp -o fallback_relay= 5.112 +showq unix n - n - - showq 5.113 +error unix - - n - - error 5.114 +retry unix - - n - - error 5.115 +local unix - n n - - local 5.116 +virtual unix - n n - - virtual 5.117 +lmtp unix - - n - - lmtp 5.118 +anvil unix - - n - 1 anvil 5.119 +scache unix - - n - 1 scache 5.120 +#maildrop unix - n n - - pipe flags=DRhu user=@l_nusr@ argv=@l_prefix@/bin/maildrop -d ${recipient} 5.121 +#cyrus unix - n n - - pipe user=@l_nusr@ argv=@l_prefix@/bin/cyrdeliver -e -r ${sender} -m ${extension} ${user} 5.122 +#uucp unix - n n - - pipe flags=Fqhu user=@l_nusr@ argv=@l_prefix@/bin/uux -r -n -z -a$sender - $nexthop!rmail ($recipient) 5.123 +#ifmail unix - n n - - pipe flags=F user=@l_nusr@ argv=@l_prefix@/bin/ifmail -r $nexthop ($recipient) 5.124 +#bsmtp unix - n n - - pipe flags=Fq. user=@l_nusr@ argv=@l_prefix@/bin/bsmtp -f $sender $nexthop $recipient 5.125 +</file> 5.126 +<file name="main.cf"> 5.127 +## 5.128 +## @l_prefix@/etc/postfix/main.cf -- Postfix main configuration 5.129 +## 5.130 +## Run "@l_prefix@/sbin/postconf -n" to see all parameters overriding 5.131 +## defaults, run "@l_prefix@/sbin/postconf -d" to see all possible 5.132 +## parameters and their defaults and read the following manual 5.133 +## pages for description of each parameter: bounce(8), cleanup(8), 5.134 +## defer(8), error(8), flush(8), lmtp(8), local(8), master(8), 5.135 +## pickup(8), pipe(8), qmgr(8), showq(8), smtp(8), smtpd(8), spawn(8), 5.136 +## trivial-rewrite(8). 5.137 +## 5.138 + 5.139 +# users 5.140 +mail_owner = @l_musr@ 5.141 +setgid_group = @l_rgrp@ 5.142 +default_privs = @l_nusr@ 5.143 + 5.144 +# local host 5.145 +myhostname = mail.example.com 5.146 +mydomain = example.com 5.147 +myorigin = $myhostname 5.148 + 5.149 +# smtp daemon 5.150 +#smtpd_banner = $myhostname ESMTP $mail_name 5.151 +inet_interfaces = 127.0.0.1 5.152 + 5.153 +# smtp client 5.154 +smtp_bind_address = 127.0.0.1 5.155 + 5.156 +# relaying 5.157 +mynetworks = 127.0.0.0/8 5.158 +#mydestination = $myhostname, localhost.$mydomain 5.159 +#relay_domains = $mydestination, 5.160 +# hash:@l_prefix@/etc/postfix/access 5.161 +#smtpd_recipient_restrictions = permit_mynetworks, 5.162 +# check_client_access hash:@l_prefix@/etc/postfix/access, 5.163 +# reject_unauth_destination 5.164 + 5.165 +# maps 5.166 +#canonical_maps = hash:@l_prefix@/etc/postfix/canonical 5.167 +#smtp_generic_maps = hash:@l_prefix@/etc/postfix/generic 5.168 +#virtual_alias_maps = hash:@l_prefix@/etc/postfix/virtual 5.169 +#relocated_maps = hash:@l_prefix@/etc/postfix/relocated 5.170 +#transport_maps = hash:@l_prefix@/etc/postfix/transport 5.171 +alias_maps = hash:@l_prefix@/etc/postfix/aliases 5.172 +alias_database = hash:@l_prefix@/etc/postfix/aliases 5.173 + 5.174 +# local delivery 5.175 +#local_recipient_maps = proxy:unix:passwd.byname $alias_maps 5.176 +recipient_delimiter = + 5.177 +mailbox_command = @l_prefix@/bin/procmail -a "$EXTENSION" 5.178 + 5.179 +</file> 5.180 +<file name="access"> 5.181 +## 5.182 +## @l_prefix@/etc/postfix/access -- access control for relaying 5.183 +## 5.184 +## Searched for both the client (hostname, parent domains, IP address, 5.185 +## networks obtained by stripping least significant octets from IP 5.186 +## address) and destination address (resolved destination address, 5.187 +## parent domain, or localpart@) in order to allow relaying. Rejects 5.188 +## the request if the result is REJECT or "[45]XX text". Permits the 5.189 +## request if the result is OK or RELAY or all-numerical. 5.190 +## 5.191 + 5.192 +# Syntax (see access(5)): 5.193 +# | user@domain action 5.194 +# | domain action 5.195 +# | user@ action 5.196 +# | net.work.addr.ess action 5.197 +# | net.work.addr action 5.198 +# | net.work action 5.199 +# | net action 5.200 +# where "action" is one of: 5.201 +# "[45]NN text", "REJECT", "OK", "restriction..." 5.202 +# 5.203 +# Examples: 5.204 +# | mail.example.com OK 5.205 +# | example.com REJECT 5.206 +# | 192.168.0.1 OK 5.207 +# | 192.168 REJECT 5.208 +# | postmaster@ OK 5.209 + 5.210 +</file> 5.211 +<file name="virtual"> 5.212 +## 5.213 +## @l_prefix@/etc/postfix/virtual -- virtual address translation 5.214 +## 5.215 +## Searched for virtual addresses user@domain, user and @domain 5.216 +## (in this order). It redirect mail for all recipients, local or 5.217 +## remote. The mapping affects only envelope recipients. 5.218 +## 5.219 + 5.220 +# Syntax (see virtual(5)): 5.221 +# | user@domain address, address, ... 5.222 +# | user address, address, ... 5.223 +# | @domain address, address, ... 5.224 +# 5.225 +# Examples: 5.226 +# | @example.com john@example.com 5.227 +# | postmaster@example.com postmaster 5.228 +# | john@example1.com john1 5.229 +# | john@example2.com john2 5.230 + 5.231 +</file> 5.232 +<file name="aliases"> 5.233 +## 5.234 +## @l_prefix@/etc/postfix/aliases -- local mailbox aliases 5.235 +## 5.236 +## Searched for virtual addresses user@domain, user and @domain 5.237 +## (in this order). It redirect mail for all recipients, local or 5.238 +## remote. The mapping affects only envelope recipients. 5.239 +## 5.240 + 5.241 +# Syntax (see aliases(5)): 5.242 +# | name: value, value, ... 5.243 +# where value is one of: 5.244 +# "address", "/file/name", "|command", ":include:/file/name" 5.245 +# 5.246 +# Examples: 5.247 +# | john.doe: john, doe 5.248 +# | robot: |/path/to/robot 5.249 +# | archive: /path/to/archive 5.250 +# | users: :include:/path/to/users.list 5.251 +# | owner-users: john.doe 5.252 + 5.253 +# standard mail targets 5.254 +nobody: /dev/null 5.255 +MAILER-DAEMON: postmaster 5.256 + 5.257 +# mailbox names for common services, roles and functions 5.258 +# (see RFC2142 for more details and expanded list of names) 5.259 +postmaster: root 5.260 +hostmaster: root 5.261 +security: root 5.262 +abuse: root 5.263 + 5.264 +# save unprivileged user storage of careless admins 5.265 +root: /dev/null 5.266 + 5.267 +</file> 5.268 +<file name="canonical"> 5.269 +## 5.270 +## @l_prefix@/etc/postfix/canonical -- address canonification on mail receiving 5.271 +## 5.272 +## Searched for canonical addresses for user@domain, user and @domain 5.273 +## (in this order). 5.274 +## 5.275 + 5.276 +# Syntax (see canonical(5)): 5.277 +# | user@domain address 5.278 +# | user address 5.279 +# | @domain address 5.280 +# 5.281 +# Examples: 5.282 +# | postmaster@mail.example.com postmaster@example.com 5.283 +# | john John.Doe 5.284 +# | @example.com @example.com 5.285 + 5.286 +</file> 5.287 +<file name="relocated"> 5.288 +## 5.289 +## @l_prefix@/etc/postfix/relocated -- relocate obsolete addresses 5.290 +## 5.291 +## Searched for relocated addresses user@domain, user and @domain 5.292 +## (in this order). It bounces mail for all recipients. 5.293 +## 5.294 + 5.295 +# Syntax (see relocated(5)): 5.296 +# | user@domain address 5.297 +# | user address 5.298 +# | @domain address 5.299 +# 5.300 +# Examples: 5.301 +# | john@invalid john@example.com 5.302 +# | john john@example.com 5.303 +# | @invalid john@example.com 5.304 + 5.305 +</file> 5.306 +<file name="generic"> 5.307 +## 5.308 +## @l_prefix@/etc/postfix/generic -- address canonification on mail sending 5.309 +## 5.310 +## Searched for canonical addresses for user@domain, user and @domain 5.311 +## (in this order). 5.312 +## 5.313 + 5.314 +# Syntax (see generic(5)): 5.315 +# | user@domain address 5.316 +# | user address 5.317 +# | @domain address 5.318 +# 5.319 +# Examples: 5.320 +# | postmaster@mail.example.com postmaster@example.com 5.321 +# | john John.Doe 5.322 +# | @example.com @example.com 5.323 + 5.324 +</file> 5.325 +<file name="transport"> 5.326 +## 5.327 +## @l_prefix@/etc/postfix/transport -- transport selection 5.328 +## 5.329 +## Searched for domain and .domain (in this order). It selects the 5.330 +## specified transport facility for delivery. 5.331 +## 5.332 + 5.333 +# Syntax (see transport(5)): 5.334 +# | domain transport:nexthop 5.335 +# | .domain transport:nexthop 5.336 +# 5.337 +# Examples: 5.338 +# | me.example.com local: 5.339 +# | you.example.com smtp:mail.example.com:2525 5.340 +# | example.com smtp:mail.example.com 5.341 +# | .example.com smtp:mail.example.com 5.342 + 5.343 +</file>
6.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 6.2 +++ b/postfix/rc.postfix Mon Apr 06 23:53:05 2009 +0200 6.3 @@ -0,0 +1,74 @@ 6.4 +#!@l_prefix@/bin/openpkg rc 6.5 +## 6.6 +## rc.postfix -- Run-Commands 6.7 +## 6.8 + 6.9 +%config 6.10 + MTA_name="postfix" 6.11 + MTA_aliases_file="@l_prefix@/etc/postfix/aliases" 6.12 + MTA_aliases_update="cd @l_prefix@/etc/postfix && @l_prefix@/sbin/postalias aliases" 6.13 + postfix_enable="$openpkg_rc_def" 6.14 + postfix_log_prolog="true" 6.15 + postfix_log_epilog="true" 6.16 + postfix_log_numfiles="10" 6.17 + postfix_log_minsize="1M" 6.18 + postfix_log_complevel="9" 6.19 + postfix_sum_flags="" 6.20 + 6.21 +%status -u @l_susr@ -o 6.22 + postfix_usable="no" 6.23 + postfix_active="no" 6.24 + @l_prefix@/sbin/postfix check >/dev/null 2>&1 && postfix_usable="yes" 6.25 + @l_prefix@/libexec/postfix/master -t >/dev/null 2>&1 || postfix_active="yes" 6.26 + echo "postfix_enable=\"$postfix_enable\"" 6.27 + echo "postfix_usable=\"$postfix_usable\"" 6.28 + echo "postfix_active=\"$postfix_active\"" 6.29 + 6.30 +%start -u @l_susr@ 6.31 + rcService postfix enable yes || exit 0 6.32 + rcService postfix active yes && exit 0 6.33 + @l_prefix@/sbin/postfix start 6.34 + 6.35 +%stop -u @l_susr@ 6.36 + rcService postfix enable yes || exit 0 6.37 + rcService postfix active no && exit 0 6.38 + @l_prefix@/sbin/postfix stop 6.39 + sleep 2 6.40 + 6.41 +%restart -u @l_susr@ 6.42 + rcService postfix enable yes || exit 0 6.43 + rcService postfix active no && exit 0 6.44 + rc postfix stop start 6.45 + 6.46 +%reload -u @l_susr@ 6.47 + rcService postfix enable yes || exit 0 6.48 + rcService postfix active no && exit 0 6.49 + @l_prefix@/sbin/postfix reload 6.50 + 6.51 +%daily -u @l_susr@ 6.52 + rcService postfix enable yes || exit 0 6.53 + 6.54 + # rotate summary logfile 6.55 + shtool rotate -f \ 6.56 + -n ${postfix_log_numfiles} -s 0 \ 6.57 + -z ${postfix_log_complevel} -m 644 -o @l_musr@ -g @l_mgrp@ \ 6.58 + @l_prefix@/var/postfix/log/postfix.sum 6.59 + 6.60 + # generate summary logfile 6.61 + logfiles="@l_prefix@/var/postfix/log/postfix.log" 6.62 + if [ -f "@l_prefix@/var/postfix/log/postfix.log.0" ]; then 6.63 + logfiles="$logfiles @l_prefix@/var/postfix/log/postfix.log.0" 6.64 + fi 6.65 + @l_prefix@/sbin/pflogsumm -d yesterday -h 10 -u 10 -i \ 6.66 + --iso_date_time --problems_first --smtpd_stats --verbose_msg_detail \ 6.67 + ${postfix_sum_flags} \ 6.68 + ${logfiles} >@l_prefix@/var/postfix/log/postfix.sum 2>/dev/null 6.69 + 6.70 + # rotate logfile 6.71 + shtool rotate -f \ 6.72 + -n ${postfix_log_numfiles} -s ${postfix_log_minsize} -d \ 6.73 + -z ${postfix_log_complevel} -m 644 -o @l_musr@ -g @l_mgrp@ \ 6.74 + -P "$postfix_log_prolog" \ 6.75 + -E "$postfix_log_epilog" \ 6.76 + @l_prefix@/var/postfix/log/postfix.log 6.77 +