SHA256
1
0
forked from pool/postfix

Accepting request 70284 from home:computersalat:devel:mail

rework tls stuff, fix post-install, update vda patch

OBS-URL: https://build.opensuse.org/request/show/70284
OBS-URL: https://build.opensuse.org/package/show/server:mail/postfix?expand=0&rev=74
This commit is contained in:
Christian Wittmer 2011-05-15 14:21:14 +00:00 committed by Git OBS Bridge
parent c17fe0c6e8
commit d737fb736c
7 changed files with 340 additions and 199 deletions

View File

@ -1,42 +0,0 @@
diff -ruN postfix-2.7.1-orig/conf/main.cf postfix-2.7.1/conf/main.cf
--- postfix-2.7.1-orig/conf/main.cf 2007-12-18 14:50:25.000000000 +0100
+++ postfix-2.7.1/conf/main.cf 2010-12-11 20:47:20.000000000 +0100
@@ -649,3 +649,38 @@
# readme_directory: The location of the Postfix README files.
#
readme_directory =
+
+
+############################################################
+# Start MySQL from postfixwiki.org
+############################################################
+#relay_domains = $mydestination, hash:/etc/postfix/relay
+#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_limit_inbox = no
+#virtual_mailbox_limit_maps = hash:/etc/postfix/vquota
+#virtual_mailbox_limit_override = yes
+#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
+### Needs Maildir++ compatible IMAP servers, like Courier-IMAP
+#virtual_maildir_filter = yes
+#virtual_maildir_filter_maps = hash:/etc/postfix/vfilter
+#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_maildir_limit_message_maps = hash:/etc/postfix/vmsg
+#virtual_overquota_bounce = yes
+#virtual_trash_count = yes
+#virtual_trash_name = ".Trash"
+############################################################
+# End MySQL from postfixwiki.org
+############################################################
+

121
postfix-2.8.3-main.cf.patch Normal file
View File

@ -0,0 +1,121 @@
diff -ruN postfix-2.8.3-orig/conf/main.cf postfix-2.8.3/conf/main.cf
--- postfix-2.8.3-orig/conf/main.cf 2007-12-18 14:50:25.000000000 +0100
+++ postfix-2.8.3/conf/main.cf 2011-05-15 13:12:35.000000000 +0200
@@ -649,3 +649,117 @@
# readme_directory: The location of the Postfix README files.
#
readme_directory =
+
+biff = no
+content_filter =
+delay_warning_time = 0h
+disable_dns_lookups = no
+disable_mime_output_conversion = no
+inet_interfaces = all
+inet_protocols = ipv4
+masquerade_classes = envelope_sender, header_sender, header_recipient
+masquerade_domains =
+masquerade_exceptions =
+mydestination = $myhostname, localhost.$mydomain
+myhostname = localhost
+mynetworks_style = subnet
+relayhost =
+
+alias_maps =
+canonical_maps =
+relocated_maps =
+sender_canonical_maps =
+transport_maps =
+mail_spool_directory = /var/mail
+message_strip_characters =
+defer_transports =
+mailbox_command =
+mailbox_transport =
+mailbox_size_limit = 0
+message_size_limit = 0
+strict_8bitmime = no
+strict_rfc821_envelopes = no
+smtpd_helo_required = no
+
+smtpd_client_restrictions =
+
+smtpd_helo_restrictions =
+
+smtpd_sender_restrictions =
+
+smtpd_recipient_restrictions =
+
+
+############################################################
+# SASL stuff
+############################################################
+smtp_sasl_auth_enable = no
+smtpd_sasl_auth_enable = no
+############################################################
+# TLS stuff
+############################################################
+#tls_append_default_CA = no
+relay_clientcerts =
+#tls_random_source = dev:/dev/urandom
+
+smtp_use_tls = no
+#smtp_tls_loglevel = 0
+smtp_enforce_tls = no
+smtp_tls_CAfile =
+smtp_tls_CApath =
+smtp_tls_cert_file =
+smtp_tls_key_file =
+#smtp_tls_session_cache_timeout = 3600s
+smtp_tls_session_cache_database =
+
+smtpd_use_tls = no
+#smtpd_tls_loglevel = 0
+smtpd_tls_CAfile =
+smtpd_tls_CApath =
+smtpd_tls_cert_file =
+smtpd_tls_key_file =
+smtpd_tls_ask_ccert = no
+smtpd_tls_received_header = no
+############################################################
+# Start MySQL from postfixwiki.org
+############################################################
+#relay_domains = $mydestination, hash:/etc/postfix/relay
+#virtual_alias_maps = hash:/etc/postfix/virtual
+virtual_alias_domains =
+#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_limit_inbox = no
+#virtual_mailbox_limit_maps = hash:/etc/postfix/vquota
+#virtual_mailbox_limit_override = yes
+#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
+### Needs Maildir++ compatible IMAP servers, like Courier-IMAP
+#virtual_maildir_filter = yes
+#virtual_maildir_filter_maps = hash:/etc/postfix/vfilter
+#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_maildir_limit_message_maps = hash:/etc/postfix/vmsg
+#virtual_overquota_bounce = yes
+#virtual_trash_count = yes
+#virtual_trash_name = ".Trash"
+############################################################
+# End MySQL from postfixwiki.org
+############################################################
+# Rewrite reject codes
+############################################################
+#unknown_address_reject_code = 550
+#unknown_client_reject_code = 550
+#unknown_hostname_reject_code = 550
+#soft_bounce = yes
+############################################################
+#debug_peer_list = example.com
+#debug_peer_level = 3
+

