[packages/postfix] - partial update to 3.3.1; try to be closer to upstream, so drop obsolete and weird patches; builds
arekm
arekm at pld-linux.org
Sat Sep 15 23:27:51 CEST 2018
commit 3cda6c7c4e88b3abd01c6becd8e6005aec3d433c
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Sat Sep 15 23:27:40 2018 +0200
- partial update to 3.3.1; try to be closer to upstream, so drop obsolete and weird patches; builds but fails in install
postfix-conf_msg.patch | 52 ----
postfix-dictname.patch | 30 +-
postfix-dynamicmaps.patch | 733 ----------------------------------------------
postfix-ident.patch | 352 ----------------------
postfix-lib64.patch | 8 -
postfix-link.patch | 48 ---
postfix-make-jN.patch | 11 -
postfix-vbuf_print.patch | 48 ---
postfix.spec | 44 +--
9 files changed, 32 insertions(+), 1294 deletions(-)
---
diff --git a/postfix.spec b/postfix.spec
index 32de569..2e02082 100644
--- a/postfix.spec
+++ b/postfix.spec
@@ -7,11 +7,7 @@
%bcond_without sasl # without SMTP AUTH support
%bcond_without ssl # without SSL/TLS support
%bcond_without cdb # without cdb map support
-%if "%{pld_release}" == "th"
-%bcond_without vda # without VDA patch
-%else
%bcond_with vda # with VDA patch
-%endif
%bcond_with hir # with Beeth's header_if_reject patch
%bcond_with tcp # with unofficial tcp: lookup table
%if "%{pld_release}" == "ac"
@@ -33,13 +29,13 @@ Summary(pl.UTF-8): Serwer SMTP Postfix
Summary(pt_BR.UTF-8): Postfix - Um MTA (Mail Transport Agent) de alto desempenho
Summary(sk.UTF-8): Agent prenosu pošty Postfix
Name: postfix
-Version: 2.11.11
-Release: 2
+Version: 3.3.1
+Release: 0.1
Epoch: 2
License: distributable
Group: Networking/Daemons/SMTP
Source0: ftp://ftp.porcupine.org/mirrors/postfix-release/official/%{name}-%{version}.tar.gz
-# Source0-md5: a85b805560c79c4ef775d96ae681b5da
+# Source0-md5: 4381c6492f415e4a69cf5099d4acea76
Source1: %{name}.aliases
Source2: %{name}.cron
Source3: %{name}.init
@@ -58,21 +54,17 @@ Source11: %{name}-vda-bigquota.patch
# -ource11-md5: d46103195b43ec5784ea2c166b238f71
Source12: %{name}.service
Patch0: %{name}-config.patch
-Patch1: %{name}-conf_msg.patch
-Patch2: %{name}-dynamicmaps.patch
+
Patch3: %{name}-master.cf_cyrus.patch
# from http://akson.sgh.waw.pl/~chopin/unix/postfix-2.1.5-header_if_reject.diff
Patch4: %{name}-header_if_reject.patch
-Patch5: %{name}-ident.patch
-Patch6: %{name}-lib64.patch
+
Patch7: %{name}-conf.patch
Patch8: %{name}-dictname.patch
-Patch9: %{name}-make-jN.patch
-Patch10: %{name}-link.patch
+
Patch11: %{name}-scache_clnt.patch
Patch12: format-security.patch
Patch13: %{name}-no_cdb.patch
-Patch14: %{name}-vbuf_print.patch
URL: http://www.postfix.org/
%{?with_sasl:BuildRequires: cyrus-sasl-devel}
BuildRequires: db-devel
@@ -283,25 +275,19 @@ cat %{SOURCE11} | %{__patch} -p1 -s
find -type f | xargs sed -i -e 's|/etc/postfix|/etc/mail|g'
%patch0 -p1
-%patch1 -p0
-%patch2 -p1
+
%patch3 -p1
%{?with_hir:%patch4 -p0}
-%patch5 -p1
+
sed -i '/scache_clnt_create/s/server/var_scache_service/' src/global/scache_clnt.c
-%if "%{_lib}" == "lib64"
-%patch6 -p1
-%endif
%patch7 -p1
%patch8 -p1
-%patch9 -p1
-%patch10 -p1
+
%patch11 -p1
%if %{with vda}
%patch12 -p1
%endif
%{!?with_cdb:%patch13 -p1}
-%patch14 -p1
%if %{with tcp}
sed -i 's/ifdef SNAPSHOT/if 1/' src/util/dict_open.c
@@ -318,7 +304,7 @@ export CC="%{__cc}"
%{!?with_mysql:MYSQLSO=""} \
%{!?with_pgsql:PGSQLSO=""} \
CCARGS="%{!?with_epoll:-DNO_EPOLL} %{?with_ldap:-DHAS_LDAP} -DHAS_PCRE %{?with_sasl:-DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/include/sasl} %{?with_mysql:-DHAS_MYSQL -I/usr/include/mysql} %{?with_pgsql:-DHAS_PGSQL} %{?with_ssl:-DUSE_TLS} -DMAX_DYNAMIC_MAPS %{?with_cdb:-DHAS_CDB}" \
- AUXLIBS="-ldb -lresolv %{?with_sasl:-lsasl} %{?with_ssl:-lssl -lcrypto} %{?with_cdb:-lcdb} -lpcre"
+ AUXLIBS="-ldb -lresolv %{?with_mysql:-lmysqlclient} %{?with_pgsql:-lpq} %{?with_sasl:-lsasl} %{?with_ssl:-lssl -lcrypto} %{?with_cdb:-lcdb} -lpcre %{?with_ldap:-lldap -llber}"
%install
rm -rf $RPM_BUILD_ROOT
@@ -330,13 +316,10 @@ install -d $RPM_BUILD_ROOT/etc/{cron.daily,rc.d/init.d,sysconfig,pam.d,security,
$RPM_BUILD_ROOT%{_var}/lib/postfix \
$RPM_BUILD_ROOT%{systemdunitdir}
-%{__rm} html/Makefile.in conf/{LICENSE,main.cf.default}
+%{__make} non-interactive-package \
+ install_root=$RPM_BUILD_ROOT
-install -p bin/* $RPM_BUILD_ROOT%{_sbindir}
-install -p libexec/* $RPM_BUILD_ROOT%{_libdir}/postfix
-ln $RPM_BUILD_ROOT%{_libdir}/postfix/smtp $RPM_BUILD_ROOT%{_libdir}/postfix/lmtp
-ln $RPM_BUILD_ROOT%{_libdir}/postfix/qmgr $RPM_BUILD_ROOT%{_libdir}/postfix/nqmgr
-cp -a conf/* $RPM_BUILD_ROOT%{_sysconfdir}/mail
+#cp -a conf/* $RPM_BUILD_ROOT%{_sysconfdir}/mail
sed -e's,^daemon_directory = .*,daemon_directory = %{_libdir}/postfix,' \
conf/main.cf > $RPM_BUILD_ROOT%{_sysconfdir}/mail/main.cf
@@ -344,7 +327,6 @@ for f in dns global master util ; do
cp -a lib/lib${f}.a $RPM_BUILD_ROOT%{_libdir}/libpostfix-${f}.so.1
ln -sf lib${f}.so.1 $RPM_BUILD_ROOT%{_libdir}/libpostfix-${f}.so
done
-install -p lib/dict*.so $RPM_BUILD_ROOT%{_libdir}/postfix
cp -a include/*.h $RPM_BUILD_ROOT%{_includedir}/postfix
cp -a man/man* $RPM_BUILD_ROOT%{_mandir}
diff --git a/postfix-conf_msg.patch b/postfix-conf_msg.patch
deleted file mode 100644
index 25a381e..0000000
--- a/postfix-conf_msg.patch
+++ /dev/null
@@ -1,52 +0,0 @@
---- src/global/mail_params.h.orig 2004-06-22 14:32:58.615734426 +0200
-+++ src/global/mail_params.h 2004-06-22 14:33:21.260418134 +0200
-@@ -2204,6 +2204,13 @@
- extern char *var_anvil_service;
- #endif
-
-+ /*
-+ * SMTPD messages
-+ */
-+#define VAR_REJECT_REPLY_MSG_ACCESS_DENIED "smtpd_reject_msg_access_denied"
-+#define DEF_REJECT_REPLY_MSG_ACCESS_DENIED "rejected: Relay access denied."
-+extern char *var_reject_reply_msg_access_denied;
-+
- /* LICENSE
- /* .ad
- /* .fi
---- src/smtpd/smtpd.c.orig 2009-05-25 19:13:15.584397697 +0200
-+++ src/smtpd/smtpd.c 2009-05-25 19:14:31.066487776 +0200
-@@ -5062,6 +5062,7 @@
- VAR_MILT_DAEMON_NAME, DEF_MILT_DAEMON_NAME, &var_milt_daemon_name, 1, 0,
- VAR_MILT_V, DEF_MILT_V, &var_milt_v, 1, 0,
- VAR_STRESS, DEF_STRESS, &var_stress, 0, 0,
-+ VAR_REJECT_REPLY_MSG_ACCESS_DENIED, DEF_REJECT_REPLY_MSG_ACCESS_DENIED, &var_reject_reply_msg_access_denied, 1, 0,
- VAR_UNV_FROM_WHY, DEF_UNV_FROM_WHY, &var_unv_from_why, 0, 0,
- VAR_UNV_RCPT_WHY, DEF_UNV_RCPT_WHY, &var_unv_rcpt_why, 0, 0,
- VAR_REJECT_TMPF_ACT, DEF_REJECT_TMPF_ACT, &var_reject_tmpf_act, 1, 0,
---- src/global/mail_params.c.orig 2010-04-05 21:25:33.331592727 +0200
-+++ src/global/mail_params.c 2010-04-05 21:27:01.504746061 +0200
-@@ -80,6 +80,7 @@
- /* char *var_debug_peer_list;
- /* int var_debug_peer_level;
- /* int var_in_flow_delay;
-+/* char *var_reject_reply_msg_access_denied;
- /* int var_fault_inj_code;
- /* char *var_bounce_service;
- /* char *var_cleanup_service;
-@@ -265,6 +266,7 @@
- char *var_export_environ;
- char *var_debug_peer_list;
- int var_debug_peer_level;
-+char *var_reject_reply_msg_access_denied;
- int var_fault_inj_code;
- char *var_bounce_service;
- char *var_cleanup_service;
-@@ -569,6 +571,7 @@
- VAR_INT_FILT_CLASSES, DEF_INT_FILT_CLASSES, &var_int_filt_classes, 0, 0,
- /* multi_instance_wrapper may have dependencies but not dependents. */
- VAR_MULTI_WRAPPER, DEF_MULTI_WRAPPER, &var_multi_wrapper, 0, 0,
-+ VAR_REJECT_REPLY_MSG_ACCESS_DENIED, DEF_REJECT_REPLY_MSG_ACCESS_DENIED, &var_reject_reply_msg_access_denied, 1, 0,
- 0,
- };
- static const CONFIG_STR_FN_TABLE function_str_defaults_2[] = {
diff --git a/postfix-dictname.patch b/postfix-dictname.patch
index 0b9f937..e4d45a0 100644
--- a/postfix-dictname.patch
+++ b/postfix-dictname.patch
@@ -1,11 +1,19 @@
---- postfix-2.9.0/src/util/dict_open.c.orig 2012-02-04 19:42:26.000000000 +0100
-+++ postfix-2.9.0/src/util/dict_open.c 2012-02-04 19:43:42.937093038 +0100
-@@ -365,7 +365,7 @@
- lib=vstring_alloc(1);
- vstring_sprintf(lib,dl->soname,dict_type);
- if (stat(vstring_str(lib),&st) < 0) {
-- msg_fatal("%s: unsupported dictionary type: %s (%s not found. Is the postfix-%s package installed?)",
-+ msg_fatal("%s: unsupported dictionary type: %s (%s not found. Is the postfix-dict-%s package installed?)",
- myname, dict_type, vstring_str(lib), dict_type);
- }
- func=vstring_alloc(1);
+--- postfix-3.3.1/src/global/dynamicmaps.c~ 2018-09-15 23:09:41.000000000 +0200
++++ postfix-3.3.1/src/global/dynamicmaps.c 2018-09-15 23:10:31.630800874 +0200
+@@ -171,14 +171,14 @@ static MKMAP_OPEN_FN dymap_mkmap_lookup(
+ */
+ if ((dp = (DYMAP_INFO *) htable_find(dymap_info, dict_type)) == 0)
+ msg_fatal("unsupported dictionary type: %s. "
+- "Is the postfix-%s package installed?",
++ "Is the postfix-dict-%s package installed?",
+ dict_type, dict_type);
+ if (!dp->mkmap_name)
+ msg_fatal("unsupported dictionary type: %s does not support "
+ "bulk-mode creation.", dict_type);
+ if (stat(dp->soname, &st) < 0)
+ msg_fatal("unsupported dictionary type: %s (%s: %m). "
+- "Is the postfix-%s package installed?",
++ "Is the postfix-dict-%s package installed?",
+ dict_type, dp->soname, dict_type);
+ if (st.st_uid != 0 || (st.st_mode & (S_IWGRP | S_IWOTH)) != 0)
+ msg_fatal("unsupported dictionary type: %s "
diff --git a/postfix-dynamicmaps.patch b/postfix-dynamicmaps.patch
deleted file mode 100644
index 9ca6db7..0000000
--- a/postfix-dynamicmaps.patch
+++ /dev/null
@@ -1,733 +0,0 @@
-diff -durN -x '*~' -x '*.orig' -x '*.rej' postfix-2.11.0.orig/conf/dynamicmaps.cf postfix-2.11.0/conf/dynamicmaps.cf
---- postfix-2.11.0.orig/conf/dynamicmaps.cf 1970-01-01 01:00:00.000000000 +0100
-+++ postfix-2.11.0/conf/dynamicmaps.cf 2014-03-05 18:10:38.674082232 +0100
-@@ -0,0 +1,9 @@
-+# Postfix dynamic maps configuration file.
-+#
-+# The first match found is the one that is used. The only wildcard
-+# allowed is '*', which matches everything. The first %s is expanded
-+# to the map type.
-+#
-+#type location of .so file name of open function
-+#==== ================================ =====================
-+* /usr/lib/postfix/dict_%s.so dict_%s_open
-diff -durN -x '*~' -x '*.orig' -x '*.rej' postfix-2.11.0.orig/src/dns/Makefile.in postfix-2.11.0/src/dns/Makefile.in
---- postfix-2.11.0.orig/src/dns/Makefile.in 2014-03-05 18:10:21.197415405 +0100
-+++ postfix-2.11.0/src/dns/Makefile.in 2014-03-05 18:10:38.670748897 +0100
-@@ -14,7 +14,7 @@
- LIB_DIR = ../../lib
- INC_DIR = ../../include
-
--.c.o:; $(CC) $(CFLAGS) -c $*.c
-+.c.o:; $(CC) -fPIC $(CFLAGS) -c $*.c
-
- all: $(LIB)
-
-@@ -31,12 +31,10 @@
- root_tests:
-
- $(LIB): $(OBJS)
-- $(AR) $(ARFL) $(LIB) $?
-- $(RANLIB) $(LIB)
-+ gcc -shared -Wl,-soname,libpostfix-dns.so.1 -o $(LIB) $(OBJS)
-
- $(LIB_DIR)/$(LIB): $(LIB)
- cp $(LIB) $(LIB_DIR)
-- $(RANLIB) $(LIB_DIR)/$(LIB)
-
- update: $(LIB_DIR)/$(LIB) $(HDRS)
- -for i in $(HDRS); \
-diff -durN -x '*~' -x '*.orig' -x '*.rej' postfix-2.11.0.orig/src/global/Makefile.in postfix-2.11.0/src/global/Makefile.in
---- postfix-2.11.0.orig/src/global/Makefile.in 2014-03-05 18:10:21.277415407 +0100
-+++ postfix-2.11.0/src/global/Makefile.in 2014-03-05 18:10:38.670748897 +0100
-@@ -37,7 +37,7 @@
- canon_addr.o cfg_parser.o cleanup_strerror.o cleanup_strflags.o \
- clnt_stream.o conv_time.o db_common.o debug_peer.o debug_process.o \
- defer.o deliver_completed.o deliver_flock.o deliver_pass.o \
-- deliver_request.o dict_ldap.o dict_mysql.o dict_pgsql.o \
-+ deliver_request.o \
- dict_proxy.o dict_sqlite.o domain_list.o dot_lockfile.o dot_lockfile_as.o \
- dsb_scan.o dsn.o dsn_buf.o dsn_mask.o dsn_print.o dsn_util.o \
- ehlo_mask.o ext_prop.o file_id.o flush_clnt.o header_opts.o \
-@@ -113,8 +113,12 @@
- LIB_DIR = ../../lib
- INC_DIR = ../../include
- MAKES =
-+LDAPSO = dict_ldap.so
-+MYSQLSO = dict_mysql.so
-+PGSQLSO = dict_pgsql.so
-+SQLITESO= dict_sqlite.so
-
--.c.o:; $(CC) $(CFLAGS) -c $*.c
-+.c.o:; $(CC) -fPIC $(CFLAGS) -c $*.c
-
- all: $(LIB)
-
-@@ -126,14 +130,36 @@
- test: $(TESTPROG)
-
- $(LIB): $(OBJS)
-- $(AR) $(ARFL) $(LIB) $?
-- $(RANLIB) $(LIB)
-+ gcc -shared -Wl,-soname,libpostfix-global.so.1 -o $(LIB) $(OBJS)
-+
-+$(LDAPSO): dict_ldap.o $(LIB)
-+ gcc -shared -Wl,-soname,dict_ldap.so -o $@ $? -lldap -llber -L../../lib -lutil -L. -lglobal
-+
-+$(MYSQLSO): dict_mysql.o $(LIB)
-+ gcc -shared -Wl,-soname,dict_mysql.so -o $@ $? -lmysqlclient -L../../lib -lutil -L. -lglobal
-+
-+$(PGSQLSO): dict_pgsql.o $(LIB)
-+ gcc -shared -Wl,-soname,dict_pgsql.so -o $@ $? -lpq -L../../lib -lutil -L. -lglobal
-+
-+$(SQLITESO): dict_sqlite.o $(LIB)
-+ gcc -shared -Wl,-soname,dict_sqlite.so -o $@ $? -lsqlite3 -L../../lib -lutil -L. -lglobal
-
- $(LIB_DIR)/$(LIB): $(LIB)
- cp $(LIB) $(LIB_DIR)
-- $(RANLIB) $(LIB_DIR)/$(LIB)
-
--update: $(LIB_DIR)/$(LIB) $(HDRS)
-+$(LIB_DIR)/$(LDAPSO): $(LDAPSO)
-+ cp $(LDAPSO) $(LIB_DIR)
-+
-+$(LIB_DIR)/$(MYSQLSO): $(MYSQLSO)
-+ cp $(MYSQLSO) $(LIB_DIR)
-+
-+$(LIB_DIR)/$(PGSQLSO): $(PGSQLSO)
-+ cp $(PGSQLSO) $(LIB_DIR)
-+
-+$(LIB_DIR)/$(SQLITESO): $(SQLITESO)
-+ cp $(SQLITESO) $(LIB_DIR)
-+
-+update: $(LIB_DIR)/$(LIB) $(LIB_DIR)/${LDAPSO} $(LIB_DIR)/${MYSQLSO} $(LIB_DIR)/${PGSQLSO} $(LIB_DIR)/${SQLITESO} $(HDRS)
- -for i in $(HDRS); \
- do \
- cmp -s $$i $(INC_DIR)/$$i 2>/dev/null || cp $$i $(INC_DIR); \
-@@ -584,7 +610,7 @@
- lint $(DEFS) $(SRCS) $(LINTFIX)
-
- clean:
-- rm -f *.o $(LIB) *core $(TESTPROG) junk
-+ rm -f *.o $(LIB) $(LDAPSO) $(MYSQLSO) $(PGSQLSO) $(SQLITESO) *core $(TESTPROG) junk
- rm -rf printfck
-
- tidy: clean
-diff -durN -x '*~' -x '*.orig' -x '*.rej' postfix-2.11.0.orig/src/global/mail_conf.c postfix-2.11.0/src/global/mail_conf.c
---- postfix-2.11.0.orig/src/global/mail_conf.c 2014-03-05 18:10:21.314082074 +0100
-+++ postfix-2.11.0/src/global/mail_conf.c 2014-03-05 18:10:38.670748897 +0100
-@@ -190,6 +190,13 @@
- if (dict_load_file_xt(CONFIG_DICT, path) == 0)
- msg_fatal("open %s: %m", path);
- myfree(path);
-+
-+#ifndef NO_DYNAMIC_MAPS
-+ path = concatenate(var_config_dir, "/", "dynamicmaps.cf", (char *) 0);
-+ dict_open_dlinfo(path);
-+ myfree(path);
-+#endif
-+
- }
-
- /* mail_conf_flush - discard configuration dictionary */
-diff -durN -x '*~' -x '*.orig' -x '*.rej' postfix-2.11.0.orig/src/global/mail_dict.c postfix-2.11.0/src/global/mail_dict.c
---- postfix-2.11.0.orig/src/global/mail_dict.c 2014-03-05 18:10:21.377415407 +0100
-+++ postfix-2.11.0/src/global/mail_dict.c 2014-03-05 18:10:38.670748897 +0100
-@@ -47,18 +47,6 @@
-
- static const DICT_OPEN_INFO dict_open_info[] = {
- DICT_TYPE_PROXY, dict_proxy_open,
--#ifdef HAS_LDAP
-- DICT_TYPE_LDAP, dict_ldap_open,
--#endif
--#ifdef HAS_MYSQL
-- DICT_TYPE_MYSQL, dict_mysql_open,
--#endif
--#ifdef HAS_PGSQL
-- DICT_TYPE_PGSQL, dict_pgsql_open,
--#endif
--#ifdef HAS_SQLITE
-- DICT_TYPE_SQLITE, dict_sqlite_open,
--#endif
- DICT_TYPE_MEMCACHE, dict_memcache_open,
- 0,
- };
-diff -durN -x '*~' -x '*.orig' -x '*.rej' postfix-2.11.0.orig/src/global/mail_params.c postfix-2.11.0/src/global/mail_params.c
---- postfix-2.11.0.orig/src/global/mail_params.c 2014-03-05 18:10:21.657415409 +0100
-+++ postfix-2.11.0/src/global/mail_params.c 2014-03-05 18:10:38.670748897 +0100
-@@ -165,6 +165,8 @@
- #ifdef STRCASECMP_IN_STRINGS_H
- #include <strings.h>
- #endif
-+#include <safe_open.h>
-+#include <mymalloc.h>
-
- /* Utility library. */
-
-@@ -275,6 +277,7 @@
- char *var_debug_peer_list;
- int var_debug_peer_level;
- char *var_reject_reply_msg_access_denied;
-+int var_command_maxtime;
- int var_fault_inj_code;
- char *var_bounce_service;
- char *var_cleanup_service;
-@@ -519,6 +522,38 @@
-
- #endif
-
-+static char *read_file(const char *name)
-+{
-+ char *ret;
-+ VSTRING *why=vstring_alloc(1);
-+ VSTRING *new_name=vstring_alloc(1);
-+ VSTREAM *vp=safe_open(name, O_RDONLY, 0, NULL, -1, -1, why);
-+
-+ /*
-+ * Ugly macros to make complex expressions less unreadable.
-+ */
-+#define SKIP(start, var, cond) \
-+ for (var = start; *var && (cond); var++);
-+
-+#define TRIM(s) { \
-+ char *p; \
-+ for (p = (s) + strlen(s); p > (s) && ISSPACE(p[-1]); p--); \
-+ *p = 0; \
-+ }
-+
-+ if (!vp) {
-+ msg_fatal("%s: unable to open: %s",name,vstring_str(why));
-+ }
-+ vstring_get_nonl(new_name,vp);
-+ vstream_fclose(vp);
-+ SKIP(vstring_str(new_name),ret,ISSPACE(*ret));
-+ ret=mystrdup(ret);
-+ TRIM(ret);
-+ vstring_free(why);
-+ vstring_free(new_name);
-+ return ret;
-+}
-+
- /* mail_params_init - configure built-in parameters */
-
- void mail_params_init()
-diff -durN -x '*~' -x '*.orig' -x '*.rej' postfix-2.11.0.orig/src/master/Makefile.in postfix-2.11.0/src/master/Makefile.in
---- postfix-2.11.0.orig/src/master/Makefile.in 2014-03-05 18:10:21.104082072 +0100
-+++ postfix-2.11.0/src/master/Makefile.in 2014-03-05 18:10:38.670748897 +0100
-@@ -22,7 +22,7 @@
- INC_DIR = ../../include
- BIN_DIR = ../../libexec
-
--.c.o:; $(CC) $(CFLAGS) -c $*.c
-+.c.o:; $(CC) `for i in $(LIB_OBJ); do [ $$i = $@ ] && echo -fPIC; done` $(CFLAGS) -c $*.c
-
- all: $(PROG) $(LIB)
-
-@@ -41,12 +41,10 @@
- root_tests:
-
- $(LIB): $(LIB_OBJ)
-- $(AR) $(ARFL) $(LIB) $?
-- $(RANLIB) $(LIB)
-+ gcc -shared -Wl,-soname,libpostfix-master.so.1 -o $(LIB) $(LIB_OBJ)
-
- $(LIB_DIR)/$(LIB): $(LIB)
- cp $(LIB) $(LIB_DIR)/$(LIB)
-- $(RANLIB) $(LIB_DIR)/$(LIB)
-
- $(BIN_DIR)/$(PROG): $(PROG)
- cp $(PROG) $(BIN_DIR)
-diff -durN -x '*~' -x '*.orig' -x '*.rej' postfix-2.11.0.orig/src/util/Makefile.in postfix-2.11.0/src/util/Makefile.in
---- postfix-2.11.0.orig/src/util/Makefile.in 2014-03-05 18:10:21.430748742 +0100
-+++ postfix-2.11.0/src/util/Makefile.in 2014-03-05 18:10:38.670748897 +0100
-@@ -30,7 +30,7 @@
- username.c valid_hostname.c vbuf.c vbuf_print.c vstream.c \
- vstream_popen.c vstring.c vstring_vstream.c watchdog.c \
- write_buf.c sane_basename.c format_tv.c allspace.c \
-- allascii.c load_file.c killme_after.c vstream_tweak.c \
-+ allascii.c load_file.c killme_after.c vstream_tweak.c load_lib.c \
- pass_trigger.c edit_file.c inet_windowsize.c \
- unix_pass_fd_fix.c dict_cache.c valid_utf_8.c dict_thash.c \
- ip_match.c nbbio.c base32_code.c dict_test.c \
-@@ -43,7 +43,7 @@
- chroot_uid.o cidr_match.o clean_env.o close_on_exec.o concatenate.o \
- ctable.o dict.o dict_alloc.o dict_cdb.o dict_cidr.o dict_db.o \
- dict_dbm.o dict_debug.o dict_env.o dict_ht.o dict_lmdb.o dict_ni.o dict_nis.o \
-- dict_nisplus.o dict_open.o dict_pcre.o dict_regexp.o dict_sdbm.o \
-+ dict_nisplus.o dict_open.o dict_regexp.o dict_sdbm.o \
- dict_static.o dict_tcp.o dict_unix.o dir_forest.o doze.o dummy_read.o \
- dummy_write.o duplex_pipe.o environ.o events.o exec_command.o \
- fifo_listen.o fifo_trigger.o file_limit.o find_inet.o fsspace.o \
-@@ -68,7 +68,7 @@
- username.o valid_hostname.o vbuf.o vbuf_print.o vstream.o \
- vstream_popen.o vstring.o vstring_vstream.o watchdog.o \
- write_buf.o sane_basename.o format_tv.o allspace.o \
-- allascii.o load_file.o killme_after.o vstream_tweak.o \
-+ allascii.o load_file.o killme_after.o vstream_tweak.o load_lib.o \
- pass_trigger.o edit_file.o inet_windowsize.o \
- unix_pass_fd_fix.o dict_cache.o valid_utf_8.o dict_thash.o \
- ip_match.o nbbio.o base32_code.o dict_test.o \
-@@ -93,7 +93,7 @@
- sigdelay.h sock_addr.h spawn_command.h split_at.h stat_as.h \
- stringops.h sys_defs.h timed_connect.h timed_wait.h trigger.h \
- username.h valid_hostname.h vbuf.h vbuf_print.h vstream.h vstring.h \
-- vstring_vstream.h watchdog.h format_tv.h load_file.h killme_after.h \
-+ vstring_vstream.h watchdog.h format_tv.h load_file.h killme_after.h load_lib.h \
- edit_file.h dict_cache.h dict_thash.h ip_match.h nbbio.h base32_code.h \
- dict_fail.h warn_stat.h dict_sockmap.h line_number.h timecmp.h \
- slmdb.h compat_va_copy.h
-@@ -103,6 +103,7 @@
- CFLAGS = $(DEBUG) $(OPT) $(DEFS)
- FILES = Makefile $(SRCS) $(HDRS)
- INCL =
-+PCRESO = dict_pcre.so
- LIB = libutil.a
- TESTPROG= dict_open dup2_pass_on_exec events exec_command fifo_open \
- fifo_rdonly_bug fifo_rdwr_bug fifo_trigger fsspace fullname \
-@@ -119,8 +120,9 @@
-
- LIB_DIR = ../../lib
- INC_DIR = ../../include
-+LIBS = $(LIB_DIR)/$(LIB) $(LIB_DIR)/$(PCRESO)
-
--.c.o:; $(CC) $(CFLAGS) -c $*.c
-+.c.o:; $(CC) -fPIC $(CFLAGS) -c $*.c
-
- all: $(LIB)
-
-@@ -131,15 +133,19 @@
-
- test: $(TESTPROG)
-
-+$(PCRESO): dict_pcre.o
-+ gcc -shared -Wl,-soname,dict_pcre.so -o $@ $? -lpcre -L. -lutil
-+
- $(LIB): $(OBJS)
-- $(AR) $(ARFL) $(LIB) $?
-- $(RANLIB) $(LIB)
-+ gcc -shared -Wl,-soname,libpostfix-util.so.1 -o $(LIB) $(OBJS) -ldl
-
- $(LIB_DIR)/$(LIB): $(LIB)
- cp $(LIB) $(LIB_DIR)
-- $(RANLIB) $(LIB_DIR)/$(LIB)
-
--update: $(LIB_DIR)/$(LIB) $(HDRS)
-+$(LIB_DIR)/$(PCRESO): $(PCRESO)
-+ cp $(PCRESO) $(LIB_DIR)
-+
-+update: $(LIBS) $(HDRS)
- -for i in $(HDRS); \
- do \
- cmp -s $$i $(INC_DIR)/$$i 2>/dev/null || cp $$i $(INC_DIR); \
-@@ -161,7 +167,8 @@
- lint $(DEFS) $(SRCS) $(LINTFIX)
-
- clean:
-- rm -f *.o $(LIB) *core $(TESTPROG) junk $(MAKES) *.tmp
-+ rm -f *.o $(LIB) $(PCRESO) *core $(TESTPROG) \
-+ junk $(MAKES) *.tmp
- rm -rf printfck
-
- tidy: clean
-diff -durN -x '*~' -x '*.orig' -x '*.rej' postfix-2.11.0.orig/src/util/dict.h postfix-2.11.0/src/util/dict.h
---- postfix-2.11.0.orig/src/util/dict.h 2014-03-05 18:10:21.547415410 +0100
-+++ postfix-2.11.0/src/util/dict.h 2014-03-05 18:10:38.670748897 +0100
-@@ -166,6 +166,20 @@
- */
- extern ARGV *dict_mapnames(void);
-
-+#ifndef NO_DYNAMIC_MAPS
-+ /*
-+ * Interface for dynamic map loading.
-+ */
-+typedef struct {
-+ const char *pattern;
-+ const char *soname;
-+ const char *openfunc;
-+} DLINFO;
-+
-+extern void dict_open_dlinfo(const char *path);
-+extern DLINFO *dict_open_dlfind(const char *type);
-+#endif
-+
- /*
- * High-level interface, with logical dictionary names.
- */
-diff -durN -x '*~' -x '*.orig' -x '*.rej' postfix-2.11.0.orig/src/util/dict_open.c postfix-2.11.0/src/util/dict_open.c
---- postfix-2.11.0.orig/src/util/dict_open.c 2014-03-05 18:10:21.444082074 +0100
-+++ postfix-2.11.0/src/util/dict_open.c 2014-03-05 18:10:38.674082232 +0100
-@@ -251,6 +251,9 @@
- #include <strings.h>
- #endif
-
-+#include <sys/stat.h>
-+#include <unistd.h>
-+
- /* Utility library. */
-
- #include <argv.h>
-@@ -281,6 +284,14 @@
- #include <htable.h>
- #include <myflock.h>
-
-+#ifndef NO_DYNAMIC_MAPS
-+#include <load_lib.h>
-+#include <vstring.h>
-+#include <vstream.h>
-+#include <vstring_vstream.h>
-+#include <mvect.h>
-+#endif
-+
- /*
- * lookup table for available map types.
- */
-@@ -319,9 +330,11 @@
- #ifdef HAS_NETINFO
- DICT_TYPE_NETINFO, dict_ni_open,
- #endif
-+#ifndef MAX_DYNAMIC_MAPS
- #ifdef HAS_PCRE
- DICT_TYPE_PCRE, dict_pcre_open,
- #endif
-+#endif /* MAX_DYNAMIC_MAPS */
- #ifdef HAS_POSIX_REGEXP
- DICT_TYPE_REGEXP, dict_regexp_open,
- #endif
-@@ -382,9 +395,38 @@
- dict_type, dict_name);
- if (dict_open_hash == 0)
- dict_open_init();
-- if ((dp = (DICT_OPEN_INFO *) htable_find(dict_open_hash, dict_type)) == 0)
-- return (dict_surrogate(dict_type, dict_name, open_flags, dict_flags,
-- "unsupported dictionary type: %s", dict_type));
-+ if ((dp = (DICT_OPEN_INFO *) htable_find(dict_open_hash, dict_type)) == 0) {
-+#ifndef NO_DYNAMIC_MAPS
-+ struct stat st;
-+ VSTRING *lib, *func;
-+ LIB_FN fn[2];
-+ DICT *(*open) (const char *, int, int);
-+ DLINFO *dl=dict_open_dlfind(dict_type);
-+ if (!dl)
-+#endif
-+ msg_fatal("%s: unsupported dictionary type: %s", myname, dict_type);
-+#ifndef NO_DYNAMIC_MAPS
-+ lib=vstring_alloc(1);
-+ vstring_sprintf(lib,dl->soname,dict_type);
-+ if (stat(vstring_str(lib),&st) < 0) {
-+ msg_fatal("%s: unsupported dictionary type: %s (%s not found. Is the postfix-%s package installed?)",
-+ myname, dict_type, vstring_str(lib), dict_type);
-+ }
-+ func=vstring_alloc(1);
-+ vstring_sprintf(func,dl->openfunc,dict_type);
-+ fn[0].name = vstring_str(func);
-+ fn[0].ptr = (void**)&open;
-+ fn[1].name = NULL;
-+ load_library_symbols(vstring_str(lib), fn, NULL);
-+ dict_open_register(dict_type, open);
-+ dp = (DICT_OPEN_INFO *) htable_find(dict_open_hash, dict_type);
-+ vstring_free(lib);
-+ vstring_free(func);
-+#endif
-+ }
-+ if (msg_verbose>1) {
-+ msg_info("%s: calling %s open routine",myname,dict_type);
-+ }
- if ((dict = dp->open(dict_name, open_flags, dict_flags)) == 0)
- return (dict_surrogate(dict_type, dict_name, open_flags, dict_flags,
- "cannot open %s:%s: %m", dict_type, dict_name));
-@@ -456,6 +498,76 @@
- return mapnames;
- }
-
-+#ifndef NO_DYNAMIC_MAPS
-+static DLINFO *dict_dlinfo;
-+
-+void dict_open_dlinfo(const char *path)
-+{
-+ char *myname="dict_open_dlinfo";
-+ VSTREAM *conf_fp=vstream_fopen(path,O_RDONLY,0);
-+ VSTRING *buf = vstring_alloc(100);
-+ char *cp;
-+ ARGV *argv;
-+ MVECT vector;
-+ int nelm=0;
-+ int linenum=0;
-+
-+ dict_dlinfo=(DLINFO*)mvect_alloc(&vector,sizeof(DLINFO),3,NULL,NULL);
-+
-+ if (!conf_fp) {
-+ msg_warn("%s: cannot open %s. No dynamic maps will be allowed.",
-+ myname, path);
-+ } else {
-+ while (vstring_get_nonl(buf,conf_fp) != VSTREAM_EOF) {
-+ cp = vstring_str(buf);
-+ linenum++;
-+ if (*cp == '#' || *cp == '\0')
-+ continue;
-+ argv = argv_split(cp, " \t");
-+ if (argv->argc != 3) {
-+ msg_fatal("%s: Expected \"pattern .so-name function\" at line %d",
-+ myname, linenum);
-+ }
-+ if (argv->argv[1][0] != '/') {
-+ msg_fatal("%s: .so name must begin with a \"/\" at line %d",
-+ myname, linenum);
-+ }
-+ if (nelm >= vector.nelm) {
-+ dict_dlinfo=(DLINFO*)mvect_realloc(&vector,vector.nelm+3);
-+ }
-+ dict_dlinfo[nelm].pattern = mystrdup(argv->argv[0]);
-+ dict_dlinfo[nelm].soname = mystrdup(argv->argv[1]);
-+ dict_dlinfo[nelm].openfunc = mystrdup(argv->argv[2]);
-+ nelm++;
-+ argv_free(argv);
-+ }
-+ }
-+ if (nelm >= vector.nelm) {
-+ dict_dlinfo=(DLINFO*)mvect_realloc(&vector,vector.nelm+1);
-+ }
-+ dict_dlinfo[nelm].pattern = NULL;
-+ dict_dlinfo[nelm].soname = NULL;
-+ dict_dlinfo[nelm].openfunc = NULL;
-+ if (conf_fp)
-+ vstream_fclose(conf_fp);
-+ vstring_free(buf);
-+}
-+
-+DLINFO *dict_open_dlfind(const char *type)
-+{
-+ DLINFO *dp;
-+
-+ if (!dict_dlinfo)
-+ return NULL;
-+
-+ for (dp=dict_dlinfo; dp->pattern; dp++) {
-+ if (strcmp(dp->pattern,type)==0 || strcmp(dp->pattern,"*")==0)
-+ return dp;
-+ }
-+ return NULL;
-+}
-+#endif /* !NO_DYNAMIC_MAPS */
-+
- #ifdef TEST
-
- /*
-diff -durN -x '*~' -x '*.orig' -x '*.rej' postfix-2.11.0.orig/src/util/load_lib.c postfix-2.11.0/src/util/load_lib.c
---- postfix-2.11.0.orig/src/util/load_lib.c 1970-01-01 01:00:00.000000000 +0100
-+++ postfix-2.11.0/src/util/load_lib.c 2014-03-05 18:10:38.674082232 +0100
-@@ -0,0 +1,135 @@
-+/*++
-+/* NAME
-+/* load_lib 3
-+/* SUMMARY
-+/* library loading wrappers
-+/* SYNOPSIS
-+/* #include <load_lib.h>
-+/*
-+/* extern int load_library_symbols(const char *, LIB_FN *, LIB_FN *);
-+/* const char *libname;
-+/* LIB_FN *libfuncs;
-+/* LIB_FN *libdata;
-+/*
-+/* DESCRIPTION
-+/* This module loads functions from libraries, returnine pointers
-+/* to the named functions.
-+/*
-+/* load_library_symbols() loads all of the desired functions, and
-+/* returns zero for success, or exits via msg_fatal().
-+/*
-+/* SEE ALSO
-+/* msg(3) diagnostics interface
-+/* DIAGNOSTICS
-+/* Problems are reported via the msg(3) diagnostics routines:
-+/* library not found, symbols not found, other fatal errors.
-+/* LICENSE
-+/* .ad
-+/* .fi
-+/* The Secure Mailer license must be distributed with this software.
-+/* AUTHOR(S)
-+/* LaMont Jones
-+/* Hewlett-Packard Company
-+/* 3404 Harmony Road
-+/* Fort Collins, CO 80528, USA
-+/*
-+/* Wietse Venema
-+/* IBM T.J. Watson Research
-+/* P.O. Box 704
-+/* Yorktown Heights, NY 10598, USA
-+/*--*/
-+
-+/* System libraries. */
-+
-+#include "sys_defs.h"
-+#include <stdlib.h>
-+#include <stddef.h>
-+#include <string.h>
-+#if defined(HAS_DLOPEN)
-+#include <dlfcn.h>
-+#elif defined(HAS_SHL_LOAD)
-+#include <dl.h>
-+#endif
-+
-+/* Application-specific. */
-+
-+#include "msg.h"
-+#include "load_lib.h"
-+
-+extern int load_library_symbols(const char * libname, LIB_FN * libfuncs, LIB_FN * libdata)
-+{
-+ char *myname = "load_library_symbols";
-+ LIB_FN *fn;
-+
-+#if defined(HAS_DLOPEN)
-+ void *handle;
-+ char *emsg;
-+
-+ handle=dlopen(libname,RTLD_NOW);
-+ emsg=dlerror();
-+ if (emsg) {
-+ msg_fatal("%s: dlopen failure loading %s: %s", myname, libname, emsg);
-+ }
-+
-+ if (libfuncs) {
-+ for (fn=libfuncs; fn->name; fn++) {
-+ *(fn->ptr) = dlsym(handle,fn->name);
-+ emsg=dlerror();
-+ if (emsg) {
-+ msg_fatal("%s: dlsym failure looking up %s in %s: %s", myname,
-+ fn->name, libname, emsg);
-+ }
-+ if (msg_verbose>1) {
-+ msg_info("loaded %s = %lx",fn->name, *((long*)(fn->ptr)));
-+ }
-+ }
-+ }
-+
-+ if (libdata) {
-+ for (fn=libdata; fn->name; fn++) {
-+ *(fn->ptr) = dlsym(handle,fn->name);
-+ emsg=dlerror();
-+ if (emsg) {
-+ msg_fatal("%s: dlsym failure looking up %s in %s: %s", myname,
-+ fn->name, libname, emsg);
-+ }
-+ if (msg_verbose>1) {
-+ msg_info("loaded %s = %lx",fn->name, *((long*)(fn->ptr)));
-+ }
-+ }
-+ }
-+#elif defined(HAS_SHL_LOAD)
-+ shl_t handle;
-+
-+ handle = shl_load(libname,BIND_IMMEDIATE,0);
-+
-+ if (libfuncs) {
-+ for (fn=libfuncs; fn->name; fn++) {
-+ if (shl_findsym(&handle,fn->name,TYPE_PROCEDURE,fn->ptr) != 0) {
-+ msg_fatal("%s: shl_findsym failure looking up %s in %s: %m",
-+ myname, fn->name, libname);
-+ }
-+ if (msg_verbose>1) {
-+ msg_info("loaded %s = %x",fn->name, *((long*)(fn->ptr)));
-+ }
-+ }
-+ }
-+
-+ if (libdata) {
-+ for (fn=libdata; fn->name; fn++) {
-+ if (shl_findsym(&handle,fn->name,TYPE_DATA,fn->ptr) != 0) {
-+ msg_fatal("%s: shl_findsym failure looking up %s in %s: %m",
-+ myname, fn->name, libname);
-+ }
-+ if (msg_verbose>1) {
-+ msg_info("loaded %s = %x",fn->name, *((long*)(fn->ptr)));
-+ }
-+ }
-+ }
-+
-+#else
-+ msg_fatal("%s: need dlopen or shl_load support for dynamic libraries",
-+ myname);
-+#endif
-+ return 0;
-+}
-diff -durN -x '*~' -x '*.orig' -x '*.rej' postfix-2.11.0.orig/src/util/load_lib.h postfix-2.11.0/src/util/load_lib.h
---- postfix-2.11.0.orig/src/util/load_lib.h 1970-01-01 01:00:00.000000000 +0100
-+++ postfix-2.11.0/src/util/load_lib.h 2014-03-05 18:10:38.674082232 +0100
-@@ -0,0 +1,41 @@
-+#ifndef _LOAD_LIB_H_INCLUDED_
-+#define _LOAD_LIB_H_INCLUDED_
-+
-+/*++
-+/* NAME
-+/* load_lib 3h
-+/* SUMMARY
-+/* library loading wrappers
-+/* SYNOPSIS
-+/* #include "load_lib.h"
-+/* DESCRIPTION
-+/* .nf
-+
-+ /*
-+ * External interface.
-+ */
-+/* NULL name terminates list */
-+typedef struct LIB_FN {
-+ const char *name;
-+ void **ptr;
-+} LIB_FN;
-+
-+extern int load_library_symbols(const char *, LIB_FN *, LIB_FN *);
-+
-+/* LICENSE
-+/* .ad
-+/* .fi
-+/* The Secure Mailer license must be distributed with this software.
-+/* AUTHOR(S)
-+/* LaMont Jones
-+/* Hewlett-Packard Company
-+/* 3404 Harmony Road
-+/* Fort Collins, CO 80528, USA
-+/*
-+/* Wietse Venema
-+/* IBM T.J. Watson Research
-+/* P.O. Box 704
-+/* Yorktown Heights, NY 10598, USA
-+/*--*/
-+
-+#endif
-diff -durN -x '*~' -x '*.orig' -x '*.rej' postfix-2.11.0.orig/src/util/sys_defs.h postfix-2.11.0/src/util/sys_defs.h
---- postfix-2.11.0.orig/src/util/sys_defs.h 2014-03-05 18:10:21.654082076 +0100
-+++ postfix-2.11.0/src/util/sys_defs.h 2014-03-05 18:10:38.674082232 +0100
-@@ -780,6 +780,7 @@
- #define STATFS_IN_SYS_VFS_H
- #define PREPEND_PLUS_TO_OPTSTRING
- #define HAS_POSIX_REGEXP
-+#define HAS_DLOPEN
- #define NATIVE_SENDMAIL_PATH "/usr/sbin/sendmail"
- #define NATIVE_MAILQ_PATH "/usr/bin/mailq"
- #define NATIVE_NEWALIAS_PATH "/usr/bin/newaliases"
-@@ -857,6 +858,7 @@
- #define STATFS_IN_SYS_VFS_H
- #define PREPEND_PLUS_TO_OPTSTRING
- #define HAS_POSIX_REGEXP
-+#define HAS_DLOPEN
- #define NATIVE_SENDMAIL_PATH "/usr/sbin/sendmail"
- #define NATIVE_MAILQ_PATH "/usr/bin/mailq"
- #define NATIVE_NEWALIAS_PATH "/usr/bin/newaliases"
-@@ -966,6 +968,7 @@
- #define USE_STATFS
- #define STATFS_IN_SYS_VFS_H
- #define HAS_POSIX_REGEXP
-+#define HAS_SHL_LOAD
- #define NATIVE_SENDMAIL_PATH "/usr/sbin/sendmail"
- #define NATIVE_MAILQ_PATH "/usr/bin/mailq"
- #define NATIVE_NEWALIAS_PATH "/usr/bin/newaliases"
-@@ -1005,6 +1008,7 @@
- #define USE_STATFS
- #define STATFS_IN_SYS_VFS_H
- #define HAS_POSIX_REGEXP
-+#define HAS_SHL_LOAD
- #define NATIVE_SENDMAIL_PATH "/usr/sbin/sendmail"
- #define NATIVE_MAILQ_PATH "/usr/bin/mailq"
- #define NATIVE_NEWALIAS_PATH "/usr/bin/newaliases"
diff --git a/postfix-ident.patch b/postfix-ident.patch
deleted file mode 100644
index 25fbeaa..0000000
--- a/postfix-ident.patch
+++ /dev/null
@@ -1,352 +0,0 @@
-diff -urN -x '*~' postfix-2.2.5/src/global/mail_params.h postfix-2.2.5-ident/src/global/mail_params.h
---- postfix-2.2.5/src/global/mail_params.h 2006-02-22 16:20:15.000000000 +0100
-+++ postfix-2.2.5-ident/src/global/mail_params.h 2006-02-22 15:56:31.000000000 +0100
-@@ -2346,6 +2346,9 @@
- #define DEF_SMTP_EHLO_DIS_MAPS ""
- extern char *var_smtp_ehlo_dis_maps;
-
-+#define VAR_SMTPD_IDENT_LOOKUP "smtpd_ident_lookup"
-+#define DEF_SMTPD_IDENT_LOOKUP ""
-+extern char *var_smtpd_ident_lookup;
- /*
- * SMTPD messages
- */
-diff -urN -x '*~' postfix-2.2.5/src/smtpd/smtpd_ident.c postfix-2.2.5-ident/src/smtpd/smtpd_ident.c
---- postfix-2.2.5/src/smtpd/smtpd_ident.c 1970-01-01 01:00:00.000000000 +0100
-+++ postfix-2.2.5-ident/src/smtpd/smtpd_ident.c 2006-02-22 15:56:31.000000000 +0100
-@@ -0,0 +1,138 @@
-+#include <sys_defs.h>
-+#include <sys/socket.h>
-+#include <netinet/in.h>
-+#include <arpa/inet.h>
-+#include <stdio.h> /* strerror() */
-+#include <errno.h>
-+#include <string.h>
-+#include <mymalloc.h>
-+#include <sys/types.h>
-+#include <sys/time.h>
-+#include <unistd.h>
-+#include <vstream.h>
-+
-+#include <iostuff.h>
-+#include "smtpd.h"
-+
-+#define IDENT_MSGSIZE 256
-+#define IDENT_TIMEOUT 10
-+
-+#define CHOMP(STR) { char *tmp; tmp = STR; while (*tmp) { \
-+ if (*tmp == '\n' || *tmp == '\r') *tmp = '\0'; tmp++ ; } }
-+
-+char *smtpd_ident(struct sockaddr_in *peer_addr, struct sockaddr_in *smtpd_addr)
-+{
-+ int ident_sock;
-+ char ident_msg[IDENT_MSGSIZE + 1], *sp;
-+ char ident_user[IDENT_MSGSIZE + 1];
-+ struct sockaddr_in local_addr;
-+ struct sockaddr_in ident_addr;
-+ char *return_val;
-+ VSTREAM *ident_stream;
-+
-+ memset(ident_msg, 0, IDENT_MSGSIZE + 1);
-+ memset(ident_user, 0, IDENT_MSGSIZE + 1);
-+
-+ /*
-+ * Bind the local sockaddr to the same interface as smtpd before
-+ * connecting back to the auth port on the peer. This helps
-+ * with multihomed postfix servers. First, set up the address.
-+ */
-+
-+ /* Local sockname */
-+
-+ memset((char *) &local_addr, 0, sizeof(local_addr));
-+ local_addr.sin_family = AF_INET;
-+ memcpy((void *) &local_addr.sin_addr, (void *) &smtpd_addr->sin_addr, sizeof(local_addr.sin_addr));
-+
-+ /* Remote sockname + port */
-+
-+ memset((char *) &ident_addr, 0, sizeof(ident_addr));
-+ ident_addr.sin_family = AF_INET;
-+ memcpy((void *) &ident_addr.sin_addr, (void *) &peer_addr->sin_addr, sizeof(ident_addr.sin_addr));
-+ ident_addr.sin_port = htons(113);
-+
-+ do {
-+ /* socket call */
-+
-+ if ((ident_sock = socket(ident_addr.sin_family, SOCK_STREAM, 0)) < 0) {
-+ msg_warn("Can't allocate socket for ident lookup: %s", strerror(errno));
-+ break;
-+ }
-+
-+ /* Now bind the local sock to the interface */
-+
-+ if (bind(ident_sock, (struct sockaddr *)&local_addr, sizeof(local_addr)) < 0) {
-+ msg_warn("local bind of ident sock failed: %s", strerror(errno));
-+ break;
-+ }
-+
-+ /* connect() back to the smtp client host on port 113 */
-+
-+ if (connect(ident_sock, (struct sockaddr *) &ident_addr, sizeof(ident_addr )) < 0) {
-+ msg_warn( "ident connect to %s: %s", inet_ntoa(peer_addr->sin_addr),
-+ strerror(errno));
-+ break;
-+ }
-+
-+ /* Ok, make this a vstream */
-+
-+ ident_stream = vstream_fdopen(ident_sock, O_RDWR);
-+ ident_stream->timeout = IDENT_TIMEOUT;
-+
-+ /* Print the ident message to the remote host */
-+
-+ vstream_fprintf(ident_stream, "%d, %d\n", ntohs(peer_addr->sin_port), ntohs(smtpd_addr->sin_port));
-+ if (vstream_ftimeout(ident_stream)) {
-+ msg_warn( "ident write timed out to %s", inet_ntoa(peer_addr->sin_addr));
-+ break;
-+ }
-+
-+ /* Read back the result */
-+
-+ vstream_fread(ident_stream, ident_msg, IDENT_MSGSIZE);
-+ if (vstream_ftimeout(ident_stream)) {
-+ msg_warn( "ident read timed out to %s", inet_ntoa(peer_addr->sin_addr));
-+ break;
-+ }
-+
-+ /*
-+ * Should I even bother with this?
-+ *
-+ * Even if so, don't worry about this failing, set the timeout low
-+ */
-+
-+ ident_stream->timeout = 2;
-+ vstream_fwrite(ident_stream, "quit\n", strlen("quit\n"));
-+
-+ if (strlen(ident_msg) == 0) {
-+ msg_warn( "Failed to get ident string from %s", inet_ntoa(peer_addr->sin_addr));
-+ break;
-+ }
-+
-+ if ((sp = strrchr(ident_msg, ':')) == NULL) {
-+ msg_warn( "Invalid ident string from %s", inet_ntoa(peer_addr->sin_addr));
-+ break;
-+ }
-+ sp++;
-+ CHOMP(sp);
-+ while (*sp && (*sp == ' ' || *sp == '\t')) {
-+ sp++;
-+ }
-+
-+ /* If we break before this line, we know we had some sort of bad error */
-+
-+ strncpy(ident_user, sp, IDENT_MSGSIZE);
-+ msg_info( "Received ident string %s from %s", sp, inet_ntoa(peer_addr->sin_addr));
-+
-+ } while (0);
-+
-+ if (strlen(ident_user) == 0) {
-+ msg_warn( "Failed to get ident user for %s", inet_ntoa(peer_addr->sin_addr));
-+ return NULL;
-+ }
-+
-+ vstream_fclose(ident_stream);
-+ return_val = mystrdup(ident_user);
-+ return return_val;
-+}
---- postfix-2.3-RC9/src/smtpd/smtpd.h.orig 2006-07-09 21:49:21.000000000 +0200
-+++ postfix-2.3-RC9/src/smtpd/smtpd.h 2006-07-11 20:30:43.993322048 +0200
-@@ -77,6 +77,7 @@
- char *addr; /* client host address string */
- char *namaddr; /* combined name and address */
- char *rfc_addr; /* address for RFC 2821 */
-+ char *ident_user; /* user name returned by ident RFC 1413 */
- int addr_family; /* address family */
- struct sockaddr_storage sockaddr; /* binary client endpoint */
- int name_status; /* 2=ok 4=soft 5=hard 6=forged */
-@@ -266,6 +267,8 @@
- extern void smtpd_peer_init(SMTPD_STATE *state);
- extern void smtpd_peer_reset(SMTPD_STATE *state);
-
-+extern char *smtpd_ident(struct sockaddr_in *peer_addr, struct sockaddr_in *smtpd_addr);
-+
- #define SMTPD_PEER_CODE_OK 2
- #define SMTPD_PEER_CODE_TEMP 4
- #define SMTPD_PEER_CODE_PERM 5
---- postfix-2.8.3/src/smtpd/Makefile.in~ 2011-05-17 14:28:28.406666872 +0200
-+++ postfix-2.8.3/src/smtpd/Makefile.in 2011-05-17 14:31:06.946666872 +0200
-@@ -2,11 +2,11 @@
- SRCS = smtpd.c smtpd_token.c smtpd_check.c smtpd_chat.c smtpd_state.c \
- smtpd_peer.c smtpd_sasl_proto.c smtpd_sasl_glue.c smtpd_proxy.c \
- smtpd_xforward.c smtpd_dsn_fix.c smtpd_milter.c smtpd_resolve.c \
-- smtpd_expand.c smtpd_haproxy.c
-+ smtpd_expand.c smtpd_haproxy.c smtpd_ident.c
- OBJS = smtpd.o smtpd_token.o smtpd_check.o smtpd_chat.o smtpd_state.o \
- smtpd_peer.o smtpd_sasl_proto.o smtpd_sasl_glue.o smtpd_proxy.o \
- smtpd_xforward.o smtpd_dsn_fix.o smtpd_milter.o smtpd_resolve.o \
-- smtpd_expand.o smtpd_haproxy.o
-+ smtpd_expand.o smtpd_haproxy.o smtpd_ident.o
- HDRS = smtpd_token.h smtpd_check.h smtpd_chat.h smtpd_sasl_proto.h \
- smtpd_sasl_glue.h smtpd_proxy.h smtpd_dsn_fix.h smtpd_milter.h \
- smtpd_resolve.h smtpd_expand.h
---- postfix-2.9.0/src/smtpd/smtpd.c.orig 2012-02-04 19:34:17.737149536 +0100
-+++ postfix-2.9.0/src/smtpd/smtpd.c 2012-02-04 19:36:43.414073592 +0100
-@@ -1208,6 +1208,7 @@
- char *var_local_rwr_clients;
- char *var_smtpd_ehlo_dis_words;
- char *var_smtpd_ehlo_dis_maps;
-+char *var_smtpd_ident_lookup;
-
- char *var_smtpd_tls_level;
- bool var_smtpd_use_tls;
-@@ -1329,6 +1330,11 @@
- int smtpd_input_transp_mask;
-
- /*
-+ * Hosts that should be ident-queried
-+ */
-+NAMADR_LIST *smtpd_ident_lookup;
-+
-+ /*
- * Forward declarations.
- */
- static void helo_reset(SMTPD_STATE *);
-@@ -2950,10 +2956,18 @@
- * intermediate proxy.
- */
- if (!proxy || state->xforward.flags == 0) {
-- out_fprintf(out_stream, REC_TYPE_NORM,
-- "Received: from %s (%s [%s])",
-- state->helo_name ? state->helo_name : state->name,
-- state->name, state->rfc_addr);
-+ if (namadr_list_match(smtpd_ident_lookup, state->name, state->addr)) {
-+ out_fprintf(out_stream, REC_TYPE_NORM,
-+ "Received: from %s (%s [%s] ident=%s)",
-+ state->helo_name ? state->helo_name : state->name,
-+ state->name, state->rfc_addr,
-+ state->ident_user);
-+ } else {
-+ out_fprintf(out_stream, REC_TYPE_NORM,
-+ "Received: from %s (%s [%s])",
-+ state->helo_name ? state->helo_name : state->name,
-+ state->name, state->rfc_addr);
-+ }
-
- #define VSTRING_STRDUP(s) vstring_strcpy(vstring_alloc(strlen(s) + 1), (s))
-
-@@ -4954,6 +4968,9 @@
- xclient_hosts = namadr_list_init(MATCH_FLAG_RETURN, var_xclient_hosts);
- xforward_hosts = namadr_list_init(MATCH_FLAG_RETURN, var_xforward_hosts);
- hogger_list = namadr_list_init(MATCH_FLAG_RETURN, var_smtpd_hoggers);
-+ smtpd_ident_lookup =
-+ namadr_list_init(match_parent_style(VAR_SMTPD_IDENT_LOOKUP),
-+ var_smtpd_ident_lookup);
-
- /*
- * Open maps before dropping privileges so we can read passwords etc.
-@@ -5382,6 +5399,7 @@
- VAR_MILT_V, DEF_MILT_V, &var_milt_v, 1, 0,
- VAR_STRESS, DEF_STRESS, &var_stress, 0, 0,
- VAR_REJECT_REPLY_MSG_ACCESS_DENIED, DEF_REJECT_REPLY_MSG_ACCESS_DENIED, &var_reject_reply_msg_access_denied, 1, 0,
-+ VAR_SMTPD_IDENT_LOOKUP, DEF_SMTPD_IDENT_LOOKUP, &var_smtpd_ident_lookup, 0, 0,
- VAR_UNV_FROM_WHY, DEF_UNV_FROM_WHY, &var_unv_from_why, 0, 0,
- VAR_UNV_RCPT_WHY, DEF_UNV_RCPT_WHY, &var_unv_rcpt_why, 0, 0,
- VAR_REJECT_TMPF_ACT, DEF_REJECT_TMPF_ACT, &var_reject_tmpf_act, 1, 0,
---- postfix-2.9.0/src/smtpd/smtpd_peer.c.orig 2012-02-04 19:34:17.294233547 +0100
-+++ postfix-2.9.0/src/smtpd/smtpd_peer.c 2012-02-04 19:40:48.203777370 +0100
-@@ -103,6 +103,7 @@
-
- #include <sys_defs.h>
- #include <sys/socket.h>
-+#include <sys/types.h>
- #include <netinet/in.h>
- #include <arpa/inet.h>
- #include <stdio.h> /* strerror() */
-@@ -123,6 +124,7 @@
-
- /* Global library. */
-
-+#include <namadr_list.h>
- #include <mail_proto.h>
- #include <valid_mailhost_addr.h>
- #include <mail_params.h>
-@@ -132,6 +134,8 @@
-
- #include "smtpd.h"
-
-+extern NAMADR_LIST *smtpd_ident_lookup;
-+
- static INET_PROTO_INFO *proto_info;
-
- /*
-@@ -345,6 +352,7 @@
- if (aierr) {
- msg_warn("hostname %s does not resolve to address %s: %s",
- state->name, state->addr, MAI_STRERROR(aierr));
-+ state->ident_user = mystrdup("NO-USER");
- REJECT_PEER_NAME(state, (TEMP_AI_ERROR(aierr) ?
- SMTPD_PEER_CODE_TEMP : SMTPD_PEER_CODE_FORGED));
- } else {
-@@ -352,6 +360,7 @@
- if (res == 0) {
- msg_warn("hostname %s does not resolve to address %s",
- state->name, state->addr);
-+ state->ident_user = mystrdup("NO-USER");
- REJECT_PEER_NAME(state, SMTPD_PEER_CODE_FORGED);
- break;
- }
-@@ -366,6 +375,22 @@
- freeaddrinfo(res0);
- }
- }
-+ if (namadr_list_match(smtpd_ident_lookup, state->name, state->addr)) {
-+ struct sockaddr_in serv_sin;
-+ char *ident_user = NULL;
-+
-+ /* If getsockname fails, just forget it */
-+ sa_length = sizeof(serv_sin);
-+ if (getsockname(vstream_fileno(state->client), (struct sockaddr *)&serv_sin, &sa_length) >= 0) {
-+ ident_user = smtpd_ident((struct sockaddr_in *)sa, &serv_sin);
-+ if (ident_user == NULL)
-+ state->ident_user = mystrdup("NO-USER");
-+ else
-+ state->ident_user = ident_user;
-+ } else
-+ msg_warn("getsockname failed while doing ident lookup: %s", strerror(errno));
-+ } else
-+ state->ident_user = mystrdup("NO-USER");
- }
-
- /* smtpd_peer_hostaddr_to_sockaddr - convert numeric string to binary */
-@@ -411,6 +433,7 @@
- state->addr_family = AF_UNSPEC;
- state->name_status = SMTPD_PEER_CODE_OK;
- state->reverse_name_status = SMTPD_PEER_CODE_OK;
-+ state->ident_user = mystrdup("NO-USER");
- state->port = mystrdup("0"); /* XXX bogus. */
- }
-
-@@ -426,6 +449,7 @@
- state->addr_family = AF_UNSPEC;
- state->name_status = SMTPD_PEER_CODE_PERM;
- state->reverse_name_status = SMTPD_PEER_CODE_PERM;
-+ state->ident_user = mystrdup("NO-USER");
- state->port = mystrdup(CLIENT_PORT_UNKNOWN);
- }
-
-@@ -554,6 +578,7 @@
- state->addr = 0;
- state->namaddr = 0;
- state->rfc_addr = 0;
-+ state->ident_user = 0;
- state->port = 0;
- state->dest_addr = 0;
-
-@@ -604,6 +629,8 @@
- myfree(state->namaddr);
- if (state->rfc_addr)
- myfree(state->rfc_addr);
-+ if (state->ident_user)
-+ myfree(state->ident_user);
- if (state->port)
- myfree(state->port);
- if (state->dest_addr)
diff --git a/postfix-lib64.patch b/postfix-lib64.patch
deleted file mode 100644
index fe77600..0000000
--- a/postfix-lib64.patch
+++ /dev/null
@@ -1,8 +0,0 @@
---- postfix-2.3.0/conf/dynamicmaps.cf~ 2006-07-25 13:36:17.245609587 +0300
-+++ postfix-2.3.0/conf/dynamicmaps.cf 2006-07-25 13:37:00.056561114 +0300
-@@ -6,4 +6,4 @@
- #
- #type location of .so file name of open function
- #==== ================================ =====================
--* /usr/lib/postfix/dict_%s.so dict_%s_open
-+* /usr/lib64/postfix/dict_%s.so dict_%s_open
diff --git a/postfix-link.patch b/postfix-link.patch
deleted file mode 100644
index 7cdd0cf..0000000
--- a/postfix-link.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-diff -ur postfix-2.7.1/src/dns/Makefile.in postfix-2.7.1-libs/src/dns/Makefile.in
---- postfix-2.7.1/src/dns/Makefile.in 2010-11-08 20:14:18.394139054 +0100
-+++ postfix-2.7.1-libs/src/dns/Makefile.in 2010-11-08 20:12:39.300139053 +0100
-@@ -31,7 +31,7 @@
- root_tests:
-
- $(LIB): $(OBJS)
-- gcc -shared -Wl,-soname,libpostfix-dns.so.1 -o $(LIB) $(OBJS)
-+ gcc -shared -Wl,-soname,libpostfix-dns.so.1 -o $(LIB) $(OBJS) $(LIBS) -lresolv
-
- $(LIB_DIR)/$(LIB): $(LIB)
- cp $(LIB) $(LIB_DIR)
-diff -ur postfix-2.7.1/src/global/Makefile.in postfix-2.7.1-libs/src/global/Makefile.in
---- postfix-2.7.1/src/global/Makefile.in 2010-11-08 20:14:18.424139054 +0100
-+++ postfix-2.7.1-libs/src/global/Makefile.in 2010-11-08 20:10:05.004139060 +0100
-@@ -120,7 +120,7 @@
- test: $(TESTPROG)
-
- $(LIB): $(OBJS)
-- gcc -shared -Wl,-soname,libpostfix-global.so.1 -o $(LIB) $(OBJS)
-+ gcc -shared -Wl,-soname,libpostfix-global.so.1 -o $(LIB) $(OBJS) $(LIBS)
-
- $(LDAPSO): dict_ldap.o $(LIB)
- gcc -shared -Wl,-soname,dict_ldap.so -o $@ $? -lldap -llber -L../../lib -lutil -L. -lglobal
-diff -ur postfix-2.7.1/src/master/Makefile.in postfix-2.7.1-libs/src/master/Makefile.in
---- postfix-2.7.1/src/master/Makefile.in 2010-11-08 20:14:18.400139054 +0100
-+++ postfix-2.7.1-libs/src/master/Makefile.in 2010-11-08 20:10:24.072139054 +0100
-@@ -39,7 +39,7 @@
- root_tests:
-
- $(LIB): $(LIB_OBJ)
-- gcc -shared -Wl,-soname,libpostfix-master.so.1 -o $(LIB) $(LIB_OBJ)
-+ gcc -shared -Wl,-soname,libpostfix-master.so.1 -o $(LIB) $(LIB_OBJ) $(LIBS)
-
- $(LIB_DIR)/$(LIB): $(LIB)
- cp $(LIB) $(LIB_DIR)/$(LIB)
-diff -ur postfix-2.7.1/src/util/Makefile.in postfix-2.7.1-libs/src/util/Makefile.in
---- postfix-2.7.1/src/util/Makefile.in 2010-11-08 20:14:18.465139054 +0100
-+++ postfix-2.7.1-libs/src/util/Makefile.in 2010-11-08 20:12:49.982139058 +0100
-@@ -126,7 +126,7 @@
- gcc -shared -Wl,-soname,dict_pcre.so -o $@ $? -lpcre -L. -lutil
-
- $(LIB): $(OBJS)
-- gcc -shared -Wl,-soname,libpostfix-util.so.1 -o $(LIB) $(OBJS) -ldl
-+ gcc -shared -Wl,-soname,libpostfix-util.so.1 -o $(LIB) $(OBJS) -ldl -lcdb -lnsl -ldb
-
- $(LIB_DIR)/$(LIB): $(LIB)
- cp $(LIB) $(LIB_DIR)
diff --git a/postfix-make-jN.patch b/postfix-make-jN.patch
deleted file mode 100644
index 1d53873..0000000
--- a/postfix-make-jN.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- postfix-2.5.1/src/util/Makefile.in.orig 2008-04-01 08:29:37.168090190 +0200
-+++ postfix-2.5.1/src/util/Makefile.in 2008-04-01 08:30:10.665787970 +0200
-@@ -118,7 +118,7 @@
-
- test: $(TESTPROG)
-
--$(PCRESO): dict_pcre.o
-+$(PCRESO): dict_pcre.o libutil.a
- gcc -shared -Wl,-soname,dict_pcre.so -o $@ $? -lpcre -L. -lutil
-
- $(LIB): $(OBJS)
diff --git a/postfix-vbuf_print.patch b/postfix-vbuf_print.patch
deleted file mode 100644
index e1bd572..0000000
--- a/postfix-vbuf_print.patch
+++ /dev/null
@@ -1,48 +0,0 @@
---- postfix-2.9.4.orig/src/util/vbuf_print.c 2012-09-19 20:00:06.000000000 +0200
-+++ postfix-2.9.4/src/util/vbuf_print.c 2012-09-19 20:06:01.000000000 +0200
-@@ -122,7 +122,7 @@
- unsigned char *cp;
- int width; /* width and numerical precision */
- int prec; /* are signed for overflow defense */
-- unsigned long_flag; /* long or plain integer */
-+ unsigned long_flag; /* long long or long or plain integer */
- int ch;
- char *s;
-
-@@ -193,8 +193,17 @@
- msg_warn("%s: bad precision %d in %.50s", myname, prec, format);
- prec = 0;
- }
-- if ((long_flag = (*cp == 'l')) != 0)/* long whatever */
-+ /* long whatever */
-+ long_flag = 0;
-+ if (*cp == 'l') {
-+ long_flag++;
- VSTRING_ADDCH(fmt, *cp++);
-+
-+ if (*cp == 'l') {
-+ long_flag++;
-+ VSTRING_ADDCH(fmt, *cp++);
-+ }
-+ }
- if (*cp == 0) /* premature end, punt */
- break;
- VSTRING_ADDCH(fmt, *cp); /* type (checked below) */
-@@ -220,13 +229,16 @@
- break;
- case 'c': /* integral-valued argument */
- case 'd':
-+ case 'i':
- case 'u':
- case 'o':
- case 'x':
- case 'X':
- if (VBUF_SPACE(bp, (width > prec ? width : prec) + INT_SPACE))
- return (bp);
-- if (long_flag)
-+ if (long_flag > 1)
-+ sprintf((char *) bp->ptr, vstring_str(fmt), va_arg(ap, long long));
-+ else if (long_flag == 1)
- sprintf((char *) bp->ptr, vstring_str(fmt), va_arg(ap, long));
- else
- sprintf((char *) bp->ptr, vstring_str(fmt), va_arg(ap, int));
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/postfix.git/commitdiff/3cda6c7c4e88b3abd01c6becd8e6005aec3d433c
More information about the pld-cvs-commit
mailing list