1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/postfix/postfix.patch Mon Apr 06 23:53:05 2009 +0200 1.3 @@ -0,0 +1,115 @@ 1.4 +Index: makedefs 1.5 +--- makedefs.orig 2008-01-15 21:20:24 +0100 1.6 ++++ makedefs 2008-01-24 12:31:48 +0100 1.7 +@@ -132,6 +132,10 @@ 1.8 + ;; 1.9 + FreeBSD.7*) SYSTYPE=FREEBSD7 1.10 + ;; 1.11 ++ FreeBSD.7*) SYSTYPE=FREEBSD7 1.12 ++ ;; 1.13 ++ FreeBSD.8*) SYSTYPE=FREEBSD8 1.14 ++ ;; 1.15 + OpenBSD.2*) SYSTYPE=OPENBSD2 1.16 + ;; 1.17 + OpenBSD.3*) SYSTYPE=OPENBSD3 1.18 +Index: src/util/file_limit.c 1.19 +--- src/util/file_limit.c.orig 2003-10-22 20:48:36 +0200 1.20 ++++ src/util/file_limit.c 2008-01-24 12:31:48 +0100 1.21 +@@ -80,12 +80,21 @@ 1.22 + void set_file_limit(off_t limit) 1.23 + { 1.24 + #ifdef USE_ULIMIT 1.25 ++#ifdef USE_SOFTLIMITONLY 1.26 ++#error "USE_ULIMIT and USE_SOFTLIMITONLY are mutual exclusive" 1.27 ++#endif 1.28 + if (ulimit(UL_SETFSIZE, limit / ULIMIT_BLOCK_SIZE) < 0) 1.29 + msg_fatal("ulimit: %m"); 1.30 + #else 1.31 + struct rlimit rlim; 1.32 + 1.33 ++#ifdef USE_SOFTLIMITONLY 1.34 ++ if (getrlimit(RLIMIT_FSIZE, &rlim) < 0) 1.35 ++ rlim.rlim_max = RLIM_INFINITY; 1.36 ++ rlim.rlim_cur = limit; 1.37 ++#else 1.38 + rlim.rlim_cur = rlim.rlim_max = limit; 1.39 ++#endif 1.40 + if (setrlimit(RLIMIT_FSIZE, &rlim) < 0) 1.41 + msg_fatal("setrlimit: %m"); 1.42 + #ifdef SIGXFSZ 1.43 +Index: src/util/msg_syslog.c 1.44 +--- src/util/msg_syslog.c.orig 2006-06-15 20:07:16 +0200 1.45 ++++ src/util/msg_syslog.c 2008-01-24 12:31:48 +0100 1.46 +@@ -50,6 +50,11 @@ 1.47 + #include <syslog.h> 1.48 + #include <string.h> 1.49 + #include <time.h> 1.50 ++#ifdef USE_SOFTLIMITONLY 1.51 ++#include <sys/time.h> 1.52 ++#include <sys/resource.h> 1.53 ++#include <signal.h> 1.54 ++#endif 1.55 + 1.56 + /* Application-specific. */ 1.57 + 1.58 +@@ -144,6 +149,9 @@ 1.59 + 1.60 + static void msg_syslog_print(int level, const char *text) 1.61 + { 1.62 ++#ifdef USE_SOFTLIMITONLY 1.63 ++ struct rlimit save, rlim; 1.64 ++#endif 1.65 + static int log_level[] = { 1.66 + LOG_INFO, LOG_WARNING, LOG_ERR, LOG_CRIT, LOG_CRIT, 1.67 + }; 1.68 +@@ -154,6 +162,15 @@ 1.69 + if (level < 0 || level >= (int) (sizeof(log_level) / sizeof(log_level[0]))) 1.70 + msg_panic("msg_syslog_print: invalid severity level: %d", level); 1.71 + 1.72 ++#ifdef USE_SOFTLIMITONLY 1.73 ++ if (getrlimit(RLIMIT_FSIZE, &save) < 0) { 1.74 ++ save.rlim_cur = RLIM_INFINITY; 1.75 ++ save.rlim_max = RLIM_INFINITY; 1.76 ++ } 1.77 ++ rlim.rlim_cur = save.rlim_max; 1.78 ++ rlim.rlim_max = save.rlim_max; 1.79 ++ (void)setrlimit(RLIMIT_FSIZE, &rlim); 1.80 ++#endif 1.81 + if (level == MSG_INFO) { 1.82 + syslog(syslog_facility | log_level[level], "%.*s", 1.83 + (int) MSG_SYSLOG_RECLEN, text); 1.84 +@@ -161,6 +178,9 @@ 1.85 + syslog(syslog_facility | log_level[level], "%s: %.*s", 1.86 + severity_name[level], (int) MSG_SYSLOG_RECLEN, text); 1.87 + } 1.88 ++#ifdef USE_SOFTLIMITONLY 1.89 ++ (void)setrlimit(RLIMIT_FSIZE, &save); 1.90 ++#endif 1.91 + } 1.92 + 1.93 + /* msg_syslog_init - initialize */ 1.94 +Index: src/util/sys_defs.h 1.95 +--- src/util/sys_defs.h.orig 2008-01-15 01:51:44 +0100 1.96 ++++ src/util/sys_defs.h 2008-01-24 12:32:41 +0100 1.97 +@@ -24,7 +24,7 @@ 1.98 + * 4.4BSD and close derivatives. 1.99 + */ 1.100 + #if defined(FREEBSD2) || defined(FREEBSD3) || defined(FREEBSD4) \ 1.101 +- || defined(FREEBSD5) || defined(FREEBSD6) || defined(FREEBSD7) \ 1.102 ++ || defined(FREEBSD5) || defined(FREEBSD6) || defined(FREEBSD7) || defined(FREEBSD8) \ 1.103 + || defined(BSDI2) || defined(BSDI3) || defined(BSDI4) \ 1.104 + || defined(OPENBSD2) || defined(OPENBSD3) || defined(OPENBSD4) \ 1.105 + || defined(NETBSD1) || defined(NETBSD2) || defined(NETBSD3) \ 1.106 +Index: src/smtp/smtp_reuse.c 1.107 +--- src/smtp/smtp_reuse.c.orig 2008-12-04 01:06:42 +0100 1.108 ++++ src/smtp/smtp_reuse.c 2009-01-04 11:11:45 +0100 1.109 +@@ -216,7 +216,9 @@ 1.110 + /* 1.111 + * Avoid poor performance when TCP MSS > VSTREAM_BUFSIZE. 1.112 + */ 1.113 ++#if 0 1.114 + vstream_tweak_sock(stream); 1.115 ++#endif 1.116 + 1.117 + /* 1.118 + * Update the list of used cached addresses.