forked from pool/postfix
Accepting request 442124 from home:computersalat:devel:mail
several improvements for config.postfix OBS-URL: https://build.opensuse.org/request/show/442124 OBS-URL: https://build.opensuse.org/package/show/server:mail/postfix?expand=0&rev=245
This commit is contained in:
parent
d307e1ddc9
commit
f7c485bb41
@ -1,7 +1,8 @@
|
||||
diff -Nur postfix-2.11.0/src/cleanup/cleanup_message.c postfix-2.11.0-patched/src/cleanup/cleanup_message.c
|
||||
--- postfix-2.11.0/src/cleanup/cleanup_message.c 2013-11-12 18:53:03.000000000 +0100
|
||||
+++ postfix-2.11.0-patched/src/cleanup/cleanup_message.c 2014-02-12 15:17:28.172612478 +0100
|
||||
@@ -290,7 +290,7 @@
|
||||
Index: src/cleanup/cleanup_message.c
|
||||
===================================================================
|
||||
--- src/cleanup/cleanup_message.c.orig
|
||||
+++ src/cleanup/cleanup_message.c
|
||||
@@ -290,7 +290,7 @@ static const char *cleanup_act(CLEANUP_S
|
||||
while (*optional_text && ISSPACE(*optional_text))
|
||||
optional_text++;
|
||||
|
||||
@ -10,10 +11,11 @@ diff -Nur postfix-2.11.0/src/cleanup/cleanup_message.c postfix-2.11.0-patched/sr
|
||||
#define CLEANUP_ACT_DROP 0
|
||||
|
||||
/*
|
||||
diff -Nur postfix-2.11.0/src/local/local_expand.c postfix-2.11.0-patched/src/local/local_expand.c
|
||||
--- postfix-2.11.0/src/local/local_expand.c 2013-04-05 23:27:48.000000000 +0200
|
||||
+++ postfix-2.11.0-patched/src/local/local_expand.c 2014-02-12 15:22:23.684849057 +0100
|
||||
@@ -115,7 +115,7 @@
|
||||
Index: src/local/local_expand.c
|
||||
===================================================================
|
||||
--- src/local/local_expand.c.orig
|
||||
+++ src/local/local_expand.c
|
||||
@@ -115,7 +115,7 @@ static const char *local_expand_lookup(c
|
||||
LOCAL_EXP *local = (LOCAL_EXP *) ptr;
|
||||
static char rcpt_delim[2];
|
||||
|
||||
@ -22,10 +24,11 @@ diff -Nur postfix-2.11.0/src/local/local_expand.c postfix-2.11.0-patched/src/loc
|
||||
|
||||
if (STREQ(name, "user")) {
|
||||
return (local->state->msg_attr.user);
|
||||
diff -Nur postfix-2.11.0/src/smtpd/smtpd_check.c postfix-2.11.0-patched/src/smtpd/smtpd_check.c
|
||||
--- postfix-2.11.0/src/smtpd/smtpd_check.c 2013-11-12 19:00:11.000000000 +0100
|
||||
+++ postfix-2.11.0-patched/src/smtpd/smtpd_check.c 2014-02-12 15:17:28.174612493 +0100
|
||||
@@ -363,6 +363,10 @@
|
||||
Index: src/smtpd/smtpd_check.c
|
||||
===================================================================
|
||||
--- src/smtpd/smtpd_check.c.orig
|
||||
+++ src/smtpd/smtpd_check.c
|
||||
@@ -368,6 +368,10 @@ static STRING_LIST *smtpd_acl_perm_log;
|
||||
#define CONST_STR(x) ((const char *) vstring_str(x))
|
||||
#define UPDATE_STRING(ptr,val) { if (ptr) myfree(ptr); ptr = mystrdup(val); }
|
||||
|
||||
@ -36,7 +39,7 @@ diff -Nur postfix-2.11.0/src/smtpd/smtpd_check.c postfix-2.11.0-patched/src/smtp
|
||||
/*
|
||||
* If some decision can't be made due to a temporary error, then change
|
||||
* other decisions into deferrals.
|
||||
@@ -2073,8 +2077,6 @@
|
||||
@@ -2297,8 +2301,6 @@ static int check_table_result(SMTPD_STAT
|
||||
if (msg_verbose)
|
||||
msg_info("%s: %s %s %s", myname, table, value, datum);
|
||||
|
||||
@ -45,7 +48,7 @@ diff -Nur postfix-2.11.0/src/smtpd/smtpd_check.c postfix-2.11.0-patched/src/smtp
|
||||
/*
|
||||
* DUNNO means skip this table. Silently ignore optional text.
|
||||
*/
|
||||
@@ -3087,8 +3089,6 @@
|
||||
@@ -3374,8 +3376,6 @@ static const char *rbl_expand_lookup(con
|
||||
SMTPD_RBL_EXPAND_CONTEXT *rbl_exp = (SMTPD_RBL_EXPAND_CONTEXT *) context;
|
||||
SMTPD_STATE *state = rbl_exp->state;
|
||||
|
||||
|
@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:e752d76f5bb7e3df93dbc9a6218c189d7acaa8b27426e5e74ac0bd88d853554c
|
||||
size 35336
|
||||
oid sha256:25a19602ccd22e65ca85a85ad75866d8ac4147ff02b5d441028cfa8e762ff323
|
||||
size 71056
|
||||
|
@ -1,6 +1,8 @@
|
||||
--- conf/main.cf.orig 2015-04-01 10:56:39.000000000 +0000
|
||||
+++ conf/main.cf 2016-03-16 09:28:51.968093319 +0000
|
||||
@@ -567,6 +567,7 @@
|
||||
Index: conf/main.cf
|
||||
===================================================================
|
||||
--- conf/main.cf.orig
|
||||
+++ conf/main.cf
|
||||
@@ -567,6 +567,7 @@ unknown_local_recipient_reject_code = 55
|
||||
#
|
||||
#smtpd_banner = $myhostname ESMTP $mail_name
|
||||
#smtpd_banner = $myhostname ESMTP $mail_name ($mail_version)
|
||||
@ -8,7 +10,7 @@
|
||||
|
||||
# PARALLEL DELIVERY TO THE SAME DESTINATION
|
||||
#
|
||||
@@ -673,4 +674,120 @@
|
||||
@@ -673,4 +674,120 @@ sample_directory =
|
||||
# readme_directory: The location of the Postfix README files.
|
||||
#
|
||||
readme_directory =
|
||||
|
@ -1,5 +1,7 @@
|
||||
--- conf/master.cf.orig 2016-03-16 09:28:26.256321206 +0100
|
||||
+++ conf/master.cf 2016-03-16 09:35:02.748681617 +0100
|
||||
Index: conf/master.cf
|
||||
===================================================================
|
||||
--- conf/master.cf.orig
|
||||
+++ conf/master.cf
|
||||
@@ -10,6 +10,11 @@
|
||||
# (yes) (yes) (no) (never) (100)
|
||||
# ==========================================================================
|
||||
@ -12,7 +14,7 @@
|
||||
#smtp inet n - n - 1 postscreen
|
||||
#smtpd pass - - n - - smtpd
|
||||
#dnsblog unix - - n - 0 dnsblog
|
||||
@@ -28,6 +33,7 @@
|
||||
@@ -28,6 +33,7 @@ smtp inet n - n
|
||||
#smtps inet n - n - - smtpd
|
||||
# -o syslog_name=postfix/smtps
|
||||
# -o smtpd_tls_wrappermode=yes
|
||||
@ -20,7 +22,7 @@
|
||||
# -o smtpd_sasl_auth_enable=yes
|
||||
# -o smtpd_reject_unlisted_recipient=no
|
||||
# -o smtpd_client_restrictions=$mua_client_restrictions
|
||||
@@ -62,6 +68,27 @@
|
||||
@@ -62,6 +68,27 @@ virtual unix - n n
|
||||
lmtp unix - - n - - lmtp
|
||||
anvil unix - - n - 1 anvil
|
||||
scache unix - - n - 1 scache
|
||||
@ -48,7 +50,7 @@
|
||||
#
|
||||
# ====================================================================
|
||||
# Interfaces to non-Postfix software. Be sure to examine the manual
|
||||
@@ -95,7 +122,7 @@
|
||||
@@ -95,7 +122,7 @@ scache unix - - n
|
||||
# Also specify in main.cf: cyrus_destination_recipient_limit=1
|
||||
#
|
||||
#cyrus unix - n n - - pipe
|
||||
@ -57,7 +59,7 @@
|
||||
#
|
||||
# ====================================================================
|
||||
#
|
||||
@@ -128,3 +155,10 @@
|
||||
@@ -128,3 +155,10 @@ scache unix - - n
|
||||
#mailman unix - n n - - pipe
|
||||
# flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
|
||||
# ${nexthop} ${user}
|
||||
|
@ -1,8 +1,8 @@
|
||||
Index: postfix-2.11.0/src/global/mail_params.h
|
||||
Index: src/global/mail_params.h
|
||||
===================================================================
|
||||
--- postfix-2.11.0.orig/src/global/mail_params.h
|
||||
+++ postfix-2.11.0/src/global/mail_params.h
|
||||
@@ -1300,7 +1300,7 @@ extern char *var_smtpd_tls_excl_ciph;
|
||||
--- src/global/mail_params.h.orig
|
||||
+++ src/global/mail_params.h
|
||||
@@ -1333,7 +1333,7 @@ extern char *var_smtpd_tls_excl_ciph;
|
||||
extern char *var_smtpd_tls_mand_excl;
|
||||
|
||||
#define VAR_SMTPD_TLS_FPT_DGST "smtpd_tls_fingerprint_digest"
|
||||
@ -11,7 +11,7 @@ Index: postfix-2.11.0/src/global/mail_params.h
|
||||
extern char *var_smtpd_tls_fpt_dgst;
|
||||
|
||||
#define VAR_SMTPD_TLS_512_FILE "smtpd_tls_dh512_param_file"
|
||||
@@ -1449,9 +1449,9 @@ extern char *var_smtp_tls_excl_ciph;
|
||||
@@ -1488,9 +1488,9 @@ extern char *var_smtp_tls_excl_ciph;
|
||||
extern char *var_smtp_tls_mand_excl;
|
||||
|
||||
#define VAR_SMTP_TLS_FPT_DGST "smtp_tls_fingerprint_digest"
|
||||
|
@ -1,6 +1,8 @@
|
||||
--- src/tls/tls_client.c.orig 2016-03-16 09:45:17.686921418 +0100
|
||||
+++ src/tls/tls_client.c 2016-03-16 09:46:24.431617807 +0100
|
||||
@@ -369,6 +369,12 @@
|
||||
Index: src/tls/tls_client.c
|
||||
===================================================================
|
||||
--- src/tls/tls_client.c.orig
|
||||
+++ src/tls/tls_client.c
|
||||
@@ -371,6 +371,12 @@ TLS_APPL_STATE *tls_client_init(const TL
|
||||
SSL_CTX_set_security_level(client_ctx, 0);
|
||||
#endif
|
||||
|
||||
@ -13,9 +15,11 @@
|
||||
/*
|
||||
* See the verify callback in tls_verify.c
|
||||
*/
|
||||
--- src/tls/tls_server.c.orig 2016-03-16 09:45:39.487150299 +0100
|
||||
+++ src/tls/tls_server.c 2016-03-16 09:51:32.230678857 +0100
|
||||
@@ -451,6 +451,12 @@
|
||||
Index: src/tls/tls_server.c
|
||||
===================================================================
|
||||
--- src/tls/tls_server.c.orig
|
||||
+++ src/tls/tls_server.c
|
||||
@@ -462,6 +462,12 @@ TLS_APPL_STATE *tls_server_init(const TL
|
||||
SSL_CTX_set_security_level(server_ctx, 0);
|
||||
#endif
|
||||
|
||||
|
@ -1,21 +1,25 @@
|
||||
diff -uNr postfix-2.10.0.orig/README_FILES/VDA_README postfix-2.10.0/README_FILES/VDA_README
|
||||
--- postfix-2.10.0.orig/README_FILES/VDA_README 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ postfix-2.10.0/README_FILES/VDA_README 2013-06-07 13:21:22.837143270 +0200
|
||||
@@ -0,0 +1,10 @@
|
||||
+Postfix VDA patch for maildir++ quota support by
|
||||
Index: README_FILES/VDA_README
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ README_FILES/VDA_README
|
||||
@@ -0,0 +1,12 @@
|
||||
+Postfix VDA patch for maildir++ quota support by
|
||||
+ Anderson Nadal <andernadal@gmail.com>
|
||||
+ Tomas Macek <maca02@atlas.cz>
|
||||
+ Lucca Longinotti
|
||||
+
|
||||
+See VDA patch official website http://vda.sf.net for instructions
|
||||
+howto patch the Postfix's sourcetree and configure the options
|
||||
+howto patch the Postfix's sourcetree and configure the options
|
||||
+provided by this patch.
|
||||
+
|
||||
+ Cristian Sava <csava@central.ucv.ro> *** port to postfix-3.0.3
|
||||
+
|
||||
diff -uNr postfix-2.10.0.orig/src/global/mail_params.h postfix-2.10.0/src/global/mail_params.h
|
||||
--- postfix-2.10.0.orig/src/global/mail_params.h 2013-02-03 19:22:21.000000000 +0100
|
||||
+++ postfix-2.10.0/src/global/mail_params.h 2013-06-07 13:21:22.838143270 +0200
|
||||
@@ -2367,6 +2367,54 @@
|
||||
+
|
||||
Index: src/global/mail_params.h
|
||||
===================================================================
|
||||
--- src/global/mail_params.h.orig
|
||||
+++ src/global/mail_params.h
|
||||
@@ -2474,6 +2474,54 @@ extern char *var_virt_uid_maps;
|
||||
#define DEF_VIRT_GID_MAPS ""
|
||||
extern char *var_virt_gid_maps;
|
||||
|
||||
@ -70,10 +74,11 @@ diff -uNr postfix-2.10.0.orig/src/global/mail_params.h postfix-2.10.0/src/global
|
||||
#define VAR_VIRT_MINUID "virtual_minimum_uid"
|
||||
#define DEF_VIRT_MINUID 100
|
||||
extern int var_virt_minimum_uid;
|
||||
diff -uNr postfix-2.10.0.orig/src/util/file_limit.c postfix-2.10.0/src/util/file_limit.c
|
||||
--- postfix-2.10.0.orig/src/util/file_limit.c 2003-10-22 20:48:36.000000000 +0200
|
||||
+++ postfix-2.10.0/src/util/file_limit.c 2013-06-07 13:21:22.839143270 +0200
|
||||
@@ -85,7 +85,11 @@
|
||||
Index: src/util/file_limit.c
|
||||
===================================================================
|
||||
--- src/util/file_limit.c.orig
|
||||
+++ src/util/file_limit.c
|
||||
@@ -85,7 +85,11 @@ void set_file_limit(off_t limit)
|
||||
#else
|
||||
struct rlimit rlim;
|
||||
|
||||
@ -86,9 +91,10 @@ diff -uNr postfix-2.10.0.orig/src/util/file_limit.c postfix-2.10.0/src/util/file
|
||||
if (setrlimit(RLIMIT_FSIZE, &rlim) < 0)
|
||||
msg_fatal("setrlimit: %m");
|
||||
#ifdef SIGXFSZ
|
||||
diff -uNr postfix-2.10.0.orig/src/virtual/mailbox.c postfix-2.10.0/src/virtual/mailbox.c
|
||||
--- postfix-2.10.0.orig/src/virtual/mailbox.c 2011-12-24 03:13:32.000000000 +0100
|
||||
+++ postfix-2.10.0/src/virtual/mailbox.c 2013-06-07 13:23:03.044139705 +0200
|
||||
Index: src/virtual/mailbox.c
|
||||
===================================================================
|
||||
--- src/virtual/mailbox.c.orig
|
||||
+++ src/virtual/mailbox.c
|
||||
@@ -52,6 +52,7 @@
|
||||
#include <mymalloc.h>
|
||||
#include <stringops.h>
|
||||
@ -168,7 +174,7 @@ diff -uNr postfix-2.10.0.orig/src/virtual/mailbox.c postfix-2.10.0/src/virtual/m
|
||||
/* deliver_mailbox_file - deliver to recipient mailbox */
|
||||
|
||||
static int deliver_mailbox_file(LOCAL_STATE state, USER_ATTR usr_attr)
|
||||
@@ -80,7 +145,6 @@
|
||||
@@ -80,7 +145,6 @@ static int deliver_mailbox_file(LOCAL_ST
|
||||
int mail_copy_status;
|
||||
int deliver_status;
|
||||
int copy_flags;
|
||||
@ -176,7 +182,7 @@ diff -uNr postfix-2.10.0.orig/src/virtual/mailbox.c postfix-2.10.0/src/virtual/m
|
||||
struct stat st;
|
||||
|
||||
/*
|
||||
@@ -132,7 +196,7 @@
|
||||
@@ -132,7 +196,7 @@ static int deliver_mailbox_file(LOCAL_ST
|
||||
msg_warn("specify \"%s = no\" to ignore mailbox ownership mismatch",
|
||||
VAR_STRICT_MBOX_OWNER);
|
||||
} else {
|
||||
@ -185,7 +191,7 @@ diff -uNr postfix-2.10.0.orig/src/virtual/mailbox.c postfix-2.10.0/src/virtual/m
|
||||
mail_copy_status = mail_copy(COPY_ATTR(state.msg_attr), mp->fp,
|
||||
copy_flags, "\n", why);
|
||||
}
|
||||
@@ -213,62 +277,72 @@
|
||||
@@ -213,62 +277,72 @@ int deliver_mailbox(LOCAL_STATE stat
|
||||
* Look up the mailbox owner rights. Defer in case of trouble.
|
||||
*/
|
||||
uid_res = mail_addr_find(virtual_uid_maps, state.msg_attr.user,
|
||||
@ -293,9 +299,10 @@ diff -uNr postfix-2.10.0.orig/src/virtual/mailbox.c postfix-2.10.0/src/virtual/m
|
||||
|
||||
/*
|
||||
* Cleanup.
|
||||
diff -uNr postfix-2.10.0.orig/src/virtual/maildir.c postfix-2.10.0/src/virtual/maildir.c
|
||||
--- postfix-2.10.0.orig/src/virtual/maildir.c 2012-01-25 01:41:08.000000000 +0100
|
||||
+++ postfix-2.10.0/src/virtual/maildir.c 2013-06-07 13:21:22.840143270 +0200
|
||||
Index: src/virtual/maildir.c
|
||||
===================================================================
|
||||
--- src/virtual/maildir.c.orig
|
||||
+++ src/virtual/maildir.c
|
||||
@@ -64,28 +64,420 @@
|
||||
#include <mbox_open.h>
|
||||
#include <dsn_util.h>
|
||||
@ -345,27 +352,27 @@ diff -uNr postfix-2.10.0.orig/src/virtual/maildir.c postfix-2.10.0/src/virtual/m
|
||||
+ int len, first;
|
||||
+ long sum = 0, count = 0, ret_value = -1;
|
||||
+
|
||||
+ if (msg_verbose)
|
||||
+ if (msg_verbose)
|
||||
+ msg_info("%s: we will use sizefile = '%s'", myname, filename);
|
||||
+
|
||||
+
|
||||
+ sizefile = vstream_fopen(filename, O_RDONLY, 0);
|
||||
+ if (!sizefile) {
|
||||
+ if (msg_verbose)
|
||||
+ msg_info("%s: cannot open %s: %m (maybe file does not exist)", myname, filename);
|
||||
+
|
||||
+
|
||||
+ return -1;
|
||||
+ } else if (stat(filename, &statbuf) < 0 || statbuf.st_size > SIZEFILE_MAX) {
|
||||
+ if (sizefile) {
|
||||
+ vstream_fclose(sizefile);
|
||||
+ unlink(filename);
|
||||
+ }
|
||||
+
|
||||
+ if (msg_verbose)
|
||||
+
|
||||
+ if (msg_verbose)
|
||||
+ msg_info("%s: stat() returned < 0 or filesize > SIZEFILE_MAX (filename = %s, filesize = %ld)", myname, filename, statbuf.st_size);
|
||||
+
|
||||
+
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+
|
||||
+ VSTRING *sizebuf = vstring_alloc(SIZEFILE_MAX);
|
||||
+ len = vstream_fread(sizefile, STR(sizebuf), SIZEFILE_MAX);
|
||||
+
|
||||
@ -407,24 +414,25 @@ diff -uNr postfix-2.10.0.orig/src/virtual/maildir.c postfix-2.10.0/src/virtual/m
|
||||
+
|
||||
+ *countptr = count;
|
||||
+ *sumptr = sum;
|
||||
+
|
||||
+
|
||||
+ if (sum < 0 || count < 0 || (sum == 0 && count != 0) || (sum != 0 && count == 0)) {
|
||||
+ if (msg_verbose) {
|
||||
+ msg_info("%s: we will return -1 and unlink %s, because file count or sum is <= 0 (sum = %ld, count = %ld)", myname, filename, sum, count);
|
||||
+ }
|
||||
+
|
||||
+
|
||||
+ unlink(filename);
|
||||
+ ret_value = -1;
|
||||
+ } else {
|
||||
+ if (msg_verbose)
|
||||
+ if (msg_verbose)
|
||||
+ msg_info("%s: we will return Maildir size = %ld, count = %ld", myname, *sumptr, *countptr);
|
||||
+
|
||||
+ ret_value = sum;
|
||||
+ ret_value = sum;
|
||||
+ }
|
||||
+
|
||||
|
||||
-int deliver_maildir(LOCAL_STATE state, USER_ATTR usr_attr)
|
||||
+ vstream_fclose(sizefile);
|
||||
+ vstring_free(sizebuf);
|
||||
+
|
||||
+
|
||||
+ return ret_value;
|
||||
+}
|
||||
+
|
||||
@ -574,8 +582,7 @@ diff -uNr postfix-2.10.0.orig/src/virtual/maildir.c postfix-2.10.0/src/virtual/m
|
||||
+ }
|
||||
+ }
|
||||
+ closedir(dir);
|
||||
|
||||
-int deliver_maildir(LOCAL_STATE state, USER_ATTR usr_attr)
|
||||
+
|
||||
+ if (msg_verbose)
|
||||
+ msg_info("%s: full scan done: dir=%s sum=%ld count=%ld", myname, dirname, sum, *countptr);
|
||||
+
|
||||
@ -729,7 +736,7 @@ diff -uNr postfix-2.10.0.orig/src/virtual/maildir.c postfix-2.10.0/src/virtual/m
|
||||
|
||||
GETTIMEOFDAY(&starttime);
|
||||
|
||||
@@ -94,15 +486,14 @@
|
||||
@@ -94,15 +486,14 @@ int deliver_maildir(LOCAL_STATE stat
|
||||
*/
|
||||
state.level++;
|
||||
if (msg_verbose)
|
||||
@ -748,7 +755,7 @@ diff -uNr postfix-2.10.0.orig/src/virtual/maildir.c postfix-2.10.0/src/virtual/m
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -110,18 +501,116 @@
|
||||
@@ -110,17 +501,115 @@ int deliver_maildir(LOCAL_STATE stat
|
||||
* attribute to reflect the final recipient.
|
||||
*/
|
||||
if (vstream_fseek(state.msg_attr.fp, state.msg_attr.offset, SEEK_SET) < 0)
|
||||
@ -781,7 +788,7 @@ diff -uNr postfix-2.10.0.orig/src/virtual/maildir.c postfix-2.10.0/src/virtual/m
|
||||
+ tmpdir = concatenate(tmpdir, "tmp/", (char *) 0);
|
||||
+ curdir = concatenate(curdir, "cur/", (char *) 0);
|
||||
+ }
|
||||
|
||||
+
|
||||
+ /* get the sizefilename, no matter if we use var_virt_maildir_extended */
|
||||
+ if (*var_virt_maildir_suffix == 0) {
|
||||
+ sizefilename = concatenate(usr_attr.mailbox, "maildirsize", (char *) 0);
|
||||
@ -789,7 +796,7 @@ diff -uNr postfix-2.10.0.orig/src/virtual/maildir.c postfix-2.10.0/src/virtual/m
|
||||
+ sizefilename = concatenate(usr_attr.mailbox, var_virt_maildir_suffix, (char *) 0);
|
||||
+ sizefilename = concatenate(sizefilename, "maildirsize", (char *) 0);
|
||||
+ }
|
||||
+
|
||||
+
|
||||
+ /*
|
||||
+ * Look up the virtual maildir limit size for this user.
|
||||
+ * Fall back to virtual_mailbox_limit in case lookup failed.
|
||||
@ -822,7 +829,7 @@ diff -uNr postfix-2.10.0.orig/src/virtual/maildir.c postfix-2.10.0/src/virtual/m
|
||||
+ }
|
||||
+ else {
|
||||
+ if (msg_verbose)
|
||||
+ msg_info("%s: quota is negative (%ld), using default virtual_mailbox_limit (%ld)",
|
||||
+ msg_info("%s: quota is negative (%ld), using default virtual_mailbox_limit (%ld)",
|
||||
+ myname, n, var_virt_mailbox_limit);
|
||||
+ /* Invalid limit size (negative). Use default virtual_mailbox_limit. */
|
||||
+ n = var_virt_mailbox_limit;
|
||||
@ -830,7 +837,7 @@ diff -uNr postfix-2.10.0.orig/src/virtual/maildir.c postfix-2.10.0/src/virtual/m
|
||||
+ }
|
||||
+ else {
|
||||
+ if (msg_verbose)
|
||||
+ msg_info("%s: no limit found in the maps, using default virtual_mailbox_limit (%ld)",
|
||||
+ msg_info("%s: no limit found in the maps, using default virtual_mailbox_limit (%ld)",
|
||||
+ myname, var_virt_mailbox_limit);
|
||||
+ /* There is no limit in the maps. Use default virtual_mailbox_limit. */
|
||||
+ n = var_virt_mailbox_limit;
|
||||
@ -846,14 +853,14 @@ diff -uNr postfix-2.10.0.orig/src/virtual/maildir.c postfix-2.10.0/src/virtual/m
|
||||
+ if (msg_verbose)
|
||||
+ msg_info("%s: maildirsize used=%s sum=%ld count=%ld", myname, sizefilename, saved_size, saved_count);
|
||||
+ } else {
|
||||
+ if (msg_verbose)
|
||||
+ msg_info("%s: We will recount the quota (var_virt_mailbox_limit = %ld, var_virt_maildir_extended = %d, read_maildirsize = %d)",
|
||||
+ if (msg_verbose)
|
||||
+ msg_info("%s: We will recount the quota (var_virt_mailbox_limit = %ld, var_virt_maildir_extended = %d, read_maildirsize = %d)",
|
||||
+ myname, var_virt_mailbox_limit, var_virt_maildir_extended, read_mds);
|
||||
+
|
||||
+ /* sanity */
|
||||
+ saved_size = 0;
|
||||
+ saved_size = 0;
|
||||
+ saved_count = 0;
|
||||
+
|
||||
+
|
||||
+ if (var_virt_mailbox_limit_inbox) {
|
||||
+ /* Check Inbox only (new, cur and tmp dirs). */
|
||||
+ saved_size = check_dir_size(newdir, &saved_count);
|
||||
@ -865,13 +872,12 @@ diff -uNr postfix-2.10.0.orig/src/virtual/maildir.c postfix-2.10.0/src/virtual/m
|
||||
+ }
|
||||
+
|
||||
+ set_eugid(var_owner_uid, var_owner_gid);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
|
||||
/*
|
||||
* Create and write the file as the recipient, so that file quota work.
|
||||
* Create any missing directories on the fly. The file name is chosen
|
||||
@@ -175,46 +664,288 @@
|
||||
@@ -175,46 +664,288 @@ int deliver_maildir(LOCAL_STATE stat
|
||||
* [...]
|
||||
*/
|
||||
set_eugid(usr_attr.uid, usr_attr.gid);
|
||||
@ -1197,7 +1203,7 @@ diff -uNr postfix-2.10.0.orig/src/virtual/maildir.c postfix-2.10.0/src/virtual/m
|
||||
}
|
||||
set_eugid(var_owner_uid, var_owner_gid);
|
||||
|
||||
@@ -224,31 +955,64 @@
|
||||
@@ -224,31 +955,64 @@ int deliver_maildir(LOCAL_STATE stat
|
||||
* location possibly under user control.
|
||||
*/
|
||||
if (mail_copy_status & MAIL_COPY_STAT_CORRUPT) {
|
||||
@ -1255,11 +1261,11 @@ diff -uNr postfix-2.10.0.orig/src/virtual/maildir.c postfix-2.10.0/src/virtual/m
|
||||
+ 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);
|
||||
+
|
||||
@ -1281,22 +1287,11 @@ diff -uNr postfix-2.10.0.orig/src/virtual/maildir.c postfix-2.10.0/src/virtual/m
|
||||
+
|
||||
return (deliver_status);
|
||||
}
|
||||
diff -uNr postfix-2.10.0.orig/src/virtual/virtual.h postfix-2.10.0/src/virtual/virtual.h
|
||||
--- postfix-2.10.0.orig/src/virtual/virtual.h 2006-01-08 00:59:47.000000000 +0100
|
||||
+++ postfix-2.10.0/src/virtual/virtual.h 2013-06-07 13:21:22.841143270 +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
|
||||
--- postfix-3.1.0/src/virtual/virtual.c.orig 2016-03-16 09:58:37.790856521 +0100
|
||||
+++ postfix-3.1.0/src/virtual/virtual.c 2016-03-16 10:04:44.267207460 +0100
|
||||
@@ -347,12 +347,28 @@
|
||||
Index: src/virtual/virtual.c
|
||||
===================================================================
|
||||
--- src/virtual/virtual.c.orig
|
||||
+++ src/virtual/virtual.c
|
||||
@@ -347,12 +347,28 @@ char *var_mail_spool_dir; /* XXX depe
|
||||
bool var_strict_mbox_owner;
|
||||
char *var_virt_dsn_filter;
|
||||
|
||||
@ -1325,36 +1320,83 @@ diff -uNr postfix-2.10.0.orig/src/virtual/virtual.h postfix-2.10.0/src/virtual/v
|
||||
|
||||
/*
|
||||
* Bit masks.
|
||||
@@ -475,6 +491,19 @@
|
||||
DICT_FLAG_LOCK | DICT_FLAG_PARANOID
|
||||
| DICT_FLAG_UTF8_REQUEST);
|
||||
@@ -462,18 +478,27 @@ static void post_init(char *unused_name,
|
||||
*/
|
||||
virtual_mailbox_maps =
|
||||
maps_create(VAR_VIRT_MAILBOX_MAPS, var_virt_mailbox_maps,
|
||||
- DICT_FLAG_LOCK | DICT_FLAG_PARANOID
|
||||
- | DICT_FLAG_UTF8_REQUEST);
|
||||
+ DICT_FLAG_LOCK);
|
||||
|
||||
virtual_uid_maps =
|
||||
maps_create(VAR_VIRT_UID_MAPS, var_virt_uid_maps,
|
||||
- DICT_FLAG_LOCK | DICT_FLAG_PARANOID
|
||||
- | DICT_FLAG_UTF8_REQUEST);
|
||||
+ DICT_FLAG_LOCK);
|
||||
|
||||
virtual_gid_maps =
|
||||
maps_create(VAR_VIRT_GID_MAPS, var_virt_gid_maps,
|
||||
- DICT_FLAG_LOCK | DICT_FLAG_PARANOID
|
||||
- | DICT_FLAG_UTF8_REQUEST);
|
||||
+ DICT_FLAG_LOCK);
|
||||
+
|
||||
+ virtual_mailbox_limit_maps =
|
||||
+ maps_create(VAR_VIRT_MAILBOX_LIMIT_MAPS, var_virt_mailbox_limit_maps,
|
||||
+ DICT_FLAG_LOCK | DICT_FLAG_UTF8_REQUEST );
|
||||
+ 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 | DICT_FLAG_UTF8_REQUEST );
|
||||
+ DICT_FLAG_LOCK);
|
||||
+
|
||||
+ virtual_maildir_filter_maps =
|
||||
+ maps_create(VAR_VIRT_MAILDIR_FILTER_MAPS, var_virt_maildir_filter_maps,
|
||||
+ DICT_FLAG_LOCK | DICT_FLAG_UTF8_REQUEST );
|
||||
+
|
||||
+
|
||||
+ DICT_FLAG_LOCK);
|
||||
|
||||
virtual_mbox_lock_mask = mbox_lock_mask(var_virt_mailbox_lock);
|
||||
}
|
||||
|
||||
@@ -526,6 +555,12 @@
|
||||
@@ -525,11 +550,23 @@ int main(int argc, char **argv)
|
||||
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,
|
||||
VAR_VIRT_DSN_FILTER, DEF_VIRT_DSN_FILTER, &var_virt_dsn_filter, 0, 0,
|
||||
+ VAR_VIRT_MAILBOX_LIMIT_MAPS, DEF_VIRT_MAILBOX_LIMIT_MAPS, &var_virt_mailbox_limit_maps, 0, 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,
|
||||
VAR_VIRT_DSN_FILTER, DEF_VIRT_DSN_FILTER, &var_virt_dsn_filter, 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,
|
||||
};
|
||||
|
||||
@@ -546,6 +583,7 @@ int main(int argc, char **argv)
|
||||
CA_MAIL_SERVER_PRE_INIT(pre_init),
|
||||
CA_MAIL_SERVER_POST_INIT(post_init),
|
||||
CA_MAIL_SERVER_PRE_ACCEPT(pre_accept),
|
||||
+ CA_MAIL_SERVER_BOOL_TABLE(bool_table),
|
||||
CA_MAIL_SERVER_PRIVILEGED,
|
||||
CA_MAIL_SERVER_BOUNCE_INIT(VAR_VIRT_DSN_FILTER,
|
||||
&var_virt_dsn_filter),
|
||||
Index: src/virtual/virtual.h
|
||||
===================================================================
|
||||
--- src/virtual/virtual.h.orig
|
||||
+++ src/virtual/virtual.h
|
||||
@@ -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
|
@ -1,3 +1,43 @@
|
||||
-------------------------------------------------------------------
|
||||
Sat Nov 26 15:43:57 UTC 2016 - chris@computersalat.de
|
||||
|
||||
- improve config.postfix
|
||||
* improve SASL stuff
|
||||
* add POSTFIX_SMTP_AUTH_SERVICE=(cyrus|dovecot)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Nov 14 21:53:18 UTC 2016 - chris@computersalat.de
|
||||
|
||||
- improve config.postfix
|
||||
* improve with MySQL stuff
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Nov 7 13:35:38 UTC 2016 - chris@computersalat.de
|
||||
|
||||
- update vda patch to latest available
|
||||
* remove postfix-vda-v13-3.10.0.patch
|
||||
* add postfix-vda-v14-3.0.3.patch
|
||||
- rebase patches (and to be p0)
|
||||
* pointer_to_literals.patch
|
||||
* postfix-main.cf.patch
|
||||
* postfix-master.cf.patch
|
||||
* postfix-no-md5.patch
|
||||
* postfix-ssl-release-buffers.patch
|
||||
- add /etc/postfix/ssl as default DIR for SSL stuff
|
||||
* cacerts -> ../../ssl/certs/
|
||||
* certs/
|
||||
- revert POSTFIX_SSL_PATH from '/etc/ssl' to '/etc/postfix/ssl'
|
||||
- improve config.postfix
|
||||
* revert smtpd_tls_CApath to POSTFIX_SSL_PATH/cacerts which is a
|
||||
symlink to /etc/ssl/certs
|
||||
Without reverting, 'gen_CA' would create files which would then be on
|
||||
the previous defined 'sslpath(/etc/ssl)/certs' (smtpd_tls_CApath)
|
||||
Cert reqs would be placed in 'sslpath(/etc/ssl)/certs/postfixreq.pem'
|
||||
which is not a good idea.
|
||||
* mkchroot: sync '/etc/postfix/ssl' to chroot
|
||||
* improve PCONF for smtp{,d}_tls_{cert,key}_file, adding/removing from
|
||||
main.cf, show warning if enabled and file is missing
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sun Oct 9 20:11:34 UTC 2016 - michael@stroeder.com
|
||||
|
||||
|
17
postfix.spec
17
postfix.spec
@ -77,8 +77,9 @@ Patch3: ipv6_disabled.patch
|
||||
Patch4: %{name}-main.cf.patch
|
||||
Patch5: %{name}-master.cf.patch
|
||||
Patch7: %{name}-ssl-release-buffers.patch
|
||||
Patch8: %{name}-vda-v13-3.10.0.patch
|
||||
Patch8: %{name}-vda-v14-3.0.3.patch
|
||||
|
||||
BuildRequires: ca-certificates
|
||||
BuildRequires: cyrus-sasl-devel
|
||||
BuildRequires: db-devel
|
||||
BuildRequires: libopenssl-devel
|
||||
@ -177,13 +178,13 @@ PostgreSQL.
|
||||
|
||||
%prep
|
||||
%setup -q -a 2 -a 3
|
||||
%patch1 -p1
|
||||
%patch2 -p1
|
||||
%patch1
|
||||
%patch2
|
||||
%patch3
|
||||
%patch4
|
||||
%patch5
|
||||
%patch7
|
||||
%patch8 -p1
|
||||
%patch8
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
@ -248,6 +249,10 @@ usermod -G %{maildrop_gid},%{mail_gid} %{name} 2> /dev/null || :
|
||||
mkdir -p %{buildroot}/%{_libdir}
|
||||
mkdir -p %{buildroot}/etc/postfix
|
||||
cp conf/* %{buildroot}/etc/postfix/
|
||||
# create our default postfix ssl DIR (/etc/postfix/ssl)
|
||||
mkdir -p %{buildroot}/etc/postfix/ssl/certs
|
||||
# link cacerts to /etc/ssl/certs
|
||||
ln -sf ../../ssl/certs %{buildroot}/etc/postfix/ssl/cacerts
|
||||
cp lib/libpostfix-* %{buildroot}/%{_libdir}
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%{buildroot}/%{_libdir}
|
||||
sh postfix-install -non-interactive \
|
||||
@ -571,6 +576,10 @@ fi
|
||||
%config %{_sysconfdir}/permissions.d/%{name}.paranoid
|
||||
%attr(0644, root, root) %config %{_sysconfdir}/%{name}/makedefs.out
|
||||
%{_libexecdir}/%{name}/%{name}-files
|
||||
# create our default postfix ssl DIR (/etc/postfix/ssl)
|
||||
%dir %{_sysconfdir}/postfix/ssl
|
||||
%dir %{_sysconfdir}/postfix/ssl/certs
|
||||
%{_sysconfdir}/postfix/ssl/cacerts
|
||||
%if 0%{?suse_version} >= 1210
|
||||
%dir %{_sysconfdir}/postfix/system
|
||||
%config %attr(0755,root,root) %{_sysconfdir}/postfix/system/*
|
||||
|
Loading…
Reference in New Issue
Block a user