From f0ff8ace09313f1fafa64664ed3007ef41247a47fa4373b7bc0976ba29178808 Mon Sep 17 00:00:00 2001 From: OBS User autobuild Date: Mon, 12 Oct 2009 14:51:23 +0000 Subject: [PATCH] Accepting request 21172 from server:mail Copy from server:mail/postfix based on submit request 21172 from user varkoly OBS-URL: https://build.opensuse.org/request/show/21172 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/postfix?expand=0&rev=37 --- dynamic_maps.patch | 717 +++++++-------- postfix-2.2.9-main.cf.patch | 42 + postfix-2.5.6.tar.bz2 | 3 - postfix-2.6.1-vda-ng-64bit.patch | 225 +++++ postfix-2.6.1-vda-ng.patch | 1459 ++++++++++++++++++++++++++++++ postfix-2.6.1.tar.bz2 | 3 + postfix-SuSE.tar.gz | 4 +- postfix-mysql.tar.bz2 | 3 + postfix.changes | 72 ++ postfix.spec | 566 +++++++----- rpmlintrc | 4 + 11 files changed, 2474 insertions(+), 624 deletions(-) create mode 100644 postfix-2.2.9-main.cf.patch delete mode 100644 postfix-2.5.6.tar.bz2 create mode 100644 postfix-2.6.1-vda-ng-64bit.patch create mode 100644 postfix-2.6.1-vda-ng.patch create mode 100644 postfix-2.6.1.tar.bz2 create mode 100644 postfix-mysql.tar.bz2 create mode 100644 rpmlintrc diff --git a/dynamic_maps.patch b/dynamic_maps.patch index 7c451e5..c8e666f 100644 --- a/dynamic_maps.patch +++ b/dynamic_maps.patch @@ -1,7 +1,6 @@ -Index: conf/dynamicmaps.cf -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ conf/dynamicmaps.cf 2007-08-06 00:02:19.119436818 +0200 +diff -ruN postfix-2.6.1//conf/dynamicmaps.cf postfix-2.6.1-dynamic_maps.patch//conf/dynamicmaps.cf +--- postfix-2.6.1//conf/dynamicmaps.cf 1970-01-01 01:00:00.000000000 +0100 ++++ postfix-2.6.1-dynamic_maps.patch//conf/dynamicmaps.cf 2009-05-27 12:50:33.000000000 +0200 @@ -0,0 +1,7 @@ +# Postfix dynamic maps configuration file. +# @@ -10,11 +9,10 @@ Index: conf/dynamicmaps.cf +# +#type location of .so file open function (mkmap func) +#==== ================================ ============= ============ -Index: conf/postfix-files -=================================================================== ---- conf/postfix-files.orig 2007-03-25 22:08:21.000000000 +0200 -+++ conf/postfix-files 2007-08-06 00:02:19.135437796 +0200 -@@ -63,6 +63,11 @@ $queue_directory/saved:d:$mail_owner:-:7 +diff -ruN postfix-2.6.1//conf/postfix-files postfix-2.6.1-dynamic_maps.patch//conf/postfix-files +--- postfix-2.6.1//conf/postfix-files 2009-02-14 03:08:16.000000000 +0100 ++++ postfix-2.6.1-dynamic_maps.patch//conf/postfix-files 2009-05-27 12:55:33.000000000 +0200 +@@ -65,6 +65,11 @@ $queue_directory/trace:d:$mail_owner:-:700:ucr $daemon_directory/anvil:f:root:-:755 $daemon_directory/bounce:f:root:-:755 @@ -26,7 +24,7 @@ Index: conf/postfix-files $daemon_directory/cleanup:f:root:-:755 $daemon_directory/discard:f:root:-:755 $daemon_directory/error:f:root:-:755 -@@ -85,6 +90,11 @@ $daemon_directory/tlsmgr:f:root:-:755 +@@ -94,6 +99,11 @@ $daemon_directory/trivial-rewrite:f:root:-:755 $daemon_directory/verify:f:root:-:755 $daemon_directory/virtual:f:root:-:755 @@ -38,19 +36,18 @@ Index: conf/postfix-files $daemon_directory/nqmgr:h:$daemon_directory/qmgr $daemon_directory/lmtp:h:$daemon_directory/smtp $command_directory/postalias:f:root:-:755 -@@ -107,6 +117,7 @@ $config_directory/access:f:root:-:644:p - $config_directory/aliases:f:root:-:644:p - $config_directory/bounce.cf.default:f:root:-:644 - $config_directory/canonical:f:root:-:644:p +@@ -117,6 +127,7 @@ + $config_directory/aliases:f:root:-:644:p1 + $config_directory/bounce.cf.default:f:root:-:644:1 + $config_directory/canonical:f:root:-:644:p1 +$config_directory/dynamicmaps.cf:f:root:-:644:p $config_directory/cidr_table:f:root:-:644:o - $config_directory/generic:f:root:-:644:p + $config_directory/generic:f:root:-:644:p1 $config_directory/generics:f:root:-:644:o -Index: src/dns/Makefile.in -=================================================================== ---- src/dns/Makefile.in.orig 2007-03-17 18:51:37.000000000 +0100 -+++ src/dns/Makefile.in 2007-08-06 00:02:19.251444890 +0200 -@@ -14,7 +14,7 @@ LIBS = ../../lib/libutil.a +diff -ruN postfix-2.6.1//src/dns/Makefile.in postfix-2.6.1-dynamic_maps.patch//src/dns/Makefile.in +--- postfix-2.6.1//src/dns/Makefile.in 2009-01-15 22:36:39.000000000 +0100 ++++ postfix-2.6.1-dynamic_maps.patch//src/dns/Makefile.in 2009-05-27 12:50:33.000000000 +0200 +@@ -14,7 +14,7 @@ LIB_DIR = ../../lib INC_DIR = ../../include @@ -59,7 +56,7 @@ Index: src/dns/Makefile.in all: $(LIB) -@@ -31,12 +31,10 @@ tests: test dns_rr_to_pa_test dns_rr_to_ +@@ -31,12 +31,10 @@ root_tests: $(LIB): $(OBJS) @@ -73,11 +70,73 @@ Index: src/dns/Makefile.in update: $(LIB_DIR)/$(LIB) $(HDRS) -for i in $(HDRS); \ -Index: src/global/Makefile.in -=================================================================== ---- src/global/Makefile.in.orig 2007-03-17 18:53:42.000000000 +0100 -+++ src/global/Makefile.in 2007-08-06 00:02:19.351451006 +0200 -@@ -32,7 +32,7 @@ OBJS = abounce.o anvil_clnt.o been_here. +diff -ruN postfix-2.6.1//src/global/mail_conf.c postfix-2.6.1-dynamic_maps.patch//src/global/mail_conf.c +--- postfix-2.6.1//src/global/mail_conf.c 2009-01-20 02:50:44.000000000 +0100 ++++ postfix-2.6.1-dynamic_maps.patch//src/global/mail_conf.c 2009-05-27 12:50:33.000000000 +0200 +@@ -182,6 +182,13 @@ + path = concatenate(var_config_dir, "/", "main.cf", (char *) 0); + dict_load_file(CONFIG_DICT, 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 -ruN postfix-2.6.1//src/global/mail_dict.c postfix-2.6.1-dynamic_maps.patch//src/global/mail_dict.c +--- postfix-2.6.1//src/global/mail_dict.c 2008-01-08 22:07:47.000000000 +0100 ++++ postfix-2.6.1-dynamic_maps.patch//src/global/mail_dict.c 2009-05-27 12:50:33.000000000 +0200 +@@ -45,6 +45,7 @@ + + static const DICT_OPEN_INFO dict_open_info[] = { + DICT_TYPE_PROXY, dict_proxy_open, ++#ifndef MAX_DYNAMIC_MAPS + #ifdef HAS_LDAP + DICT_TYPE_LDAP, dict_ldap_open, + #endif +@@ -54,6 +55,7 @@ + #ifdef HAS_PGSQL + DICT_TYPE_PGSQL, dict_pgsql_open, + #endif ++#endif /* MAX_DYNAMIC_MAPS */ + 0, + }; + +diff -ruN postfix-2.6.1//src/global/mail_params.c postfix-2.6.1-dynamic_maps.patch//src/global/mail_params.c +--- postfix-2.6.1//src/global/mail_params.c 2009-01-22 22:16:49.000000000 +0100 ++++ postfix-2.6.1-dynamic_maps.patch//src/global/mail_params.c 2009-05-27 12:50:33.000000000 +0200 +@@ -79,6 +79,7 @@ + /* char *var_export_environ; + /* char *var_debug_peer_list; + /* int var_debug_peer_level; ++/* int var_command_maxtime; + /* int var_in_flow_delay; + /* int var_fault_inj_code; + /* char *var_bounce_service; +@@ -265,6 +266,7 @@ + char *var_export_environ; + char *var_debug_peer_list; + int var_debug_peer_level; ++int var_command_maxtime; + int var_fault_inj_code; + char *var_bounce_service; + char *var_cleanup_service; +@@ -276,6 +278,7 @@ + char *var_error_service; + char *var_flush_service; + char *var_verify_service; ++char *var_scache_service; + char *var_trace_service; + char *var_proxymap_service; + char *var_proxywrite_service; +diff -ruN postfix-2.6.1//src/global/Makefile.in postfix-2.6.1-dynamic_maps.patch//src/global/Makefile.in +--- postfix-2.6.1//src/global/Makefile.in 2009-02-13 02:25:05.000000000 +0100 ++++ postfix-2.6.1-dynamic_maps.patch//src/global/Makefile.in 2009-05-27 12:50:33.000000000 +0200 +@@ -34,7 +34,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 \ @@ -86,7 +145,7 @@ Index: src/global/Makefile.in dict_proxy.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 \ -@@ -97,10 +97,13 @@ LIBS = ../../lib/libutil.a +@@ -103,10 +103,13 @@ LIB_DIR = ../../lib INC_DIR = ../../include MAKES = @@ -102,7 +161,7 @@ Index: src/global/Makefile.in $(OBJS): ../../conf/makedefs.out -@@ -110,14 +113,30 @@ Makefile: Makefile.in +@@ -116,14 +119,30 @@ test: $(TESTPROG) $(LIB): $(OBJS) @@ -137,7 +196,7 @@ Index: src/global/Makefile.in -for i in $(HDRS); \ do \ cmp -s $$i $(INC_DIR)/$$i 2>/dev/null || cp $$i $(INC_DIR); \ -@@ -425,7 +444,7 @@ lint: +@@ -491,7 +510,7 @@ lint $(DEFS) $(SRCS) $(LINTFIX) clean: @@ -146,78 +205,11 @@ Index: src/global/Makefile.in rm -rf printfck tidy: clean -Index: src/global/mail_conf.c -=================================================================== ---- src/global/mail_conf.c.orig 2004-04-10 16:52:51.000000000 +0200 -+++ src/global/mail_conf.c 2007-08-06 00:02:19.451457122 +0200 -@@ -175,6 +175,13 @@ void mail_conf_suck(void) - path = concatenate(var_config_dir, "/", "main.cf", (char *) 0); - dict_load_file(CONFIG_DICT, 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_eval - expand macros in string */ -Index: src/global/mail_dict.c -=================================================================== ---- src/global/mail_dict.c.orig 2004-01-04 19:53:27.000000000 +0100 -+++ src/global/mail_dict.c 2007-08-06 00:02:19.499460057 +0200 -@@ -45,6 +45,7 @@ typedef struct { - - static DICT_OPEN_INFO dict_open_info[] = { - DICT_TYPE_PROXY, dict_proxy_open, -+#ifndef MAX_DYNAMIC_MAPS - #ifdef HAS_LDAP - DICT_TYPE_LDAP, dict_ldap_open, - #endif -@@ -54,6 +55,7 @@ static DICT_OPEN_INFO dict_open_info[] = - #ifdef HAS_PGSQL - DICT_TYPE_PGSQL, dict_pgsql_open, - #endif -+#endif /* MAX_DYNAMIC_MAPS */ - 0, - }; - -Index: src/global/mail_params.c -=================================================================== ---- src/global/mail_params.c.orig 2007-07-10 19:27:12.000000000 +0200 -+++ src/global/mail_params.c 2007-08-06 00:02:19.515461036 +0200 -@@ -77,6 +77,7 @@ - /* char *var_export_environ; - /* char *var_debug_peer_list; - /* int var_debug_peer_level; -+/* int var_command_maxtime; - /* int var_in_flow_delay; - /* int var_fault_inj_code; - /* char *var_bounce_service; -@@ -248,6 +249,7 @@ char *var_import_environ; - char *var_export_environ; - char *var_debug_peer_list; - int var_debug_peer_level; -+int var_command_maxtime; - int var_fault_inj_code; - char *var_bounce_service; - char *var_cleanup_service; -@@ -259,6 +261,7 @@ char *var_showq_service; - char *var_error_service; - char *var_flush_service; - char *var_verify_service; -+char *var_scache_service; - char *var_trace_service; - int var_db_create_buf; - int var_db_read_buf; -Index: src/global/mkmap_open.c -=================================================================== ---- src/global/mkmap_open.c.orig 2004-12-15 01:24:22.000000000 +0100 -+++ src/global/mkmap_open.c 2007-08-06 00:02:19.547462993 +0200 -@@ -78,7 +78,7 @@ - * types that exist as files. Network-based maps are not of interest. +diff -ruN postfix-2.6.1//src/global/mkmap_open.c postfix-2.6.1-dynamic_maps.patch//src/global/mkmap_open.c +--- postfix-2.6.1//src/global/mkmap_open.c 2008-01-08 23:08:45.000000000 +0100 ++++ postfix-2.6.1-dynamic_maps.patch//src/global/mkmap_open.c 2009-05-27 12:50:33.000000000 +0200 +@@ -81,7 +81,7 @@ + * We use a different table (in dict_open.c) when querying maps. */ typedef struct { - char *type; @@ -225,7 +217,7 @@ Index: src/global/mkmap_open.c MKMAP *(*before_open) (const char *); } MKMAP_OPEN_INFO; -@@ -152,7 +152,16 @@ MKMAP *mkmap_open(const char *type, con +@@ -156,7 +156,16 @@ */ for (mp = mkmap_types; /* void */ ; mp++) { if (mp->type == 0) @@ -242,11 +234,10 @@ Index: src/global/mkmap_open.c if (strcmp(type, mp->type) == 0) break; } -Index: src/master/Makefile.in -=================================================================== ---- src/master/Makefile.in.orig 2007-03-17 18:51:39.000000000 +0100 -+++ src/master/Makefile.in 2007-08-06 00:02:19.563463971 +0200 -@@ -20,7 +20,7 @@ LIB_DIR = ../../lib +diff -ruN postfix-2.6.1//src/master/Makefile.in postfix-2.6.1-dynamic_maps.patch//src/master/Makefile.in +--- postfix-2.6.1//src/master/Makefile.in 2009-01-15 22:36:39.000000000 +0100 ++++ postfix-2.6.1-dynamic_maps.patch//src/master/Makefile.in 2009-05-27 12:50:33.000000000 +0200 +@@ -20,7 +20,7 @@ INC_DIR = ../../include BIN_DIR = ../../libexec @@ -255,7 +246,7 @@ Index: src/master/Makefile.in all: $(PROG) $(LIB) -@@ -39,12 +39,10 @@ tests: +@@ -39,12 +39,10 @@ root_tests: $(LIB): $(LIB_OBJ) @@ -269,11 +260,36 @@ Index: src/master/Makefile.in $(BIN_DIR)/$(PROG): $(PROG) cp $(PROG) $(BIN_DIR) -Index: src/postconf/postconf.c -=================================================================== ---- src/postconf/postconf.c.orig 2007-04-26 21:34:57.000000000 +0200 -+++ src/postconf/postconf.c 2007-08-06 00:02:19.687471554 +0200 -@@ -893,6 +893,16 @@ static void show_maps(void) +diff -ruN postfix-2.6.1//src/milter/Makefile.in postfix-2.6.1-dynamic_maps.patch//src/milter/Makefile.in +--- postfix-2.6.1//src/milter/Makefile.in 2009-01-15 22:36:39.000000000 +0100 ++++ postfix-2.6.1-dynamic_maps.patch//src/milter/Makefile.in 2009-05-27 12:50:33.000000000 +0200 +@@ -14,7 +14,7 @@ + INC_DIR = ../../include + MAKES = + +-.c.o:; $(CC) $(CFLAGS) -c $*.c ++.c.o:; $(CC) -fPIC $(CFLAGS) -c $*.c + + all: $(LIB) + +@@ -30,12 +30,10 @@ + root_tests: + + $(LIB): $(OBJS) +- $(AR) $(ARFL) $(LIB) $? +- $(RANLIB) $(LIB) ++ gcc -shared -Wl,-soname,libpostfix-milter.so.1 -o $(LIB) $(OBJS) $(LIBS) $(SYSLIBS) + + $(LIB_DIR)/$(LIB): $(LIB) + cp $(LIB) $(LIB_DIR) +- $(RANLIB) $(LIB_DIR)/$(LIB) + + update: $(LIB_DIR)/$(LIB) $(HDRS) + -for i in $(HDRS); \ +diff -ruN postfix-2.6.1//src/postconf/postconf.c postfix-2.6.1-dynamic_maps.patch//src/postconf/postconf.c +--- postfix-2.6.1//src/postconf/postconf.c 2009-02-13 02:49:27.000000000 +0100 ++++ postfix-2.6.1-dynamic_maps.patch//src/postconf/postconf.c 2009-05-27 12:50:33.000000000 +0200 +@@ -962,6 +962,16 @@ { ARGV *maps_argv; int i; @@ -290,21 +306,20 @@ Index: src/postconf/postconf.c maps_argv = dict_mapnames(); for (i = 0; i < maps_argv->argc; i++) -Index: src/postmap/postmap.c -=================================================================== ---- src/postmap/postmap.c.orig 2007-03-27 02:09:16.000000000 +0200 -+++ src/postmap/postmap.c 2007-08-06 00:02:19.707472778 +0200 +diff -ruN postfix-2.6.1//src/postmap/postmap.c postfix-2.6.1-dynamic_maps.patch//src/postmap/postmap.c +--- postfix-2.6.1//src/postmap/postmap.c 2009-04-17 22:04:00.000000000 +0200 ++++ postfix-2.6.1-dynamic_maps.patch//src/postmap/postmap.c 2009-05-27 12:59:50.000000000 +0200 @@ -5,7 +5,7 @@ /* Postfix lookup table management /* SYNOPSIS /* .fi --/* \fBpostmap\fR [\fB-Nfinoprsvw\fR] [\fB-c \fIconfig_dir\fR] -+/* \fBpostmap\fR [\fB-Nfinoprsuvw\fR] [\fB-c \fIconfig_dir\fR] +-/* \fBpostmap\fR [\fB-Nbfhimnoprsvw\fR] [\fB-c \fIconfig_dir\fR] ++/* \fBpostmap\fR [\fB-Nbfhimnoprsuvw\fR] [\fB-c \fIconfig_dir\fR] /* [\fB-d \fIkey\fR] [\fB-q \fIkey\fR] /* [\fIfile_type\fR:]\fIfile_name\fR ... /* DESCRIPTION -@@ -115,6 +115,8 @@ - /* as the original input order. +@@ -151,6 +151,8 @@ + /* .sp /* This feature is available in Postfix version 2.2 and later, /* and is not available for all database types. +/* .IP \fB-u\fR @@ -312,7 +327,7 @@ Index: src/postmap/postmap.c /* .IP \fB-v\fR /* Enable verbose logging for debugging purposes. Multiple \fB-v\fR /* options make the software increasingly verbose. -@@ -538,6 +540,18 @@ static void postmap_seq(const char *map_ +@@ -723,6 +725,18 @@ dict_close(dict); } @@ -331,7 +346,7 @@ Index: src/postmap/postmap.c /* usage - explain */ static NORETURN usage(char *myname) -@@ -558,6 +572,7 @@ int main(int argc, char **argv) +@@ -743,6 +757,7 @@ int postmap_flags = POSTMAP_FLAG_AS_OWNER | POSTMAP_FLAG_SAVE_PERM; int open_flags = O_RDWR | O_CREAT | O_TRUNC; int dict_flags = DICT_FLAG_DUP_WARN | DICT_FLAG_FOLD_FIX; @@ -339,16 +354,16 @@ Index: src/postmap/postmap.c char *query = 0; char *delkey = 0; int sequence = 0; -@@ -602,7 +617,7 @@ int main(int argc, char **argv) +@@ -787,7 +802,7 @@ /* * Parse JCL. */ -- while ((ch = GETOPT(argc, argv, "Nc:d:finopq:rsvw")) > 0) { -+ while ((ch = GETOPT(argc, argv, "Nc:d:finopq:rsuvw")) > 0) { +- while ((ch = GETOPT(argc, argv, "Nbc:d:fhimnopq:rsvw")) > 0) { ++ while ((ch = GETOPT(argc, argv, "Nbc:d:fhimnopq:rsuvw")) > 0) { switch (ch) { default: usage(argv[0]); -@@ -616,8 +631,8 @@ int main(int argc, char **argv) +@@ -804,8 +819,8 @@ msg_fatal("out of memory"); break; case 'd': @@ -359,7 +374,7 @@ Index: src/postmap/postmap.c delkey = optarg; break; case 'f': -@@ -637,8 +652,8 @@ int main(int argc, char **argv) +@@ -831,8 +846,8 @@ postmap_flags &= ~POSTMAP_FLAG_SAVE_PERM; break; case 'q': @@ -370,7 +385,7 @@ Index: src/postmap/postmap.c query = optarg; break; case 'r': -@@ -646,10 +661,15 @@ int main(int argc, char **argv) +@@ -840,10 +855,15 @@ dict_flags |= DICT_FLAG_DUP_REPLACE; break; case 's': @@ -388,7 +403,7 @@ Index: src/postmap/postmap.c case 'v': msg_verbose++; break; -@@ -717,6 +737,21 @@ int main(int argc, char **argv) +@@ -914,6 +934,21 @@ exit(0); } exit(1); @@ -410,11 +425,10 @@ Index: src/postmap/postmap.c } else { /* create/update map(s) */ if (optind + 1 > argc) usage(argv[0]); -Index: src/tls/Makefile.in -=================================================================== ---- src/tls/Makefile.in.orig 2007-03-17 18:51:38.000000000 +0100 -+++ src/tls/Makefile.in 2007-08-06 00:02:19.731474245 +0200 -@@ -22,7 +22,7 @@ LIB_DIR = ../../lib +diff -ruN postfix-2.6.1//src/tls/Makefile.in postfix-2.6.1-dynamic_maps.patch//src/tls/Makefile.in +--- postfix-2.6.1//src/tls/Makefile.in 2009-01-15 22:36:39.000000000 +0100 ++++ postfix-2.6.1-dynamic_maps.patch//src/tls/Makefile.in 2009-05-27 12:50:33.000000000 +0200 +@@ -22,7 +22,7 @@ INC_DIR = ../../include MAKES = @@ -423,7 +437,7 @@ Index: src/tls/Makefile.in all: $(LIB) -@@ -38,12 +38,10 @@ tests: +@@ -38,12 +38,10 @@ root_tests: $(LIB): $(OBJS) @@ -437,141 +451,34 @@ Index: src/tls/Makefile.in update: $(LIB_DIR)/$(LIB) $(HDRS) -for i in $(HDRS); \ -Index: src/util/Makefile.in -=================================================================== ---- src/util/Makefile.in.orig 2008-01-07 17:22:02.000000000 +0100 -+++ src/util/Makefile.in 2008-01-28 17:05:05.000000000 +0100 -@@ -31,15 +31,16 @@ - vstream_popen.c vstring.c vstring_vstream.c watchdog.c writable.c \ - write_buf.c write_wait.c sane_basename.c format_tv.c allspace.c \ - allascii.c load_file.c killme_after.c vstream_tweak.c upass_connect.c \ -- upass_listen.c upass_trigger.c -+ upass_listen.c upass_trigger.c \ -+ load_lib.c sdbm.c - OBJS = alldig.o allprint.o argv.o argv_split.o attr_clnt.o attr_print0.o \ - attr_print64.o attr_print_plain.o attr_scan0.o attr_scan64.o \ - attr_scan_plain.o auto_clnt.o base64_code.o basename.o binhash.o \ - 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_ni.o dict_nis.o \ -- dict_nisplus.o dict_open.o dict_pcre.o dict_regexp.o dict_sdbm.o \ -- dict_static.o dict_tcp.o dict_unix.o dir_forest.o doze.o dummy_read.o \ -+ dict_nisplus.o dict_open.o dict_regexp.o dict_sdbm.o \ -+ dict_static.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 \ - fullname.o get_domainname.o get_hostname.o hex_code.o hex_quote.o \ -@@ -64,7 +65,8 @@ - vstream_popen.o vstring.o vstring_vstream.o watchdog.o writable.o \ - write_buf.o write_wait.o sane_basename.o format_tv.o allspace.o \ - allascii.o load_file.o killme_after.o vstream_tweak.o upass_connect.o \ -- upass_listen.o upass_trigger.o -+ upass_listen.o upass_trigger.o \ -+ load_lib.o sdbm.o - HDRS = argv.h attr.h attr_clnt.h auto_clnt.h base64_code.h binhash.h \ - chroot_uid.h cidr_match.h clean_env.h connect.h ctable.h dict.h \ - dict_cdb.h dict_cidr.h dict_db.h dict_dbm.h dict_env.h dict_ht.h \ -@@ -78,7 +80,7 @@ - msg_output.h msg_syslog.h msg_vstream.h mvect.h myaddrinfo.h myflock.h \ - mymalloc.h myrand.h name_code.h name_mask.h netstring.h nvtable.h \ - open_as.h open_lock.h percentm.h posix_signals.h readlline.h ring.h \ -- safe.h safe_open.h sane_accept.h sane_connect.h sane_fsops.h \ -+ safe.h safe_open.h sane_accept.h sane_connect.h sane_fsops.h sdbm.h load_lib.h \ - sane_socketpair.h sane_time.h scan_dir.h set_eugid.h set_ugid.h \ - 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 \ -@@ -90,6 +92,8 @@ - CFLAGS = $(DEBUG) $(OPT) $(DEFS) - FILES = Makefile $(SRCS) $(HDRS) - INCL = -+PCRESO = dict_pcre.so -+TCPSO = dict_tcp.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 \ -@@ -104,10 +108,11 @@ +diff -ruN postfix-2.6.1//src/tls/tls_client.c postfix-2.6.1-dynamic_maps.patch//src/tls/tls_client.c +--- postfix-2.6.1//src/tls/tls_client.c 2008-11-09 00:51:41.000000000 +0100 ++++ postfix-2.6.1-dynamic_maps.patch//src/tls/tls_client.c 2009-05-27 12:50:33.000000000 +0200 +@@ -155,6 +155,8 @@ + #define STR vstring_str + #define LEN VSTRING_LEN - LIB_DIR = ../../lib - INC_DIR = ../../include -+LIBS = $(LIB_DIR)/$(LIB) $(LIB_DIR)/$(PCRESO) $(LIB_DIR)/$(TCPSO) - --.c.o:; $(CC) $(CFLAGS) -c $*.c -+.c.o:; $(CC) -fPIC $(CFLAGS) -c $*.c - --all: $(LIB) -+all: $(LIB) $(PCRESO) $(TCPSO) - - $(OBJS): ../../conf/makedefs.out - -@@ -116,15 +121,25 @@ - - test: $(TESTPROG) - -+$(PCRESO): dict_pcre.o -+ gcc -shared -Wl,-soname,dict_pcre.so -o $@ $? -lpcre -L. -lutil ++int var_tls_daemon_rand_bytes; + -+$(TCPSO): dict_tcp.o -+ gcc -shared -Wl,-soname,dict_tcp.so -o $@ $? -L. -lutil + /* load_clnt_session - load session from client cache (non-callback) */ + + static SSL_SESSION *load_clnt_session(TLS_SESS_STATE *TLScontext) +diff -ruN postfix-2.6.1//src/tls/tls_server.c postfix-2.6.1-dynamic_maps.patch//src/tls/tls_server.c +--- postfix-2.6.1//src/tls/tls_server.c 2008-11-09 00:51:48.000000000 +0100 ++++ postfix-2.6.1-dynamic_maps.patch//src/tls/tls_server.c 2009-05-27 12:50:33.000000000 +0200 +@@ -124,6 +124,8 @@ + #define STR(x) vstring_str(x) + #define LEN(x) VSTRING_LEN(x) + ++int var_tls_daemon_rand_bytes; + - $(LIB): $(OBJS) -- $(AR) $(ARFL) $(LIB) $? -- $(RANLIB) $(LIB) -+ gcc -shared -Wl,-soname,libpostfix-util.so.1 -o $(LIB) $(OBJS) -ldl $(SYSLIBS) + /* Application-specific. */ - $(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) -+ -+$(LIB_DIR)/$(TCPSO): $(TCPSO) -+ cp $(TCPSO) $(LIB_DIR) -+ -+update: $(LIBS) $(HDRS) - -for i in $(HDRS); \ - do \ - cmp -s $$i $(INC_DIR)/$$i 2>/dev/null || cp $$i $(INC_DIR); \ -@@ -146,7 +161,8 @@ - lint $(SRCS) - - clean: -- rm -f *.o $(LIB) *core $(TESTPROG) junk $(MAKES) *.tmp -+ rm -f *.o $(LIB) $(PCRESO) $(TCPSO) *core $(TESTPROG) \ -+ junk $(MAKES) *.tmp - rm -rf printfck - - tidy: clean -Index: src/util/dict.h -=================================================================== ---- src/util/dict.h.orig 2007-01-05 01:48:48.000000000 +0100 -+++ src/util/dict.h 2007-08-06 00:02:19.799478404 +0200 -@@ -66,6 +66,7 @@ extern DICT *dict_debug(DICT *); - #define DICT_FLAG_NO_UNAUTH (1<<13) /* disallow unauthenticated data */ - #define DICT_FLAG_FOLD_FIX (1<<14) /* case-fold key with fixed-case map */ - #define DICT_FLAG_FOLD_MUL (1<<15) /* case-fold key with multi-case map */ -+#define DICT_FLAG_UPGRADE (1<<30) /* Upgrade the db */ - #define DICT_FLAG_FOLD_ANY (DICT_FLAG_FOLD_FIX | DICT_FLAG_FOLD_MUL) - - /* IMPORTANT: Update the dict_mask[] table when the above changes */ -@@ -136,6 +137,11 @@ extern const char *dict_eval(const char - extern DICT *dict_open(const char *, int, int); - extern DICT *dict_open3(const char *, const char *, int, int); - extern void dict_open_register(const char *, DICT *(*) (const char *, int, int)); -+#ifndef NO_DYNAMIC_MAPS -+extern void dict_open_dlinfo(const char *path); -+typedef void* (*dict_mkmap_func_t)(const char *); -+dict_mkmap_func_t dict_mkmap_func(const char *dict_type); -+#endif - - #define dict_get(dp, key) (dp)->lookup((dp), (key)) - #define dict_put(dp, key, val) (dp)->update((dp), (key), (val)) -Index: src/util/dict_db.c -=================================================================== ---- src/util/dict_db.c.orig 2007-01-04 15:06:07.000000000 +0100 -+++ src/util/dict_db.c 2007-08-06 00:02:19.843481095 +0200 -@@ -664,6 +664,12 @@ static DICT *dict_db_open(const char *cl + /* +diff -ruN postfix-2.6.1//src/util/dict_db.c postfix-2.6.1-dynamic_maps.patch//src/util/dict_db.c +--- postfix-2.6.1//src/util/dict_db.c 2007-01-04 15:06:07.000000000 +0100 ++++ postfix-2.6.1-dynamic_maps.patch//src/util/dict_db.c 2009-05-27 12:50:33.000000000 +0200 +@@ -664,6 +664,12 @@ msg_fatal("set DB cache size %d: %m", dict_db_cache_size); if (type == DB_HASH && db->set_h_nelem(db, DICT_DB_NELM) != 0) msg_fatal("set DB hash element count %d: %m", DICT_DB_NELM); @@ -584,11 +491,10 @@ Index: src/util/dict_db.c #if (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR > 0) if ((errno = db->open(db, 0, db_path, 0, type, db_flags, 0644)) != 0) msg_fatal("open database %s: %m", db_path); -Index: src/util/dict_dbm.c -=================================================================== ---- src/util/dict_dbm.c.orig 2007-01-04 15:07:36.000000000 +0100 -+++ src/util/dict_dbm.c 2007-08-06 00:02:19.867482562 +0200 -@@ -407,6 +407,10 @@ DICT *dict_dbm_open(const char *path, +diff -ruN postfix-2.6.1//src/util/dict_dbm.c postfix-2.6.1-dynamic_maps.patch//src/util/dict_dbm.c +--- postfix-2.6.1//src/util/dict_dbm.c 2007-01-04 15:07:36.000000000 +0100 ++++ postfix-2.6.1-dynamic_maps.patch//src/util/dict_dbm.c 2009-05-27 12:50:33.000000000 +0200 +@@ -407,6 +407,10 @@ char *dbm_path; int lock_fd; @@ -599,10 +505,32 @@ Index: src/util/dict_dbm.c /* * Note: DICT_FLAG_LOCK is used only by programs that do fine-grained (in * the time domain) locking while accessing individual database records. -Index: src/util/dict_open.c -=================================================================== ---- src/util/dict_open.c.orig 2006-06-26 14:59:19.000000000 +0200 -+++ src/util/dict_open.c 2007-08-06 00:02:19.907485009 +0200 +diff -ruN postfix-2.6.1//src/util/dict.h postfix-2.6.1-dynamic_maps.patch//src/util/dict.h +--- postfix-2.6.1//src/util/dict.h 2007-12-03 20:42:26.000000000 +0100 ++++ postfix-2.6.1-dynamic_maps.patch//src/util/dict.h 2009-05-27 12:50:33.000000000 +0200 +@@ -66,6 +66,7 @@ + #define DICT_FLAG_NO_UNAUTH (1<<13) /* disallow unauthenticated data */ + #define DICT_FLAG_FOLD_FIX (1<<14) /* case-fold key with fixed-case map */ + #define DICT_FLAG_FOLD_MUL (1<<15) /* case-fold key with multi-case map */ ++#define DICT_FLAG_UPGRADE (1<<30) /* Upgrade the db */ + #define DICT_FLAG_FOLD_ANY (DICT_FLAG_FOLD_FIX | DICT_FLAG_FOLD_MUL) + + /* IMPORTANT: Update the dict_mask[] table when the above changes */ +@@ -138,6 +139,11 @@ + extern DICT *dict_open(const char *, int, int); + extern DICT *dict_open3(const char *, const char *, int, int); + extern void dict_open_register(const char *, DICT *(*) (const char *, int, int)); ++#ifndef NO_DYNAMIC_MAPS ++extern void dict_open_dlinfo(const char *path); ++typedef void* (*dict_mkmap_func_t)(const char *); ++dict_mkmap_func_t dict_mkmap_func(const char *dict_type); ++#endif + + #define dict_get(dp, key) ((const char *) (dp)->lookup((dp), (key))) + #define dict_put(dp, key, val) (dp)->update((dp), (key), (val)) +diff -ruN postfix-2.6.1//src/util/dict_open.c postfix-2.6.1-dynamic_maps.patch//src/util/dict_open.c +--- postfix-2.6.1//src/util/dict_open.c 2008-01-08 22:05:20.000000000 +0100 ++++ postfix-2.6.1-dynamic_maps.patch//src/util/dict_open.c 2009-05-27 12:50:33.000000000 +0200 @@ -44,6 +44,8 @@ /* DICT *(*open) (const char *, int, int); /* @@ -612,7 +540,7 @@ Index: src/util/dict_open.c /* DESCRIPTION /* This module implements a low-level interface to multiple /* physical dictionary types. -@@ -156,6 +158,9 @@ +@@ -159,6 +161,9 @@ /* /* dict_mapnames() returns a sorted list with the names of all available /* dictionary types. @@ -622,7 +550,7 @@ Index: src/util/dict_open.c /* DIAGNOSTICS /* Fatal error: open error, unsupported dictionary type, attempt to /* update non-writable dictionary. -@@ -180,6 +185,9 @@ +@@ -183,6 +188,9 @@ #include #endif @@ -632,7 +560,7 @@ Index: src/util/dict_open.c /* Utility library. */ #include -@@ -204,6 +212,27 @@ +@@ -207,6 +215,27 @@ #include #include @@ -660,7 +588,7 @@ Index: src/util/dict_open.c /* * lookup table for available map types. */ -@@ -218,9 +247,11 @@ static DICT_OPEN_INFO dict_open_info[] = +@@ -221,9 +250,11 @@ #endif DICT_TYPE_ENVIRON, dict_env_open, DICT_TYPE_UNIX, dict_unix_open, @@ -672,7 +600,7 @@ Index: src/util/dict_open.c #ifdef HAS_SDBM DICT_TYPE_SDBM, dict_sdbm_open, #endif -@@ -240,9 +271,11 @@ static DICT_OPEN_INFO dict_open_info[] = +@@ -243,9 +274,11 @@ #ifdef HAS_NETINFO DICT_TYPE_NETINFO, dict_ni_open, #endif @@ -684,7 +612,7 @@ Index: src/util/dict_open.c #ifdef HAS_POSIX_REGEXP DICT_TYPE_REGEXP, dict_regexp_open, #endif -@@ -300,8 +333,31 @@ DICT *dict_open3(const char *dict_type +@@ -303,8 +336,31 @@ dict_type, dict_name); if (dict_open_hash == 0) dict_open_init(); @@ -718,7 +646,7 @@ Index: src/util/dict_open.c if ((dict = dp->open(dict_name, open_flags, dict_flags)) == 0) msg_fatal("opening %s:%s %m", dict_type, dict_name); if (msg_verbose) -@@ -309,6 +365,36 @@ DICT *dict_open3(const char *dict_type +@@ -312,6 +368,36 @@ return (dict); } @@ -755,7 +683,7 @@ Index: src/util/dict_open.c /* dict_open_register - register dictionary type */ void dict_open_register(const char *type, -@@ -342,6 +428,9 @@ ARGV *dict_mapnames() +@@ -345,6 +431,9 @@ HTABLE_INFO **ht; DICT_OPEN_INFO *dp; ARGV *mapnames; @@ -765,7 +693,7 @@ Index: src/util/dict_open.c if (dict_open_hash == 0) dict_open_init(); -@@ -350,6 +439,13 @@ ARGV *dict_mapnames() +@@ -353,6 +442,13 @@ dp = (DICT_OPEN_INFO *) ht[0]->value; argv_add(mapnames, dp->type, ARGV_END); } @@ -779,7 +707,7 @@ Index: src/util/dict_open.c qsort((void *) mapnames->argv, mapnames->argc, sizeof(mapnames->argv[0]), dict_sort_alpha_cpp); myfree((char *) ht_info); -@@ -357,6 +453,87 @@ ARGV *dict_mapnames() +@@ -360,6 +456,87 @@ return mapnames; } @@ -867,10 +795,9 @@ Index: src/util/dict_open.c #ifdef TEST /* -Index: src/util/load_lib.c -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ src/util/load_lib.c 2007-08-06 00:02:19.939486966 +0200 +diff -ruN postfix-2.6.1//src/util/load_lib.c postfix-2.6.1-dynamic_maps.patch//src/util/load_lib.c +--- postfix-2.6.1//src/util/load_lib.c 1970-01-01 01:00:00.000000000 +0100 ++++ postfix-2.6.1-dynamic_maps.patch//src/util/load_lib.c 2009-05-27 12:50:33.000000000 +0200 @@ -0,0 +1,135 @@ +/*++ +/* NAME @@ -1007,10 +934,9 @@ Index: src/util/load_lib.c +#endif + return 0; +} -Index: src/util/load_lib.h -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ src/util/load_lib.h 2007-08-06 00:02:19.971488923 +0200 +diff -ruN postfix-2.6.1//src/util/load_lib.h postfix-2.6.1-dynamic_maps.patch//src/util/load_lib.h +--- postfix-2.6.1//src/util/load_lib.h 1970-01-01 01:00:00.000000000 +0100 ++++ postfix-2.6.1-dynamic_maps.patch//src/util/load_lib.h 2009-05-27 12:50:33.000000000 +0200 @@ -0,0 +1,41 @@ +#ifndef _LOAD_LIB_H_INCLUDED_ +#define _LOAD_LIB_H_INCLUDED_ @@ -1053,10 +979,114 @@ Index: src/util/load_lib.h +/*--*/ + +#endif -Index: src/util/sdbm.c -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ src/util/sdbm.c 2007-08-06 00:02:19.995490390 +0200 +diff -ruN postfix-2.6.1//src/util/Makefile.in postfix-2.6.1-dynamic_maps.patch//src/util/Makefile.in +--- postfix-2.6.1//src/util/Makefile.in 2009-04-27 14:04:22.000000000 +0200 ++++ postfix-2.6.1-dynamic_maps.patch//src/util/Makefile.in 2009-05-27 16:05:55.000000000 +0200 +@@ -31,15 +31,16 @@ + vstream_popen.c vstring.c vstring_vstream.c watchdog.c writable.c \ + write_buf.c write_wait.c sane_basename.c format_tv.c allspace.c \ + allascii.c load_file.c killme_after.c vstream_tweak.c upass_connect.c \ +- upass_listen.c upass_trigger.c edit_file.c inet_windowsize.c ++ upass_listen.c upass_trigger.c edit_file.c inet_windowsize.c \ ++ load_lib.c sdbm.c + OBJS = alldig.o allprint.o argv.o argv_split.o attr_clnt.o attr_print0.o \ + attr_print64.o attr_print_plain.o attr_scan0.o attr_scan64.o \ + attr_scan_plain.o auto_clnt.o base64_code.o basename.o binhash.o \ + 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_ni.o dict_nis.o \ +- dict_nisplus.o dict_open.o dict_pcre.o dict_regexp.o dict_sdbm.o \ +- dict_static.o dict_tcp.o dict_unix.o dir_forest.o doze.o dummy_read.o \ ++ dict_nisplus.o dict_open.o dict_regexp.o dict_sdbm.o \ ++ dict_static.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 \ + fullname.o get_domainname.o get_hostname.o hex_code.o hex_quote.o \ +@@ -64,7 +65,8 @@ + vstream_popen.o vstring.o vstring_vstream.o watchdog.o writable.o \ + write_buf.o write_wait.o sane_basename.o format_tv.o allspace.o \ + allascii.o load_file.o killme_after.o vstream_tweak.o upass_connect.o \ +- upass_listen.o upass_trigger.o edit_file.o inet_windowsize.o ++ upass_listen.o upass_trigger.o edit_file.o inet_windowsize.o \ ++ load_lib.o sdbm.o + HDRS = argv.h attr.h attr_clnt.h auto_clnt.h base64_code.h binhash.h \ + chroot_uid.h cidr_match.h clean_env.h connect.h ctable.h dict.h \ + dict_cdb.h dict_cidr.h dict_db.h dict_dbm.h dict_env.h dict_ht.h \ +@@ -78,7 +80,7 @@ + msg_output.h msg_syslog.h msg_vstream.h mvect.h myaddrinfo.h myflock.h \ + mymalloc.h myrand.h name_code.h name_mask.h netstring.h nvtable.h \ + open_as.h open_lock.h percentm.h posix_signals.h readlline.h ring.h \ +- safe.h safe_open.h sane_accept.h sane_connect.h sane_fsops.h \ ++ safe.h safe_open.h sane_accept.h sane_connect.h sane_fsops.h sdbm.h load_lib.h \ + sane_socketpair.h sane_time.h scan_dir.h set_eugid.h set_ugid.h \ + 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 \ +@@ -91,6 +93,8 @@ + CFLAGS = $(DEBUG) $(OPT) $(DEFS) + FILES = Makefile $(SRCS) $(HDRS) + INCL = ++PCRESO = dict_pcre.so ++TCPSO = dict_tcp.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 \ +@@ -105,10 +109,11 @@ + + LIB_DIR = ../../lib + INC_DIR = ../../include ++LIBS = $(LIB_DIR)/$(LIB) $(LIB_DIR)/$(PCRESO) $(LIB_DIR)/$(TCPSO) + +-.c.o:; $(CC) $(CFLAGS) -c $*.c ++.c.o:; $(CC) -fPIC $(CFLAGS) -c $*.c + +-all: $(LIB) ++all: $(LIB) $(PCRESO) $(TCPSO) + + $(OBJS): ../../conf/makedefs.out + +@@ -117,15 +122,25 @@ + + test: $(TESTPROG) + ++$(PCRESO): dict_pcre.o ++ gcc -shared -Wl,-soname,dict_pcre.so -o $@ $? -lpcre -L. -lutil ++ ++$(TCPSO): dict_tcp.o ++ gcc -shared -Wl,-soname,dict_tcp.so -o $@ $? -L. -lutil ++ + $(LIB): $(OBJS) +- $(AR) $(ARFL) $(LIB) $? +- $(RANLIB) $(LIB) ++ gcc -shared -Wl,-soname,libpostfix-util.so.1 -o $(LIB) $(OBJS) -ldl $(SYSLIBS) + + $(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) ++ ++$(LIB_DIR)/$(TCPSO): $(TCPSO) ++ cp $(TCPSO) $(LIB_DIR) ++ ++update: $(LIBS) $(HDRS) + -for i in $(HDRS); \ + do \ + cmp -s $$i $(INC_DIR)/$$i 2>/dev/null || cp $$i $(INC_DIR); \ +@@ -147,7 +162,8 @@ + lint $(SRCS) + + clean: +- rm -f *.o $(LIB) *core $(TESTPROG) junk $(MAKES) *.tmp ++ rm -f *.o $(LIB) $(PCRESO) $(TCPSO) *core $(TESTPROG) \ ++ junk $(MAKES) *.tmp + rm -rf printfck + + tidy: clean +diff -ruN postfix-2.6.1//src/util/sdbm.c postfix-2.6.1-dynamic_maps.patch//src/util/sdbm.c +--- postfix-2.6.1//src/util/sdbm.c 1970-01-01 01:00:00.000000000 +0100 ++++ postfix-2.6.1-dynamic_maps.patch//src/util/sdbm.c 2009-05-27 12:50:33.000000000 +0200 @@ -0,0 +1,972 @@ +/*++ +/* NAME @@ -2030,10 +2060,9 @@ Index: src/util/sdbm.c + return db; +} + -Index: src/util/sdbm.h -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ src/util/sdbm.h 2007-08-06 00:02:20.023492103 +0200 +diff -ruN postfix-2.6.1//src/util/sdbm.h postfix-2.6.1-dynamic_maps.patch//src/util/sdbm.h +--- postfix-2.6.1//src/util/sdbm.h 1970-01-01 01:00:00.000000000 +0100 ++++ postfix-2.6.1-dynamic_maps.patch//src/util/sdbm.h 2009-05-27 12:50:33.000000000 +0200 @@ -0,0 +1,97 @@ +/*++ +/* NAME @@ -2132,11 +2161,10 @@ Index: src/util/sdbm.h +#define BADMESS /* generate a message for worst case: + cannot make room after SPLTMAX splits */ +#endif /* UTIL_SDBM_H */ -Index: src/util/sys_defs.h -=================================================================== ---- src/util/sys_defs.h.orig 2007-03-24 23:45:33.000000000 +0100 -+++ src/util/sys_defs.h 2007-08-06 00:02:20.039493081 +0200 -@@ -689,6 +689,7 @@ extern int initgroups(const char *, int) +diff -ruN postfix-2.6.1//src/util/sys_defs.h postfix-2.6.1-dynamic_maps.patch//src/util/sys_defs.h +--- postfix-2.6.1//src/util/sys_defs.h 2009-05-11 02:45:27.000000000 +0200 ++++ postfix-2.6.1-dynamic_maps.patch//src/util/sys_defs.h 2009-05-27 13:19:08.000000000 +0200 +@@ -710,6 +710,7 @@ #define INTERNAL_LOCK MYFLOCK_STYLE_FLOCK #define DEF_MAILBOX_LOCK "fcntl, dotlock" /* RedHat >= 4.x */ #define HAS_FSYNC @@ -2144,7 +2172,7 @@ Index: src/util/sys_defs.h #define HAS_DB #define DEF_DB_TYPE "hash" #define ALIAS_DB_MAP "hash:/etc/aliases" -@@ -700,11 +701,25 @@ extern int initgroups(const char *, int) +@@ -721,11 +722,25 @@ #define STATFS_IN_SYS_VFS_H #define PREPEND_PLUS_TO_OPTSTRING #define HAS_POSIX_REGEXP @@ -2154,23 +2182,23 @@ Index: src/util/sys_defs.h #define NATIVE_NEWALIAS_PATH "/usr/bin/newaliases" #define NATIVE_COMMAND_DIR "/usr/sbin" +#ifdef DEBIAN -+#define NATIVE_DAEMON_DIR "/usr/lib/postfix" ++#define NATIVE_DAEMON_DIR "/usr/lib/postfix" +#ifndef DEF_MANPAGE_DIR -+#define DEF_MANPAGE_DIR "/usr/share/man" ++#define DEF_MANPAGE_DIR "/usr/share/man" +#endif +#ifndef DEF_SAMPLE_DIR -+#define DEF_SAMPLE_DIR "/usr/share/doc/postfix/examples" ++#define DEF_SAMPLE_DIR "/usr/share/doc/postfix/examples" +#endif +#ifndef DEF_README_DIR -+#define DEF_README_DIR "/usr/share/doc/postfix" ++#define DEF_README_DIR "/usr/share/doc/postfix" +#endif +#else #define NATIVE_DAEMON_DIR "/usr/libexec/postfix" +#endif - #if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 - #define SOCKADDR_SIZE socklen_t - #define SOCKOPT_SIZE socklen_t -@@ -859,6 +874,7 @@ extern int h_errno; /* impor + #ifdef __GLIBC_PREREQ + # define HAVE_GLIBC_API_VERSION_SUPPORT(maj, min) __GLIBC_PREREQ(maj, min) + #else +@@ -891,6 +906,7 @@ #define USE_STATFS #define STATFS_IN_SYS_VFS_H #define HAS_POSIX_REGEXP @@ -2178,7 +2206,7 @@ Index: src/util/sys_defs.h #define NATIVE_SENDMAIL_PATH "/usr/sbin/sendmail" #define NATIVE_MAILQ_PATH "/usr/bin/mailq" #define NATIVE_NEWALIAS_PATH "/usr/bin/newaliases" -@@ -896,6 +912,7 @@ extern int h_errno; /* impor +@@ -928,6 +944,7 @@ #define USE_STATFS #define STATFS_IN_SYS_VFS_H #define HAS_POSIX_REGEXP @@ -2186,7 +2214,7 @@ Index: src/util/sys_defs.h #define NATIVE_SENDMAIL_PATH "/usr/sbin/sendmail" #define NATIVE_MAILQ_PATH "/usr/bin/mailq" #define NATIVE_NEWALIAS_PATH "/usr/bin/newaliases" -@@ -935,6 +952,7 @@ extern int h_errno; +@@ -967,6 +984,7 @@ #define USE_STATFS #define STATFS_IN_SYS_VFS_H #define HAS_POSIX_REGEXP @@ -2194,56 +2222,3 @@ Index: src/util/sys_defs.h #define NATIVE_SENDMAIL_PATH "/usr/bin/sendmail" #define NATIVE_MAILQ_PATH "/usr/bin/mailq" #define NATIVE_NEWALIAS_PATH "/usr/bin/newaliases" -Index: src/tls/tls_client.c -=================================================================== ---- src/tls/tls_client.c.orig 2007-02-22 01:08:45.000000000 +0100 -+++ src/tls/tls_client.c 2007-08-06 00:02:20.079495528 +0200 -@@ -147,6 +147,8 @@ - #define STR vstring_str - #define LEN VSTRING_LEN - -+int var_tls_daemon_rand_bytes; -+ - /* load_clnt_session - load session from client cache (non-callback) */ - - static SSL_SESSION *load_clnt_session(TLScontext_t *TLScontext) -Index: src/tls/tls_server.c -=================================================================== ---- src/tls/tls_server.c.orig 2007-02-22 01:08:45.000000000 +0100 -+++ src/tls/tls_server.c 2007-08-06 00:02:20.095496506 +0200 -@@ -120,6 +120,8 @@ - #define STR(x) vstring_str(x) - #define LEN(x) VSTRING_LEN(x) - -+int var_tls_daemon_rand_bytes; -+ - /* Application-specific. */ - - /* We must keep some of the info available */ -Index: src/milter/Makefile.in -=================================================================== ---- src/milter/Makefile.in.orig 2007-03-17 18:51:39.000000000 +0100 -+++ src/milter/Makefile.in 2007-08-06 00:02:20.211503600 +0200 -@@ -14,7 +14,7 @@ LIB_DIR = ../../lib - INC_DIR = ../../include - MAKES = - --.c.o:; $(CC) $(CFLAGS) -c $*.c -+.c.o:; $(CC) -fPIC $(CFLAGS) -c $*.c - - all: $(LIB) - -@@ -30,12 +30,10 @@ tests: - root_tests: - - $(LIB): $(OBJS) -- $(AR) $(ARFL) $(LIB) $? -- $(RANLIB) $(LIB) -+ gcc -shared -Wl,-soname,libpostfix-milter.so.1 -o $(LIB) $(OBJS) $(LIBS) $(SYSLIBS) - - $(LIB_DIR)/$(LIB): $(LIB) - cp $(LIB) $(LIB_DIR) -- $(RANLIB) $(LIB_DIR)/$(LIB) - - update: $(LIB_DIR)/$(LIB) $(HDRS) - -for i in $(HDRS); \ diff --git a/postfix-2.2.9-main.cf.patch b/postfix-2.2.9-main.cf.patch new file mode 100644 index 0000000..0abac29 --- /dev/null +++ b/postfix-2.2.9-main.cf.patch @@ -0,0 +1,42 @@ +diff -ruN postfix-2.2.9-orig/conf/main.cf postfix-2.2.9/conf/main.cf +--- postfix-2.2.9-orig/conf/main.cf 2005-03-04 17:48:25.000000000 +0000 ++++ postfix-2.2.9/conf/main.cf 2008-08-04 19:08:01.086201423 +0000 +@@ -405,7 +405,7 @@ + # "Maildir/" for qmail-style delivery (the / is required). + # + #home_mailbox = Mailbox +-#home_mailbox = Maildir/ ++home_mailbox = Maildir/ + + # The mail_spool_directory parameter specifies the directory where + # UNIX-style mailboxes are kept. The default setting depends on the +@@ -642,3 +642,29 @@ + # readme_directory: The location of the Postfix README files. + # + readme_directory = ++ ++ ++############################################################ ++# Start MySQL from postfixwiki.org ++############################################################ ++virtual_alias_maps = hash:/etc/postfix/virtual ++#virtual_uid_maps = static:303 ++#virtual_gid_maps = static:303 ++#virtual_minimum_uid = 303 ++#virtual_mailbox_base = /srv/maildirs ++#virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains_maps.cf ++#virtual_mailbox_limit = 0 ++#virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf ++#virtual_transport = virtual ++## Additional for quota support ++#virtual_create_maildirsize = yes ++#virtual_mailbox_extended = yes ++#virtual_mailbox_limit_maps = mysql:/etc/postfix/mysql_virtual_mailbox_limit_maps.cf ++#virtual_mailbox_limit_override = yes ++#virtual_maildir_limit_message = Sorry, the user's maildir has overdrawn his diskspace quota, please try again later. ++#virtual_overquota_bounce = yes ++relay_domains = $mydestination, hash:/etc/postfix/relay ++############################################################ ++# End MySQL from postfixwiki.org ++############################################################ ++ diff --git a/postfix-2.5.6.tar.bz2 b/postfix-2.5.6.tar.bz2 deleted file mode 100644 index 807ab1b..0000000 --- a/postfix-2.5.6.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:59d810fde87c73dc50d309051e726a1ad25f5ea081aa1d0fe00dc9d6aa4405f1 -size 2304976 diff --git a/postfix-2.6.1-vda-ng-64bit.patch b/postfix-2.6.1-vda-ng-64bit.patch new file mode 100644 index 0000000..9d9d58c --- /dev/null +++ b/postfix-2.6.1-vda-ng-64bit.patch @@ -0,0 +1,225 @@ +diff -uNr postfix-2.5.6-vda-ng.orig/src/util/vbuf_print.c postfix-2.5.6/src/util/vbuf_print.c +--- postfix-2.5.6-vda-ng.orig/src/util/vbuf_print.c 2006-12-10 18:13:07.000000000 +0100 ++++ postfix-2.5.6/src/util/vbuf_print.c 2008-08-25 12:20:41.032890016 +0200 +@@ -193,8 +193,13 @@ + msg_warn("%s: bad precision %d in %.50s", myname, prec, format); + prec = 0; + } +- if ((long_flag = (*cp == 'l')) != 0)/* long whatever */ ++ if ((long_flag = (*cp == 'l')) != 0) { /* long whatever */ + VSTRING_ADDCH(fmt, *cp++); ++ if (*cp == 'l') { /* we have long long param */ ++ long_flag = 2; ++ VSTRING_ADDCH(fmt, *cp++); ++ } ++ } + if (*cp == 0) /* premature end, punt */ + break; + VSTRING_ADDCH(fmt, *cp); /* type (checked below) */ +@@ -226,8 +231,10 @@ + 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)); ++ else if (long_flag == 2) ++ sprintf((char *) bp->ptr, vstring_str(fmt), va_arg(ap, long long)); + else + sprintf((char *) bp->ptr, vstring_str(fmt), va_arg(ap, int)); + VBUF_SKIP(bp); +diff -uNr postfix-2.5.6-vda-ng.orig/src/virtual/mailbox.c postfix-2.5.6/src/virtual/mailbox.c +--- postfix-2.5.6-vda-ng.orig/src/virtual/mailbox.c 2008-08-25 11:57:48.000000000 +0200 ++++ postfix-2.5.6/src/virtual/mailbox.c 2008-08-25 12:20:41.032890016 +0200 +@@ -120,7 +120,6 @@ + myname, usr_attr.mailbox, OFF_T_MAX); + } + else { +- /* Invalid limit size (negative). Use default virtual_mailbox_limit. */ + set_file_limit(var_virt_mailbox_limit); + status = NO; + } +diff -uNr postfix-2.5.6-vda-ng.orig/src/virtual/maildir.c postfix-2.5.6/src/virtual/maildir.c +--- postfix-2.5.6-vda-ng.orig/src/virtual/maildir.c 2008-08-25 11:57:48.000000000 +0200 ++++ postfix-2.5.6/src/virtual/maildir.c 2008-08-25 12:20:41.033889864 +0200 +@@ -65,6 +65,8 @@ + + /* Patch library. */ + ++#include ++#include + #include /* opendir(3), stat(2) */ + #include /* stat(2) */ + #include /* opendir(3) */ +@@ -98,14 +100,14 @@ + * Returns the size of all mails as read from maildirsize, + * zero if it couldn't read the file. + */ +-static long read_maildirsize(char *dirname, long *countptr) ++static uint64_t read_maildirsize(char *dirname, uint64_t *countptr) + { + struct stat statbuf; + VSTRING *sizefilename = vstring_alloc(1024); + VSTREAM *sizefile; + char *p; + int len, first; +- long sum = 0, count = 0; ++ uint64_t sum = 0, count = 0; + + vstring_sprintf(sizefilename, "%s/%s", dirname, "maildirsize"); + +@@ -128,7 +130,7 @@ + first = 1; + + while (*p) { +- long n = 0, c = 0; ++ uint64_t n = 0, c = 0; + char *q = p; + + while (*p) { +@@ -143,7 +145,7 @@ + continue; + } + +- if(sscanf(q, "%ld %ld", &n, &c) == 2) { ++ if(sscanf(q, "%llu %llu", &n, &c) == 2) { + sum += n; + count += c; + } +@@ -179,7 +181,7 @@ + * Returns the size given in ",S=" in the filename, + * zero if it cannot find ",S=" in the filename. + */ +-static long maildir_parsequota(const char *n) ++static uint64_t maildir_parsequota(const char *n) + { + const char *o; + int yes = 0; +@@ -204,7 +206,7 @@ + } + + if (yes) { +- long s = 0; ++ uint64_t s = 0; + + while (*o >= '0' && *o <= '9') + s = s*10 + (*o++ - '0'); +@@ -231,17 +233,17 @@ + * Returns the sum of the sizes of all measurable files, + * zero if the directory could not be opened. + */ +-static long check_dir_size(char *dirname, long *countptr) ++static uint64_t check_dir_size(char *dirname, uint64_t *countptr) + { + char *myname = "check_dir_size"; + DIR *dir; +- long sum = 0; ++ uint64_t sum = 0; + struct dirent *ent; + struct stat statbuf; + + if (!var_virt_mailbox_limit_inbox && var_virt_maildir_extended && (sum = read_maildirsize(dirname, countptr))) { + if (msg_verbose) +- msg_info("%s: maildirsize used: dir=%s sum=%ld count=%ld", myname, dirname, sum, *countptr); ++ msg_info("%s: maildirsize used: dir=%s sum=%llu count=%llu", myname, dirname, sum, *countptr); + return sum; + } + +@@ -262,7 +264,7 @@ + + while ((ent = readdir(dir)) != NULL) { + char *name = ent->d_name; +- long tmpsum = 0; ++ uint64_t tmpsum = 0; + VSTRING *buffer; + + if (var_virt_trash_count) { +@@ -325,7 +327,7 @@ + closedir(dir); + + if (msg_verbose) +- msg_info("%s: full scan done: dir=%s sum=%ld count=%ld", myname, dirname, sum, *countptr); ++ msg_info("%s: full scan done: dir=%s sum=%llu count=%llu", myname, dirname, sum, *countptr); + + return sum; + } +@@ -443,9 +445,9 @@ + char *sizefilename = (char *) 0; /* Maildirsize file name. */ + VSTRING *filequota; /* Quota setting from the maildirsize file. */ + VSTREAM *sizefile; /* Maildirsize file handle. */ +- long n = 0; /* Limit in long integer format. */ +- long saved_count = 0; /* The total number of files. */ +- long saved_size = 0; /* The total quota of all files. */ ++ uint64_t n = 0; /* Limit in long integer format. */ ++ uint64_t saved_count = 0; /* The total number of files. */ ++ uint64_t saved_size = 0; /* The total quota of all files. */ + struct stat mail_stat; /* To check the size of the mail to be written. */ + struct stat sizefile_stat; /* To check the size of the maildirsize file. */ + time_t tm; /* To check the age of the maildirsize file. */ +@@ -520,7 +522,8 @@ + * warn the user, else use the value directly as the maildir limit. + */ + if (*var_virt_mailbox_limit_maps != 0 && (limit_res = mail_addr_find(virtual_mailbox_limit_maps, state.msg_attr.user, (char **) NULL)) != 0) { +- n = atol(limit_res); ++ /* if there is some unexpected char in limit_res var, n will be zero! */ ++ n = strtoull(limit_res, NULL, 10); + if (n > 0) { + if ((n < var_message_limit) && (!var_virt_mailbox_limit_override)) { + n = var_virt_mailbox_limit; +@@ -535,13 +538,13 @@ + } + else { + if (msg_verbose) +- msg_info("%s: set virtual maildir limit size for %s to %ld", ++ msg_info("%s: set virtual maildir limit size for %s to %llu", + myname, usr_attr.mailbox, n); + } + } + else if (n == 0) { + if (msg_verbose) +- msg_info("%s: set virtual maildir limit size for %s to %ld", ++ msg_info("%s: set virtual maildir limit size for %s to %llu", + myname, usr_attr.mailbox, n); + } + else { +@@ -662,7 +665,7 @@ + */ + if (stat(tmpfile, &mail_stat) == 0) { + if (n != 0) { +- saved_size += (long) mail_stat.st_size; ++ saved_size += (uint64_t) mail_stat.st_size; + saved_count++; + } + if (var_virt_maildir_extended) { +@@ -866,7 +869,9 @@ + filequota = vstring_alloc(128); + vstring_get_null_bound(filequota, sizefile, 127); + vstream_fclose(sizefile); +- if (atol(vstring_export(filequota)) != n) ++ /* if there will be some unexpected char in filequota var, strtoull() return 0 ++ and this probably != n, so file will be rewritten */ ++ if (strtoull(vstring_export(filequota), NULL, 10) != n) + unlink(sizefilename); + } + +@@ -886,7 +891,7 @@ + + /* If the creation worked, write to the file, otherwise just give up. */ + if (sizefile) { +- vstream_fprintf(sizefile, "%ldS\n%ld %ld\n", n, saved_size, saved_count); ++ vstream_fprintf(sizefile, "%lluS\n%llu %llu\n", n, saved_size, saved_count); + vstream_fclose(sizefile); + } + } +diff -uNr postfix-2.5.6-vda-ng.orig/src/virtual/Makefile.in postfix-2.5.6/src/virtual/Makefile.in +--- postfix-2.5.6-vda-ng.orig/src/virtual/Makefile.in 2007-03-17 18:51:46.000000000 +0100 ++++ postfix-2.5.6/src/virtual/Makefile.in 2008-08-25 12:20:41.034889712 +0200 +@@ -4,7 +4,7 @@ + HDRS = virtual.h + TESTSRC = + DEFS = -I. -I$(INC_DIR) -D$(SYSTYPE) +-CFLAGS = $(DEBUG) $(OPT) $(DEFS) ++CFLAGS = $(DEBUG) $(OPT) $(DEFS) -std=gnu99 + PROG = virtual + TESTPROG= + INC_DIR = ../../include diff --git a/postfix-2.6.1-vda-ng.patch b/postfix-2.6.1-vda-ng.patch new file mode 100644 index 0000000..a9ddbd8 --- /dev/null +++ b/postfix-2.6.1-vda-ng.patch @@ -0,0 +1,1459 @@ +diff -Nru postfix-2.5.6-orig/README_FILES/VDA_README postfix-2.5.6/README_FILES/VDA_README +--- postfix-2.5.6-orig/README_FILES/VDA_README 1969-12-31 21:00:00.000000000 -0300 ++++ postfix-2.5.6/README_FILES/VDA_README 2009-01-16 08:55:22.000000000 -0200 +@@ -0,0 +1,97 @@ ++Installation: ++ ++1 - Get the Postfix source code ( http://www.postfix.org/ ) ++2 - Get this software ( http://vda.sourceforge.net ) for your Postfix version ++3 - Unpack the source code: tar -xvzf postfix-VERSION.tar.gz ++4 - Unpack the patch: gunzip postfix-VERSION-vda-ng-rREV.patch.gz ++5 - Apply the patch: cd postfix-VERSION; patch -p1 < ../postfix-VERSION-vda-ng-rREV.patch ++6 - Configure ++7 - Make ++ ++Configuration: ++ ++#### Postfix main.cf ++ ++# I use only virtual as local delivery ++mailbox_transport = virtual ++ ++# Base directory where the mailboxes are located ++virtual_mailbox_base = /var/virtualmail ++ ++# Virtual users maps ++virtual_mailbox_maps = hash:/etc/postfix/vmailbox ++transport_maps = hash:/etc/postfix/vtransport ++ ++# Minimal permitted UID value (for virtual_uid_maps) ++virtual_minimum_uid = 1000 ++ ++# GIDs and UIDs to run as ++# Can also be stored in hash, mysql, ... ++virtual_uid_maps = static:4000 ++virtual_gid_maps = static:4000 ++ ++# A maximum size limit for a mailbox ++virtual_mailbox_limit = 100000000 ++ ++# Quota values maps ++virtual_mailbox_limit_maps = hash:/etc/postfix/vquota ++ ++# Limit only the INBOX ++# (useful for when you have IMAP users) ++virtual_mailbox_limit_inbox = no ++ ++# Enable limits smaller than maximum message size ++virtual_mailbox_limit_override = yes ++ ++# Enable Maildir++ extensions for faster maildir quota calculation ++# (maildirsize file and ",S=" filename extension) ++# Needs Maildir++ compatible IMAP servers, like Courier-IMAP ++virtual_maildir_extended = yes ++ ++# Always bounce the message when quota reached ++virtual_overquota_bounce = yes ++ ++# Custom message to send when bouncing ++#virtual_maildir_limit_message = "Sorry, maximum quota reached!" ++ ++# Custom message maps for the bounces ++#virtual_maildir_limit_message_maps = hash:/etc/postfix/vmsg ++ ++# Also count the Trash folder when calculating quotas? ++virtual_trash_count = yes ++ ++# The name of the Trash folder ++# (if it doesn't need to be calculated) ++#virtual_trash_name = ".Trash" ++ ++# Enable the Maildirfilter feature ++virtual_maildir_filter = yes ++ ++# Maildirfilter maps ++virtual_maildir_filter_maps = hash:/etc/postfix/vfilter ++ ++#### Mailbox users file - vmailbox ++user@domain.com.br /path/to/mailbox - path relative to virtual_mailbox_base ++user1@domain.com.br /domain.com.br/user1 - no trailing slash, user has a MAILBOX ++user2@domain.com.br /domain.com.br/user2 - no trailing slash, user has a MAILBOX ++user1@domain.net.br /domain.net.br/user1/ - trailing slash, user has a MAILDIR ++user2@domain.net.br /domain.net.br/user2/ - trailing slash, user has a MAILDIR ++ ++#### Quota users file - vquota ++user@domain.com.br QUOTA IN BYTES ++user1@domain.com.br 2048000 ++user2@domain.com.br 2048000 ++user1@domain.net.br 5192000 ++user2@domain.net.br 0 - NO QUOTA ++ ++#### Maildirfilter file - vfilter ++# ATTENTION: the syntax for maildirfilter values is the following: ++# the # sign, followed by a space, followed by a M (uppercase), then a modification time value ++# (you need to change this when you change the regexps) made of a maximum of 10 digits, then a ++# space again and an arbitrary number of regexps (a regexp always starts with /^ and ends with ++# a space) and their corresponding actions ++user@domain.com.br # M regexp1 action1 regexp2 action2 ... ++user1@domain.net.br # M2007022701 /^subject:.*BAD.*/m DISCARD /^from:.*user@domain.com.br*/m MOVE Trash ++user2@domain.com.br # M2007022617 /^subject:.*Viagra.*/m REJECT /^subject:.*trash.*/m MOVE SpamFolder /^subject:.*pharmacy.*/m DISCARD ++ ++More informations can be found at http://vda.sourceforge.net +diff -Nru postfix-2.5.6-orig/src/global/mail_params.h postfix-2.5.6/src/global/mail_params.h +--- postfix-2.5.6-orig/src/global/mail_params.h 2008-07-27 16:10:27.000000000 -0300 ++++ postfix-2.5.6/src/global/mail_params.h 2009-01-16 08:55:22.000000000 -0200 +@@ -2171,6 +2171,54 @@ + #define DEF_VIRT_GID_MAPS "" + extern char *var_virt_gid_maps; + ++#define VAR_VIRT_MAILBOX_LIMIT_MAPS "virtual_mailbox_limit_maps" ++#define DEF_VIRT_MAILBOX_LIMIT_MAPS "" ++extern char *var_virt_mailbox_limit_maps; ++ ++#define VAR_VIRT_MAILBOX_LIMIT_INBOX "virtual_mailbox_limit_inbox" ++#define DEF_VIRT_MAILBOX_LIMIT_INBOX 0 ++extern bool var_virt_mailbox_limit_inbox; ++ ++#define VAR_VIRT_MAILBOX_LIMIT_OVERRIDE "virtual_mailbox_limit_override" ++#define DEF_VIRT_MAILBOX_LIMIT_OVERRIDE 0 ++extern bool var_virt_mailbox_limit_override; ++ ++#define VAR_VIRT_MAILDIR_EXTENDED "virtual_maildir_extended" ++#define DEF_VIRT_MAILDIR_EXTENDED 0 ++extern bool var_virt_maildir_extended; ++ ++#define VAR_VIRT_OVERQUOTA_BOUNCE "virtual_overquota_bounce" ++#define DEF_VIRT_OVERQUOTA_BOUNCE 0 ++extern bool var_virt_overquota_bounce; ++ ++#define VAR_VIRT_MAILDIR_LIMIT_MESSAGE "virtual_maildir_limit_message" ++#define DEF_VIRT_MAILDIR_LIMIT_MESSAGE "Sorry, the user's maildir has overdrawn his diskspace quota, please try again later." ++extern char *var_virt_maildir_limit_message; ++ ++#define VAR_VIRT_MAILDIR_LIMIT_MESSAGE_MAPS "virtual_maildir_limit_message_maps" ++#define DEF_VIRT_MAILDIR_LIMIT_MESSAGE_MAPS "" ++extern char *var_virt_maildir_limit_message_maps; ++ ++#define VAR_VIRT_MAILDIR_SUFFIX "virtual_maildir_suffix" ++#define DEF_VIRT_MAILDIR_SUFFIX "" ++extern char *var_virt_maildir_suffix; ++ ++#define VAR_VIRT_TRASH_COUNT "virtual_trash_count" ++#define DEF_VIRT_TRASH_COUNT 0 ++extern bool var_virt_trash_count; ++ ++#define VAR_VIRT_TRASH_NAME "virtual_trash_name" ++#define DEF_VIRT_TRASH_NAME ".Trash" ++extern char *var_virt_trash_name; ++ ++#define VAR_VIRT_MAILDIR_FILTER "virtual_maildir_filter" ++#define DEF_VIRT_MAILDIR_FILTER 0 ++extern bool var_virt_maildir_filter; ++ ++#define VAR_VIRT_MAILDIR_FILTER_MAPS "virtual_maildir_filter_maps" ++#define DEF_VIRT_MAILDIR_FILTER_MAPS "" ++extern char *var_virt_maildir_filter_maps; ++ + #define VAR_VIRT_MINUID "virtual_minimum_uid" + #define DEF_VIRT_MINUID 100 + extern int var_virt_minimum_uid; +diff -Nru postfix-2.5.6-orig/src/util/file_limit.c postfix-2.5.6/src/util/file_limit.c +--- postfix-2.5.6-orig/src/util/file_limit.c 2003-10-22 16:48:36.000000000 -0200 ++++ postfix-2.5.6/src/util/file_limit.c 2009-01-16 08:55:22.000000000 -0200 +@@ -85,7 +85,11 @@ + #else + struct rlimit rlim; + +- rlim.rlim_cur = rlim.rlim_max = limit; ++ /* rlim_max can only be changed by root. */ ++ if (getrlimit(RLIMIT_FSIZE, &rlim) < 0) ++ msg_fatal("getrlimit: %m"); ++ rlim.rlim_cur = limit; ++ + if (setrlimit(RLIMIT_FSIZE, &rlim) < 0) + msg_fatal("setrlimit: %m"); + #ifdef SIGXFSZ +diff -Nru postfix-2.5.6-orig/src/virtual/mailbox.c postfix-2.5.6/src/virtual/mailbox.c +--- postfix-2.5.6-orig/src/virtual/mailbox.c 2008-07-25 22:22:37.000000000 -0300 ++++ postfix-2.5.6/src/virtual/mailbox.c 2009-01-16 08:55:22.000000000 -0200 +@@ -70,6 +70,70 @@ + #define YES 1 + #define NO 0 + ++/* change_mailbox_limit - change limit for mailbox file */ ++static int change_mailbox_limit(LOCAL_STATE state, USER_ATTR usr_attr) ++{ ++ char *myname = "change_mailbox_limit"; ++ const char *limit_res; ++ long n = 0; ++ int status = NO; ++ ++ /* ++ * Look up the virtual mailbox limit size for this user. ++ * Fall back to virtual_mailbox_limit in case lookup failed. ++ * If virtual mailbox limit size is negative, fall back to virtual_mailbox_limit. ++ * If it's 0, set the mailbox limit to 0, which means unlimited. ++ * If it's more than 0 (positive int), check if the value is smaller than the maximum message size, ++ * if it is and the virtual mailbox limit can't be overridden, fall back to virtual_mailbox_limit and ++ * warn the user, else use the value directly as the mailbox limit. ++ */ ++ if (*var_virt_mailbox_limit_maps != 0 && (limit_res = mail_addr_find(virtual_mailbox_limit_maps, state.msg_attr.user, (char **) NULL)) != 0) { ++ n = atol(limit_res); ++ if (n > 0) { ++ if ((n < var_message_limit) && (!var_virt_mailbox_limit_override)) { ++ set_file_limit(var_virt_mailbox_limit); ++ status = NO; ++ ++ msg_warn("%s: recipient %s - virtual mailbox limit is " ++ "smaller than %s in %s - falling back to %s", ++ myname, ++ state.msg_attr.user, ++ VAR_MESSAGE_LIMIT, ++ virtual_mailbox_limit_maps->title, ++ VAR_VIRT_MAILBOX_LIMIT); ++ } ++ else { ++ set_file_limit((off_t) n); ++ status = YES; ++ ++ if (msg_verbose) ++ msg_info("%s: set virtual mailbox limit size for %s to %ld", ++ myname, usr_attr.mailbox, n); ++ } ++ } ++ else if (n == 0) { ++ set_file_limit(OFF_T_MAX); ++ status = YES; ++ ++ if (msg_verbose) ++ msg_info("%s: set virtual mailbox limit size for %s to %ld", ++ myname, usr_attr.mailbox, OFF_T_MAX); ++ } ++ else { ++ /* Invalid limit size (negative). Use default virtual_mailbox_limit. */ ++ set_file_limit(var_virt_mailbox_limit); ++ status = NO; ++ } ++ } ++ else { ++ /* There is no limit in the maps. Use default virtual_mailbox_limit. */ ++ set_file_limit(var_virt_mailbox_limit); ++ status = NO; ++ } ++ ++ return(status); ++} ++ + /* deliver_mailbox_file - deliver to recipient mailbox */ + + static int deliver_mailbox_file(LOCAL_STATE state, USER_ATTR usr_attr) +@@ -213,62 +277,72 @@ + * Look up the mailbox owner rights. Defer in case of trouble. + */ + uid_res = mail_addr_find(virtual_uid_maps, state.msg_attr.user, +- IGNORE_EXTENSION); +- if (uid_res == 0) { +- msg_warn("recipient %s: not found in %s", +- state.msg_attr.user, virtual_uid_maps->title); +- dsb_simple(why, "4.3.5", "mail system configuration error"); +- *statusp = defer_append(BOUNCE_FLAGS(state.request), +- BOUNCE_ATTR(state.msg_attr)); +- RETURN(YES); ++ IGNORE_EXTENSION); ++ ++ if ((uid_res = mail_addr_find(virtual_uid_maps, state.msg_attr.user, (char **) 0)) == 0) { ++ if ((uid_res = maps_find(virtual_uid_maps, strchr(state.msg_attr.user, '@'), DICT_FLAG_FIXED)) == 0) { ++ msg_warn("recipient %s: not found in %s", state.msg_attr.user, virtual_uid_maps->title); ++ dsb_simple(why, "4.3.5", "mail system configuration error"); ++ *statusp = defer_append(BOUNCE_FLAGS(state.request), BOUNCE_ATTR(state.msg_attr)); ++ RETURN(YES); ++ } + } ++ + if ((n = atol(uid_res)) < var_virt_minimum_uid) { +- msg_warn("recipient %s: bad uid %s in %s", +- state.msg_attr.user, uid_res, virtual_uid_maps->title); +- dsb_simple(why, "4.3.5", "mail system configuration error"); +- *statusp = defer_append(BOUNCE_FLAGS(state.request), +- BOUNCE_ATTR(state.msg_attr)); +- RETURN(YES); ++ msg_warn("recipient %s: bad uid %s in %s", state.msg_attr.user, uid_res, virtual_uid_maps->title); ++ dsb_simple(why, "4.3.5", "mail system configuration error"); ++ *statusp = defer_append(BOUNCE_FLAGS(state.request), BOUNCE_ATTR(state.msg_attr)); ++ RETURN(YES); + } ++ + usr_attr.uid = (uid_t) n; + + /* + * Look up the mailbox group rights. Defer in case of trouble. + */ + gid_res = mail_addr_find(virtual_gid_maps, state.msg_attr.user, +- IGNORE_EXTENSION); +- if (gid_res == 0) { +- msg_warn("recipient %s: not found in %s", +- state.msg_attr.user, virtual_gid_maps->title); +- dsb_simple(why, "4.3.5", "mail system configuration error"); +- *statusp = defer_append(BOUNCE_FLAGS(state.request), +- BOUNCE_ATTR(state.msg_attr)); +- RETURN(YES); ++ IGNORE_EXTENSION); ++ ++ if ((gid_res = mail_addr_find(virtual_gid_maps, state.msg_attr.user, (char **) 0)) == 0) { ++ if ((gid_res = maps_find(virtual_gid_maps, strchr(state.msg_attr.user, '@'), DICT_FLAG_FIXED)) == 0) { ++ msg_warn("recipient %s: not found in %s", state.msg_attr.user, virtual_gid_maps->title); ++ dsb_simple(why, "4.3.5", "mail system configuration error"); ++ *statusp = defer_append(BOUNCE_FLAGS(state.request), BOUNCE_ATTR(state.msg_attr)); ++ RETURN(YES); ++ } + } ++ + if ((n = atol(gid_res)) <= 0) { +- msg_warn("recipient %s: bad gid %s in %s", +- state.msg_attr.user, gid_res, virtual_gid_maps->title); +- dsb_simple(why, "4.3.5", "mail system configuration error"); +- *statusp = defer_append(BOUNCE_FLAGS(state.request), +- BOUNCE_ATTR(state.msg_attr)); +- RETURN(YES); ++ msg_warn("recipient %s: bad gid %s in %s", state.msg_attr.user, gid_res, virtual_gid_maps->title); ++ dsb_simple(why, "4.3.5", "mail system configuration error"); ++ *statusp = defer_append(BOUNCE_FLAGS(state.request), BOUNCE_ATTR(state.msg_attr)); ++ RETURN(YES); + } ++ + usr_attr.gid = (gid_t) n; + + if (msg_verbose) +- msg_info("%s[%d]: set user_attr: %s, uid = %u, gid = %u", +- myname, state.level, usr_attr.mailbox, +- (unsigned) usr_attr.uid, (unsigned) usr_attr.gid); ++ msg_info("%s[%d]: set user_attr: %s, uid = %u, gid = %u", ++ myname, state.level, usr_attr.mailbox, ++ (unsigned) usr_attr.uid, (unsigned) usr_attr.gid); + + /* + * Deliver to mailbox or to maildir. + */ + #define LAST_CHAR(s) (s[strlen(s) - 1]) + +- if (LAST_CHAR(usr_attr.mailbox) == '/') +- *statusp = deliver_maildir(state, usr_attr); +- else +- *statusp = deliver_mailbox_file(state, usr_attr); ++ if (LAST_CHAR(usr_attr.mailbox) == '/') { ++ *statusp = deliver_maildir(state, usr_attr); ++ } ++ else { ++ int changed_limit; ++ ++ changed_limit = change_mailbox_limit(state, usr_attr); ++ *statusp = deliver_mailbox_file(state, usr_attr); ++ ++ if (changed_limit) ++ set_file_limit(var_virt_mailbox_limit); ++ } + + /* + * Cleanup. +diff -Nru postfix-2.5.6-orig/src/virtual/maildir.c postfix-2.5.6/src/virtual/maildir.c +--- postfix-2.5.6-orig/src/virtual/maildir.c 2006-06-26 09:59:19.000000000 -0300 ++++ postfix-2.5.6/src/virtual/maildir.c 2009-01-16 08:55:22.000000000 -0200 +@@ -63,28 +63,406 @@ + #include + #include + ++/* Patch library. */ ++ ++#include /* opendir(3), stat(2) */ ++#include /* stat(2) */ ++#include /* opendir(3) */ ++#include /* stat(2) */ ++#include /* atol(3) */ ++#include /* strrchr(3) */ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ + /* Application-specific. */ + + #include "virtual.h" + +-/* deliver_maildir - delivery to maildir-style mailbox */ ++/* Maildirsize maximal size. */ ++ ++#define SIZEFILE_MAX 5120 ++ ++/* ++ * Chris Stratford ++ * Read the maildirsize file to get quota info. ++ * ++ * Arguments: ++ * dirname: the maildir ++ * countptr: number of messages ++ * ++ * Returns the size of all mails as read from maildirsize, ++ * zero if it couldn't read the file. ++ */ ++static long read_maildirsize(char *dirname, long *countptr) ++{ ++ struct stat statbuf; ++ VSTRING *sizefilename = vstring_alloc(1024); ++ VSTREAM *sizefile; ++ char *p; ++ int len, first; ++ long sum = 0, count = 0; ++ ++ vstring_sprintf(sizefilename, "%s/%s", dirname, "maildirsize"); ++ ++ sizefile = vstream_fopen(STR(sizefilename), O_RDONLY, 0); ++ if (!sizefile || (stat(STR(sizefilename), &statbuf) < 0) || (statbuf.st_size > SIZEFILE_MAX)) { ++ if (sizefile) { ++ vstream_fclose(sizefile); ++ unlink(STR(sizefilename)); ++ } ++ vstring_free(sizefilename); ++ ++ return 0; ++ } ++ ++ VSTRING *sizebuf = vstring_alloc(SIZEFILE_MAX); ++ len = vstream_fread(sizefile, STR(sizebuf), SIZEFILE_MAX); ++ ++ p = STR(sizebuf); ++ *(p + len) = '\0'; ++ first = 1; ++ ++ while (*p) { ++ long n = 0, c = 0; ++ char *q = p; ++ ++ while (*p) { ++ if (*p++ == '\n') { ++ p[-1] = 0; ++ break; ++ } ++ } ++ ++ if (first) { ++ first = 0; ++ continue; ++ } ++ ++ if(sscanf(q, "%ld %ld", &n, &c) == 2) { ++ sum += n; ++ count += c; ++ } ++ else { ++ vstream_fclose(sizefile); ++ unlink(STR(sizefilename)); ++ ++ msg_warn("read_maildirsize: invalid line '%s' found in %s, removing maildirsize file", q, STR(sizefilename)); ++ ++ vstring_free(sizefilename); ++ vstring_free(sizebuf); ++ ++ return 0; ++ } ++ } ++ ++ vstream_fclose(sizefile); ++ vstring_free(sizefilename); ++ vstring_free(sizebuf); ++ ++ *countptr = count; ++ ++ return sum; ++} ++ ++/* ++ * Gives the size of the file according to the Maildir++ extension ++ * present in the filename (code taken from courier-imap). ++ * ++ * Arguments: ++ * n: filename ++ * ++ * Returns the size given in ",S=" in the filename, ++ * zero if it cannot find ",S=" in the filename. ++ */ ++static long maildir_parsequota(const char *n) ++{ ++ const char *o; ++ int yes = 0; + +-int deliver_maildir(LOCAL_STATE state, USER_ATTR usr_attr) ++ if ((o = strrchr(n, '/')) == 0) ++ o = n; ++ ++ for (; *o; o++) { ++ if (*o == ':') ++ break; ++ } ++ ++ for (; o >= n; --o) { ++ if (*o == '/') ++ break; ++ ++ if (*o == ',' && o[1] == 'S' && o[2] == '=') { ++ yes = 1; ++ o += 3; ++ break; ++ } ++ } ++ ++ if (yes) { ++ long s = 0; ++ ++ while (*o >= '0' && *o <= '9') ++ s = s*10 + (*o++ - '0'); ++ ++ return s; ++ } ++ ++ return 0; ++} ++ ++/* ++ * Computes quota usage for a directory (taken from exim). ++ * ++ * This function is called to determine the exact quota usage of a virtual ++ * maildir box. To achieve maximum possible speed while doing this, it takes ++ * advantage of the maildirsize file and the Maildir++ extensions to filenames, ++ * when applicable and configured to be used. In all other cases it simply ++ * stats all the files as needed to get the size information. ++ * ++ * Arguments: ++ * dirname: the name of the directory ++ * countptr: where to add the file count (because this function recurses) ++ * ++ * Returns the sum of the sizes of all measurable files, ++ * zero if the directory could not be opened. ++ */ ++static long check_dir_size(char *dirname, long *countptr) ++{ ++ char *myname = "check_dir_size"; ++ DIR *dir; ++ long sum = 0; ++ struct dirent *ent; ++ struct stat statbuf; ++ ++ if (!var_virt_mailbox_limit_inbox && var_virt_maildir_extended && (sum = read_maildirsize(dirname, countptr))) { ++ if (msg_verbose) ++ msg_info("%s: maildirsize used: dir=%s sum=%ld count=%ld", myname, dirname, sum, *countptr); ++ return sum; ++ } ++ ++ dir = opendir(dirname); ++ if (dir == NULL) { ++ if (make_dirs(dirname, 0700) == 0) { /* Try to create the dirs. */ ++ dir = opendir(dirname); /* Reopen the dir. */ ++ if (dir == NULL) { ++ msg_warn("%s: cannot reopen directory: %s", myname, dirname); ++ return 0; ++ } ++ } ++ else { ++ msg_warn("%s: cannot open directory: %s", myname, dirname); ++ return 0; ++ } ++ } ++ ++ while ((ent = readdir(dir)) != NULL) { ++ char *name = ent->d_name; ++ long tmpsum = 0; ++ VSTRING *buffer; ++ ++ if (var_virt_trash_count) { ++ if(strcmp(name, ".") == 0 || strcmp(name, "..") == 0) ++ continue; ++ } ++ else { ++ if(strcmp(name, ".") == 0 || strcmp(name, "..") == 0 || strcmp(name, var_virt_trash_name) == 0) ++ continue; ++ } ++ ++ /* ++ * Here comes the real logic behind this function. ++ * Optimized to be the most efficient possible, ++ * depending on the settings given. ++ * See above for a more detailed description. ++ */ ++ if (var_virt_mailbox_limit_inbox) { ++ if (var_virt_maildir_extended && (tmpsum = maildir_parsequota(name))) { ++ sum += tmpsum; ++ (*countptr)++; ++ } ++ else { ++ buffer = vstring_alloc(1024); ++ vstring_sprintf(buffer, "%s/%s", dirname, name); ++ ++ if (stat(STR(buffer), &statbuf) < 0) { ++ vstring_free(buffer); ++ continue; ++ } ++ if ((statbuf.st_mode & S_IFREG) != 0) { ++ sum += (long) statbuf.st_size; ++ (*countptr)++; ++ } ++ ++ vstring_free(buffer); ++ } ++ } ++ else { ++ buffer = vstring_alloc(1024); ++ vstring_sprintf(buffer, "%s/%s", dirname, name); ++ ++ if (stat(STR(buffer), &statbuf) < 0) { ++ vstring_free(buffer); ++ continue; ++ } ++ if ((statbuf.st_mode & S_IFREG) != 0) { ++ if (strcmp(dirname + strlen(dirname) - 3, "new") == 0 || strcmp(dirname + strlen(dirname) - 3, "cur") == 0 || strcmp(dirname + strlen(dirname) - 3, "tmp") == 0) { ++ sum += (long) statbuf.st_size; ++ (*countptr)++; ++ } ++ } ++ else if ((statbuf.st_mode & S_IFDIR) != 0) { ++ sum += check_dir_size(STR(buffer), countptr); ++ } ++ ++ vstring_free(buffer); ++ } ++ } ++ closedir(dir); ++ ++ if (msg_verbose) ++ msg_info("%s: full scan done: dir=%s sum=%ld count=%ld", myname, dirname, sum, *countptr); ++ ++ return sum; ++} ++ ++/* Cut all occurrences of pattern from string. */ ++static char *strcut(char *str, const char *pat) ++{ ++ char *ptr, *loc, *ret; ++ ret = str; ++ loc = str; ++ ++ /* No match, return original string. */ ++ if (!strstr(loc, pat)) ++ return(str); ++ ++ while (*loc && (ptr = strstr(loc, pat))) { ++ while (loc < ptr) ++ *str++ = *loc++; ++ loc += strlen(pat); ++ } ++ ++ while (*loc) ++ *str++ = *loc++; ++ ++ *str = 0; ++ ++ return(ret); ++} ++ ++/* Check if maildirfilter file is up-to-date compared to SQL, (re)write it if not. */ ++static long sql2file(char *filename, char *user) ++{ ++ char *myname = "sql2file"; ++ char *filter_sqlres; ++ char filter_fileres[128]; ++ long sqlmtime = 0, filemtime = 0, retval = 0; ++ int filterfile, size_sqlres, i; ++ struct stat statbuf; ++ ++ if (*var_virt_maildir_filter_maps != 0) { ++ filter_sqlres = (char *) mymalloc(16000); ++ filter_sqlres = (char *) mail_addr_find(virtual_maildir_filter_maps, user, (char **) 0); ++ ++ if (filter_sqlres) { ++ strcut(filter_sqlres, "\r"); ++ if (filter_sqlres[0] == '#' && filter_sqlres[1] == ' ' && filter_sqlres[2] == 'M') { ++ size_sqlres = strlen(filter_sqlres); ++ ++ for (i = 4; i <= size_sqlres; i++) { ++ if(filter_sqlres[i] == '/' && filter_sqlres[i+1] == '^') { ++ filter_sqlres[i-1] = '\n'; ++ } ++ } ++ ++ filter_sqlres[(size_sqlres+1)] = '\0'; ++ ++ sqlmtime = atol(filter_sqlres+3); ++ retval = sqlmtime; ++ ++ filterfile = open(filename, O_RDONLY, 0); ++ if (filterfile) { ++ read(filterfile, (void *) filter_fileres, 127); ++ close(filterfile); ++ ++ filemtime = atol(filter_fileres+3); ++ } ++ ++ if (msg_verbose) ++ msg_info("%s: filter data: sql_size=%d sql_mtime=%ld file_mtime=%ld", myname, strlen(filter_sqlres), sqlmtime, filemtime); ++ } ++ if (sqlmtime != filemtime && sqlmtime != 0) { ++ if ((filterfile = open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0640))) { ++ if (msg_verbose) ++ msg_info("%s: updating filter file: %s", myname, filename); ++ write(filterfile, filter_sqlres, strlen(filter_sqlres)); ++ close(filterfile); ++ } ++ else { ++ msg_warn("%s: can't create filter file: %s", myname, filename); ++ retval = 0; ++ } ++ } ++ } ++ } ++ else { ++ if (stat(filename, &statbuf) == 0) ++ retval = (long) statbuf.st_mtime; ++ if (msg_verbose) ++ msg_info("%s: processing filter file: file_mtime=%ld", myname, retval); ++ } ++ ++ return retval; ++} ++ ++/* deliver_maildir - delivery to maildir-style mailbox */ ++int deliver_maildir(LOCAL_STATE state, USER_ATTR usr_attr) + { + const char *myname = "deliver_maildir"; +- char *newdir; +- char *tmpdir; +- char *curdir; +- char *tmpfile; +- char *newfile; ++ char *newdir; ++ char *tmpdir; ++ char *curdir; ++ char *newfile; ++ char *tmpfile; + DSN_BUF *why = state.msg_attr.why; + VSTRING *buf; + VSTREAM *dst; +- int mail_copy_status; +- int deliver_status; +- int copy_flags; +- struct stat st; +- struct timeval starttime; ++ int mail_copy_status; ++ int deliver_status; ++ int copy_flags; ++ struct stat st; ++ struct timeval starttime; ++ ++ /* Maildir Quota. */ ++ const char *limit_res; /* Limit from map. */ ++ char *sizefilename = (char *) 0; /* Maildirsize file name. */ ++ VSTRING *filequota; /* Quota setting from the maildirsize file. */ ++ VSTREAM *sizefile; /* Maildirsize file handle. */ ++ long n = 0; /* Limit in long integer format. */ ++ long saved_count = 0; /* The total number of files. */ ++ long saved_size = 0; /* The total quota of all files. */ ++ struct stat mail_stat; /* To check the size of the mail to be written. */ ++ struct stat sizefile_stat; /* To check the size of the maildirsize file. */ ++ time_t tm; /* To check the age of the maildirsize file. */ ++ ++ /* Maildir Filters. */ ++ const char *value, *cmd_text; /* Filter values. */ ++ char *filtername; ++ char *header; ++ char *bkpnewfile; ++ char *mdffilename = (char *) 0; /* Maildirfolder file name. */ ++ VSTRING *fltstr; ++ VSTREAM *tmpfilter; ++ VSTREAM *mdffile; /* Maildirfolder file handle. */ ++ DICT *FILTERS; ++ long sqlmtime; /* Latest modification time from sql2file(). */ ++ int cmd_len; ++ struct stat mdffile_stat; /* To check if the maildirfolder file exists. */ + + GETTIMEOFDAY(&starttime); + +@@ -93,15 +471,14 @@ + */ + state.level++; + if (msg_verbose) +- MSG_LOG_STATE(myname, state); ++ MSG_LOG_STATE(myname, state); + + /* + * Don't deliver trace-only requests. + */ + if (DEL_REQ_TRACE_ONLY(state.request->flags)) { +- dsb_simple(why, "2.0.0", "delivers to maildir"); +- return (sent(BOUNCE_FLAGS(state.request), +- SENT_ATTR(state.msg_attr))); ++ dsb_simple(why, "2.0.0", "delivers to maildir"); ++ return (sent(BOUNCE_FLAGS(state.request), SENT_ATTR(state.msg_attr))); + } + + /* +@@ -109,17 +486,91 @@ + * attribute to reflect the final recipient. + */ + if (vstream_fseek(state.msg_attr.fp, state.msg_attr.offset, SEEK_SET) < 0) +- msg_fatal("seek message file %s: %m", VSTREAM_PATH(state.msg_attr.fp)); ++ msg_fatal("seek message file %s: %m", VSTREAM_PATH(state.msg_attr.fp)); + state.msg_attr.delivered = state.msg_attr.rcpt.address; + mail_copy_status = MAIL_COPY_STAT_WRITE; + buf = vstring_alloc(100); + +- copy_flags = MAIL_COPY_TOFILE | MAIL_COPY_RETURN_PATH +- | MAIL_COPY_DELIVERED | MAIL_COPY_ORIG_RCPT; ++ copy_flags = MAIL_COPY_TOFILE | MAIL_COPY_RETURN_PATH | MAIL_COPY_DELIVERED | MAIL_COPY_ORIG_RCPT; + +- newdir = concatenate(usr_attr.mailbox, "new/", (char *) 0); +- tmpdir = concatenate(usr_attr.mailbox, "tmp/", (char *) 0); +- curdir = concatenate(usr_attr.mailbox, "cur/", (char *) 0); ++ /* ++ * Concatenate the maildir suffix (if set). ++ */ ++ if (*var_virt_maildir_suffix == 0) { ++ newdir = concatenate(usr_attr.mailbox, "new/", (char *) 0); ++ tmpdir = concatenate(usr_attr.mailbox, "tmp/", (char *) 0); ++ curdir = concatenate(usr_attr.mailbox, "cur/", (char *) 0); ++ } ++ else { ++ newdir = concatenate(usr_attr.mailbox, var_virt_maildir_suffix, (char *) 0); ++ tmpdir = concatenate(usr_attr.mailbox, var_virt_maildir_suffix, (char *) 0); ++ curdir = concatenate(usr_attr.mailbox, var_virt_maildir_suffix, (char *) 0); ++ newdir = concatenate(newdir, "new/", (char *) 0); ++ tmpdir = concatenate(tmpdir, "tmp/", (char *) 0); ++ curdir = concatenate(curdir, "cur/", (char *) 0); ++ } ++ ++ /* ++ * Look up the virtual maildir limit size for this user. ++ * Fall back to virtual_mailbox_limit in case lookup failed. ++ * If virtual maildir limit size is negative, fall back to virtual_mailbox_limit. ++ * If it's 0, set the mailbox limit to 0, which means unlimited. ++ * If it's more than 0 (positive int), check if the value is smaller than the maximum message size, ++ * if it is and the virtual maildir limit can't be overridden, fall back to virtual_mailbox_limit and ++ * warn the user, else use the value directly as the maildir limit. ++ */ ++ if (*var_virt_mailbox_limit_maps != 0 && (limit_res = mail_addr_find(virtual_mailbox_limit_maps, state.msg_attr.user, (char **) NULL)) != 0) { ++ n = atol(limit_res); ++ if (n > 0) { ++ if ((n < var_message_limit) && (!var_virt_mailbox_limit_override)) { ++ n = var_virt_mailbox_limit; ++ ++ msg_warn("%s: recipient %s - virtual maildir limit is " ++ "smaller than %s in %s - falling back to %s", ++ myname, ++ state.msg_attr.user, ++ VAR_MESSAGE_LIMIT, ++ virtual_mailbox_limit_maps->title, ++ VAR_VIRT_MAILBOX_LIMIT); ++ } ++ else { ++ if (msg_verbose) ++ msg_info("%s: set virtual maildir limit size for %s to %ld", ++ myname, usr_attr.mailbox, n); ++ } ++ } ++ else if (n == 0) { ++ if (msg_verbose) ++ msg_info("%s: set virtual maildir limit size for %s to %ld", ++ myname, usr_attr.mailbox, n); ++ } ++ else { ++ /* Invalid limit size (negative). Use default virtual_mailbox_limit. */ ++ n = var_virt_mailbox_limit; ++ } ++ } ++ else { ++ /* There is no limit in the maps. Use default virtual_mailbox_limit. */ ++ n = var_virt_mailbox_limit; ++ } ++ ++ /* ++ * Check quota before delivering the mail. ++ */ ++ if (n != 0) { ++ set_eugid(usr_attr.uid, usr_attr.gid); ++ if (var_virt_mailbox_limit_inbox) { ++ /* Check Inbox only (new, cur and tmp dirs). */ ++ saved_size = check_dir_size(newdir, &saved_count); ++ saved_size += check_dir_size(curdir, &saved_count); ++ saved_size += check_dir_size(tmpdir, &saved_count); ++ } ++ else { ++ /* Check all boxes. */ ++ saved_size = check_dir_size(usr_attr.mailbox, &saved_count); ++ } ++ set_eugid(var_owner_uid, var_owner_gid); ++ } + + /* + * Create and write the file as the recipient, so that file quota work. +@@ -174,46 +625,296 @@ + * [...] + */ + set_eugid(usr_attr.uid, usr_attr.gid); +- vstring_sprintf(buf, "%lu.P%d.%s", +- (unsigned long) starttime.tv_sec, var_pid, get_hostname()); ++ vstring_sprintf(buf, "%lu.P%d.%s", (unsigned long) starttime.tv_sec, var_pid, get_hostname()); + tmpfile = concatenate(tmpdir, STR(buf), (char *) 0); + newfile = 0; ++ bkpnewfile = 0; + if ((dst = vstream_fopen(tmpfile, O_WRONLY | O_CREAT | O_EXCL, 0600)) == 0 +- && (errno != ENOENT +- || make_dirs(tmpdir, 0700) < 0 +- || (dst = vstream_fopen(tmpfile, O_WRONLY | O_CREAT | O_EXCL, 0600)) == 0)) { +- dsb_simple(why, mbox_dsn(errno, "4.2.0"), +- "create maildir file %s: %m", tmpfile); +- } else if (fstat(vstream_fileno(dst), &st) < 0) { +- +- /* +- * Coverity 200604: file descriptor leak in code that never executes. +- * Code replaced by msg_fatal(), as it is not worthwhile to continue +- * after an impossible error condition. +- */ +- msg_fatal("fstat %s: %m", tmpfile); +- } else { +- vstring_sprintf(buf, "%lu.V%lxI%lxM%lu.%s", +- (unsigned long) starttime.tv_sec, +- (unsigned long) st.st_dev, +- (unsigned long) st.st_ino, +- (unsigned long) starttime.tv_usec, +- get_hostname()); +- newfile = concatenate(newdir, STR(buf), (char *) 0); +- if ((mail_copy_status = mail_copy(COPY_ATTR(state.msg_attr), +- dst, copy_flags, "\n", +- why)) == 0) { +- if (sane_link(tmpfile, newfile) < 0 +- && (errno != ENOENT +- || (make_dirs(curdir, 0700), make_dirs(newdir, 0700)) < 0 +- || sane_link(tmpfile, newfile) < 0)) { +- dsb_simple(why, mbox_dsn(errno, "4.2.0"), +- "create maildir file %s: %m", newfile); +- mail_copy_status = MAIL_COPY_STAT_WRITE; +- } +- } +- if (unlink(tmpfile) < 0) +- msg_warn("remove %s: %m", tmpfile); ++ && (errno != ENOENT ++ || make_dirs(tmpdir, 0700) < 0 ++ || (dst = vstream_fopen(tmpfile, O_WRONLY | O_CREAT | O_EXCL, 0600)) == 0)) { ++ dsb_simple(why, mbox_dsn(errno, "4.2.0"), "create maildir file %s: %m", tmpfile); ++ } ++ else if (fstat(vstream_fileno(dst), &st) < 0) { ++ /* ++ * Coverity 200604: file descriptor leak in code that never executes. ++ * Code replaced by msg_fatal(), as it is not worthwhile to continue ++ * after an impossible error condition. ++ */ ++ msg_fatal("fstat %s: %m", tmpfile); ++ } ++ else { ++ vstring_sprintf(buf, "%lu.V%lxI%lxM%lu.%s", ++ (unsigned long) starttime.tv_sec, ++ (unsigned long) st.st_dev, ++ (unsigned long) st.st_ino, ++ (unsigned long) starttime.tv_usec, ++ get_hostname()); ++ newfile = concatenate(newdir, STR(buf), (char *) 0); ++ bkpnewfile = concatenate(STR(buf), (char *) 0); /* Will need it later, if we MOVE to other folders. */ ++ ++ if ((mail_copy_status = mail_copy(COPY_ATTR(state.msg_attr), dst, copy_flags, "\n", why)) == 0) { ++ /* ++ * Add a ",S=" to the newly written file according to the ++ * Maildir++ specifications: http://www.inter7.com/courierimap/README.maildirquota.html ++ * This needs a stat(2) of the tempfile and modification of the ++ * name of the file. ++ */ ++ if (stat(tmpfile, &mail_stat) == 0) { ++ if (n != 0) { ++ saved_size += (long) mail_stat.st_size; ++ saved_count++; ++ } ++ if (var_virt_maildir_extended) { ++ /* Append the size of the file to newfile. */ ++ vstring_sprintf(buf, ",S=%ld", (long) mail_stat.st_size); ++ newfile = concatenate(newfile, STR(buf), (char *) 0); ++ bkpnewfile = concatenate(bkpnewfile, STR(buf), (char *) 0); ++ } ++ } ++ ++ /* ++ * Now we have the maildir size in saved_size, compare it to the max ++ * quota value and eventually issue a message that we've overdrawn it. ++ */ ++ if (saved_size > n) { ++ mail_copy_status = MAIL_COPY_STAT_WRITE; ++ if (((long) mail_stat.st_size > n) || (var_virt_overquota_bounce)) ++ errno = EFBIG; ++ else ++ errno = EDQUOT; ++ } ++ else { ++ /* Maildirfilter code by rk@demiurg.net. */ ++ if (var_virt_maildir_filter) { ++ if (msg_verbose) ++ msg_info("%s: loading DICT filters", myname); ++ ++#define STREQUAL(x,y,l) (strncasecmp((x), (y), (l)) == 0 && (y)[l] == 0) ++#define MAIL_COPY_STAT_REJECT (1<<3) ++#define MAIL_COPY_STAT_DISCARD (1<<4) ++ ++ /* Read filters. */ ++ filtername = concatenate("regexp:", usr_attr.mailbox, "maildirfilter", (char *) 0); ++ sqlmtime = sql2file(strchr(filtername, '/'), state.msg_attr.user); ++ ++ /* Check if this filter is already registered as dictionary. */ ++ if (msg_verbose) ++ msg_info("%s: checking DICT filters for %s", myname, filtername); ++ ++ if ((FILTERS = dict_handle(filtername))) { ++ if (msg_verbose) ++ msg_info("%s: DICT filter found", myname); ++ ++ /* ++ * If we have mtime in our DICT structure, check it against sqlmtime ++ * and reload the filters if they differ. ++ */ ++ if (FILTERS->mtime > 0 && sqlmtime > 0 && FILTERS->mtime != sqlmtime) { ++ if (msg_verbose) ++ msg_info("%s: reloading DICT filters (dict_mtime=%ld != sql_mtime=%ld)", ++ myname, FILTERS->mtime, sqlmtime); ++ ++ dict_unregister(filtername); ++ FILTERS = dict_open(filtername, O_RDONLY, DICT_FLAG_LOCK); ++ dict_register(filtername, FILTERS); ++ FILTERS->mtime = sqlmtime; ++ } ++ } ++ else { ++ if (sqlmtime > 0) { ++ /* Registering filter as new dictionary. */ ++ if (msg_verbose) ++ msg_info("%s: loading DICT filters from %s (mtime=%ld)", ++ myname, filtername, sqlmtime); ++ ++ FILTERS = dict_open(filtername, O_RDONLY, DICT_FLAG_LOCK); ++ dict_register(filtername, FILTERS); ++ FILTERS->mtime = sqlmtime; ++ } ++ } ++ ++ if (FILTERS && (tmpfilter = vstream_fopen(tmpfile, O_RDONLY, 0))) { ++ fltstr = vstring_alloc(1024); ++ header = (char *) malloc(8192); /* !!!INSECURE!!! See 7168-hack below. */ ++ header[0] = 0; ++ vstring_get_nonl_bound(fltstr, tmpfilter, 1023); ++ header = concatenate(header, STR(fltstr), (char *) 0); ++ ++ while(!vstream_feof(tmpfilter) && fltstr->vbuf.data[0] && strlen(header) < 7168 ) { ++ vstring_get_nonl_bound(fltstr, tmpfilter, 1023); ++ /* Glue multiline headers, replacing leading TAB with space. */ ++ if (msg_verbose) ++ msg_info("%s: fltstr value: %s", myname, STR(fltstr)); ++ ++ if (fltstr->vbuf.data[0] == ' ' || fltstr->vbuf.data[0] == '\t' ) { ++ if (fltstr->vbuf.data[0] == '\t') ++ fltstr->vbuf.data[0] = ' '; ++ header = concatenate(header, STR(fltstr), (char *) 0); ++ } ++ else { ++ header = concatenate(header, "\n", STR(fltstr), (char *) 0); ++ } ++ } ++ ++ if (msg_verbose) ++ msg_info("%s: checking filter CMD for %s", myname, filtername); ++ ++ /* Check whole header part with regexp maps. */ ++ if ((value = dict_get(FILTERS, lowercase(header))) != 0) { ++ if (msg_verbose) ++ msg_info("%s: preparing filter CMD", myname); ++ ++ cmd_text = value + strcspn(value, " \t"); ++ cmd_len = cmd_text - value; ++ while (*cmd_text && ISSPACE(*cmd_text)) ++ cmd_text++; ++ ++ if (msg_verbose) ++ msg_info("%s: executing filter CMD", myname); ++ ++ if (STREQUAL(value, "REJECT", cmd_len)) { ++ if (msg_verbose) ++ msg_info("%s: executing filter CMD REJECT", myname); ++ ++ mail_copy_status = MAIL_COPY_STAT_REJECT; ++ vstring_sprintf(why->reason, "%s", cmd_text); ++ dsb_simple(why, "5.0.0", "User filter - REJECT"); ++ } ++ ++ if (STREQUAL(value, "DISCARD", cmd_len)) { ++ if (msg_verbose) ++ msg_info("%s: executing filter CMD DISCARD", myname); ++ ++ mail_copy_status = MAIL_COPY_STAT_DISCARD; ++ vstring_sprintf(why->reason, "%s", cmd_text); ++ dsb_simple(why, "5.0.0", "User filter - DISCARD"); ++ } ++ ++ if (var_virt_maildir_extended) { ++ if (STREQUAL(value, "MOVE", cmd_len)) { ++ if (msg_verbose) ++ msg_info("%s: executing filter CMD MOVE", myname); ++ ++ strcut((char *) cmd_text, " "); ++ strcut((char *) cmd_text, "\t"); ++ strcut((char *) cmd_text, "/"); ++ strcut((char *) cmd_text, ".."); ++ ++ if (*var_virt_maildir_suffix == 0) { ++ newfile = concatenate(usr_attr.mailbox, (char *) 0); ++ } ++ else { ++ newfile = concatenate(usr_attr.mailbox, var_virt_maildir_suffix, (char *) 0); ++ } ++ ++ if (cmd_text[0] != '.') { ++ newfile = concatenate(newfile, ".", (char *) 0); ++ } ++ newdir = concatenate(newfile, cmd_text, "/", "new/", (char *) 0); ++ tmpdir = concatenate(newfile, cmd_text, "/", "tmp/", (char *) 0); ++ curdir = concatenate(newfile, cmd_text, "/", "cur/", (char *) 0); ++ mdffilename = concatenate(newfile, cmd_text, "/", "maildirfolder", (char *) 0); ++ newfile = concatenate(newfile, cmd_text, "/", "new/", bkpnewfile, (char *) 0); ++ } ++ } ++ ++ if (STREQUAL(value, "LOG", cmd_len) || STREQUAL(value, "WARN", cmd_len)) { ++ msg_warn("%s: header check warning: %s", myname, cmd_text); ++ } ++ ++ if (STREQUAL(value, "INFO", cmd_len)) { ++ msg_info("%s: header check info: %s", myname, cmd_text); ++ } ++ ++ if (msg_verbose) ++ msg_info("%s: exiting filter CMD", myname); ++ } /* End-Of-Check */ ++ ++ myfree(header); ++ vstring_free(fltstr); ++ vstream_fclose(tmpfilter); ++ } ++ ++ myfree(filtername); ++ } /* End-Of-Maildirfilter */ ++ ++ /* Deliver to curdir. */ ++ if (mail_copy_status == 0) { ++ if (sane_link(tmpfile, newfile) < 0 ++ && (errno != ENOENT ++ || (make_dirs(curdir, 0700), make_dirs(newdir, 0700), make_dirs(tmpdir, 0700)) < 0 ++ || sane_link(tmpfile, newfile) < 0)) { ++ dsb_simple(why, mbox_dsn(errno, "4.2.0"), "create maildir file %s: %m", newfile); ++ mail_copy_status = MAIL_COPY_STAT_WRITE; ++ } ++ ++ if (var_virt_maildir_extended) { ++ time(&tm); ++ ++ if (*var_virt_maildir_suffix == 0) { ++ sizefilename = concatenate(usr_attr.mailbox, "maildirsize", (char *) 0); ++ } ++ else { ++ sizefilename = concatenate(usr_attr.mailbox, var_virt_maildir_suffix, (char *) 0); ++ sizefilename = concatenate(sizefilename, "maildirsize", (char *) 0); ++ } ++ ++ /* Check if the quota in the file is the same as the current one, if not, delete the file. */ ++ sizefile = vstream_fopen(sizefilename, O_RDONLY, 0); ++ if (sizefile) { ++ filequota = vstring_alloc(128); ++ vstring_get_null_bound(filequota, sizefile, 127); ++ vstream_fclose(sizefile); ++ if (atol(vstring_export(filequota)) != n) ++ unlink(sizefilename); ++ } ++ ++ /* Open maildirsize file to append this transaction. */ ++ sizefile = vstream_fopen(sizefilename, O_WRONLY | O_APPEND, 0640); ++ ++ /* If the open fails (maildirsize doesn't exist), or it's too large, or too old, overwrite it. */ ++ if(!sizefile || (stat(sizefilename, &sizefile_stat) < 0) || (sizefile_stat.st_size > SIZEFILE_MAX) || (sizefile_stat.st_mtime + 15*60 < tm)) { ++ /* If the file exists, sizefile has been opened above, so close it first. */ ++ if (sizefile) { ++ vstream_fclose(sizefile); ++ sizefile = vstream_fopen(sizefilename, O_WRONLY | O_TRUNC, 0640); ++ } ++ else { ++ sizefile = vstream_fopen(sizefilename, O_WRONLY | O_CREAT, 0640); ++ } ++ ++ /* If the creation worked, write to the file, otherwise just give up. */ ++ if (sizefile) { ++ vstream_fprintf(sizefile, "%ldS\n%ld %ld\n", n, saved_size, saved_count); ++ vstream_fclose(sizefile); ++ } ++ } ++ else { ++ /* We opened maildirsize, so let's just append this transaction and close it. */ ++ vstream_fprintf(sizefile, "%ld 1\n", (long) mail_stat.st_size); ++ vstream_fclose(sizefile); ++ } ++ ++ /* ++ * 1) mdffilename != 0, so the maildirfilter code went through the MOVE to subfolder rule. ++ * 2) stat() failed, maybe the file does not exist? Try to create it. ++ */ ++ if (mdffilename && (stat(mdffilename, &mdffile_stat) < 0)) { ++ mdffile = vstream_fopen(mdffilename, O_WRONLY | O_CREAT, 0600); ++ if (mdffile) { ++ vstream_fclose(mdffile); ++ } ++ else { ++ msg_warn("Cannot create maildirfolder file '%s': %s", mdffilename, strerror(errno)); ++ } ++ } ++ } ++ } ++ } ++ } ++ if (unlink(tmpfile) < 0) ++ msg_warn("remove %s: %m", tmpfile); + } + set_eugid(var_owner_uid, var_owner_gid); + +@@ -223,31 +924,64 @@ + * location possibly under user control. + */ + if (mail_copy_status & MAIL_COPY_STAT_CORRUPT) { +- deliver_status = DEL_STAT_DEFER; +- } else if (mail_copy_status != 0) { +- if (errno == EACCES) { +- msg_warn("maildir access problem for UID/GID=%lu/%lu: %s", +- (long) usr_attr.uid, (long) usr_attr.gid, +- STR(why->reason)); +- msg_warn("perhaps you need to create the maildirs in advance"); +- } +- vstring_sprintf_prepend(why->reason, "maildir delivery failed: "); +- deliver_status = +- (STR(why->status)[0] == '4' ? +- defer_append : bounce_append) +- (BOUNCE_FLAGS(state.request), +- BOUNCE_ATTR(state.msg_attr)); +- } else { +- dsb_simple(why, "2.0.0", "delivered to maildir"); +- deliver_status = sent(BOUNCE_FLAGS(state.request), +- SENT_ATTR(state.msg_attr)); ++ deliver_status = DEL_STAT_DEFER; ++ } ++ else if (mail_copy_status != 0) { ++ if (errno == EACCES) { ++ msg_warn("maildir access problem for UID/GID=%lu/%lu: %s", ++ (long) usr_attr.uid, (long) usr_attr.gid, STR(why->reason)); ++ msg_warn("perhaps you need to create the maildirs in advance"); ++ } ++ ++ /* Support per-recipient bounce messages. */ ++ const char *limit_message; ++ int errnored = errno; /* Seems like mail_addr_find resets errno ... */ ++ ++ if (*var_virt_maildir_limit_message_maps != 0 && (limit_message = mail_addr_find(virtual_maildir_limit_message_maps, state.msg_attr.user, (char **) NULL)) != 0) { ++ errno = errnored; ++ if (errno == EFBIG) { ++ dsb_simple(why, "5.2.2", limit_message); ++ } ++ if (errno == EDQUOT) { ++ dsb_simple(why, "4.2.2", limit_message); ++ } ++ } ++ else { ++ errno = errnored; ++ if (errno == EFBIG) { ++ dsb_simple(why, "5.2.2", var_virt_maildir_limit_message); ++ } ++ if (errno == EDQUOT) { ++ dsb_simple(why, "4.2.2", var_virt_maildir_limit_message); ++ } ++ } ++ ++ vstring_sprintf_prepend(why->reason, "maildir delivery failed: "); ++ deliver_status = ++ (STR(why->status)[0] == '4' ? defer_append : bounce_append) ++ (BOUNCE_FLAGS(state.request), BOUNCE_ATTR(state.msg_attr)); + } ++ else { ++ dsb_simple(why, "2.0.0", "delivered to maildir"); ++ deliver_status = sent(BOUNCE_FLAGS(state.request), SENT_ATTR(state.msg_attr)); ++ } ++ + vstring_free(buf); ++ + myfree(newdir); + myfree(tmpdir); + myfree(curdir); ++ ++ if (sizefilename) ++ myfree(sizefilename); ++ if (mdffilename) ++ myfree(mdffilename); ++ + myfree(tmpfile); + if (newfile) +- myfree(newfile); ++ myfree(newfile); ++ if (bkpnewfile) ++ myfree(bkpnewfile); ++ + return (deliver_status); + } +diff -Nru postfix-2.5.6-orig/src/virtual/virtual.c postfix-2.5.6/src/virtual/virtual.c +--- postfix-2.5.6-orig/src/virtual/virtual.c 2008-07-27 18:00:11.000000000 -0300 ++++ postfix-2.5.6/src/virtual/virtual.c 2009-01-16 08:55:22.000000000 -0200 +@@ -335,12 +335,30 @@ + char *var_mail_spool_dir; /* XXX dependency fix */ + bool var_strict_mbox_owner; + ++char *var_virt_mailbox_limit_maps; ++bool var_virt_mailbox_limit_inbox; ++bool var_virt_mailbox_limit_override; ++bool var_virt_maildir_extended; ++bool var_virt_overquota_bounce; ++char *var_virt_maildir_limit_message; ++char *var_virt_maildir_limit_message_maps; ++char *var_virt_maildir_suffix; ++bool var_virt_trash_count; ++char *var_virt_trash_name; ++bool var_virt_maildir_filter; ++char *var_virt_maildir_filter_maps; ++ ++ + /* + * Mappings. + */ + MAPS *virtual_mailbox_maps; + MAPS *virtual_uid_maps; + MAPS *virtual_gid_maps; ++MAPS *virtual_mailbox_limit_maps; ++MAPS *virtual_maildir_limit_message_maps; ++MAPS *virtual_maildir_filter_maps; ++ + + /* + * Bit masks. +@@ -450,15 +468,28 @@ + */ + virtual_mailbox_maps = + maps_create(VAR_VIRT_MAILBOX_MAPS, var_virt_mailbox_maps, +- DICT_FLAG_LOCK | DICT_FLAG_PARANOID); ++ DICT_FLAG_LOCK); + + virtual_uid_maps = + maps_create(VAR_VIRT_UID_MAPS, var_virt_uid_maps, +- DICT_FLAG_LOCK | DICT_FLAG_PARANOID); ++ DICT_FLAG_LOCK); + + virtual_gid_maps = + maps_create(VAR_VIRT_GID_MAPS, var_virt_gid_maps, +- DICT_FLAG_LOCK | DICT_FLAG_PARANOID); ++ DICT_FLAG_LOCK); ++ ++ virtual_mailbox_limit_maps = ++ maps_create(VAR_VIRT_MAILBOX_LIMIT_MAPS, var_virt_mailbox_limit_maps, ++ DICT_FLAG_LOCK); ++ ++ virtual_maildir_limit_message_maps = ++ maps_create(VAR_VIRT_MAILDIR_LIMIT_MESSAGE_MAPS, var_virt_maildir_limit_message_maps, ++ DICT_FLAG_LOCK); ++ ++ virtual_maildir_filter_maps = ++ maps_create(VAR_VIRT_MAILDIR_FILTER_MAPS, var_virt_maildir_filter_maps, ++ DICT_FLAG_LOCK); ++ + + virtual_mbox_lock_mask = mbox_lock_mask(var_virt_mailbox_lock); + } +@@ -495,24 +526,39 @@ + + int main(int argc, char **argv) + { +- static const CONFIG_INT_TABLE int_table[] = { +- VAR_VIRT_MINUID, DEF_VIRT_MINUID, &var_virt_minimum_uid, 1, 0, +- VAR_VIRT_MAILBOX_LIMIT, DEF_VIRT_MAILBOX_LIMIT, &var_virt_mailbox_limit, 0, 0, +- 0, +- }; +- static const CONFIG_STR_TABLE str_table[] = { +- VAR_MAIL_SPOOL_DIR, DEF_MAIL_SPOOL_DIR, &var_mail_spool_dir, 0, 0, +- VAR_VIRT_MAILBOX_MAPS, DEF_VIRT_MAILBOX_MAPS, &var_virt_mailbox_maps, 0, 0, +- VAR_VIRT_UID_MAPS, DEF_VIRT_UID_MAPS, &var_virt_uid_maps, 0, 0, +- VAR_VIRT_GID_MAPS, DEF_VIRT_GID_MAPS, &var_virt_gid_maps, 0, 0, +- VAR_VIRT_MAILBOX_BASE, DEF_VIRT_MAILBOX_BASE, &var_virt_mailbox_base, 1, 0, +- VAR_VIRT_MAILBOX_LOCK, DEF_VIRT_MAILBOX_LOCK, &var_virt_mailbox_lock, 1, 0, +- 0, +- }; +- static const CONFIG_BOOL_TABLE bool_table[] = { +- VAR_STRICT_MBOX_OWNER, DEF_STRICT_MBOX_OWNER, &var_strict_mbox_owner, +- 0, +- }; ++ ++ static const CONFIG_INT_TABLE int_table[] = { ++ VAR_VIRT_MINUID, DEF_VIRT_MINUID, &var_virt_minimum_uid, 1, 0, ++ VAR_VIRT_MAILBOX_LIMIT, DEF_VIRT_MAILBOX_LIMIT, &var_virt_mailbox_limit, 0, 0, ++ 0, ++ }; ++ ++ static const CONFIG_BOOL_TABLE bool_table[] = { ++ VAR_STRICT_MBOX_OWNER, DEF_STRICT_MBOX_OWNER, &var_strict_mbox_owner, ++ VAR_VIRT_MAILBOX_LIMIT_INBOX, DEF_VIRT_MAILBOX_LIMIT_INBOX, &var_virt_mailbox_limit_inbox, ++ VAR_VIRT_MAILBOX_LIMIT_OVERRIDE, DEF_VIRT_MAILBOX_LIMIT_OVERRIDE, &var_virt_mailbox_limit_override, ++ VAR_VIRT_MAILDIR_EXTENDED, DEF_VIRT_MAILDIR_EXTENDED, &var_virt_maildir_extended, ++ VAR_VIRT_OVERQUOTA_BOUNCE, DEF_VIRT_OVERQUOTA_BOUNCE, &var_virt_overquota_bounce, ++ VAR_VIRT_TRASH_COUNT, DEF_VIRT_TRASH_COUNT, &var_virt_trash_count, ++ VAR_VIRT_MAILDIR_FILTER, DEF_VIRT_MAILDIR_FILTER, &var_virt_maildir_filter, ++ 0, ++ }; ++ ++ static const CONFIG_STR_TABLE str_table[] = { ++ VAR_MAIL_SPOOL_DIR, DEF_MAIL_SPOOL_DIR, &var_mail_spool_dir, 0, 0, ++ VAR_VIRT_MAILBOX_MAPS, DEF_VIRT_MAILBOX_MAPS, &var_virt_mailbox_maps, 0, 0, ++ VAR_VIRT_UID_MAPS, DEF_VIRT_UID_MAPS, &var_virt_uid_maps, 0, 0, ++ VAR_VIRT_GID_MAPS, DEF_VIRT_GID_MAPS, &var_virt_gid_maps, 0, 0, ++ VAR_VIRT_MAILBOX_LIMIT_MAPS, DEF_VIRT_MAILBOX_LIMIT_MAPS, &var_virt_mailbox_limit_maps, 0, 0, ++ VAR_VIRT_MAILBOX_BASE, DEF_VIRT_MAILBOX_BASE, &var_virt_mailbox_base, 1, 0, ++ VAR_VIRT_MAILBOX_LOCK, DEF_VIRT_MAILBOX_LOCK, &var_virt_mailbox_lock, 1, 0, ++ VAR_VIRT_MAILDIR_LIMIT_MESSAGE, DEF_VIRT_MAILDIR_LIMIT_MESSAGE, &var_virt_maildir_limit_message, 1, 0, ++ VAR_VIRT_MAILDIR_LIMIT_MESSAGE_MAPS, DEF_VIRT_MAILDIR_LIMIT_MESSAGE_MAPS, &var_virt_maildir_limit_message_maps, 0, 0, ++ VAR_VIRT_MAILDIR_SUFFIX, DEF_VIRT_MAILDIR_SUFFIX, &var_virt_maildir_suffix, 0, 0, ++ VAR_VIRT_TRASH_NAME, DEF_VIRT_TRASH_NAME, &var_virt_trash_name, 0, 0, ++ VAR_VIRT_MAILDIR_FILTER_MAPS, DEF_VIRT_MAILDIR_FILTER_MAPS, &var_virt_maildir_filter_maps, 0, 0, ++ 0, ++ }; + + /* + * Fingerprint executables and core dumps. +@@ -526,6 +572,7 @@ + MAIL_SERVER_PRE_INIT, pre_init, + MAIL_SERVER_POST_INIT, post_init, + MAIL_SERVER_PRE_ACCEPT, pre_accept, ++ MAIL_SERVER_BOOL_TABLE, bool_table, + MAIL_SERVER_PRIVILEGED, + 0); + } +diff -Nru postfix-2.5.6-orig/src/virtual/virtual.h postfix-2.5.6/src/virtual/virtual.h +--- postfix-2.5.6-orig/src/virtual/virtual.h 2006-01-07 21:59:47.000000000 -0200 ++++ postfix-2.5.6/src/virtual/virtual.h 2009-01-16 08:55:22.000000000 -0200 +@@ -34,6 +34,9 @@ + extern MAPS *virtual_mailbox_maps; + extern MAPS *virtual_uid_maps; + extern MAPS *virtual_gid_maps; ++extern MAPS *virtual_mailbox_limit_maps; ++extern MAPS *virtual_maildir_limit_message_maps; ++extern MAPS *virtual_maildir_filter_maps; + + /* + * User attributes: these control the privileges for delivery to external diff --git a/postfix-2.6.1.tar.bz2 b/postfix-2.6.1.tar.bz2 new file mode 100644 index 0000000..46753a3 --- /dev/null +++ b/postfix-2.6.1.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:09fd1b79d900b42e41c9f3ed31c6400dfb6e0d2955aed27d76d5e464bf2d09c9 +size 2438713 diff --git a/postfix-SuSE.tar.gz b/postfix-SuSE.tar.gz index 3260469..7908ecf 100644 --- a/postfix-SuSE.tar.gz +++ b/postfix-SuSE.tar.gz @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5e9732abe32e8eebb4fb53a2e338cc31d2307f96af303f6f5d2b0993040684c2 -size 18111 +oid sha256:81bb95c7b712f3ac4a1356917992e7c5e650e03b192f9a35117351360386cc97 +size 21145 diff --git a/postfix-mysql.tar.bz2 b/postfix-mysql.tar.bz2 new file mode 100644 index 0000000..4e9eef6 --- /dev/null +++ b/postfix-mysql.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cff3c067d45ff6a9c7ce1c7ac47c155955fe55b965ef1bf030b1bd912ce55479 +size 1743 diff --git a/postfix.changes b/postfix.changes index 293b89a..b8c574e 100644 --- a/postfix.changes +++ b/postfix.changes @@ -1,3 +1,75 @@ +------------------------------------------------------------------- +Mon Sep 28 09:22:54 CEST 2009 - varkoly@suse.de + +- bnc#540538 – postfix-2.6.1-10.1 installs new files in /etc/postfix and does not generate .db +- bnc#519438 - Postfix: Running chrooted lets qmgr loosing his syslog-socket +- remove obsolate version tests from SuSEconfig.postfix + +------------------------------------------------------------------- +Mon Sep 28 08:24:43 CEST 2009 - varkoly@suse.de + +- bnc#525825 - when using cyrus in a chroot environment Suseconfig does not + create socket /var/lib/imap/socket/lmtp + +------------------------------------------------------------------- +Mon Sep 14 11:34:41 UTC 2009 - chris@computersalat.de + +- spec + o fdupes if >= 1100 + +------------------------------------------------------------------- +Thu Sep 10 21:22:46 CEST 2009 - chris@computersalat.de + +- update to 2.6.1 + o merge home:varkoly:Factory and o:F +- spec mods + o use of getent +- rpmlint + o remove unneeded dists from examples/chroot-setup/ + o postin-without-ldconfig + o files-duplicate /usr/share/doc/packages/postfix-doc/html/ + o files-duplicate /usr/share/man/man? + +------------------------------------------------------------------- +Mon Apr 13 18:21:14 UTC 2009 - chris@computersalat.de + +- added VDA patch + o Mailbox / Maildir size limit, known also as "soft quota", + to avoid user take all you disk space + o Customizable "limit" message when the soft quota limit is reached. + NOTE: message is sent to senders, but NOT to the owner of the mailbox. + o Limit only 'INBOX', because some people use IMAP and don't want + the same limit in IMAP folder that are differents from INBOX. + o Support for 'Courier' style Maildir, usefull for people that + use courier as pop3/imap server and to get fast soft quota summary. + Note that it is also compatible with qmail maildir per default. + o Supports for Courier 'maildirsize' file in Maildir folder that + is used to read quotas quickly. Note that this option is not + actived per default and can be dangerous on some NFS client + implementation + (like for example Solaris that cache some filesystem operations). + o Customisable suffix for Maildir support, when share same external + dict between postfix and pop3/imap server sometime "Maildir/" suffix + is needed to avoid extra database handling (eg LDAP, MySQL...). +- some improvements of SuSEconfig.postfix + o POSTFIX_LISTEN: Comma separated list of IP's + o POSTFIX_INET_PROTO: ipv4, ipv6, all + o POSTFIX_MYHOSTNAME: define SMTPs FQHOSTNAME + o POSTFIX_WITH_MYSQL: when using MySQL as backend + o POSTFIX_BASIC_SPAM_PREVENTION: "custom" + you can now define your own rules + - POSTFIX_SMTPD_CLIENT_RESTRICTIONS + - POSTFIX_SMTPD_HELO_RESTRICTIONS + - POSTFIX_SMTPD_SENDER_RESTRICTIONS + - POSTFIX_SMTPD_RECIPIENT_RESTRICTIONS +- added helo_access for helo checks +- added relay for relaying domain +- added MySQL stuff when using MySQL as backend (virtuser) + o you should consider postfixAdmin as mgmnt interface + o when runninng postfix chrooted: + you have to run SUSEconfig each time when you have restarted MySQL + because of linking mysql.sock + ------------------------------------------------------------------- Sun Mar 29 15:18:52 CEST 2009 - varkoly@suse.de diff --git a/postfix.spec b/postfix.spec index aa76a0d..f5c3e99 100644 --- a/postfix.spec +++ b/postfix.spec @@ -1,5 +1,5 @@ # -# spec file for package postfix (Version 2.5.6) +# spec file for package postfix (Version 2.6.1) # # Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany. # @@ -17,69 +17,53 @@ # norootforbuild +%define usetls 1 Name: postfix -#!BuildIgnore: sendmail -BuildRequires: db-devel mysql-devel openldap2-devel pcre-devel postgresql-devel -# require pwdutils to make postinstall script check work -BuildRequires: pwdutils -%define usetls 1 -Url: http://www.postfix.org/ +Summary: A fast, secure, and flexible mailer +Version: 2.6.1 +Release: 1 License: IBM Public License .. Group: Productivity/Networking/Email/Servers -Provides: smtp_daemon -Conflicts: sendmail exim +Url: http://www.postfix.org/ AutoReqProv: on -Summary: A fast, secure, and flexible mailer -Version: 2.5.6 -Release: 5 -Source: postfix-%{version}.tar.bz2 -Source1: postfix-SuSE.tar.gz +Source: %{name}-%{version}.tar.bz2 +Source1: %{name}-SuSE.tar.gz +Source2: %{name}-mysql.tar.bz2 +Source10: rpmlintrc Patch: dynamic_maps.patch Patch1: dynamic_maps_pie.patch Patch2: pointer_to_literals.patch Patch3: ipv6_disabled.patch -PreReq: /usr/sbin/useradd /usr/sbin/groupadd %insserv_prereq %fillup_prereq /bin/sed /bin/awk /bin/grep textutils sh-utils fileutils pcre openldap2-client netcfg +Patch10: %{name}-2.2.9-main.cf.patch +Patch11: %{name}-%{version}-vda-ng.patch +Patch12: %{name}-%{version}-vda-ng-64bit.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build +PreReq: %insserv_prereq %fillup_prereq +PreReq: /usr/bin/getent +PreReq: /usr/sbin/useradd /usr/sbin/groupadd +PreReq: /bin/sed /bin/awk /bin/grep +PreReq: textutils sh-utils fileutils pcre openldap2-client netcfg +BuildRequires: db-devel +BuildRequires: mysql-devel +BuildRequires: openldap2-devel pcre-devel postgresql-devel +# require pwdutils to make postinstall script check work +BuildRequires: pwdutils +%if 0%{?suse_version} >= 1100 +BuildRequires: fdupes +%endif # - -%package mysql -License: IBM Public License .. -Summary: Postfix plugin to support MySQL maps -AutoReqProv: on -Group: Productivity/Networking/Email/Servers -PreReq: %{name} = %{version} -# - -%package postgresql -License: IBM Public License .. -Summary: Postfix plugin to support PostgreSQL maps -AutoReqProv: on -Group: Productivity/Networking/Email/Servers -PreReq: %{name} = %{version} -# - -%package devel -License: IBM Public License .. -Summary: Development headers for the postfix package -AutoReqProv: on -Group: Productivity/Networking/Email/Servers -PreReq: %{name} = %{version} - -%package doc -License: IBM Public License .. -Summary: Documentations for the postfix package -AutoReqProv: on -Group: Productivity/Networking/Email/Servers -PreReq: %{name} = %{version} +Conflicts: sendmail exim +Provides: smtp_daemon # # Some defines # -%define postfixfiles postfix.filelist -%define pf_config_directory /etc/postfix -%define pf_daemon_directory /usr/lib/postfix +%define pf_docdir %{_docdir}/%{name}-doc +%define postfixfiles %{name}.filelist +%define pf_config_directory /etc/%{name} +%define pf_daemon_directory /usr/lib/%{name} %define pf_command_directory /usr/sbin -%define pf_queue_directory var/spool/postfix +%define pf_queue_directory var/spool/%{name} %define pf_sendmail_path /usr/sbin/sendmail %define pf_newaliases_path /usr/bin/newaliases %define pf_mailq_path /usr/bin/mailq @@ -87,22 +71,102 @@ PreReq: %{name} = %{version} %define pf_readme_directory %{_docdir}/%{name}-doc/README_FILES %define pf_html_directory %{_docdir}/%{name}-doc/html %define pf_sample_directory %{_docdir}/%{name}-doc/samples -%define pf_data_directory /var/lib/postfix -%define postfix_uid 51 -%define postfix_gid 51 +%define pf_data_directory /var/lib/%{name} +%define pf_uid 51 +%define pf_gid 51 %define maildrop_gid 59 -%define conf_backup_dir /var/adm/backup/postfix +%define conf_backup_dir /var/adm/backup/%{name} %define omc_pdir /usr/share/omc/ %define omc_dir /usr/share/omc/svcinfo.d/ # +%define vmusr vmail +%define vmgid 303 +%define vmid 303 +%define vmdir /srv/maildirs +# # --------------------------------------------------------------------------- +%description +Postfix aims to be an alternative to the widely-used sendmail program. + +Authors: +-------- + Wietse Venema + + +%package devel +Summary: Development headers for the postfix package +License: IBM Public License .. +Group: Development/Libraries/C and C++ +AutoReqProv: on +PreReq: %{name} = %{version} + +%description devel +Postfix aims to be an alternative to the widely-used sendmail program. + +Authors: +-------- + Wietse Venema + + +%package doc +Summary: Documentations for the postfix package +License: IBM Public License .. +Group: Productivity/Networking/Email/Servers + +%description doc +Postfix aims to be an alternative to the widely-used sendmail program. +This package contains the documentation for %{name} + +Authors: +-------- + Wietse Venema + + +%package mysql +Summary: Postfix plugin to support MySQL maps +License: IBM Public License .. +Group: Productivity/Networking/Email/Servers +AutoReqProv: on +PreReq: %{name} = %{version} + +%description mysql +Postfix plugin to support MySQL maps. This library will be loaded by +starting %{name} if you'll access a postmap which is stored in mysql. + +Authors: +-------- + Wietse Venema + + +%package postgresql +Summary: Postfix plugin to support PostgreSQL maps +License: IBM Public License .. +Group: Productivity/Networking/Email/Servers +AutoReqProv: on +PreReq: %{name} = %{version} + +%description postgresql +Postfix plugin to support PostgreSQL maps. This library will be loaded +by starting %{name} if you'll access a postmap which is stored in +PostgreSQL. + +Authors: +-------- + Wietse Venema + + %prep -%setup -n postfix-%{version} -a 1 -%patch +%setup -n %{name}-%{version} -a 1 -a 2 +%patch -p1 %patch1 %patch2 -p1 %patch3 -p1 +%patch10 -p1 +%patch11 -p1 +%ifarch x86_64 +%patch12 -p1 +%endif # --------------------------------------------------------------------------- %build @@ -124,16 +188,16 @@ export PIE=-pie make makefiles DEBUG="" cd lib for i in dns global master tls util milter; do - ln -sf lib${i}.a libpostfix-${i}.so.1.0.1; + ln -sf lib${i}.a lib%{name}-${i}.so.1.0.1; done cd - make LD_LIBRARY_PATH=$(pwd)/lib:${LD_LIBRARY_PATH} # --------------------------------------------------------------------------- %install -/usr/sbin/groupadd -g %{postfix_gid} -o -r postfix 2> /dev/null || : +/usr/sbin/groupadd -g %{pf_gid} -o -r %{name} 2> /dev/null || : /usr/sbin/groupadd -g %{maildrop_gid} -o -r maildrop 2> /dev/null || : -/usr/sbin/useradd -r -o -g postfix -u %{postfix_uid} -s /bin/false -c "Postfix Daemon" -d /%{pf_queue_directory} postfix 2> /dev/null || : +/usr/sbin/useradd -r -o -g %{name} -u %{pf_uid} -s /bin/false -c "Postfix Daemon" -d /%{pf_queue_directory} %{name} 2> /dev/null || : mkdir -p $RPM_BUILD_ROOT/%{_libdir} install lib/*.1 $RPM_BUILD_ROOT/%{_libdir} for i in $RPM_BUILD_ROOT/%{_libdir}/*.1; do @@ -170,17 +234,17 @@ mkdir -p $RPM_BUILD_ROOT/%{_libdir}/sasl2 mkdir -p $RPM_BUILD_ROOT/usr/sbin mkdir -p $RPM_BUILD_ROOT/%{conf_backup_dir} mkdir -p $RPM_BUILD_ROOT/%{pf_sample_directory} -mkdir -p $RPM_BUILD_ROOT/usr/include/postfix +mkdir -p $RPM_BUILD_ROOT/usr/include/%{name} mkdir -p $RPM_BUILD_ROOT/etc/pam.d -install -m 644 postfix-SuSE/smtp $RPM_BUILD_ROOT/etc/pam.d/smtp +install -m 644 %{name}-SuSE/smtp $RPM_BUILD_ROOT/etc/pam.d/smtp #mkdir samples -install -m 755 postfix-SuSE/rc.postfix $RPM_BUILD_ROOT/etc/init.d/postfix -ln -sf ../etc/init.d/postfix $RPM_BUILD_ROOT/sbin/rcpostfix +install -m 755 %{name}-SuSE/rc.%{name} $RPM_BUILD_ROOT/etc/init.d/%{name} +ln -sf ../etc/init.d/%{name} $RPM_BUILD_ROOT/sbin/rc%{name} mkdir -p $RPM_BUILD_ROOT/var/adm/fillup-templates -rm -f $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.postfix -sed -e 's;@lib@;%{_lib};g' postfix-SuSE/sysconfig.postfix > $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.postfix -install -m 644 postfix-SuSE/sysconfig.mail-postfix $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.mail-postfix -rm -f $RPM_BUILD_ROOT/sbin/conf.d/SuSEconfig.postfix +rm -f $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.%{name} +sed -e 's;@lib@;%{_lib};g' %{name}-SuSE/sysconfig.%{name} > $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.%{name} +install -m 644 %{name}-SuSE/sysconfig.mail-%{name} $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.mail-%{name} +rm -f $RPM_BUILD_ROOT/sbin/conf.d/SuSEconfig.%{name} sed -e 's;@lib@;%{_lib};g' \ -e 's;@conf_backup_dir@;%{conf_backup_dir};' \ -e 's;@daemon_directory@;%{pf_daemon_directory};' \ @@ -191,25 +255,27 @@ sed -e 's;@lib@;%{_lib};g' \ -e 's;@manpage_directory@;%{_mandir};' \ -e 's;@newaliases_path@;%{pf_newaliases_path};' \ -e 's;@sample_directory@;%{pf_sample_directory};' \ - -e 's;@mailq_path@;%{pf_mailq_path};' postfix-SuSE/SuSEconfig.postfix \ - > $RPM_BUILD_ROOT/sbin/conf.d/SuSEconfig.postfix -chmod 755 $RPM_BUILD_ROOT/sbin/conf.d/SuSEconfig.postfix -install -m 644 postfix-SuSE/master.cf $RPM_BUILD_ROOT/etc/postfix/master.cf -install -m 644 postfix-SuSE/dynamicmaps.cf $RPM_BUILD_ROOT/etc/postfix/dynamicmaps.cf -install -m 644 postfix-SuSE/permissions $RPM_BUILD_ROOT/etc/permissions.d/postfix -install -m 644 postfix-SuSE/sender_canonical $RPM_BUILD_ROOT/etc/postfix/sender_canonical -install -m 644 postfix-SuSE/relay_ccerts $RPM_BUILD_ROOT/etc/postfix/relay_ccerts -install -m 600 postfix-SuSE/sasl_passwd $RPM_BUILD_ROOT/etc/postfix/sasl_passwd + -e 's;@mailq_path@;%{pf_mailq_path};' %{name}-SuSE/SuSEconfig.%{name} \ + > $RPM_BUILD_ROOT/sbin/conf.d/SuSEconfig.%{name} +chmod 755 $RPM_BUILD_ROOT/sbin/conf.d/SuSEconfig.%{name} +install -m 644 %{name}-SuSE/master.cf $RPM_BUILD_ROOT/etc/%{name}/master.cf +install -m 644 %{name}-SuSE/dynamicmaps.cf $RPM_BUILD_ROOT/etc/%{name}/dynamicmaps.cf +install -m 644 %{name}-SuSE/helo_access $RPM_BUILD_ROOT/etc/postfix/helo_access +install -m 644 %{name}-SuSE/permissions $RPM_BUILD_ROOT/etc/permissions.d/%{name} +install -m 644 %{name}-SuSE/sender_canonical $RPM_BUILD_ROOT/etc/%{name}/sender_canonical +install -m 644 %{name}-SuSE/relay $RPM_BUILD_ROOT/etc/postfix/relay +install -m 644 %{name}-SuSE/relay_ccerts $RPM_BUILD_ROOT/etc/%{name}/relay_ccerts +install -m 600 %{name}-SuSE/sasl_passwd $RPM_BUILD_ROOT/etc/%{name}/sasl_passwd mkdir -p $RPM_BUILD_ROOT/etc/sasl2 -install -m 600 postfix-SuSE/smtpd.conf $RPM_BUILD_ROOT/etc/sasl2/smtpd.conf -install -m 644 postfix-SuSE/openssl_postfix.conf.in $RPM_BUILD_ROOT/etc/postfix/openssl_postfix.conf.in -install -m 755 postfix-SuSE/mkpostfixcert $RPM_BUILD_ROOT/usr/sbin/mkpostfixcert +install -m 600 %{name}-SuSE/smtpd.conf $RPM_BUILD_ROOT/etc/sasl2/smtpd.conf +install -m 644 %{name}-SuSE/openssl_%{name}.conf.in $RPM_BUILD_ROOT/etc/%{name}/openssl_%{name}.conf.in +install -m 755 %{name}-SuSE/mk%{name}cert $RPM_BUILD_ROOT/usr/sbin/mk%{name}cert rm -rf $RPM_BUILD_ROOT/%{pf_queue_directory} -install -m 644 postfix-SuSE/master.cf $RPM_BUILD_ROOT/%{conf_backup_dir}/master.cf +install -m 644 %{name}-SuSE/master.cf $RPM_BUILD_ROOT/%{conf_backup_dir}/master.cf mkdir -p $RPM_BUILD_ROOT/%{omc_dir} -install -m 644 postfix-SuSE/postfix.xml $RPM_BUILD_ROOT/%{omc_dir} +install -m 644 %{name}-SuSE/%{name}.xml $RPM_BUILD_ROOT/%{omc_dir} mkdir -p $RPM_BUILD_ROOT/etc/sysconfig/SuSEfirewall2.d/services/ -install -m 644 postfix-SuSE/postfix-fw $RPM_BUILD_ROOT/etc/sysconfig/SuSEfirewall2.d/services/postfix +install -m 644 %{name}-SuSE/%{name}-fw $RPM_BUILD_ROOT/etc/sysconfig/SuSEfirewall2.d/services/%{name} { cat< $RPM_BUILD_ROOT/etc/postfix/main.cf -$RPM_BUILD_ROOT/usr/sbin/postconf -c $RPM_BUILD_ROOT/etc/postfix \ +} > $RPM_BUILD_ROOT/etc/%{name}/main.cf +$RPM_BUILD_ROOT/usr/sbin/postconf -c $RPM_BUILD_ROOT/etc/%{name} \ -e "manpage_directory = %{_mandir}" \ "setgid_group = %{pf_setgid_group}" \ "mailq_path = %{pf_mailq_path}" \ @@ -235,7 +301,7 @@ $RPM_BUILD_ROOT/usr/sbin/postconf -c $RPM_BUILD_ROOT/etc/postfix \ "daemon_directory = %{pf_daemon_directory}" \ "biff = no" \ "inet_protocols = all" -install -m 644 $RPM_BUILD_ROOT/etc/postfix/main.cf $RPM_BUILD_ROOT/%{conf_backup_dir}/main.cf +install -m 644 $RPM_BUILD_ROOT/etc/%{name}/main.cf $RPM_BUILD_ROOT/%{conf_backup_dir}/main.cf # ----------------------------------------------------------------------- # preparing /etc/postfix/postfix-files to be able to use postfix # own upgrade script. Unfortunately it looks in postfix-files and @@ -244,17 +310,17 @@ install -m 644 $RPM_BUILD_ROOT/etc/postfix/main.cf $RPM_BUILD_ROOT/%{conf_backup # also remove the both sql dictionary libs as they will not be installed # per default # ----------------------------------------------------------------------- -rm -f $RPM_BUILD_ROOT/etc/postfix/aliases -rm -f $RPM_BUILD_ROOT/etc/postfix/postfix-files -sed 's;^$config_directory/aliases\(.*\);/etc/aliases\1;' conf/postfix-files \ - | grep -v '^$manpage_directory' | grep -Ev 'dict_(mysql|pgsql)' > $RPM_BUILD_ROOT/etc/postfix/postfix-files +rm -f $RPM_BUILD_ROOT/etc/%{name}/aliases +rm -f $RPM_BUILD_ROOT/etc/%{name}/%{name}-files +sed 's;^$config_directory/aliases\(.*\);/etc/aliases\1;' conf/%{name}-files \ + | grep -v '^$manpage_directory' | grep -Ev 'dict_(mysql|pgsql)' > $RPM_BUILD_ROOT/etc/%{name}/%{name}-files rm -f %{postfixfiles} -test -f conf/postfix-files || { - echo "conf/postfix-files does not exist!" +test -f conf/%{name}-files || { + echo "conf/%{name}-files does not exist!" exit 1 } echo "%defattr(-,root,root)" >> %{postfixfiles} -exec > %{postfixfiles} mkdir -m $mode -p $RPM_BUILD_ROOT/$path - printf '%%-38s %%-18s %%04d\n' $path "${owner}.${group}" $mode >> $RPM_BUILD_ROOT/etc/permissions.d/postfix + printf '%%-38s %%-18s %%04d\n' $path "${owner}.${group}" $mode >> $RPM_BUILD_ROOT/etc/permissions.d/%{name} ;; \$command_directory/*) path=${path/\$command_directory/\/usr\/sbin} group=${group/-/root} echo "%attr($mode,$owner,$group) $path" >> %{postfixfiles} - printf '%%-38s %%-18s %%04d\n' $path "${owner}.${group}" $mode >> $RPM_BUILD_ROOT/etc/permissions.d/postfix + printf '%%-38s %%-18s %%04d\n' $path "${owner}.${group}" $mode >> $RPM_BUILD_ROOT/etc/permissions.d/%{name} ;; *) continue;; esac done +# postfix-mysql +install -m 644 %{name}-mysql/main.cf-mysql $RPM_BUILD_ROOT/etc/%{name}/main.cf-mysql +install -m 640 %{name}-mysql/*_maps.cf $RPM_BUILD_ROOT/etc/%{name}/ # create paranoid permissions file -printf '%%-38s %%-18s %%s\n' /usr/sbin/postdrop "root.%{pf_setgid_group}" "0755" >> $RPM_BUILD_ROOT/etc/permissions.d/postfix.paranoid -printf '%%-38s %%-18s %%s\n' /usr/sbin/postqueue "root.%{pf_setgid_group}" "0755" >> $RPM_BUILD_ROOT/etc/permissions.d/postfix.paranoid -install -m 644 include/*.h $RPM_BUILD_ROOT/usr/include/postfix/ +printf '%%-38s %%-18s %%s\n' /usr/sbin/postdrop "root.%{pf_setgid_group}" "0755" >> $RPM_BUILD_ROOT/etc/permissions.d/%{name}.paranoid +printf '%%-38s %%-18s %%s\n' /usr/sbin/postqueue "root.%{pf_setgid_group}" "0755" >> $RPM_BUILD_ROOT/etc/permissions.d/%{name}.paranoid +install -m 644 include/*.h $RPM_BUILD_ROOT/usr/include/%{name}/ +# some rpmlint stuff +# remove unneeded examples/chroot-setup +for example in AIX42 BSDI* F* HPUX* IRIX* NETBSD1 NEXTSTEP3 OPENSTEP4 OSF1 Solaris*; do + %{__rm} examples/chroot-setup/${example} +done +# files-duplicate /usr/share/doc/packages/postfix-doc/html/ +# so we copy all docs to a postfix-doc to do fdupes :) +%{__install} -d $RPM_BUILD_ROOT%{pf_docdir}/html +for doc in AAAREADME COMPATIBILITY COPYRIGHT HISTORY INSTALL IPv6-ChangeLog LICENSE PORTING RELEASE_NOTES* US_PATENT_6321267 TLS_LICENSE README_FILES auxiliary examples html %{name}-SuSE/README.SuSE %{name}-SuSE/SPAMASSASSIN+POSTFIX.SuSE; do + %{__cp} -rv ${doc} $RPM_BUILD_ROOT%{pf_docdir}/ +done +%if 0%{?suse_version} >= 1100 +%fdupes $RPM_BUILD_ROOT%{pf_docdir} +# files-duplicate /usr/share/man/man? +%fdupes $RPM_BUILD_ROOT%{_mandir} +%endif +# --------------------------------------------------------------------------- %pre VERSIONTEST=$(test -x usr/sbin/postconf && usr/sbin/postconf proxy_read_maps 2>/dev/null) if [ -z "$VERSIONTEST" -a -f %{pf_queue_directory}/pid/master.pid ]; then - if checkproc -p %{pf_queue_directory}/pid/master.pid usr/lib/postfix/master; then - echo "postfix is still running. You have to stop postfix in order to" + if checkproc -p %{pf_queue_directory}/pid/master.pid usr/lib/%{name}/master; then + echo "%{name} is still running. You have to stop %{name} in order to" echo "install a newer version." exit 1 fi fi -/usr/sbin/groupadd -g %{postfix_gid} -o -r postfix 2> /dev/null || : +/usr/sbin/groupadd -g %{pf_gid} -o -r %{name} 2> /dev/null || : /usr/sbin/groupadd -g %{maildrop_gid} -o -r maildrop 2> /dev/null || : -/usr/sbin/useradd -r -o -g postfix -u %{postfix_uid} -s /bin/false -c "Postfix Daemon" -d /%{pf_queue_directory} postfix 2> /dev/null || : +/usr/sbin/useradd -r -o -g %{name} -u %{pf_uid} -s /bin/false -c "Postfix Daemon" -d /%{pf_queue_directory} %{name} 2> /dev/null || : +# --------------------------------------------------------------------------- + +%pre mysql +#echo "PARAM_pre: "$1 +# on `rpm -ivh` PARAM is 1 +# on `rpm -Uvh` PARAM is 2 +if [ "$1" = "1" ]; then + echo "Adding %{vmusr} user" + if [ -z "`%{_bindir}/getent group %{vmusr} 2>/dev/null`" ]; then + %{_sbindir}/groupadd -r -g %{vmgid} %{vmusr} + fi + if [ -z "`%{_bindir}/getent passwd %{vmusr} 2>/dev/null`" ]; then + %{_sbindir}/useradd -c "maildirs chef" -d %{vmdir} -g %{vmusr} -u %{vmid} -r -s /bin/false %{vmusr} + fi +fi +# --------------------------------------------------------------------------- %preun -%stop_on_removal postfix +%stop_on_removal %{name} +# --------------------------------------------------------------------------- -%post -%{fillup_and_insserv -y postfix} -# We never have to run suseconfig for postfix after installation -# We only start postfix own upgrade-configuration by update -if [ ${1:-0} -gt 1 ]; then - echo "executing upgrade-configuration" - /usr/sbin/postfix set-permissions upgrade-configuration setgid_group=%{pf_setgid_group} -fi - -%postun -%restart_on_update postfix -%insserv_cleanup -ldconfig - -%clean -#rm -rf $RPM_BUILD_ROOT - -%post postgresql -FILE=etc/postfix/dynamicmaps.cf -if ! grep -q "^pgsql[[:space:]]" ${FILE}; then - echo "Adding pgsql map entry to ${FILE}" - echo "pgsql /usr/lib/postfix/dict_pgsql.so dict_pgsql_open" >> ${FILE} -fi - -%post mysql -FILE=etc/postfix/dynamicmaps.cf -if ! grep -q "^mysql[[:space:]]" ${FILE}; then - echo "Adding mysql map entry to ${FILE}" - echo "mysql /usr/lib/postfix/dict_mysql.so dict_mysql_open" >> ${FILE} +%preun mysql +#echo "PARAM_preun: "$1 +# on `rpm -e` PARAM is 0 +if [ "$1" = "0" ]; then + FILE=etc/%{name}/dynamicmaps.cf + if [ -e "$FILE" ] ; then + if grep -q "^mysql[[:space:]]" ${FILE}; then + echo "Removing mysql map entry from ${FILE}" + sed "/^mysql[[:space:]]/d" ${FILE} > ${FILE}.$$ && \ + cp --remove-destination ${FILE}.$$ ${FILE} && \ + rm ${FILE}.$$ + fi + else + echo "Can not find \"$FILE\". Not updating the file." >&2 + fi + echo "Removing %{vmusr} user" + userdel %{vmusr} 2> /dev/null + groupdel %{vmusr} 2> /dev/null fi +# --------------------------------------------------------------------------- %preun postgresql if [ "$1" = 0 ] ; then - FILE=etc/postfix/dynamicmaps.cf + FILE=etc/%{name}/dynamicmaps.cf if [ -e "$FILE" ] ; then if grep -q "^pgsql[[:space:]]" ${FILE}; then echo "Removing pgsql map entry from ${FILE}" @@ -341,150 +434,127 @@ if [ "$1" = 0 ] ; then echo "Can not find \"$FILE\". Not updating the file." >&2 fi fi +# --------------------------------------------------------------------------- -%preun mysql -if [ "$1" = 0 ] ; then - FILE=etc/postfix/dynamicmaps.cf - if [ -e "$FILE" ] ; then - if grep -q "^mysql[[:space:]]" ${FILE}; then - echo "Removing mysql map entry from ${FILE}" - sed "/^mysql[[:space:]]/d" ${FILE} > ${FILE}.$$ && \ - cp --remove-destination ${FILE}.$$ ${FILE} && \ - rm ${FILE}.$$ - fi - else - echo "Can not find \"$FILE\". Not updating the file." >&2 - fi +%post +%{fillup_and_insserv -y postfix} +# We never have to run suseconfig for postfix after installation +# We only start postfix own upgrade-configuration by update +if [ ${1:-0} -gt 1 ]; then + echo "executing upgrade-configuration" + /usr/sbin/%{name} set-permissions upgrade-configuration setgid_group=%{pf_setgid_group} + #New map in 11.2 #TODO remove it later + . /etc/sysconfig/postfix + sed -i "s/^POSTFIX_MAP_LIST=.*/POSTFIX_MAP_LIST=\"$POSTFIX_MAP_LIST relay\"/" /etc/sysconfig/postfix fi +ldconfig +# --------------------------------------------------------------------------- -%files postgresql -%defattr(-,root,root) -/usr/lib/postfix/dict_pgsql.so +%postun +%restart_on_update %{name} +%insserv_cleanup +ldconfig +# --------------------------------------------------------------------------- -%files mysql -%defattr(-,root,root) -/usr/lib/postfix/dict_mysql.so +%post postgresql +FILE=etc/%{name}/dynamicmaps.cf +if ! grep -q "^pgsql[[:space:]]" ${FILE}; then + echo "Adding pgsql map entry to ${FILE}" + echo "pgsql /usr/lib/%{name}/dict_pgsql.so dict_pgsql_open" >> ${FILE} +fi +# --------------------------------------------------------------------------- -%files devel -%defattr(-,root,root) -/usr/include/postfix/ +%post mysql +FILE=etc/%{name}/dynamicmaps.cf +if ! grep -q "^mysql[[:space:]]" ${FILE}; then + echo "Adding mysql map entry to ${FILE}" + echo "mysql /usr/lib/%{name}/dict_mysql.so dict_mysql_open" >> ${FILE} +fi +# --------------------------------------------------------------------------- -%files doc -%defattr(-,root,root) -%doc AAAREADME COMPATIBILITY COPYRIGHT HISTORY INSTALL IPv6-ChangeLog LICENSE -%doc PORTING RELEASE_NOTES* US_PATENT_6321267 TLS_LICENSE -%doc README_FILES examples html auxiliary -%doc postfix-SuSE/README.SuSE -%doc postfix-SuSE/SPAMASSASSIN+POSTFIX.SuSE +%clean +rm -rf $RPM_BUILD_ROOT %files -f %{postfixfiles} %defattr(-,root,root) %config /etc/pam.d/* -/var/adm/fillup-templates/sysconfig.postfix -/var/adm/fillup-templates/sysconfig.mail-postfix -/sbin/conf.d/SuSEconfig.postfix -%config(noreplace) %{omc_dir}/postfix.xml -%dir /etc/postfix -%config(noreplace) /etc/postfix/access -%config(noreplace) /etc/postfix/generic -%config(noreplace) /etc/postfix/canonical -#%config(noreplace) /etc/postfix/cidr_table -%config(noreplace) /etc/postfix/main.cf -%config /etc/postfix/main.cf.default -%config(noreplace) /etc/postfix/master.cf -%config(noreplace) /etc/postfix/openssl_postfix.conf.in -%config(noreplace) /etc/postfix/relocated -%config(noreplace) /etc/postfix/transport -%config(noreplace) /etc/postfix/virtual -%config(noreplace) /etc/postfix/sasl_passwd -%config(noreplace) /etc/postfix/sender_canonical -#%config(noreplace) /etc/postfix/tcp_table -#%config(noreplace) /etc/postfix/pcre_table -#%config(noreplace) /etc/postfix/regexp_table -%config(noreplace) /etc/postfix/relay_ccerts -%config(noreplace) /etc/postfix/header_checks -%config(noreplace) /etc/postfix/bounce.cf.default -%config(noreplace) /etc/postfix/dynamicmaps.cf -%config /etc/sysconfig/SuSEfirewall2.d/services/postfix +/var/adm/fillup-templates/sysconfig.%{name} +/var/adm/fillup-templates/sysconfig.mail-%{name} +/sbin/conf.d/SuSEconfig.%{name} +%config(noreplace) %{omc_dir}/%{name}.xml +%dir /etc/%{name} +%config(noreplace) /etc/%{name}/access +%config(noreplace) /etc/%{name}/generic +%config(noreplace) /etc/%{name}/helo_access +%config(noreplace) /etc/%{name}/canonical +#%config(noreplace) /etc/%{name}/cidr_table +%config(noreplace) /etc/%{name}/main.cf +%config /etc/%{name}/main.cf.default +%config(noreplace) /etc/%{name}/master.cf +%config(noreplace) /etc/%{name}/openssl_%{name}.conf.in +%config(noreplace) /etc/%{name}/relocated +%config(noreplace) /etc/%{name}/transport +%config(noreplace) /etc/%{name}/virtual +%config(noreplace) /etc/%{name}/sasl_passwd +%config(noreplace) /etc/%{name}/sender_canonical +#%config(noreplace) /etc/%{name}/tcp_table +#%config(noreplace) /etc/%{name}/pcre_table +#%config(noreplace) /etc/%{name}/regexp_table +%config(noreplace) /etc/%{name}/relay +%config(noreplace) /etc/%{name}/relay_ccerts +%config(noreplace) /etc/%{name}/header_checks +%config(noreplace) /etc/%{name}/bounce.cf.default +%config(noreplace) /etc/%{name}/dynamicmaps.cf +%config /etc/sysconfig/SuSEfirewall2.d/services/%{name} %dir /etc/sasl2/ %config(noreplace) /etc/sasl2/smtpd.conf -%config /etc/postfix/LICENSE +%config /etc/%{name}/LICENSE %if %{usetls} -%config /etc/postfix/TLS_LICENSE +%config /etc/%{name}/TLS_LICENSE %endif -%config /etc/permissions.d/postfix -%config /etc/permissions.d/postfix.paranoid -%attr(0644, root, root) /etc/postfix/makedefs.out -%attr(0755, root, root) /etc/postfix/postfix-script -%attr(0755, root, root) /etc/postfix/post-install -%attr(0644, root, root) /etc/postfix/postfix-files -%config %attr(0755,root,root) /etc/init.d/postfix +%config /etc/permissions.d/%{name} +%config /etc/permissions.d/%{name}.paranoid +%attr(0644, root, root) %config /etc/%{name}/makedefs.out +%attr(0644, root, root) %config /etc/%{name}/%{name}-files +/usr/lib/%{name}/%{name}-files +%config %attr(0755,root,root) /etc/init.d/%{name} /usr/bin/mailq /usr/bin/newaliases %attr(0755, root, root) /usr/sbin/sendmail /usr/sbin/qmqp-source /usr/sbin/smtp-sink /usr/sbin/smtp-source -/usr/sbin/mkpostfixcert -/sbin/rcpostfix +/usr/sbin/mk%{name}cert +/sbin/rc%{name} %{_libdir}/lib* /usr/lib/sendmail -%dir /usr/lib/postfix -/usr/lib/postfix/*[^.so] -/usr/lib/postfix/dict_ldap.so -/usr/lib/postfix/dict_pcre.so -/usr/lib/postfix/dict_tcp.so +%dir /usr/lib/%{name} +/usr/lib/%{name}/*[^.so] +/usr/lib/%{name}/dict_ldap.so +/usr/lib/%{name}/dict_pcre.so +/usr/lib/%{name}/dict_tcp.so %{conf_backup_dir} -%dir %attr(0700,postfix,root) %{pf_data_directory} +%dir %attr(0700,%{name},root) %{pf_data_directory} %{_mandir}/man?/*.gz -%description -Postfix aims to be an alternative to the widely-used sendmail program. +%files devel +%defattr(-,root,root) +/usr/include/%{name}/ +%files doc +%defattr(0644,root,root,0755) +%dir %{pf_docdir}/ +%{pf_docdir}/ +%files mysql +%defattr(-,root,root) +%doc %{name}-mysql/%{name}-mysql.sql +%config(noreplace) %attr(640, root, %{name}) /etc/%{name}/*_maps.cf +%config(noreplace) /etc/%{name}/main.cf-mysql +/usr/lib/%{name}/dict_mysql.so -Authors: --------- - Wietse Venema - -%description mysql -Postfix plugin to support MySQL maps. This library will be loaded by -starting postfix if you'll access a postmap which is stored in mysql. - - - -Authors: --------- - Wietse Venema - -%description postgresql -Postfix plugin to support PostgreSQL maps. This library will be loaded -by starting postfix if you'll access a postmap which is stored in -PostgreSQL. - - - -Authors: --------- - Wietse Venema - -%description devel -Postfix aims to be an alternative to the widely-used sendmail program. - - - -Authors: --------- - Wietse Venema - -%description doc -Postfix aims to be an alternative to the widely-used sendmail program. -This package contains the documentation for postfix - - - -Authors: --------- - Wietse Venema +%files postgresql +%defattr(-,root,root) +/usr/lib/%{name}/dict_pgsql.so %changelog diff --git a/rpmlintrc b/rpmlintrc new file mode 100644 index 0000000..7bf645d --- /dev/null +++ b/rpmlintrc @@ -0,0 +1,4 @@ +addFilter("executable-sourced-script .*/sbin/conf.d/SuSEconfig.postfix") +addFilter("sourced-script-with-shebang .*/sbin/conf.d/SuSEconfig.postfix") +addFilter("devel-file-in-non-devel-package .*/usr/lib/libpostfix*.so") +addFilter("devel-file-in-non-devel-package .*/usr/lib64/libpostfix*.so")