diff -r d06cf9bcdea5 -r bc79b3740eb8 postfix/postfix.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/postfix/postfix.patch Mon Apr 06 23:53:05 2009 +0200 @@ -0,0 +1,115 @@ +Index: makedefs +--- makedefs.orig 2008-01-15 21:20:24 +0100 ++++ makedefs 2008-01-24 12:31:48 +0100 +@@ -132,6 +132,10 @@ + ;; + FreeBSD.7*) SYSTYPE=FREEBSD7 + ;; ++ 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 2008-01-24 12:31:48 +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 2006-06-15 20:07:16 +0200 ++++ src/util/msg_syslog.c 2008-01-24 12:31:48 +0100 +@@ -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 2008-01-15 01:51:44 +0100 ++++ src/util/sys_defs.h 2008-01-24 12:32:41 +0100 +@@ -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) \ +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.