head 1.20; access; symbols OPENPKG_E1_MP_HEAD:1.13 OPENPKG_E1_MP:1.13 OPENPKG_E1_MP_2_STABLE:1.10.2.1 OPENPKG_E1_FP:1.10.2.1 OPENPKG_2_STABLE_MP:1.13 OPENPKG_2_STABLE_20061018:1.10.2.1 OPENPKG_2_STABLE_20060622:1.10 OPENPKG_2_STABLE:1.10.0.2 OPENPKG_2_STABLE_BP:1.10 OPENPKG_2_5_RELEASE:1.8 OPENPKG_2_5_SOLID:1.8.0.2 OPENPKG_2_5_SOLID_BP:1.8 OPENPKG_2_4_RELEASE:1.7 OPENPKG_2_4_SOLID:1.7.0.2 OPENPKG_2_4_SOLID_BP:1.7 OPENPKG_CW_FP:1.7 OPENPKG_2_3_RELEASE:1.6 OPENPKG_2_3_SOLID:1.6.0.2 OPENPKG_2_3_SOLID_BP:1.6 OPENPKG_2_2_RELEASE:1.4 OPENPKG_2_2_SOLID:1.4.0.4 OPENPKG_2_2_SOLID_BP:1.4 OPENPKG_2_1_RELEASE:1.4 OPENPKG_2_1_SOLID:1.4.0.2 OPENPKG_2_1_SOLID_BP:1.4 OPENPKG_2_0_RELEASE:1.3 OPENPKG_2_0_SOLID:1.3.0.2 OPENPKG_2_0_SOLID_BP:1.3 OPENPKG_1_3_RELEASE:1.2.2.1 OPENPKG_1_3_SOLID:1.2.2.1.0.2 OPENPKG_1_3_SOLID_BP:1.2.2.1 OPENPKG_1_STABLE:1.2.0.2 OPENPKG_1_STABLE_MP:1.2; locks; strict; comment @# @; 1.20 date 2009.07.15.18.19.57; author rse; state Exp; branches; next 1.19; commitid ZxBTjJWTtXNRVPVt; 1.19 date 2009.07.13.18.02.10; author rse; state Exp; branches; next 1.18; commitid X3Oe6x3hQkdKTzVt; 1.18 date 2009.05.12.07.31.19; author rse; state Exp; branches; next 1.17; commitid yEQWYATu67JToyNt; 1.17 date 2009.01.04.10.17.29; author rse; state Exp; branches; next 1.16; commitid r0eJiGABWzPZq7xt; 1.16 date 2008.01.25.09.28.01; author rse; state Exp; branches; next 1.15; commitid meapyz2DMlRzfMOs; 1.15 date 2007.12.13.17.44.14; author rse; state Exp; branches; next 1.14; commitid HOSgT7KeuDkvniJs; 1.14 date 2007.03.29.09.53.14; author rse; state Exp; branches; next 1.13; commitid yRsW1EJ4uG456Ybs; 1.13 date 2006.11.02.16.22.36; author rse; state Exp; branches; next 1.12; commitid fWOkf2hqewfCY6Tr; 1.12 date 2006.08.26.07.30.50; author rse; state Exp; branches; next 1.11; commitid EtYT1nxp2z9HdkKr; 1.11 date 2006.07.14.08.01.07; author thl; state Exp; branches; next 1.10; commitid 3e4tHTWn6VOMLNEr; 1.10 date 2006.02.22.19.04.01; author rse; state Exp; branches 1.10.2.1; next 1.9; commitid p12Q1m72pOTa0Cmr; 1.9 date 2006.01.04.08.41.21; author rse; state Exp; branches; next 1.8; commitid 5enHkIwbEODe8ggr; 1.8 date 2005.09.23.12.37.04; author rse; state Exp; branches; next 1.7; 1.7 date 2005.03.11.09.50.35; author rse; state Exp; branches; next 1.6; 1.6 date 2005.02.06.13.05.57; author rse; state Exp; branches; next 1.5; 1.5 date 2004.12.17.10.47.40; author thl; state Exp; branches; next 1.4; 1.4 date 2004.04.23.07.35.28; author rse; state Exp; branches; next 1.3; 1.3 date 2003.10.28.10.42.16; author thl; state Exp; branches; next 1.2; 1.2 date 2003.07.22.14.19.09; author rse; state Exp; branches 1.2.2.1; next 1.1; 1.1 date 2003.04.02.15.59.59; author mlelstv; state Exp; branches; next ; 1.10.2.1 date 2006.10.16.14.54.56; author rse; state Exp; branches; next 1.10.2.2; commitid iZxwRSmmWscPXUQr; 1.10.2.2 date 2006.11.27.11.16.47; author rse; state Exp; branches; next ; commitid ND13XKfBnp9StiWr; 1.2.2.1 date 2003.07.24.20.45.04; author rse; state Exp; branches 1.2.2.1.2.1; next ; 1.2.2.1.2.1 date 2003.11.25.16.57.55; author thl; state Exp; branches; next ; desc @@ 1.20 log @FreeBSD 7 now also receives closefrom(2) @ text @Index: makedefs --- makedefs.orig 2009-05-11 23:26:46 +0200 +++ makedefs 2009-07-13 19:43:04 +0200 @@@@ -144,6 +144,8 @@@@ ;; FreeBSD.7*) SYSTYPE=FREEBSD7 ;; + FreeBSD.8*) SYSTYPE=FREEBSD8 + ;; OpenBSD.2*) SYSTYPE=OPENBSD2 ;; OpenBSD.3*) SYSTYPE=OPENBSD3 Index: src/util/file_limit.c --- src/util/file_limit.c.orig 2003-10-22 20:48:36 +0200 +++ src/util/file_limit.c 2009-07-13 19:43:04 +0200 @@@@ -80,12 +80,21 @@@@ void set_file_limit(off_t limit) { #ifdef USE_ULIMIT +#ifdef USE_SOFTLIMITONLY +#error "USE_ULIMIT and USE_SOFTLIMITONLY are mutual exclusive" +#endif if (ulimit(UL_SETFSIZE, limit / ULIMIT_BLOCK_SIZE) < 0) msg_fatal("ulimit: %m"); #else struct rlimit rlim; +#ifdef USE_SOFTLIMITONLY + if (getrlimit(RLIMIT_FSIZE, &rlim) < 0) + rlim.rlim_max = RLIM_INFINITY; + rlim.rlim_cur = limit; +#else rlim.rlim_cur = rlim.rlim_max = limit; +#endif if (setrlimit(RLIMIT_FSIZE, &rlim) < 0) msg_fatal("setrlimit: %m"); #ifdef SIGXFSZ Index: src/util/msg_syslog.c --- src/util/msg_syslog.c.orig 2006-06-15 20:07:16 +0200 +++ src/util/msg_syslog.c 2009-07-13 19:43:04 +0200 @@@@ -50,6 +50,11 @@@@ #include #include #include +#ifdef USE_SOFTLIMITONLY +#include +#include +#include +#endif /* Application-specific. */ @@@@ -144,6 +149,9 @@@@ static void msg_syslog_print(int level, const char *text) { +#ifdef USE_SOFTLIMITONLY + struct rlimit save, rlim; +#endif static int log_level[] = { LOG_INFO, LOG_WARNING, LOG_ERR, LOG_CRIT, LOG_CRIT, }; @@@@ -154,6 +162,15 @@@@ if (level < 0 || level >= (int) (sizeof(log_level) / sizeof(log_level[0]))) msg_panic("msg_syslog_print: invalid severity level: %d", level); +#ifdef USE_SOFTLIMITONLY + if (getrlimit(RLIMIT_FSIZE, &save) < 0) { + save.rlim_cur = RLIM_INFINITY; + save.rlim_max = RLIM_INFINITY; + } + rlim.rlim_cur = save.rlim_max; + rlim.rlim_max = save.rlim_max; + (void)setrlimit(RLIMIT_FSIZE, &rlim); +#endif if (level == MSG_INFO) { syslog(syslog_facility | log_level[level], "%.*s", (int) MSG_SYSLOG_RECLEN, text); @@@@ -161,6 +178,9 @@@@ syslog(syslog_facility | log_level[level], "%s: %.*s", severity_name[level], (int) MSG_SYSLOG_RECLEN, text); } +#ifdef USE_SOFTLIMITONLY + (void)setrlimit(RLIMIT_FSIZE, &save); +#endif } /* msg_syslog_init - initialize */ Index: src/util/sys_defs.h --- src/util/sys_defs.h.orig 2009-05-11 02:45:27 +0200 +++ src/util/sys_defs.h 2009-07-13 19:43:55 +0200 @@@@ -24,7 +24,7 @@@@ * 4.4BSD and close derivatives. */ #if defined(FREEBSD2) || defined(FREEBSD3) || defined(FREEBSD4) \ - || defined(FREEBSD5) || defined(FREEBSD6) || defined(FREEBSD7) \ + || defined(FREEBSD5) || defined(FREEBSD6) || defined(FREEBSD7) || defined(FREEBSD8) \ || defined(BSDI2) || defined(BSDI3) || defined(BSDI4) \ || defined(OPENBSD2) || defined(OPENBSD3) || defined(OPENBSD4) \ || defined(NETBSD1) || defined(NETBSD2) || defined(NETBSD3) \ @@@@ -110,6 +110,10 @@@@ #define HAS_DUPLEX_PIPE /* 4.1 breaks with kqueue(2) */ #endif +#if (__FreeBSD_version < 800000 && __FreeBSD_version >= 702104) || (__FreeBSD_version >= 800100) +#define HAS_CLOSEFROM +#endif + /* OpenBSD version is year+month */ #if OpenBSD >= 199805 /* XXX */ @ 1.19 log @apply FreeBSD 8 patch and remove obsolete vstream related patch @ text @d105 1 a105 1 +#if __FreeBSD_version >= 800100 @ 1.18 log @upgrading package: postfix 2.5.6 -> 2.6.0 @ text @d3 1 a3 1 +++ makedefs 2009-05-12 09:08:00 +0200 a12 13 Index: src/smtp/smtp_reuse.c --- src/smtp/smtp_reuse.c.orig 2008-12-04 01:06:42 +0100 +++ src/smtp/smtp_reuse.c 2009-05-12 09:07:29 +0200 @@@@ -216,7 +216,9 @@@@ /* * Avoid poor performance when TCP MSS > VSTREAM_BUFSIZE. */ +#if 0 vstream_tweak_sock(session->stream); +#endif /* * Update the list of used cached addresses. d15 1 a15 1 +++ src/util/file_limit.c 2009-05-12 08:58:45 +0200 d40 1 a40 1 +++ src/util/msg_syslog.c 2009-05-12 08:58:45 +0200 d91 1 a91 1 +++ src/util/sys_defs.h 2009-05-12 08:58:45 +0200 d101 11 @ 1.17 log @upgrading package: postfix 2.5.5 -> 2.5.6 @ text @d2 3 a4 3 --- makedefs.orig 2008-01-15 21:20:24 +0100 +++ makedefs 2008-01-24 12:31:48 +0100 @@@@ -132,6 +132,10 @@@@ a7 2 + FreeBSD.7*) SYSTYPE=FREEBSD7 + ;; d13 13 d28 1 a28 1 +++ src/util/file_limit.c 2008-01-24 12:31:48 +0100 d53 1 a53 1 +++ src/util/msg_syslog.c 2008-01-24 12:31:48 +0100 d103 2 a104 2 --- src/util/sys_defs.h.orig 2008-01-15 01:51:44 +0100 +++ src/util/sys_defs.h 2008-01-24 12:32:41 +0100 a113 13 Index: src/smtp/smtp_reuse.c --- src/smtp/smtp_reuse.c.orig 2008-12-04 01:06:42 +0100 +++ src/smtp/smtp_reuse.c 2009-01-04 11:11:45 +0100 @@@@ -216,7 +216,9 @@@@ /* * Avoid poor performance when TCP MSS > VSTREAM_BUFSIZE. */ +#if 0 vstream_tweak_sock(stream); +#endif /* * Update the list of used cached addresses. @ 1.16 log @upgrading package: postfix 2.4.6 -> 2.5.0 @ text @d103 13 @ 1.15 log @support FreeBSD 8-CURRENT @ text @d2 3 a4 3 --- makedefs.orig 2007-03-24 14:30:18 +0100 +++ makedefs 2007-12-13 18:42:19 +0100 @@@@ -130,6 +130,10 @@@@ d6 1 a6 1 FreeBSD.6*) SYSTYPE=FREEBSD6 d17 1 a17 1 +++ src/util/file_limit.c 2007-12-13 18:41:59 +0100 d42 1 a42 1 +++ src/util/msg_syslog.c 2007-12-13 18:41:59 +0100 d92 2 a93 2 --- src/util/sys_defs.h.orig 2007-03-24 23:45:33 +0100 +++ src/util/sys_defs.h 2007-12-13 18:42:42 +0100 d98 1 a98 1 - || defined(FREEBSD5) || defined(FREEBSD6) \ @ 1.14 log @regen patches to apply without offsets @ text @d3 2 a4 2 +++ makedefs 2007-03-29 11:51:18 +0200 @@@@ -130,6 +130,8 @@@@ d10 2 d17 1 a17 1 +++ src/util/file_limit.c 2007-03-29 11:51:18 +0200 d42 1 a42 1 +++ src/util/msg_syslog.c 2007-03-29 11:51:18 +0200 d93 1 a93 1 +++ src/util/sys_defs.h 2007-03-29 11:51:18 +0200 d99 1 a99 1 + || defined(FREEBSD5) || defined(FREEBSD6) || defined(FREEBSD7) \ @ 1.13 log @upgrading package: postfix 2.3.3 -> 2.3.4 @ text @d2 3 a4 3 --- makedefs.orig 2006-08-26 17:54:59 +0200 +++ makedefs 2006-11-02 17:14:40 +0100 @@@@ -118,6 +118,8 @@@@ d15 1 a15 1 +++ src/util/file_limit.c 2006-11-02 17:13:58 +0100 d40 1 a40 1 +++ src/util/msg_syslog.c 2006-11-02 17:13:58 +0100 d90 2 a91 2 --- src/util/sys_defs.h.orig 2006-09-29 00:55:47 +0200 +++ src/util/sys_defs.h 2006-11-02 17:13:58 +0100 @ 1.12 log @upgrading package: postfix 2.3.2 -> 2.3.3 @ text @d2 2 a3 2 --- makedefs.orig 2006-07-31 15:03:31 +0200 +++ makedefs 2006-08-26 09:00:57 +0200 a12 11 @@@@ -132,6 +134,10 @@@@ ;; NetBSD.3*) SYSTYPE=NETBSD3 ;; + NetBSD.3*) SYSTYPE=NETBSD3 + ;; + NetBSD.4*) SYSTYPE=NETBSD4 + ;; BSD/OS.2*) SYSTYPE=BSDI2 ;; BSD/OS.3*) SYSTYPE=BSDI3 d15 1 a15 1 +++ src/util/file_limit.c 2006-08-26 09:00:57 +0200 d40 1 a40 1 +++ src/util/msg_syslog.c 2006-08-26 09:00:57 +0200 d90 3 a92 3 --- src/util/sys_defs.h.orig 2006-07-31 15:04:29 +0200 +++ src/util/sys_defs.h 2006-08-26 09:03:20 +0200 @@@@ -24,10 +24,10 @@@@ d100 1 a100 5 - || defined(NETBSD1) || defined(NETBSD2) || defined(NETBSD3) \ + || defined(NETBSD1) || defined(NETBSD2) || defined(NETBSD3) || defined(NETBSD4) \ || defined(EKKOBSD1) #define SUPPORTED #include @ 1.11 log @upgrading package: postfix 2.2.10 -> 2.3.0 @ text @d2 2 a3 2 --- makedefs.orig 2006-01-03 22:50:25 +0100 +++ makedefs 2006-02-22 20:00:04 +0100 d13 1 a13 1 @@@@ -128,6 +130,10 @@@@ d15 1 a15 1 NetBSD.2*) SYSTYPE=NETBSD2 d26 1 a26 1 +++ src/util/file_limit.c 2006-02-22 19:58:39 +0100 d50 2 a51 2 --- src/util/msg_syslog.c.orig 2005-01-19 02:22:19 +0100 +++ src/util/msg_syslog.c 2006-02-22 19:58:39 +0100 d101 2 a102 2 --- src/util/sys_defs.h.orig 2006-07-03 14:37:32 +0200 +++ src/util/sys_defs.h 2006-07-14 09:52:35 +0200 d110 1 a110 1 || defined(OPENBSD2) || defined(OPENBSD3) \ @ 1.10 log @add NetBSD 3.x/4.x support. Submitted by: anonymous @ text @d101 2 a102 2 --- src/util/sys_defs.h.orig 2006-01-03 22:52:17 +0100 +++ src/util/sys_defs.h 2006-02-22 19:59:21 +0100 d111 1 a111 1 - || defined(NETBSD1) || defined(NETBSD2) \ @ 1.10.2.1 log @Mass merge from CURRENT to 2-STABLE (all packages except those of JUNK class) @ text @d2 2 a3 2 --- makedefs.orig 2006-07-31 15:03:31 +0200 +++ makedefs 2006-08-26 09:00:57 +0200 d13 1 a13 1 @@@@ -132,6 +134,10 @@@@ d15 1 a15 1 NetBSD.3*) SYSTYPE=NETBSD3 d26 1 a26 1 +++ src/util/file_limit.c 2006-08-26 09:00:57 +0200 d50 2 a51 2 --- src/util/msg_syslog.c.orig 2006-06-15 20:07:16 +0200 +++ src/util/msg_syslog.c 2006-08-26 09:00:57 +0200 d101 2 a102 2 --- src/util/sys_defs.h.orig 2006-07-31 15:04:29 +0200 +++ src/util/sys_defs.h 2006-08-26 09:03:20 +0200 d110 2 a111 2 || defined(OPENBSD2) || defined(OPENBSD3) || defined(OPENBSD4) \ - || defined(NETBSD1) || defined(NETBSD2) || defined(NETBSD3) \ @ 1.10.2.2 log @MFC: recent update and fixes @ text @d2 2 a3 2 --- makedefs.orig 2006-08-26 17:54:59 +0200 +++ makedefs 2006-11-02 17:14:40 +0100 d13 11 d26 1 a26 1 +++ src/util/file_limit.c 2006-11-02 17:13:58 +0100 d51 1 a51 1 +++ src/util/msg_syslog.c 2006-11-02 17:13:58 +0100 d101 3 a103 3 --- src/util/sys_defs.h.orig 2006-09-29 00:55:47 +0200 +++ src/util/sys_defs.h 2006-11-02 17:13:58 +0100 @@@@ -24,7 +24,7 @@@@ d111 5 a115 1 || defined(NETBSD1) || defined(NETBSD2) || defined(NETBSD3) \ @ 1.9 log @upgrading package: postfix 2.2.7 -> 2.2.8 @ text @d2 3 a4 3 --- makedefs.orig 2005-02-22 13:35:52 +0100 +++ makedefs 2005-09-23 14:27:15 +0200 @@@@ -116,6 +116,10 @@@@ d6 1 a6 1 FreeBSD.5*) SYSTYPE=FREEBSD5 a7 2 + FreeBSD.6*) SYSTYPE=FREEBSD6 + ;; d13 11 d26 1 a26 1 +++ src/util/file_limit.c 2005-03-11 10:30:43 +0100 d51 1 a51 1 +++ src/util/msg_syslog.c 2005-03-11 10:30:43 +0100 d101 3 a103 3 --- src/util/sys_defs.h.orig 2005-02-04 01:07:44 +0100 +++ src/util/sys_defs.h 2005-03-11 10:30:49 +0100 @@@@ -24,7 +24,7 @@@@ d111 5 a115 1 || defined(NETBSD1) || defined(NETBSD2) \ @ 1.8 log @recognize FreeBSD 7.0-CURRENT @ text @d98 1 a98 1 - || defined(FREEBSD5) \ @ 1.7 log @upgrade to Postfix 2.2 @ text @d3 2 a4 2 +++ makedefs 2005-03-11 10:30:49 +0100 @@@@ -116,6 +116,8 @@@@ d10 2 d99 1 a99 1 + || defined(FREEBSD5) || defined(FREEBSD6) \ @ 1.6 log @regen patches and add FreeBSD 6 support @ text @d1 12 a12 3 https://rt.openpkg.org/Ticket/Display.html?id=285 USE_SOFTLIMITONLY kludge d15 1 a15 1 +++ src/util/file_limit.c 2005-02-06 13:34:59 +0100 d39 2 a40 2 --- src/util/msg_syslog.c.orig 2004-01-04 17:14:58 +0100 +++ src/util/msg_syslog.c 2005-02-06 13:34:59 +0100 a88 91 ----------------------------------------------------------------------------- Steffen Hansen has patched postfix-2.1.5 for making various client information (ip, hostname etc.) available to processes run via the pipe transport. The code has been accepted for postfix-2.2, but depending on how far away from release that is, it might be a good idea to have the patch in OpenPKG. Index: man/man8/pipe.8 --- man/man8/pipe.8.orig 2004-08-09 16:51:07 +0200 +++ man/man8/pipe.8 2005-02-06 13:34:59 +0100 @@@@ -128,6 +128,22 @@@@ and replaced with corresponding information from the Postfix queue manager delivery request: .RS +.IP \fB${\fBclient_address\fR}\fR +This macro expands to the remote client network address. +.sp +This is available in Postfix 2.2 and later. +.IP \fB${\fBclient_helo\fR}\fR +This macro expands to the remote client HELO command parameter. +.sp +This is available in Postfix 2.2 and later. +.IP \fB${\fBclient_hostname\fR}\fR +This macro expands to the remote client hostname. +.sp +This is available in Postfix 2.2 and later. +.IP \fB${\fBclient_protocol\fR}\fR +This macro expands to the remote client protocol. +.sp +This is available in Postfix 2.2 and later. .IP \fB${\fBextension\fR}\fR This macro expands to the extension part of a recipient address. For example, with an address \fIuser+foo@@domain\fR the extension is Index: src/pipe/pipe.c --- src/pipe/pipe.c.orig 2004-07-24 01:09:21 +0200 +++ src/pipe/pipe.c 2005-02-06 13:34:59 +0100 @@@@ -332,6 +332,10 @@@@ #define PIPE_DICT_EXTENSION "extension" /* key */ #define PIPE_DICT_MAILBOX "mailbox" /* key */ #define PIPE_DICT_SIZE "size" /* key */ +#define PIPE_DICT_CLIENT_ADDR "client_address" /* key */ +#define PIPE_DICT_CLIENT_NAME "client_hostname" /* key */ +#define PIPE_DICT_CLIENT_PROTO "client_protocol" /* key */ +#define PIPE_DICT_CLIENT_HELO "client_helo" /* key */ /* * Flags used to pass back the type of special parameter found by @@@@ -412,6 +416,10 @@@@ PIPE_DICT_EXTENSION, PIPE_FLAG_EXTENSION, PIPE_DICT_MAILBOX, PIPE_FLAG_MAILBOX, PIPE_DICT_SIZE, 0, + PIPE_DICT_CLIENT_ADDR, 0, + PIPE_DICT_CLIENT_NAME, 0, + PIPE_DICT_CLIENT_PROTO, 0, + PIPE_DICT_CLIENT_HELO, 0, 0, 0, }; struct cmd_flags *p; @@@@ -954,6 +962,15 @@@@ dict_update(PIPE_DICT_TABLE, PIPE_DICT_SIZE, STR(buf)); vstring_free(buf); + dict_update(PIPE_DICT_TABLE, PIPE_DICT_CLIENT_ADDR, + request->client_addr); + dict_update(PIPE_DICT_TABLE, PIPE_DICT_CLIENT_HELO, + request->client_helo); + dict_update(PIPE_DICT_TABLE, PIPE_DICT_CLIENT_NAME, + request->client_name); + dict_update(PIPE_DICT_TABLE, PIPE_DICT_CLIENT_PROTO, + request->client_proto); + if ((expanded_argv = expand_argv(service, attr.command, rcpt_list, attr.flags)) == 0) { deliver_status = eval_command_status(PIPE_STAT_DEFER, service, ----------------------------------------------------------------------------- Index: makedefs --- makedefs.orig 2004-04-14 20:59:43 +0200 +++ makedefs 2005-02-06 13:34:59 +0100 @@@@ -93,6 +93,8 @@@@ ;; FreeBSD.5*) SYSTYPE=FREEBSD5 ;; + FreeBSD.6*) SYSTYPE=FREEBSD6 + ;; OpenBSD.2*) SYSTYPE=OPENBSD2 ;; OpenBSD.3*) SYSTYPE=OPENBSD3 d90 2 a91 2 --- src/util/sys_defs.h.orig 2004-08-01 23:05:23 +0200 +++ src/util/sys_defs.h 2005-02-06 13:34:59 +0100 a100 1 @ 1.5 log @Postfix enhancement: make various client information available to processes run via the pipe transport (contributed by Steffen Hansen) @ text @d2 1 a2 1 USE_SOFTLIMITONLY kludge d5 2 a6 2 --- src/util/file_limit.c.orig 2003-10-22 20:48:36.000000000 +0200 +++ src/util/file_limit.c 2004-04-23 08:52:51.000000000 +0200 d30 2 a31 2 --- src/util/msg_syslog.c.orig 2004-01-04 17:14:58.000000000 +0100 +++ src/util/msg_syslog.c 2004-04-23 08:52:51.000000000 +0200 d81 12 a92 10 I [Steffen Hansen] have attached a patch for postfix-2.1.5 that makes various client information (ip, hostname etc.) available to processes run via the pipe transport. The code has been accepted for postfix-2.2, but depending on how far away from release that is, it might be a good idea to have the patch in OpenPKG. diff -upr ../postfix-2.1.5.orig/man/man8/pipe.8 ./man/man8/pipe.8 --- man/man8/pipe.8.orig 2004-08-09 16:51:07.000000000 +0200 +++ man/man8/pipe.8 2004-12-16 13:16:01.000000000 +0100 @@@@ -128,6 +128,22 @@@@ In the command argument vector, the foll d115 3 a117 4 Kun i ../postfix-2.1.5.orig: postfix-2.1.5 diff -upr ../postfix-2.1.5.orig/src/pipe/pipe.c ./src/pipe/pipe.c --- src/pipe/pipe.c.orig 2004-07-24 01:09:21.000000000 +0200 +++ src/pipe/pipe.c 2004-12-16 13:11:43.000000000 +0100 d129 1 a129 1 @@@@ -412,6 +416,10 @@@@ static int parse_callback(int type, VSTR d140 1 a140 1 @@@@ -954,6 +962,15 @@@@ static int deliver_message(DELIVER_REQUE d157 27 @ 1.4 log @upgrading package: postfix 2.0.19 -> 2.1.0 @ text @d80 76 @ 1.3 log @PR#285 patch to use soft not hard limits with setrlimit(2) @ text @a0 26 This patch drops the deprecated OpenLDAP API. --- src/util/dict_ldap.c.dist Wed Apr 2 17:31:29 2003 +++ src/util/dict_ldap.c Wed Apr 2 17:37:22 2003 @@@@ -400,20 +400,6 @@@@ myname, dict_ldap->ldapsource); } } -#else - - rc = ldap_enable_cache(dict_ldap->ld, dict_ldap->cache_expiry, - dict_ldap->cache_size); - if (rc != LDAP_SUCCESS) { - msg_warn - ("%s: Unable to configure cache for %s: %d (%s) -- continuing", - myname, dict_ldap->ldapsource, rc, ldap_err2string(rc)); - } else { - if (msg_verbose) - msg_info("%s: Caching enabled for %s", - myname, dict_ldap->ldapsource); - } - #endif } if (msg_verbose) d5 2 a6 2 --- src/util/file_limit.c.orig 2000-08-22 23:44:44.000000000 +0200 +++ src/util/file_limit.c 2003-10-28 11:11:47.000000000 +0100 a28 1 d30 2 a31 2 --- src/util/msg_syslog.c.orig 2003-09-14 03:34:33.000000000 +0200 +++ src/util/msg_syslog.c 2003-10-28 11:14:00.000000000 +0100 a79 1 @ 1.2 log @cleanup packaging @ text @d26 82 @ 1.2.2.1 log @mass Merge-From-CURRENT (MFC) in preparation for OpenPKG 1.3 [class BASE only] @ text @@ 1.2.2.1.2.1 log @MFC: PR#268 fsl monitor feature; PR#285 use soft not hard limits @ text @a25 82 https://rt.openpkg.org/Ticket/Display.html?id=285 USE_SOFTLIMITONLY kludge Index: src/util/file_limit.c --- src/util/file_limit.c.orig 2000-08-22 23:44:44.000000000 +0200 +++ src/util/file_limit.c 2003-10-28 11:11:47.000000000 +0100 @@@@ -80,12 +80,21 @@@@ void set_file_limit(off_t limit) { #ifdef USE_ULIMIT +#ifdef USE_SOFTLIMITONLY +#error "USE_ULIMIT and USE_SOFTLIMITONLY are mutual exclusive" +#endif if (ulimit(UL_SETFSIZE, limit / ULIMIT_BLOCK_SIZE) < 0) msg_fatal("ulimit: %m"); #else struct rlimit rlim; +#ifdef USE_SOFTLIMITONLY + if (getrlimit(RLIMIT_FSIZE, &rlim) < 0) + rlim.rlim_max = RLIM_INFINITY; + rlim.rlim_cur = limit; +#else rlim.rlim_cur = rlim.rlim_max = limit; +#endif if (setrlimit(RLIMIT_FSIZE, &rlim) < 0) msg_fatal("setrlimit: %m"); #ifdef SIGXFSZ Index: src/util/msg_syslog.c --- src/util/msg_syslog.c.orig 2003-09-14 03:34:33.000000000 +0200 +++ src/util/msg_syslog.c 2003-10-28 11:14:00.000000000 +0100 @@@@ -49,6 +49,11 @@@@ #include #include #include +#ifdef USE_SOFTLIMITONLY +#include +#include +#include +#endif /* Application-specific. */ @@@@ -144,6 +149,9 @@@@ static void msg_syslog_print(int level, const char *text) { +#ifdef USE_SOFTLIMITONLY + struct rlimit save, rlim; +#endif static int log_level[] = { LOG_INFO, LOG_WARNING, LOG_ERR, LOG_CRIT, LOG_CRIT, }; @@@@ -154,6 +162,15 @@@@ if (level < 0 || level >= (int) (sizeof(log_level) / sizeof(log_level[0]))) msg_panic("msg_syslog_print: invalid severity level: %d", level); +#ifdef USE_SOFTLIMITONLY + if (getrlimit(RLIMIT_FSIZE, &save) < 0) { + save.rlim_cur = RLIM_INFINITY; + save.rlim_max = RLIM_INFINITY; + } + rlim.rlim_cur = save.rlim_max; + rlim.rlim_max = save.rlim_max; + (void)setrlimit(RLIMIT_FSIZE, &rlim); +#endif if (level == MSG_INFO) { syslog(syslog_facility | log_level[level], "%.*s", (int) MSG_SYSLOG_RECLEN, text); @@@@ -161,6 +178,9 @@@@ syslog(syslog_facility | log_level[level], "%s: %.*s", severity_name[level], (int) MSG_SYSLOG_RECLEN, text); } +#ifdef USE_SOFTLIMITONLY + (void)setrlimit(RLIMIT_FSIZE, &save); +#endif } /* msg_syslog_init - initialize */ @ 1.1 log @get rid of deprecated OpenLDAP calls - next postfix release SHOULD fix this @ text @d1 2 @