From: Wietse Venema
/etc/postfix/main.cf:
# Note: avoid hash files here. Use btree instead.
- address_verify_map = btree:/var/mta/verify
+ address_verify_map = btree:/var/lib/postfix/verify
-NOTE: Do not put this file in a file system that may run out +
NOTE 1: As of version 2.5, Postfix no longer uses root privileges +when opening this file. The file should now be stored under the +Postfix-owned data_directory. As a migration aid, an attempt to +open the file under a non-Postfix directory is redirected to the +Postfix-owned data_directory, and a warning is logged. If you wish +to continue using an pre-existing database file, move it to the +data_directory, and change ownership to the account specfied with +the mail_owner parameter.
+ +NOTE 2: Do not put this file in a file system that may run out of space. When the address verification table gets corrupted the world comes to an end and YOU will have to MANUALLY fix things as described in the next section. Meanwhile, you will not receive mail via SMTP.
-The verify(8) daemon process will create a new database when +
NOTE 3: The verify(8) daemon process will create a new database when none exists, and will open/create the file before it enters the -chroot jail and before it drops root privileges.
+chroot jail.Postfix version 2.2 introduces support for TLS as described in -RFC 3207. TLS Support for older Postfix versions was available as +RFC 3207. TLS Support for older Postfix versions was available as an add-on patch. The section "Compatibility with Postfix < 2.2 TLS support" below discusses the differences between these implementations.
@@ -425,7 +425,7 @@ private key. This is intended behavior.You can ENFORCE the use of TLS, so that the Postfix SMTP server announces STARTTLS and accepts no mail without TLS encryption, by -setting "smtpd_enforce_tls = yes". According to RFC 2487 this MUST +setting "smtpd_enforce_tls = yes". According to RFC 2487 this MUST NOT be applied in case of a publicly-referenced Postfix SMTP server. This option is off by default and should only seldom be used.
@@ -564,13 +564,18 @@ the cost of repeatedly negotiating TLS session keys is high.+/etc/postfix/main.cf: - smtpd_tls_session_cache_database = btree:/etc/postfix/smtpd_scache + smtpd_tls_session_cache_database = btree:/var/lib/postfix/smtpd_scache
As of version 2.5, Postfix will no longer maintain this file +in a directory with non-Postfix ownership. As a migration aid, +attempts to open such files are redirected to the Postfix-owned +$data_directory, and a warning is logged.
+Cached Postfix SMTP server session information expires after a certain amount of time. Postfix/TLS does not use the OpenSSL -default of 300s, but a longer time of 3600sec (=1 hour). RFC 2246 +default of 300s, but a longer time of 3600sec (=1 hour). RFC 2246 recommends a maximum of 24 hours.
Example:
@@ -933,13 +938,18 @@ is allowed to negotiate per unit time.+/etc/postfix/main.cf: - smtp_tls_session_cache_database = btree:/etc/postfix/smtp_scache + smtp_tls_session_cache_database = btree:/var/lib/postfix/smtp_scache
As of version 2.5, Postfix will no longer maintain this file +in a directory with non-Postfix ownership. As a migration aid, +attempts to open such files are redirected to the Postfix-owned +$data_directory, and a warning is logged.
+Cached Postfix SMTP client session information expires after a certain amount of time. Postfix/TLS does not use the OpenSSL -default of 300s, but a longer time of 3600s (=1 hour). RFC 2246 +default of 300s, but a longer time of 3600s (=1 hour). RFC 2246 recommends a maximum of 24 hours.
Example:
@@ -994,7 +1004,7 @@ CommonName is checked. Verification may be turned off with theEnforcing the use of TLS is useful if you know that you will only -connect to servers that support RFC 2487 _and_ that present server +connect to servers that support RFC 2487 _and_ that present server certificates that meet the above requirements. An example would be a client only sends email to one specific mailhub that offers the necessary STARTTLS support.
@@ -1011,7 +1021,7 @@ the necessary STARTTLS support.As of RFC 2487 the requirements for hostname checking for MTA +
As of RFC 2487 the requirements for hostname checking for MTA clients are not set. When TLS is required (smtp_enforce_tls = yes), the option smtp_tls_enforce_peername can be set to "no" to disable strict remote SMTP server hostname checking. In this case, the mail diff --git a/postfix/html/TLS_README.html b/postfix/html/TLS_README.html index 1cbe97e32..d8ce9fc5c 100644 --- a/postfix/html/TLS_README.html +++ b/postfix/html/TLS_README.html @@ -463,7 +463,7 @@ so that the Postfix SMTP server announces STARTTLS and accepts no mail without TLS encryption, by setting "smtpd_tls_security_level = encrypt" (Postfix 2.3 and later) or "smtpd_enforce_tls = yes" (obsolete but still -supported). According to RFC 2487 this MUST NOT be applied in case +supported). According to RFC 2487 this MUST NOT be applied in case of a publicly-referenced Postfix SMTP server. This option is off by default and should only seldom be used.
@@ -616,9 +616,15 @@ the cost of repeatedly negotiating TLS session keys is high. +Note: as of version 2.5, Postfix no longer uses root privileges +when opening this file. The file should now be stored under the +Postfix-owned data_directory. As a migration aid, an attempt to +open the file under a non-Postfix directory is redirected to the +Postfix-owned data_directory, and a warning is logged.
+Cached Postfix SMTP server session information expires after a certain amount of time. Postfix/TLS does not use the OpenSSL -default of 300s, but a longer time of 3600sec (=1 hour). RFC 2246 +default of 300s, but a longer time of 3600sec (=1 hour). RFC 2246 recommends a maximum of 24 hours.
Example:
@@ -1077,9 +1083,15 @@ is allowed to negotiate per unit time. +Note: as of version 2.5, Postfix no longer uses root privileges +when opening this file. The file should now be stored under the +Postfix-owned data_directory. As a migration aid, an attempt to +open the file under a non-Postfix directory is redirected to the +Postfix-owned data_directory, and a warning is logged.
+Cached Postfix SMTP client session information expires after a certain amount of time. Postfix/TLS does not use the OpenSSL -default of 300s, but a longer time of 3600s (=1 hour). RFC 2246 +default of 300s, but a longer time of 3600s (=1 hour). RFC 2246 recommends a maximum of 24 hours.
Example:
@@ -1461,7 +1473,7 @@ verification as a default policy. Mandatory server certificate verification as a default security
level may be appropriate if you know that you will only connect to
-servers that support RFC 2487 and that present verifiable
+servers that support RFC 2487 and that present verifiable
server certificates. An example would be a client that sends all
email to a central mailhub that offers the necessary STARTTLS
support. In such cases, you can often use a
Mandatory secure server certificate verification as a default
security level may be appropriate if you know that you will only
-connect to servers that support RFC 2487 and that present
+connect to servers that support RFC 2487 and that present
verifiable server certificates. An example would be a client that
sends all email to a central mailhub that offers the necessary
STARTTLS support.
The tlsmgr(8) process saves the PRNG state to a persistent exchange file at regular times and when the process terminates, so that it can recover the PRNG state the next time it starts up. -This file is created when it does not exist. Its default location -is under the Postfix configuration directory, which is not the -proper place for information that is modified by Postfix. Instead, -the file location should probably be on the /var partition (but -not inside the chroot jail).
+This file is created when it does not exist.Examples:
/etc/postfix/main.cf:
- tls_random_exchange_name = /etc/postfix/prng_exch
+ tls_random_exchange_name = /var/lib/postfix/prng_exch
tls_random_prng_update_period = 3600s
+As of version 2.5, Postfix no longer uses root privileges when +opening this file. The file should now be stored under the Postfix-owned +data_directory. As a migration aid, an attempt to open the file +under a non-Postfix directory is redirected to the Postfix-owned +data_directory, and a warning is logged. If you wish to continue +using a pre-existing PRNG state file, move it to the data_directory +and change the ownership to the account specified with the mail_owner +parameter.
+ +With earlier Postfix versions the default file location +is under the Postfix configuration directory, which is not the +proper place for information that is modified by Postfix.
+The following steps will get you started quickly. Because you diff --git a/postfix/html/postconf.5.html b/postfix/html/postconf.5.html index 7d364d855..cd525afc4 100644 --- a/postfix/html/postconf.5.html +++ b/postfix/html/postconf.5.html @@ -163,6 +163,12 @@ database becomes corrupted, the world comes to an end. To recover delete the file and do "postfix reload".
+As of version 2.5, Postfix no longer uses root privileges when +opening this file. The file should now be stored under the Postfix-owned +data_directory. As a migration aid, an attempt to open the file +under a non-Postfix directory is redirected to the Postfix-owned +data_directory, and a warning is logged.
+Examples:
@@ -6180,13 +6186,10 @@ This feature is available in Postfix 2.0 and later.-The lookup tables that the proxymap(8) server is allowed to access -for the read-write service. If implemented with local files, these -tables are preferably stored under the location specified with the -data_directory configuration parameter. -Table references that don't begin with proxy: are ignored. -
+The lookup tables that the proxymap(8) server is allowed to +access for the read-write service. Postfix-owned local database +files should be stored under the Postfix-owned data_directory. +Table references that don't begin with proxy: are ignored.
This feature is available in Postfix 2.5 and later. @@ -9116,13 +9119,19 @@ implemented indirectly in the tlsmgr(8) daemon. This per-smtp-instance master.cf overrides of this parameter are not effective. Note, that each of the cache databases supported by tlsmgr(8) daemon: $smtpd_tls_session_cache_database, $smtp_tls_session_cache_database -(and with Postfix 2.3 and later $lmtp_session_cache_database), needs to -be stored separately, it is not at this time possible to store multiple +(and with Postfix 2.3 and later $lmtp_tls_session_cache_database), needs to +be stored separately. It is not at this time possible to store multiple caches in a single database.
Note: dbm databases are not suitable. TLS session objects are too large.
+As of version 2.5, Postfix no longer uses root privileges when +opening this file. The file should now be stored under the Postfix-owned +data_directory. As a migration aid, an attempt to open the file +under a non-Postfix directory is redirected to the Postfix-owned +data_directory, and a warning is logged.
+Example:
@@ -11850,13 +11859,19 @@ implemented indirectly in the tlsmgr(8) daemon. This per-smtpd-instance master.cf overrides of this parameter are not effective. Note, that each of the cache databases supported by tlsmgr(8) daemon: $smtpd_tls_session_cache_database, $smtp_tls_session_cache_database -(and with Postfix 2.3 and later $lmtp_session_cache_database), needs to be -stored separately, it is not at this time possible to store multiple +(and with Postfix 2.3 and later $lmtp_tls_session_cache_database), needs to be +stored separately. It is not at this time possible to store multiple caches in a single database.Note: dbm databases are not suitable. TLS session objects are too large.
+As of version 2.5, Postfix no longer uses root privileges when +opening this file. The file should now be stored under the Postfix-owned +data_directory. As a migration aid, an attempt to open the file +under a non-Postfix directory is redirected to the Postfix-owned +data_directory, and a warning is logged.
+Example:
@@ -12245,15 +12260,18 @@ bytes is read.
Name of the pseudo random number generator (PRNG) state file that is maintained by tlsmgr(8). The file is created when it does not exist, and its length is fixed at 1024 bytes.
-Since this file is modified by Postfix, it should probably be -kept in the /var file system, instead of under $config_directory. -The location should not be inside the chroot jail.
+As of version 2.5, Postfix no longer uses root privileges when +opening this file, and the default file location was changed from +${config_directory}/prng_exch to ${data_directory}/prng_exch. As +a migration aid, an attempt to open the file under a non-Postfix +directory is redirected to the Postfix-owned data_directory, and a +warning is logged.
This feature is available in Postfix 2.2 and later.
diff --git a/postfix/html/proxymap.8.html b/postfix/html/proxymap.8.html index 48100fe83..a11b312aa 100644 --- a/postfix/html/proxymap.8.html +++ b/postfix/html/proxymap.8.html @@ -117,13 +117,13 @@ PROXYMAP(8) PROXYMAP(8) sitive processes. Postfix-writable data files should be stored under a dedi- - cated directory that is writable only by the $mail_owner - account, such as the $data_directory directory. + cated directory that is writable only by the Postfix mail + system, such as the Postfix-owned data_directory. In particular, Postfix-writable files should never exist in root-owned directories. That would open up a particular - type of security hole where ownership (root) does not - match content provenance (Postfix). + type of security hole where ownership of a file or direc- + tory does not match the provider of its content. DIAGNOSTICS Problems and transactions are logged to syslogd(8). diff --git a/postfix/html/tlsmgr.8.html b/postfix/html/tlsmgr.8.html index a60980d8a..509ee8b06 100644 --- a/postfix/html/tlsmgr.8.html +++ b/postfix/html/tlsmgr.8.html @@ -47,6 +47,13 @@ TLSMGR(8) TLSMGR(8) source and exchange file, and creates or truncates the optional TLS session cache files. + With Postfix version 2.5 and later, the tlsmgr(8) no + longer uses root privileges when opening cache files. + These files should now be stored under the Postfix-owned + data_directory. As a migration aid, an attempt to open a + cache file under a non-Postfix directory is redirected to + the Postfix-owned data_directory, and a warning is logged. + DIAGNOSTICS Problems and transactions are logged to the syslog daemon. @@ -111,7 +118,7 @@ TLSMGR(8) TLSMGR(8) $tls_random_source when (re)seeding the in-memory pseudo random number generator (PRNG) pool. - tls_random_exchange_name (${config_directory}/prng_exch) + tls_random_exchange_name (see 'postconf -d' output) Name of the pseudo random number generator (PRNG) state file that is maintained by tlsmgr(8). diff --git a/postfix/html/verify.8.html b/postfix/html/verify.8.html index 23dce7167..744a5bb71 100644 --- a/postfix/html/verify.8.html +++ b/postfix/html/verify.8.html @@ -54,6 +54,14 @@ VERIFY(8) VERIFY(8) trades one problem (disk space exhaustion) for another one (poor response time to client requests). + With Postfix version 2.5 and later, the verify(8) server + no longer uses root privileges when opening the + address_verify_map cache file. The file should now be + stored under the Postfix-owned data_directory. As a + migration aid, an attempt to open a cache file under a + non-Postfix directory is redirected to the Postfix-owned + data_directory, and a warning is logged. + DIAGNOSTICS Problems and transactions are logged to syslogd(8). @@ -82,12 +90,13 @@ VERIFY(8) VERIFY(8) Optional lookup table for persistent address veri- fication status storage. - address_verify_sender (postmaster) + address_verify_sender ($double_bounce_sender) The sender address to use in address verification - probes. + probes; prior to Postfix 2.5 the default was "post- + master". address_verify_positive_expire_time (31d) - The time after which a successful probe expires + The time after which a successful probe expires from the address verification cache. address_verify_positive_refresh_time (7d) @@ -99,24 +108,24 @@ VERIFY(8) VERIFY(8) results. address_verify_negative_expire_time (3d) - The time after which a failed probe expires from + The time after which a failed probe expires from the address verification cache. address_verify_negative_refresh_time (3h) - The time after which a failed address verification + The time after which a failed address verification probe needs to be refreshed. PROBE MESSAGE ROUTING CONTROLS - By default, probe messages are delivered via the same - route as regular messages. The following parameters can + By default, probe messages are delivered via the same + route as regular messages. The following parameters can be used to override specific message routing mechanisms. address_verify_relayhost ($relayhost) - Overrides the relayhost parameter setting for + Overrides the relayhost parameter setting for address verification probes. address_verify_transport_maps ($transport_maps) - Overrides the transport_maps parameter setting for + Overrides the transport_maps parameter setting for address verification probes. address_verify_local_transport ($local_transport) @@ -124,7 +133,7 @@ VERIFY(8) VERIFY(8) address verification probes. address_verify_virtual_transport ($virtual_transport) - Overrides the virtual_transport parameter setting + Overrides the virtual_transport parameter setting for address verification probes. address_verify_relay_transport ($relay_transport) @@ -132,17 +141,17 @@ VERIFY(8) VERIFY(8) address verification probes. address_verify_default_transport ($default_transport) - Overrides the default_transport parameter setting + Overrides the default_transport parameter setting for address verification probes. MISCELLANEOUS CONTROLS config_directory (see 'postconf -d' output) - The default location of the Postfix main.cf and + The default location of the Postfix main.cf and master.cf configuration files. daemon_timeout (18000s) - How much time a Postfix daemon process may take to - handle a request before it is terminated by a + How much time a Postfix daemon process may take to + handle a request before it is terminated by a built-in watchdog timer. ipc_timeout (3600s) @@ -150,23 +159,23 @@ VERIFY(8) VERIFY(8) over an internal communication channel. process_id (read-only) - The process ID of a Postfix command or daemon + The process ID of a Postfix command or daemon process. process_name (read-only) - The process name of a Postfix command or daemon + The process name of a Postfix command or daemon process. queue_directory (see 'postconf -d' output) - The location of the Postfix top-level queue direc- + The location of the Postfix top-level queue direc- tory. syslog_facility (mail) The syslog facility of Postfix logging. syslog_name (postfix) - The mail system name that is prepended to the - process name in syslog records, so that "smtpd" + The mail system name that is prepended to the + process name in syslog records, so that "smtpd" becomes, for example, "postfix/smtpd". SEE ALSO @@ -179,7 +188,7 @@ VERIFY(8) VERIFY(8) ADDRESS_VERIFICATION_README, address verification howto LICENSE - The Secure Mailer license must be distributed with this + The Secure Mailer license must be distributed with this software. HISTORY diff --git a/postfix/man/man5/postconf.5 b/postfix/man/man5/postconf.5 index e204a342a..5bef7fd80 100644 --- a/postfix/man/man5/postconf.5 +++ b/postfix/man/man5/postconf.5 @@ -99,6 +99,12 @@ Specify a location in a file system that will not fill up. If the database becomes corrupted, the world comes to an end. To recover delete the file and do "\fBpostfix reload\fR". .PP +As of version 2.5, Postfix no longer uses root privileges when +opening this file. The file should now be stored under the Postfix-owned +data_directory. As a migration aid, an attempt to open the file +under a non-Postfix directory is redirected to the Postfix-owned +data_directory, and a warning is logged. +.PP Examples: .PP .nf @@ -3436,10 +3442,9 @@ Table references that don't begin with proxy: are ignored. .PP This feature is available in Postfix 2.0 and later. .SH proxy_write_maps (default: see "postconf -d" output) -The lookup tables that the \fBproxymap\fR(8) server is allowed to access -for the read-write service. If implemented with local files, these -tables are preferably stored under the location specified with the -data_directory configuration parameter. +The lookup tables that the \fBproxymap\fR(8) server is allowed to +access for the read-write service. Postfix-owned local database +files should be stored under the Postfix-owned data_directory. Table references that don't begin with proxy: are ignored. .PP This feature is available in Postfix 2.5 and later. @@ -5359,13 +5364,19 @@ implemented indirectly in the \fBtlsmgr\fR(8) daemon. This means that per-smtp-instance master.cf overrides of this parameter are not effective. Note, that each of the cache databases supported by \fBtlsmgr\fR(8) daemon: $smtpd_tls_session_cache_database, $smtp_tls_session_cache_database -(and with Postfix 2.3 and later $lmtp_session_cache_database), needs to -be stored separately, it is not at this time possible to store multiple +(and with Postfix 2.3 and later $lmtp_tls_session_cache_database), needs to +be stored separately. It is not at this time possible to store multiple caches in a single database. .PP Note: \fBdbm\fR databases are not suitable. TLS session objects are too large. .PP +As of version 2.5, Postfix no longer uses root privileges when +opening this file. The file should now be stored under the Postfix-owned +data_directory. As a migration aid, an attempt to open the file +under a non-Postfix directory is redirected to the Postfix-owned +data_directory, and a warning is logged. +.PP Example: .PP .nf @@ -7234,13 +7245,19 @@ implemented indirectly in the \fBtlsmgr\fR(8) daemon. This means that per-smtpd-instance master.cf overrides of this parameter are not effective. Note, that each of the cache databases supported by \fBtlsmgr\fR(8) daemon: $smtpd_tls_session_cache_database, $smtp_tls_session_cache_database -(and with Postfix 2.3 and later $lmtp_session_cache_database), needs to be -stored separately, it is not at this time possible to store multiple +(and with Postfix 2.3 and later $lmtp_tls_session_cache_database), needs to be +stored separately. It is not at this time possible to store multiple caches in a single database. .PP Note: \fBdbm\fR databases are not suitable. TLS session objects are too large. .PP +As of version 2.5, Postfix no longer uses root privileges when +opening this file. The file should now be stored under the Postfix-owned +data_directory. As a migration aid, an attempt to open the file +under a non-Postfix directory is redirected to the Postfix-owned +data_directory, and a warning is logged. +.PP Example: .PP .nf @@ -7454,14 +7471,17 @@ symmetric keys. If using EGD or a device file, a maximum of 255 bytes is read. .PP This feature is available in Postfix 2.2 and later. -.SH tls_random_exchange_name (default: ${config_directory}/prng_exch) +.SH tls_random_exchange_name (default: see "postconf -d" output) Name of the pseudo random number generator (PRNG) state file that is maintained by \fBtlsmgr\fR(8). The file is created when it does not exist, and its length is fixed at 1024 bytes. .PP -Since this file is modified by Postfix, it should probably be -kept in the /var file system, instead of under $config_directory. -The location should not be inside the chroot jail. +As of version 2.5, Postfix no longer uses root privileges when +opening this file, and the default file location was changed from +${config_directory}/prng_exch to ${data_directory}/prng_exch. As +a migration aid, an attempt to open the file under a non-Postfix +directory is redirected to the Postfix-owned data_directory, and a +warning is logged. .PP This feature is available in Postfix 2.2 and later. .SH tls_random_prng_update_period (default: 3600s) diff --git a/postfix/man/man8/proxymap.8 b/postfix/man/man8/proxymap.8 index 6d6aa619d..025b30726 100644 --- a/postfix/man/man8/proxymap.8 +++ b/postfix/man/man8/proxymap.8 @@ -119,13 +119,13 @@ and opens the table directly. This allows the same main.cf setting to be used by sensitive and non-sensitive processes. Postfix-writable data files should be stored under a dedicated -directory that is writable only by the $\fBmail_owner\fR -account, such as the $\fBdata_directory\fR directory. +directory that is writable only by the Postfix mail system, +such as the Postfix-owned \fBdata_directory\fR. In particular, Postfix-writable files should never exist in root-owned directories. That would open up a particular -type of security hole where ownership (root) does not match -content provenance (Postfix). +type of security hole where ownership of a file or directory +does not match the provider of its content. .SH DIAGNOSTICS .ad .fi @@ -185,8 +185,8 @@ Available in Postfix 2.5 and later: The directory with Postfix-writable data files (for example: caches, pseudo-random numbers). .IP "\fBproxy_write_maps (see 'postconf -d' output)\fR" -The lookup tables that the \fBproxymap\fR(8) server is allowed to access -for the read-write service. +The lookup tables that the \fBproxymap\fR(8) server is allowed to +access for the read-write service. .SH "SEE ALSO" .na .nf diff --git a/postfix/man/man8/tlsmgr.8 b/postfix/man/man8/tlsmgr.8 index 6bba143a5..5765ea391 100644 --- a/postfix/man/man8/tlsmgr.8 +++ b/postfix/man/man8/tlsmgr.8 @@ -48,6 +48,14 @@ The \fBtlsmgr\fR(8) can be run chrooted and with reduced privileges. At process startup it connects to the entropy source and exchange file, and creates or truncates the optional TLS session cache files. + +With Postfix version 2.5 and later, the \fBtlsmgr\fR(8) no +longer uses root privileges when opening cache files. These +files should now be stored under the Postfix-owned +\fBdata_directory\fR. As a migration aid, an attempt to +open a cache file under a non-Postfix directory is redirected +to the Postfix-owned \fBdata_directory\fR, and a warning +is logged. .SH DIAGNOSTICS .ad .fi @@ -110,7 +118,7 @@ random number generator (PRNG) pool. The number of bytes that \fBtlsmgr\fR(8) reads from $tls_random_source when (re)seeding the in-memory pseudo random number generator (PRNG) pool. -.IP "\fBtls_random_exchange_name (${config_directory}/prng_exch)\fR" +.IP "\fBtls_random_exchange_name (see 'postconf -d' output)\fR" Name of the pseudo random number generator (PRNG) state file that is maintained by \fBtlsmgr\fR(8). .IP "\fBtls_random_prng_update_period (3600s)\fR" diff --git a/postfix/man/man8/verify.8 b/postfix/man/man8/verify.8 index 2a9eedbe0..fa8c05ec9 100644 --- a/postfix/man/man8/verify.8 +++ b/postfix/man/man8/verify.8 @@ -52,6 +52,14 @@ The address verification server can be coerced to store unlimited amounts of garbage. Limiting the cache size trades one problem (disk space exhaustion) for another one (poor response time to client requests). + +With Postfix version 2.5 and later, the \fBverify\fR(8) +server no longer uses root privileges when opening the +\fBaddress_verify_map\fR cache file. The file should now +be stored under the Postfix-owned \fBdata_directory\fR. As +a migration aid, an attempt to open a cache file under a +non-Postfix directory is redirected to the Postfix-owned +\fBdata_directory\fR, and a warning is logged. .SH DIAGNOSTICS .ad .fi @@ -88,8 +96,9 @@ The text below provides only a parameter summary. See .IP "\fBaddress_verify_map (empty)\fR" Optional lookup table for persistent address verification status storage. -.IP "\fBaddress_verify_sender (postmaster)\fR" -The sender address to use in address verification probes. +.IP "\fBaddress_verify_sender ($double_bounce_sender)\fR" +The sender address to use in address verification probes; prior +to Postfix 2.5 the default was "postmaster". .IP "\fBaddress_verify_positive_expire_time (31d)\fR" The time after which a successful probe expires from the address verification cache. diff --git a/postfix/proto/ADDRESS_VERIFICATION_README.html b/postfix/proto/ADDRESS_VERIFICATION_README.html index 6addcb7b5..46be3f376 100644 --- a/postfix/proto/ADDRESS_VERIFICATION_README.html +++ b/postfix/proto/ADDRESS_VERIFICATION_README.html @@ -272,7 +272,7 @@ specific domains that often appear in forged email. unverified_sender_reject_code = 550 # Note 1: Be sure to read the "Caching" section below! # Note 2: Avoid hash files here. Use btree instead. - address_verify_map = btree:/var/mta/verify + address_verify_map = btree:/var/lib/postfix/verify /etc/postfix/sender_access: aol.com reject_unverified_sender @@ -314,7 +314,7 @@ you can see what mail would be blocked: ... # Note 1: Be sure to read the "Caching" section below! # Note 2: Avoid hash files here. Use btree instead. - address_verify_map = btree:/var/mta/verify + address_verify_map = btree:/var/lib/postfix/verify @@ -373,19 +373,28 @@ stop".
/etc/postfix/main.cf:
# Note: avoid hash files here. Use btree instead.
- address_verify_map = btree:/var/mta/verify
+ address_verify_map = btree:/var/lib/postfix/verify
-NOTE: Do not put this file in a file system that may run out +
NOTE 1: As of version 2.5, Postfix no longer uses root privileges +when opening this file. The file should now be stored under the +Postfix-owned data_directory. As a migration aid, an attempt to +open the file under a non-Postfix directory is redirected to the +Postfix-owned data_directory, and a warning is logged. If you wish +to continue using an pre-existing database file, move it to the +data_directory, and change ownership to the account specfied with +the mail_owner parameter.
+ +NOTE 2: Do not put this file in a file system that may run out of space. When the address verification table gets corrupted the world comes to an end and YOU will have to MANUALLY fix things as described in the next section. Meanwhile, you will not receive mail via SMTP.
-The verify(8) daemon process will create a new database when +
NOTE 3: The verify(8) daemon process will create a new database when none exists, and will open/create the file before it enters the -chroot jail and before it drops root privileges.
+chroot jail.Note: as of version 2.5, Postfix no longer uses root privileges +when opening this file. The file should now be stored under the +Postfix-owned data_directory. As a migration aid, an attempt to +open the file under a non-Postfix directory is redirected to the +Postfix-owned data_directory, and a warning is logged.
+Cached Postfix SMTP server session information expires after a certain amount of time. Postfix/TLS does not use the OpenSSL default of 300s, but a longer time of 3600sec (=1 hour). RFC 2246 @@ -1077,6 +1083,12 @@ is allowed to negotiate per unit time.
+Note: as of version 2.5, Postfix no longer uses root privileges +when opening this file. The file should now be stored under the +Postfix-owned data_directory. As a migration aid, an attempt to +open the file under a non-Postfix directory is redirected to the +Postfix-owned data_directory, and a warning is logged.
+Cached Postfix SMTP client session information expires after a certain amount of time. Postfix/TLS does not use the OpenSSL default of 300s, but a longer time of 3600s (=1 hour). RFC 2246 @@ -2164,22 +2176,31 @@ The default maximal time interval is 1 hour.
The tlsmgr(8) process saves the PRNG state to a persistent exchange file at regular times and when the process terminates, so that it can recover the PRNG state the next time it starts up. -This file is created when it does not exist. Its default location -is under the Postfix configuration directory, which is not the -proper place for information that is modified by Postfix. Instead, -the file location should probably be on the /var partition (but -not inside the chroot jail).
+This file is created when it does not exist.Examples:
/etc/postfix/main.cf:
- tls_random_exchange_name = /etc/postfix/prng_exch
+ tls_random_exchange_name = /var/lib/postfix/prng_exch
tls_random_prng_update_period = 3600s
+As of version 2.5, Postfix no longer uses root privileges when +opening this file. The file should now be stored under the Postfix-owned +data_directory. As a migration aid, an attempt to open the file +under a non-Postfix directory is redirected to the Postfix-owned +data_directory, and a warning is logged. If you wish to continue +using a pre-existing PRNG state file, move it to the data_directory +and change the ownership to the account specified with the mail_owner +parameter.
+ +With earlier Postfix versions the default file location +is under the Postfix configuration directory, which is not the +proper place for information that is modified by Postfix.
+The following steps will get you started quickly. Because you diff --git a/postfix/proto/postconf.proto b/postfix/proto/postconf.proto index 8a1889615..8f8daa962 100644 --- a/postfix/proto/postconf.proto +++ b/postfix/proto/postconf.proto @@ -183,6 +183,12 @@ Specify a location in a file system that will not fill up. If the database becomes corrupted, the world comes to an end. To recover delete the file and do "postfix reload".
+ +As of version 2.5, Postfix no longer uses root privileges when +opening this file. The file should now be stored under the Postfix-owned +data_directory. As a migration aid, an attempt to open the file +under a non-Postfix directory is redirected to the Postfix-owned +data_directory, and a warning is logged.
Examples: @@ -7215,13 +7221,10 @@ This feature is available in Postfix 2.0 and later. %PARAM proxy_write_maps see "postconf -d" output -
-The lookup tables that the proxymap(8) server is allowed to access -for the read-write service. If implemented with local files, these -tables are preferably stored under the location specified with the -data_directory configuration parameter. -Table references that don't begin with proxy: are ignored. -
+The lookup tables that the proxymap(8) server is allowed to +access for the read-write service. Postfix-owned local database +files should be stored under the Postfix-owned data_directory. +Table references that don't begin with proxy: are ignored.
This feature is available in Postfix 2.5 and later. @@ -8480,12 +8483,18 @@ implemented indirectly in the tlsmgr(8) daemon. This means that per-smtpd-instance master.cf overrides of this parameter are not effective. Note, that each of the cache databases supported by tlsmgr(8) daemon: $smtpd_tls_session_cache_database, $smtp_tls_session_cache_database -(and with Postfix 2.3 and later $lmtp_session_cache_database), needs to be -stored separately, it is not at this time possible to store multiple +(and with Postfix 2.3 and later $lmtp_tls_session_cache_database), needs to be +stored separately. It is not at this time possible to store multiple caches in a single database.
Note: dbm databases are not suitable. TLS session objects are too large.
+ +As of version 2.5, Postfix no longer uses root privileges when +opening this file. The file should now be stored under the Postfix-owned +data_directory. As a migration aid, an attempt to open the file +under a non-Postfix directory is redirected to the Postfix-owned +data_directory, and a warning is logged.
Example:
@@ -8738,12 +8747,18 @@ implemented indirectly in the tlsmgr(8) daemon. This means that per-smtp-instance master.cf overrides of this parameter are not effective. Note, that each of the cache databases supported by tlsmgr(8) daemon: $smtpd_tls_session_cache_database, $smtp_tls_session_cache_database -(and with Postfix 2.3 and later $lmtp_session_cache_database), needs to -be stored separately, it is not at this time possible to store multiple +(and with Postfix 2.3 and later $lmtp_tls_session_cache_database), needs to +be stored separately. It is not at this time possible to store multiple caches in a single database.Note: dbm databases are not suitable. TLS session objects are too large.
+ +As of version 2.5, Postfix no longer uses root privileges when +opening this file. The file should now be stored under the Postfix-owned +data_directory. As a migration aid, an attempt to open the file +under a non-Postfix directory is redirected to the Postfix-owned +data_directory, and a warning is logged.
Example:
@@ -8966,15 +8981,18 @@ smtp_tls_dcert_file = /etc/postfix/client-dsa.pemThis feature is available in Postfix 2.2 and later.
-%PARAM tls_random_exchange_name ${config_directory}/prng_exch +%PARAM tls_random_exchange_name see "postconf -d" outputName of the pseudo random number generator (PRNG) state file that is maintained by tlsmgr(8). The file is created when it does not exist, and its length is fixed at 1024 bytes.
-Since this file is modified by Postfix, it should probably be -kept in the /var file system, instead of under $config_directory. -The location should not be inside the chroot jail.
+As of version 2.5, Postfix no longer uses root privileges when +opening this file, and the default file location was changed from +${config_directory}/prng_exch to ${data_directory}/prng_exch. As +a migration aid, an attempt to open the file under a non-Postfix +directory is redirected to the Postfix-owned data_directory, and a +warning is logged.
This feature is available in Postfix 2.2 and later.
diff --git a/postfix/src/global/Makefile.in b/postfix/src/global/Makefile.in index b87e77335..bb44e93d9 100644 --- a/postfix/src/global/Makefile.in +++ b/postfix/src/global/Makefile.in @@ -28,7 +28,7 @@ SRCS = abounce.c anvil_clnt.c been_here.c bounce.c bounce_log.c \ tok822_resolve.c tok822_rewrite.c tok822_tree.c trace.c \ user_acl.c valid_mailhost_addr.c verify.c verify_clnt.c \ verp_sender.c wildcard_inet_addr.c xtext.c delivered_hdr.c \ - fold_addr.c header_body_checks.c mkmap_proxy.c + fold_addr.c header_body_checks.c mkmap_proxy.c data_redirect.c OBJS = abounce.o anvil_clnt.o been_here.o bounce.o bounce_log.o \ canon_addr.o cfg_parser.o cleanup_strerror.o cleanup_strflags.o \ clnt_stream.o conv_time.o db_common.o debug_peer.o debug_process.o \ @@ -58,7 +58,7 @@ OBJS = abounce.o anvil_clnt.o been_here.o bounce.o bounce_log.o \ tok822_resolve.o tok822_rewrite.o tok822_tree.o trace.o \ user_acl.o valid_mailhost_addr.o verify.o verify_clnt.o \ verp_sender.o wildcard_inet_addr.o xtext.o delivered_hdr.o \ - fold_addr.o header_body_checks.o mkmap_proxy.o + fold_addr.o header_body_checks.o mkmap_proxy.o data_redirect.o HDRS = abounce.h anvil_clnt.h been_here.h bounce.h bounce_log.h \ canon_addr.h cfg_parser.h cleanup_user.h clnt_stream.h config.h \ conv_time.h db_common.h debug_peer.h debug_process.h defer.h \ @@ -82,7 +82,7 @@ HDRS = abounce.h anvil_clnt.h been_here.h bounce.h bounce_log.h \ string_list.h strip_addr.h sys_exits.h timed_ipc.h tok822.h \ trace.h user_acl.h valid_mailhost_addr.h verify.h verify_clnt.h \ verp_sender.h wildcard_inet_addr.h xtext.h delivered_hdr.h \ - fold_addr.h header_body_checks.h + fold_addr.h header_body_checks.h data_redirect.h TESTSRC = rec2stream.c stream2rec.c recdump.c DEFS = -I. -I$(INC_DIR) -D$(SYSTYPE) CFLAGS = $(DEBUG) $(OPT) $(DEFS) @@ -94,7 +94,8 @@ TESTPROG= domain_list dot_lockfile mail_addr_crunch mail_addr_find \ resolve_local rewrite_clnt stream2rec string_list tok822_parse \ quote_821_local mail_conf_time mime_state strip_addr \ verify_clnt xtext anvil_clnt scache ehlo_mask \ - valid_mailhost_addr own_inet_addr header_body_checks + valid_mailhost_addr own_inet_addr header_body_checks \ + data_redirect LIBS = ../../lib/libutil.a LIB_DIR = ../../lib @@ -274,6 +275,9 @@ own_inet_addr: own_inet_addr.c $(LIB) $(LIBS) header_body_checks: header_body_checks.c $(LIB) $(LIBS) $(CC) $(CFLAGS) -DTEST -o $@ $@.c $(LIB) $(LIBS) $(SYSLIBS) +data_redirect: data_redirect.c $(LIB) $(LIBS) + $(CC) $(CFLAGS) -DTEST -o $@ $@.c $(LIB) $(LIBS) $(SYSLIBS) + tests: tok822_test mime_tests strip_addr_test tok822_limit_test \ xtext_test scache_multi_test ehlo_mask_test \ namadr_list_test mail_conf_time_test header_body_checks_tests @@ -636,6 +640,23 @@ conv_time.o: ../../include/msg.h conv_time.o: ../../include/sys_defs.h conv_time.o: conv_time.c conv_time.o: conv_time.h +data_redirect.o: ../../include/argv.h +data_redirect.o: ../../include/dict.h +data_redirect.o: ../../include/dict_cdb.h +data_redirect.o: ../../include/dict_db.h +data_redirect.o: ../../include/dict_dbm.h +data_redirect.o: ../../include/msg.h +data_redirect.o: ../../include/name_code.h +data_redirect.o: ../../include/split_at.h +data_redirect.o: ../../include/stringops.h +data_redirect.o: ../../include/sys_defs.h +data_redirect.o: ../../include/vbuf.h +data_redirect.o: ../../include/vstream.h +data_redirect.o: ../../include/vstring.h +data_redirect.o: data_redirect.c +data_redirect.o: data_redirect.h +data_redirect.o: dict_proxy.h +data_redirect.o: mail_params.h db_common.o: ../../include/argv.h db_common.o: ../../include/dict.h db_common.o: ../../include/match_list.h diff --git a/postfix/src/global/data_redirect.c b/postfix/src/global/data_redirect.c new file mode 100644 index 000000000..95697075c --- /dev/null +++ b/postfix/src/global/data_redirect.c @@ -0,0 +1,244 @@ +/*++ +/* NAME +/* data_redirect 3 +/* SUMMARY +/* redirect legacy writes to Postfix-owned data directory +/* SYNOPSIS +/* #include