View File

@ -0,0 +1,12 @@
diff -ruN postfix-2.8.3-orig/conf/post-install postfix-2.8.3/conf/post-install
--- postfix-2.8.3-orig/conf/post-install 2011-01-09 15:24:00.000000000 +0100
+++ postfix-2.8.3/conf/post-install 2011-05-15 16:11:52.000000000 +0200
@@ -696,7 +696,7 @@
# Postfix 2.2.
# Add missing tlsmgr service to master.cf.
- grep '^tlsmgr.*tlsmgr' $config_directory/master.cf >/dev/null || {
+ grep '^#*tlsmgr.*tlsmgr' $config_directory/master.cf >/dev/null || {
echo Editing $config_directory/master.cf, adding missing entry for tlsmgr service
cat >>$config_directory/master.cf <<EOF || exit 1
tlsmgr unix - - n 1000? 1 tlsmgr

132
postfix-SuSE.patch Normal file
View File

@ -0,0 +1,132 @@
diff -ruN postfix-SuSE-orig/SuSEconfig.postfix postfix-SuSE/SuSEconfig.postfix
--- postfix-SuSE-orig/SuSEconfig.postfix 2011-05-11 10:30:56.000000000 +0200
+++ postfix-SuSE/SuSEconfig.postfix 2011-05-15 15:42:17.000000000 +0200
@@ -143,7 +143,6 @@
if [ "$CAPATH" ]
then
cpifnewer "$CAPATH/*" ./$CAPATH
- mkdir ./etc/ssl
rsync -avH /etc/ssl/certs ./etc/ssl
fi
# smtpd_tls_CAfile
@@ -162,10 +161,12 @@
fi
# smtpd_tls_key_file
smtpd_tls_key_file=`postconf -h smtpd_tls_key_file`
- if [ "$smtpd_tls_key_file" -a $smtpd_tls_key_file != '$smtpd_tls_cert_file' ]
- then
- DIR=`dirname $smtpd_tls_key_file`
- cpifnewer $smtpd_tls_key_file ./$DIR
+ if [ -n "$smtpd_tls_key_file" ]; then
+ if [ "$smtpd_tls_key_file" -a $smtpd_tls_key_file != '$smtpd_tls_cert_file' ]
+ then
+ DIR=`dirname $smtpd_tls_key_file`
+ cpifnewer $smtpd_tls_key_file ./$DIR
+ fi
fi
# PAM
@@ -263,7 +264,6 @@
# to be on the save side
$PCONF -e "daemon_directory = @daemon_directory@"
- $PCONF -e "program_directory = @daemon_directory@"
$PCONF -e "readme_directory = @readme_directory@"
$PCONF -e "html_directory = @html_directory@"
$PCONF -e "sample_directory = @sample_directory@"
@@ -557,19 +557,28 @@
fi
if test "$POSTFIX_SMTP_TLS_SERVER" == "yes" -o "$POSTFIX_SMTP_TLS_SERVER_LEGACY_SUPPORT" == "yes"; then
$PCONF -e "smtpd_use_tls = yes"
- $PCONF -e "smtpd_tls_CAfile = $POSTFIX_SSL_PATH/$POSTFIX_TLS_CAFILE"
+ if [ -n "$POSTFIX_TLS_CAFILE" -a -s "$POSTFIX_SSL_PATH/$POSTFIX_TLS_CAFILE" ]; then
+ $PCONF -e "smtpd_tls_CAfile = $POSTFIX_SSL_PATH/$POSTFIX_TLS_CAFILE"
+ else
+ $PCONF -e "smtpd_tls_CApath = $POSTFIX_SSL_PATH/cacerts"
+ fi
$PCONF -e "smtpd_tls_cert_file = $POSTFIX_SSL_PATH/$POSTFIX_TLS_CERTFILE"
$PCONF -e "smtpd_tls_key_file = $POSTFIX_SSL_PATH/$POSTFIX_TLS_KEYFILE"
- $PCONF -e "smtpd_tls_received_header = yes"
- $PCONF -e "tls_daemon_random_source = dev:/dev/urandom"
- $PCONF -e "tls_random_source = dev:/dev/urandom"
$PCONF -e "relay_clientcerts = hash:/etc/postfix/relay_ccerts"
$PCONF -e "smtpd_tls_ask_ccert = yes"
+ $PCONF -e "smtpd_tls_received_header = yes"
touch -m -d "1 minute ago" $TMPDIR/main.cf
CURRENT=$($PCONF -h smtpd_recipient_restrictions)
$PCONF -e "smtpd_recipient_restrictions = permit_tls_clientcerts, $CURRENT"
else
$PCONF -e "smtpd_use_tls = no"
+ $PCONF -e "smtpd_tls_CAfile ="
+ $PCONF -e "smtpd_tls_CApath ="
+ $PCONF -e "smtpd_tls_cert_file ="
+ $PCONF -e "smtpd_tls_key_file ="
+ $PCONF -e "relay_clientcerts ="
+ $PCONF -e "smtpd_tls_ask_ccert = no"
+ $PCONF -e "smtpd_tls_received_header = no"
fi
if test "$POSTFIX_SMTP_TLS_CLIENT" == "no"; then
@@ -585,16 +594,22 @@
$PCONF -e "smtp_enforce_tls = yes"
fi
if test "$POSTFIX_SMTP_TLS_CLIENT" = "yes" -o "$POSTFIX_SMTP_TLS_CLIENT" = "must" ; then
- test -s "$POSTFIX_SSL_PATH/$POSTFIX_TLS_CAFILE" && \
+ if [ -n "$POSTFIX_TLS_CAFILE" -a -s "$POSTFIX_SSL_PATH/$POSTFIX_TLS_CAFILE" ]; then
$PCONF -e "smtp_tls_CAfile = $POSTFIX_SSL_PATH/$POSTFIX_TLS_CAFILE"
+ else
+ $PCONF -e "smtp_tls_CApath = $POSTFIX_SSL_PATH/cacerts"
+ fi
test -s "$POSTFIX_SSL_PATH/$POSTFIX_TLS_CERTFILE" && \
$PCONF -e "smtp_tls_cert_file = $POSTFIX_SSL_PATH/$POSTFIX_TLS_CERTFILE"
test -s "$POSTFIX_SSL_PATH/$POSTFIX_TLS_KEYFILE" && \
$PCONF -e "smtp_tls_key_file = $POSTFIX_SSL_PATH/$POSTFIX_TLS_KEYFILE"
- $PCONF -e "smtp_tls_session_cache_timeout = 3600s"
$PCONF -e "smtp_tls_session_cache_database = btree:/var/lib/postfix/smtpd_tls_session_cache"
else
- $PCONF -e "smtp_use_tls = no"
+ $PCONF -e "smtp_tls_CAfile ="
+ $PCONF -e "smtp_tls_CApath ="
+ $PCONF -e "smtp_tls_cert_file ="
+ $PCONF -e "smtp_tls_key_file ="
+ $PCONF -e "smtp_tls_session_cache_database ="
fi
ALLMAPS="hash:/etc/aliases"
diff -ruN postfix-SuSE-orig/sysconfig.postfix postfix-SuSE/sysconfig.postfix
--- postfix-SuSE-orig/sysconfig.postfix 2011-05-11 10:30:56.000000000 +0200
+++ postfix-SuSE/sysconfig.postfix 2011-05-14 18:00:01.000000000 +0200
@@ -198,9 +198,8 @@
# Note: This only has effect, if POSTFIX_BASIC_SPAM_PREVENTION is set
# to either "medium" or "hard" or "custom". If left empty, no RBL checks will take place.
#
-# Example: POSTFIX_RBL_HOSTS="rbl1.example.com, rbl2.example.com"
+# Example: POSTFIX_RBL_HOSTS="cbl.abuseat.org, dnsbl.sorbs.net, dnsbl.ahbl.org"
#
-#POSTFIX_RBL_HOSTS="zen.spamhaus.org, cbl.abuseat.org, dnsbl.sorbs.net, dnsbl.ahbl.org"
POSTFIX_RBL_HOSTS=""
## Type: yesno
@@ -287,7 +286,7 @@
# Note: "if set to "medium" default is "hash:/etc/postfix/access, reject_unknown_sender_domain"
#
# Example:
-# POSTFIX_SMTPD_SENDERNT_RESTRICTIONS="reject_unauth_pipelining,
+# POSTFIX_SMTPD_SENDER_RESTRICTIONS="reject_unauth_pipelining,
# check_client_access hash:/etc/postfix/pop-before-smtp,
# check_client_access hash:/etc/postfix/relay,
# check_client_access hash:/etc/postfix/access,
@@ -414,7 +413,12 @@
## Default: "cacert.pem"
## Config: postfix
#
-# name of the CA file (below POSTFIX_SSL_PATH)
+# name of the CAfile (below POSTFIX_SSL_PATH)
+#
+# when having more than one CA you want to trust, then
+# leave it empty and CApath ( POSTFIX_SSL_PATH/cacerts )
+# is used instead. Do not forget to run c_rehash POSTFIX_SSL_PATH/cacerts
+# after storing the certs.
#
POSTFIX_TLS_CAFILE="cacert.pem"

View File

@ -1,108 +1,21 @@
diff -uNr postfix-2.7.1.orig/README_FILES/VDA_README postfix-2.7.1/README_FILES/VDA_README
--- postfix-2.7.1.orig/README_FILES/VDA_README 1970-01-01 01:00:00.000000000 +0100
+++ postfix-2.7.1/README_FILES/VDA_README 2010-03-02 08:18:28.000000000 +0100
@@ -0,0 +1,97 @@
+Installation:
diff -uNr postfix-2.8.1.orig/README_FILES/VDA_README postfix-2.8.1/README_FILES/VDA_README
--- postfix-2.8.1.orig/README_FILES/VDA_README 1970-01-01 01:00:00.000000000 +0100
+++ postfix-2.8.1/README_FILES/VDA_README 2011-03-03 08:26:48.000000000 +0100
@@ -0,0 +1,10 @@
+Postfix VDA patch for maildir++ quota support by
+ Anderson Nadal <andernadal@gmail.com>
+ Tomas Macek <maca02@atlas.cz>
+ Lucca Longinotti
+
+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
+See VDA patch official website http://vda.sf.net for instructions
+howto patch the Postfix's sourcetree and configure the options
+provided by this patch.
+
+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=<size>" 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<timestamp> 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 -uNr postfix-2.7.1.orig/src/global/mail_params.h postfix-2.7.1/src/global/mail_params.h
--- postfix-2.7.1.orig/src/global/mail_params.h 2010-01-17 21:54:35.000000000 +0100
+++ postfix-2.7.1/src/global/mail_params.h 2010-03-02 08:18:28.000000000 +0100
@@ -2311,6 +2311,54 @@
diff -uNr postfix-2.8.1.orig/src/global/mail_params.h postfix-2.8.1/src/global/mail_params.h
--- postfix-2.8.1.orig/src/global/mail_params.h 2011-01-17 15:56:39.000000000 +0100
+++ postfix-2.8.1/src/global/mail_params.h 2011-03-03 07:40:55.000000000 +0100
@@ -2333,6 +2333,54 @@
#define DEF_VIRT_GID_MAPS ""
extern char *var_virt_gid_maps;
@ -157,9 +70,9 @@ diff -uNr postfix-2.7.1.orig/src/global/mail_params.h postfix-2.7.1/src/global/m
#define VAR_VIRT_MINUID "virtual_minimum_uid"
#define DEF_VIRT_MINUID 100
extern int var_virt_minimum_uid;
diff -uNr postfix-2.7.1.orig/src/util/file_limit.c postfix-2.7.1/src/util/file_limit.c
--- postfix-2.7.1.orig/src/util/file_limit.c 2003-10-22 20:48:36.000000000 +0200
+++ postfix-2.7.1/src/util/file_limit.c 2010-03-02 08:18:28.000000000 +0100
diff -uNr postfix-2.8.1.orig/src/util/file_limit.c postfix-2.8.1/src/util/file_limit.c
--- postfix-2.8.1.orig/src/util/file_limit.c 2003-10-22 20:48:36.000000000 +0200
+++ postfix-2.8.1/src/util/file_limit.c 2011-03-03 07:40:55.000000000 +0100
@@ -85,7 +85,11 @@
#else
struct rlimit rlim;
@ -173,9 +86,9 @@ diff -uNr postfix-2.7.1.orig/src/util/file_limit.c postfix-2.7.1/src/util/file_l
if (setrlimit(RLIMIT_FSIZE, &rlim) < 0)
msg_fatal("setrlimit: %m");
#ifdef SIGXFSZ
diff -uNr postfix-2.7.1.orig/src/virtual/mailbox.c postfix-2.7.1/src/virtual/mailbox.c
--- postfix-2.7.1.orig/src/virtual/mailbox.c 2008-07-26 03:22:37.000000000 +0200
+++ postfix-2.7.1/src/virtual/mailbox.c 2010-03-02 08:18:28.000000000 +0100
diff -uNr postfix-2.8.1.orig/src/virtual/mailbox.c postfix-2.8.1/src/virtual/mailbox.c
--- postfix-2.8.1.orig/src/virtual/mailbox.c 2008-07-26 03:22:37.000000000 +0200
+++ postfix-2.8.1/src/virtual/mailbox.c 2011-03-03 07:40:55.000000000 +0100
@@ -70,6 +70,70 @@
#define YES 1
#define NO 0
@ -355,10 +268,10 @@ diff -uNr postfix-2.7.1.orig/src/virtual/mailbox.c postfix-2.7.1/src/virtual/mai
/*
* Cleanup.
diff -uNr postfix-2.7.1.orig/src/virtual/maildir.c postfix-2.7.1/src/virtual/maildir.c
--- postfix-2.7.1.orig/src/virtual/maildir.c 2006-06-26 14:59:19.000000000 +0200
+++ postfix-2.7.1/src/virtual/maildir.c 2010-03-02 08:28:18.000000000 +0100
@@ -63,28 +63,419 @@
diff -uNr postfix-2.8.1.orig/src/virtual/maildir.c postfix-2.8.1/src/virtual/maildir.c
--- postfix-2.8.1.orig/src/virtual/maildir.c 2006-06-26 14:59:19.000000000 +0200
+++ postfix-2.8.1/src/virtual/maildir.c 2011-03-03 08:15:42.000000000 +0100
@@ -63,28 +63,420 @@
#include <mbox_open.h>
#include <dsn_util.h>
@ -786,11 +699,12 @@ diff -uNr postfix-2.7.1.orig/src/virtual/maildir.c postfix-2.7.1/src/virtual/mai
+ DICT *FILTERS;
+ long sqlmtime; /* Latest modification time from sql2file(). */
+ int cmd_len;
+ int read_mds = -1; /* read_maildirsize() returned value */
+ struct stat mdffile_stat; /* To check if the maildirfolder file exists. */
GETTIMEOFDAY(&starttime);
@@ -93,15 +484,14 @@
@@ -93,15 +485,14 @@
*/
state.level++;
if (msg_verbose)
@ -809,7 +723,7 @@ diff -uNr postfix-2.7.1.orig/src/virtual/maildir.c postfix-2.7.1/src/virtual/mai
}
/*
@@ -109,18 +499,110 @@
@@ -109,18 +500,116 @@
* attribute to reflect the final recipient.
*/
if (vstream_fseek(state.msg_attr.fp, state.msg_attr.offset, SEEK_SET) < 0)
@ -882,28 +796,34 @@ diff -uNr postfix-2.7.1.orig/src/virtual/maildir.c postfix-2.7.1/src/virtual/mai
+ myname, usr_attr.mailbox, n);
+ }
+ else {
+ if (msg_verbose)
+ msg_info("%s: quota is negative (%ld), using default virtual_mailbox_limit (%d)",
+ myname, n, var_virt_mailbox_limit);
+ /* Invalid limit size (negative). Use default virtual_mailbox_limit. */
+ n = var_virt_mailbox_limit;
+ }
+ }
+ else {
+ if (msg_verbose)
+ msg_info("%s: no limit found in the maps, using default virtual_mailbox_limit (%d)",
+ myname, var_virt_mailbox_limit);
+ /* There is no limit in the maps. Use default virtual_mailbox_limit. */
+ n = var_virt_mailbox_limit;
+ }
+
+ /* If there should is a quota on maildir generaly, check it
+ before dlivering the mail */
+ /* If there should is a quota on maildir generaly, check it before delivering the mail */
+ if (n != 0) {
+ set_eugid(usr_attr.uid, usr_attr.gid);
+ /* try to read the quota from maildirsize file. Returned values by read_maildirsize:
+ x < 0 = something failed
+ x >= 0 = reading successfully finished - sum si returned, so sum size of Maildir was 0 or more */
+ if (!var_virt_mailbox_limit_inbox && var_virt_maildir_extended && read_maildirsize(sizefilename, &saved_size, &saved_count) >= 0) {
+ if (!var_virt_mailbox_limit_inbox && var_virt_maildir_extended && (read_mds = read_maildirsize(sizefilename, &saved_size, &saved_count)) >= 0) {
+ 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: var_virt_mailbox_limit == 1 OR var_virt_maildir_extended == 0 OR read_maildidrsize() returned value x < 0 as saying something failed", myname);
+ msg_info("%s: We will recount the quota (var_virt_mailbox_limit = %d, var_virt_maildir_extended = %d, read_maildirsize = %d)",
+ myname, var_virt_mailbox_limit, var_virt_maildir_extended, read_mds);
+
+ /* sanity */
+ saved_size = 0;
@ -926,7 +846,7 @@ diff -uNr postfix-2.7.1.orig/src/virtual/maildir.c postfix-2.7.1/src/virtual/mai
/*
* 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
@@ -174,46 +656,288 @@
@@ -174,46 +663,288 @@
* [...]
*/
set_eugid(usr_attr.uid, usr_attr.gid);
@ -1252,7 +1172,7 @@ diff -uNr postfix-2.7.1.orig/src/virtual/maildir.c postfix-2.7.1/src/virtual/mai
}
set_eugid(var_owner_uid, var_owner_gid);
@@ -223,31 +947,64 @@
@@ -223,31 +954,64 @@
* location possibly under user control.
*/
if (mail_copy_status & MAIL_COPY_STAT_CORRUPT) {
@ -1336,9 +1256,9 @@ diff -uNr postfix-2.7.1.orig/src/virtual/maildir.c postfix-2.7.1/src/virtual/mai
+
return (deliver_status);
}
diff -uNr postfix-2.7.1.orig/src/virtual/virtual.c postfix-2.7.1/src/virtual/virtual.c
--- postfix-2.7.1.orig/src/virtual/virtual.c 2010-01-02 02:57:04.000000000 +0100
+++ postfix-2.7.1/src/virtual/virtual.c 2010-03-02 08:18:28.000000000 +0100
diff -uNr postfix-2.8.1.orig/src/virtual/virtual.c postfix-2.8.1/src/virtual/virtual.c
--- postfix-2.8.1.orig/src/virtual/virtual.c 2010-01-02 02:57:04.000000000 +0100
+++ postfix-2.8.1/src/virtual/virtual.c 2011-03-03 07:40:55.000000000 +0100
@@ -335,12 +335,30 @@
char *var_mail_spool_dir; /* XXX dependency fix */
bool var_strict_mbox_owner;
@ -1468,9 +1388,9 @@ diff -uNr postfix-2.7.1.orig/src/virtual/virtual.c postfix-2.7.1/src/virtual/vir
MAIL_SERVER_PRIVILEGED,
0);
}
diff -uNr postfix-2.7.1.orig/src/virtual/virtual.h postfix-2.7.1/src/virtual/virtual.h
--- postfix-2.7.1.orig/src/virtual/virtual.h 2006-01-08 00:59:47.000000000 +0100
+++ postfix-2.7.1/src/virtual/virtual.h 2010-03-02 08:18:28.000000000 +0100
diff -uNr postfix-2.8.1.orig/src/virtual/virtual.h postfix-2.8.1/src/virtual/virtual.h
--- postfix-2.8.1.orig/src/virtual/virtual.h 2006-01-08 00:59:47.000000000 +0100
+++ postfix-2.8.1/src/virtual/virtual.h 2011-03-03 07:40:55.000000000 +0100
@@ -34,6 +34,9 @@
extern MAPS *virtual_mailbox_maps;
extern MAPS *virtual_uid_maps;

View File

@ -1,3 +1,18 @@
-------------------------------------------------------------------
Sun May 15 14:16:03 UTC 2011 - chris@computersalat.de
- rework TLS stuff
o reworked main.cf patch
o added postfix-SuSE patch
o added post-install patch
Editing /etc/postfix/master.cf, adding missing entry for tlsmgr service
add only if it really does not exist
- removed Author from description
- updated vda patch
o vda-2.7.1 > vda-v10-2.8.1
- fix build for SLE_10
o no fdupes ;)
-------------------------------------------------------------------
Wed May 11 08:23:56 UTC 2011 - varkoly@novell.com

View File

@ -20,7 +20,7 @@
Name: postfix
Summary: A fast, secure, and flexible mailer
Version: 2.8.3
Release: 5
Release: 1
License: IBM Public License ..
Group: Productivity/Networking/Email/Servers
Url: http://www.postfix.org/
@ -34,8 +34,10 @@ Patch: dynamic_maps.patch
Patch1: dynamic_maps_pie.patch
Patch2: pointer_to_literals.patch
Patch3: ipv6_disabled.patch
Patch10: %{name}-2.7.1-main.cf.patch
Patch11: %{name}-vda-2.7.1.patch
Patch10: %{name}-2.8.3-main.cf.patch
Patch11: %{name}-2.8.3-post-install.patch
Patch12: %{name}-vda-v10-2.8.1.patch
Patch13: %{name}-SuSE.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
PreReq: %insserv_prereq %fillup_prereq
PreReq: /usr/bin/getent
@ -89,11 +91,6 @@ Provides: smtp_daemon
%description
Postfix aims to be an alternative to the widely-used sendmail program.
Authors:
--------
Wietse Venema <wietse@porcupine.org>
%package devel
Summary: Development headers for the postfix package
License: IBM Public License ..
@ -104,11 +101,6 @@ PreReq: %{name} = %{version}
%description devel
Postfix aims to be an alternative to the widely-used sendmail program.
Authors:
--------
Wietse Venema <wietse@porcupine.org>
%package doc
Summary: Documentations for the postfix package
License: IBM Public License ..
@ -121,11 +113,6 @@ BuildArch: noarch
Postfix aims to be an alternative to the widely-used sendmail program.
This package contains the documentation for %{name}
Authors:
--------
Wietse Venema <wietse@porcupine.org>
%package mysql
Summary: Postfix plugin to support MySQL maps
License: IBM Public License ..
@ -137,11 +124,6 @@ PreReq: %{name} = %{version}
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 <wietse@porcupine.org>
%package postgresql
Summary: Postfix plugin to support PostgreSQL maps
License: IBM Public License ..
@ -154,11 +136,6 @@ 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 <wietse@porcupine.org>
%prep
%setup -n %{name}-%{version} -a 1 -a 2
%patch -p1
@ -167,6 +144,8 @@ Authors:
%patch3 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13
# ---------------------------------------------------------------------------
%build
@ -293,9 +272,7 @@ $RPM_BUILD_ROOT/usr/sbin/postconf -c $RPM_BUILD_ROOT/etc/%{name} \
"readme_directory = %{pf_readme_directory}" \
"html_directory = %{pf_html_directory}" \
"sample_directory = %{pf_sample_directory}" \
"daemon_directory = %{pf_daemon_directory}" \
"biff = no" \
"inet_protocols = all"
"daemon_directory = %{pf_daemon_directory}"
#Set Permissions
install -m 644 %{name}-SuSE/%{name}-files $RPM_BUILD_ROOT/usr/lib/postfix/postfix-files
# postfix-mysql
@ -312,8 +289,10 @@ for example in AIX42 BSDI* F* HPUX* IRIX* NETBSD1 NEXTSTEP3 OPENSTEP4 OSF1 Solar
done
cp -a examples/* $RPM_BUILD_ROOT%{pf_sample_directory}
cp -a html/* $RPM_BUILD_ROOT%{pf_html_directory}
%if 0%{?suse_version} >= 1100
%fdupes $RPM_BUILD_ROOT%{pf_docdir}
%fdupes $RPM_BUILD_ROOT%{_mandir}
%endif
# ---------------------------------------------------------------------------
install -m 755 %{SOURCE11} $RPM_BUILD_ROOT/usr/sbin/
@ -394,6 +373,10 @@ fi
if [ ${1:-0} -gt 1 ]; then
/usr/sbin/postfix upgrade-configuration || :
fi
# before fillup we need to fix something
%{__sed} -i \
-e "s/POSTFIX_SMTPD_SENDERNT_RESTRICTIONS/POSTFIX_SMTPD_SENDER_RESTRICTIONS/" \
%{_sysconfdir}/sysconfig/%{name}
%{fillup_and_insserv -y postfix}
%{fillup_only -an mail}
/sbin/ldconfig