Merge conflicts between postfix 3.5.2 and 3.7.3

This commit is contained in:
christos 2022-10-08 16:12:43 +00:00
parent 4a6720548c
commit 67b9b338a7
368 changed files with 13149 additions and 8178 deletions

View File

@ -6,7 +6,7 @@ WWAARRNNIINNGG
Recipient address verification may cause an increased load on down-stream
servers in the case of a dictionary attack or a flood of backscatter bounces.
Sender address verification may cause your site to be blacklisted by some
Sender address verification may cause your site to be denylisted by some
providers. See also the "Limitations" section below for more.
WWhhaatt PPoossttffiixx aaddddrreessss vveerriiffiiccaattiioonn ccaann ddoo ffoorr yyoouu
@ -89,11 +89,11 @@ LLiimmiittaattiioonnss ooff aaddddrreessss vveerriiffi
mail for a remote address can bounce AFTER a preferred MTA accepts the
recipient address, or AFTER a preferred MTA accepts the message content.
* Some sites may blacklist you when you are probing them too often (a probe
is an SMTP session that does not deliver mail), or when you are probing
them too often for a non-existent address. This is one reason why you
should use sender address verification sparingly, if at all, when your site
receives lots of email.
* Some sites may denylist you when you are probing them too often (a probe is
an SMTP session that does not deliver mail), or when you are probing them
too often for a non-existent address. This is one reason why you should use
sender address verification sparingly, if at all, when your site receives
lots of email.
* Normally, address verification probe messages follow the same path as
regular mail. However, some sites send mail to the Internet via an
@ -125,7 +125,7 @@ LLiimmiittaattiioonnss ooff aaddddrreessss vveerriiffi
"double-bounce@$myorigin" would succeed.
* The downside of using a non-empty sender address is that the address may
end op on spammer mailing lists. Although Postfix always discards mail to
end up on spammer mailing lists. Although Postfix always discards mail to
the double-bounce address, this still results in wasted network bandwidth
and server capacity. To defeat address harvesting, Postfix 2.9 and later
support time-dependent sender addresses when you specify a non-zero
@ -234,7 +234,7 @@ SSeennddeerr aaddddrreessss vveerriiffiiccaattiioonn f
Unfortunately, sender address verification cannot simply be turned on for all
email - you are likely to lose legitimate mail from mis-configured systems. You
almost certainly will have to set up white lists for specific addresses, or
almost certainly will have to set up allow lists for specific addresses, or
even for entire domains.
To find out how sender address verification would affect your mail, specify
@ -260,11 +260,11 @@ be blocked:
This is also a good way to populate your cache with address verification
results before you start to actually reject mail.
The sender_access restriction is needed to whitelist domains or addresses that
The sender_access restriction is needed to allowlist domains or addresses that
are known to be OK. Although Postfix will not mark a known-to-be-good address
as bad after a probe fails, it is better to be safe than sorry.
NOTE: You will have to whitelist sites such as securityfocus.com and other
NOTE: You will have to allowlist sites such as securityfocus.com and other
sites that operate mailing lists that use a different sender address for each
posting (VERP). Such addresses pollute the address verification cache quickly,
and generate unnecessary sender verification probes.

View File

@ -1,5 +0,0 @@
PPoossttffiixx CCyyrruuss HHoowwttoo
-------------------------------------------------------------------------------
This document will be made available via http://www.postfix.org/.

View File

@ -331,7 +331,7 @@ install" or "make upgrade".
# make upgrade meta_directory=/usr/libexec/postfix ...
# make install meta_directory=/usr/libexec/postfix ...
As with the command "make makefiles, the command "make install/upgrade
As with the command "make makefiles", the command "make install/upgrade
name=value..." will replace the string MAIL_VERSION at the end of a
configuration parameter value with the Postfix release version. Do not try to
specify something like $mail_version on this command line. This produces
@ -593,6 +593,9 @@ The following is an extensive list of names and values.
||-DNO_POSIX_GETPW_R |getpwuid_r. By default Postfix uses these |
|| |where they are known to be available. |
|_|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
||-DNO_RES_NCALLS |Do not build with the threadsafe resolver(5) |
|| |API (res_ninit() etc.). |
|_|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
|| |Use setjmp()/longjmp() instead of sigsetjmp |
||-DNO_SIGSETJMP |()/siglongjmp(). By default, Postfix uses |
|| |sigsetjmp()/siglongjmp() when they are known |
@ -1085,6 +1088,7 @@ Finally, build the indexed aliases file with one of the following commands:
# newaliases
# sendmail -bi
# postalias /etc/aliases (pathname is system dependent!)
1111 -- TToo cchhrroooott oorr nnoott ttoo cchhrroooott

View File

@ -12,7 +12,7 @@ NOTE: By turning on TLS support in Postfix, you not only get the ability to
encrypt mail and to authenticate remote SMTP clients or servers. You also turn
on hundreds of thousands of lines of OpenSSL library code. Assuming that
OpenSSL is written as carefully as Wietse's own code, every 1000 lines
introduce one additional bug into Postfix.
introduces one additional bug into Postfix.
Topics covered in this document:
@ -101,10 +101,10 @@ SMTP server configurations will not accidentally enable TLS without
certificates.
Note that server certificates are nnoott optional in TLS 1.3. To run without
certificates you'd have to disable the TLS 1.3 protocol by including '!TLSv1.3'
in "smtpd_tls_protocols" and perhaps also "smtpd_tls_mandatory_protocols". It
is simpler instead to just configure a certificate chain. Certificate-less
operation is not recommended.
certificates you'd have to disable the TLS 1.3 protocol by including
"<=TLSv1.2" (or, for Postfix < 3.6, "!TLSv1.3") in "smtpd_tls_protocols" and
perhaps also "smtpd_tls_mandatory_protocols". It is simpler instead to just
configure a certificate chain. Certificate-less operation is not recommended.
RSA, DSA and ECDSA (Postfix >= 2.6) certificates are supported. Most sites only
have RSA certificates. You can configure all three at the same time, in which
@ -121,7 +121,7 @@ To verify the Postfix SMTP server certificate, the remote SMTP client must
receive the issuing CA certificates via the TLS handshake or via public-key
infrastructure. This means that the Postfix server public-key certificate file
must include the server certificate first, then the issuing CA(s) (bottom-up
order). The Postfix SMTP server certificate must be usable as SSL server
order). The Postfix SMTP server certificate must be usable as an SSL server
certificate and hence pass the "openssl verify -purpose sslserver ..." test.
The examples that follow show how to create a server certificate file. We
@ -178,7 +178,8 @@ and any additional issuer certificates. A single file can hold multiple (key,
cert, [chain]) sequences, one per algorithm. It is typically simpler to keep
the chain for each algorithm in its own file. Most users are likely to deploy
just a single RSA chain, but with OpenSSL 1.1.1, it is possible to deploy up to
five chains, one each for RSA, ECDSA, ED25519, ED448 and even the obsolete DSA.
five chains, one each for RSA, ECDSA, ED25519, ED448, and even the obsolete
DSA.
# Postfix >= 3.4. Preferred configuration interface. Each file
# starts with the private key, followed by the corresponding
@ -364,11 +365,11 @@ Example:
/etc/postfix/main.cf:
smtpd_tls_security_level = encrypt
TLS is sometimes used in the non-standard "wrapper" mode where a server always
uses TLS, instead of announcing STARTTLS support and waiting for remote SMTP
clients to request TLS service. Some clients, namely Outlook [Express] prefer
the "wrapper" mode. This is true for OE (Win32 < 5.0 and Win32 >=5.0 when run
on a port<>25 and OE (5.01 Mac on all ports).
TLS is also used in the "wrapper" mode where a server always uses TLS, instead
of announcing STARTTLS support and waiting for remote SMTP clients to request
TLS service. Some clients, namely Outlook [Express] prefer the "wrapper" mode.
This is true for OE (Win32 < 5.0 and Win32 >=5.0 when run on a port<>25 and OE
(5.01 Mac on all ports).
It is strictly discouraged to use this mode from main.cf. If you want to
support this service, enable a special port in master.cf and specify "-
@ -545,12 +546,17 @@ server access control:
The digest algorithm used to compute the client certificate fingerprints is
specified with the main.cf smtpd_tls_fingerprint_digest parameter. The default
is "md5", for compatibility with Postfix versions < 2.5.
algorithm is sshhaa225566 with Postfix >= 3.6 and the ccoommppaattiibbiilliittyy__lleevveell set to 3.6
or higher. With Postfix <= 3.5, the default algorithm is mmdd55. The best-practice
algorithm is now sshhaa225566. Recent advances in hash function cryptanalysis have
led to md5 and sha1 being deprecated in favor of sha256. However, as long as
there are no known "second pre-image" attacks against the older algorithms,
their use in this context, though not recommended, is still likely safe.
The permit_tls_all_clientcerts feature must be used with caution, because it
can result in too many access permissions. Use this feature only if a special
CA issues the client certificates, and only if this CA is listed as trusted CA.
If other CAs are trusted, any owner of a valid client certificate would be
CA issues the client certificates, and only if this CA is listed as a trusted
CA. If other CAs are trusted, any owner of a valid client certificate would be
authorized. The permit_tls_all_clientcerts feature can be practical for a
specially created email relay server.
@ -596,26 +602,12 @@ command extracts the public key always in "PEM" format. We pipe the result to
another OpenSSL command that converts the key to DER and then to the "dgst"
command to compute the fingerprint.
The actual command to transform the key to DER format depends on the version of
OpenSSL used. With OpenSSL 1.0.0 and later, the "pkey" command supports all key
types. With OpenSSL 0.9.8 and earlier, the key type is always RSA (nobody uses
DSA, and EC keys are not fully supported by 0.9.8), so the "rsa" command is
used.
Example:
# OpenSSL 1.0 with all certificates and SHA-1 fingerprints.
$ openssl x509 -in cert.pem -noout -pubkey |
openssl pkey -pubin -outform DER |
openssl dgst -sha1 -c
(stdin)= 64:3f:1f:f6:e5:1e:d4:2a:56:8b:fc:09:1a:61:98:b5:bc:7c:60:58
# OpenSSL 0.9.8 with RSA certificates and MD5 fingerprints.
$ openssl x509 -in cert.pem -noout -pubkey |
openssl rsa -pubin -outform DER |
openssl dgst -md5 -c
(stdin)= f4:62:60:f6:12:8f:d5:8d:28:4d:13:a7:db:b2:ff:50
Note: Postfix 2.9.0-2.9.5 computed the public key fingerprint incorrectly. To
use public-key fingerprints, upgrade to Postfix 2.9.6 or later.
openssl dgst -sha256 -c
(stdin)= 64:3f:1f:f6:e5:1e:d4:2a:...:8b:fc:09:1a:61:98:b5:bc:7c:60:58
SSeerrvveerr--ssiiddee cciipphheerr ccoonnttrroollss
@ -641,8 +633,8 @@ With mandatory and opportunistic TLS encryption, the Postfix SMTP server by
default disables SSLv2 and SSLv3 with Postfix releases after the middle of
2015; older releases only disable SSLv2 for mandatory TLS. The mandatory TLS
protocol list is specified via the smtpd_tls_mandatory_protocols configuration
parameter. The smtpd_tls_protocols parameter (Postfix >= 2.6) controls the SSL/
TLS protocols used with opportunistic TLS.
parameter. The smtpd_tls_protocols parameter (Postfix >= 2.6) controls the TLS
protocols used with opportunistic TLS.
Note that the OpenSSL library only supports protocol exclusion (not inclusion).
For this reason, Postfix can exclude only protocols that are known at the time
@ -658,8 +650,7 @@ configurations may not interoperate with some clients, and require that TLSv1.3
be explicitly disabled. Therefore, they are not recommended, it is better and
simpler to just configure a suitable certificate.
Example, MSA that requires TLSv1 or higher, not SSLv2 or SSLv3, with high grade
ciphers:
Example, MSA that requires TLSv1.2 or higher, with high grade ciphers:
/etc/postfix/main.cf:
smtpd_tls_cert_file = /etc/postfix/cert.pem
@ -667,10 +658,10 @@ ciphers:
smtpd_tls_mandatory_ciphers = high
smtpd_tls_mandatory_exclude_ciphers = aNULL, MD5
smtpd_tls_security_level = encrypt
# Preferred syntax with Postfix >= 2.5:
smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3
# Preferred syntax with Postfix >= 3.6:
smtpd_tls_mandatory_protocols = >=TLSv1.2
# Legacy syntax:
smtpd_tls_mandatory_protocols = TLSv1
smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
With Postfix >= 3.4, specify instead a single file that holds the key followed
by the corresponding certificate and any associated issuing certificates,
@ -933,9 +924,10 @@ not specified consistently.
submission
/etc/postfix/tls_policy:
[example.net]:587 encrypt protocols=TLSv1 ciphers=high
[example.net]:msa encrypt protocols=TLSv1 ciphers=high
[example.net]:submission encrypt protocols=TLSv1 ciphers=high
# Postfix >= 3.6 "protocols" syntax
[example.net]:587 encrypt protocols=>=TLSv1.2 ciphers=high
# Legacy "protocols" syntax
[example.net]:msa encrypt protocols=!SSLv2:!SSLv3 ciphers=high
DDAANNEE TTLLSS aauutthheennttiiccaattiioonn..
@ -1033,8 +1025,9 @@ The pre-requisites for DANE support in the Postfix SMTP client are:
The above client pre-requisites do not apply to the Postfix SMTP server. It
will support DANE provided it supports TLSv1 and its TLSA records are published
in a DNSSEC signed zone. To receive DANE secured mail for multiple domains, use
the same hostname to add the server to each domain's MX records. There are no
plans to implement SNI in the Postfix SMTP server.
the same hostname to add the server to each domain's MX records. The Postfix
SMTP server supports SNI (Postfix 3.4 and later), configured with
tls_server_sni_maps.
Note: The Postfix SMTP client's internal stub DNS resolver is DNSSEC-aware, but
it does not itself validate DNSSEC records, rather it delegates DNSSEC
@ -1129,6 +1122,14 @@ fingerprints can be combined with a "|" delimiter in a single match attribute,
or multiple match attributes can be employed. The ":" character is not used as
a delimiter as it occurs between each pair of fingerprint (hexadecimal) digits.
The default algorithm is sshhaa225566 with Postfix >= 3.6 and the ccoommppaattiibbiilliittyy__lleevveell
set to 3.6 or higher; with Postfix <= 3.5, the default algorithm is mmdd55. The
best-practice algorithm is now sshhaa225566. Recent advances in hash function
cryptanalysis have led to md5 and sha1 being deprecated in favor of sha256.
However, as long as there are no known "second pre-image" attacks against the
older algorithms, their use in this context, though not recommended, is still
likely safe.
Example: fingerprint TLS security with an internal mailhub. Two matching
fingerprints are listed. The relayhost may be multiple physical hosts behind a
load-balancer, each with its own private/public key and self-signed
@ -1138,22 +1139,22 @@ trusted just prior to the transition.
relayhost = [mailhub.example.com]
smtp_tls_security_level = fingerprint
smtp_tls_fingerprint_digest = md5
smtp_tls_fingerprint_digest = sha256
smtp_tls_fingerprint_cert_match =
3D:95:34:51:24:66:33:B9:D2:40:99:C0:C1:17:0B:D1
EC:3B:2D:B0:5B:B1:FB:6D:20:A3:9D:72:F6:8D:12:35
51:e9:af:2e:1e:40:1f:de:64:...:30:35:2d:09:16:31:5a:eb:82:76
b6:b4:72:34:e2:59:cd:fb:c2:...:63:0d:4d:cc:2c:7d:84:de:e6:2f
Example: Certificate fingerprint verification with selected destinations. As in
the example above, we show two matching fingerprints:
/etc/postfix/main.cf:
smtp_tls_policy_maps = hash:/etc/postfix/tls_policy
smtp_tls_fingerprint_digest = md5
smtp_tls_fingerprint_digest = sha256
/etc/postfix/tls_policy:
example.com fingerprint
match=3D:95:34:51:24:66:33:B9:D2:40:99:C0:C1:17:0B:D1
match=EC:3B:2D:B0:5B:B1:FB:6D:20:A3:9D:72:F6:8D:12:35
match=51:e9:af:2e:1e:40:1f:de:...:35:2d:09:16:31:5a:eb:82:76
match=b6:b4:72:34:e2:59:cd:fb:...:0d:4d:cc:2c:7d:84:de:e6:2f
To extract the public key fingerprint from an X.509 certificate, you need to
extract the public key from the certificate and compute the appropriate digest
@ -1162,26 +1163,12 @@ command extracts the public key always in "PEM" format. We pipe the result to
another OpenSSL command that converts the key to DER and then to the "dgst"
command to compute the fingerprint.
The actual command to transform the key to DER format depends on the version of
OpenSSL used. With OpenSSL 1.0.0 and later, the "pkey" command supports all key
types. With OpenSSL 0.9.8 and earlier, the key type is always RSA (nobody uses
DSA, and EC keys are not fully supported by 0.9.8), so the "rsa" command is
used.
Example:
# OpenSSL 1.0 with all certificates and SHA-1 fingerprints.
$ openssl x509 -in cert.pem -noout -pubkey |
openssl pkey -pubin -outform DER |
openssl dgst -sha1 -c
(stdin)= 64:3f:1f:f6:e5:1e:d4:2a:56:8b:fc:09:1a:61:98:b5:bc:7c:60:58
# OpenSSL 0.9.8 with RSA certificates and MD5 fingerprints.
$ openssl x509 -in cert.pem -noout -pubkey |
openssl rsa -pubin -outform DER |
openssl dgst -md5 -c
(stdin)= f4:62:60:f6:12:8f:d5:8d:28:4d:13:a7:db:b2:ff:50
Note: Postfix 2.9.0-2.9.5 computed the public key fingerprint incorrectly. To
use public-key fingerprints, upgrade to Postfix 2.9.6 or later.
openssl dgst -sha256 -c
(stdin)= 64:3f:1f:f6:e5:1e:d4:2a:56:...:09:1a:61:98:b5:bc:7c:60:58
MMaannddaattoorryy sseerrvveerr cceerrttiiffiiccaattee vveerriiffiiccaattiioonn
@ -1418,8 +1405,8 @@ which certificate is presented.
It is possible for the Postfix SMTP client to use the same key/certificate pair
as the Postfix SMTP server. If a certificate is to be presented, it must be in
"PEM" format. The private key must not be encrypted, meaning: it must be
accessible without password. Both parts (certificate and private key) may be in
the same file.
accessible without a password. Both parts (certificate and private key) may be
in the same file.
With OpenSSL 1.1.1 and Postfix >= 3.4 it is also possible to configure Ed25519
and Ed448 certificates. Rather than add two more pairs of key and certificate
@ -1440,7 +1427,7 @@ user create the client.pem file with:
# uummaasskk 007777
# ccaatt cclliieenntt__kkeeyy..ppeemm cclliieenntt__cceerrtt..ppeemm iinntteerrmmeeddiiaattee__CCAA..ppeemm >> cchhaaiinn..ppeemm
A Postfix SMTP client certificate supplied here must be usable as SSL client
A Postfix SMTP client certificate supplied here must be usable as an SSL client
certificate and hence pass the "openssl verify -purpose sslclient ..." test.
A server that trusts the root CA has a local copy of the root CA certificate,
@ -1457,7 +1444,8 @@ and any additional issuer certificates. A single file can hold multiple (key,
cert, [chain]) sequences, one per algorithm. It is typically simpler to keep
the chain for each algorithm in its own file. Most users are likely to deploy
at most a single RSA chain, but with OpenSSL 1.1.1, it is possible to deploy up
five chains, one each for RSA, ECDSA, ED25519, ED448 and even the obsolete DSA.
five chains, one each for RSA, ECDSA, ED25519, ED448, and even the obsolete
DSA.
# Postfix >= 3.4. Preferred configuration interface. Each file
# starts with the private key, followed by the corresponding
@ -1796,14 +1784,15 @@ vveerriiffyy
files.
sseeccuurree
Secure certificate verification. Mail is delivered only if the TLS
handshake succeeds, if the remote SMTP server certificate can be validated
(not expired or revoked, and signed by a trusted Certification Authority),
and if the server certificate name matches the optional "match" attribute
(or the main.cf smtp_tls_secure_cert_match parameter value when no optional
"match" attribute is specified). With Postfix >= 2.11 the "tafile"
attribute optionally modifies trust chain verification in the same manner
as the "smtp_tls_trust_anchor_file" parameter. The "tafile" attribute may
be specified multiple times to load multiple trust-anchor files.
handshake succeeds, and DNS forgery resistant remote SMTP certificate
verification succeeds (not expired or revoked, and signed by a trusted
Certification Authority), and if the server certificate name matches the
optional "match" attribute (or the main.cf smtp_tls_secure_cert_match
parameter value when no optional "match" attribute is specified). With
Postfix >= 2.11 the "tafile" attribute optionally modifies trust chain
verification in the same manner as the "smtp_tls_trust_anchor_file"
parameter. The "tafile" attribute may be specified multiple times to load
multiple trust-anchor files.
Notes:
* The "match" attribute is especially useful to verify TLS certificates for
@ -1836,7 +1825,7 @@ Example:
/etc/postfix/main.cf:
smtp_tls_policy_maps = hash:/etc/postfix/tls_policy
# Postfix 2.5 and later
smtp_tls_fingerprint_digest = md5
smtp_tls_fingerprint_digest = sha256
/etc/postfix/tls_policy:
example.edu none
example.mil may
@ -1847,10 +1836,13 @@ Example:
[mail.example.org]:587 secure match=nexthop
# Postfix 2.5 and later
[thumb.example.org] fingerprint
match=EC:3B:2D:B0:5B:B1:FB:6D:20:A3:9D:72:F6:8D:12:35
match=3D:95:34:51:24:66:33:B9:D2:40:99:C0:C1:17:0B:D1
# Postfix 2.6 and later
example.info may protocols=!SSLv2 ciphers=medium
match=b6:b4:72:34:e2:59:cd:fb:...:0d:4d:cc:2c:7d:84:de:e6:2f
match=51:e9:af:2e:1e:40:1f:de:...:35:2d:09:16:31:5a:eb:82:76
# Postfix >= 3.6 "protocols" syntax
example.info may protocols=>=TLSv1 ciphers=medium
exclude=3DES
# Legacy protocols syntax
example.info may protocols=!SSLv2:!SSLv3 ciphers=medium
exclude=3DES
NNoottee:: The "hostname" strategy if listed in a non-default setting of
@ -1923,8 +1915,8 @@ the minimum opportunistic TLS cipher grade is always "export".
With mandatory and opportunistic TLS encryption, the Postfix SMTP client will
by default disable SSLv2 and SSLv3. The mandatory TLS protocol list is
specified via the smtp_tls_mandatory_protocols configuration parameter. The
corresponding smtp_tls_protocols parameter (Postfix >= 2.6) controls the SSL/
TLS protocols used with opportunistic TLS.
corresponding smtp_tls_protocols parameter (Postfix >= 2.6) controls the TLS
protocols used with opportunistic TLS.
Example:
@ -1932,19 +1924,19 @@ Example:
smtp_tls_mandatory_ciphers = medium
smtp_tls_mandatory_exclude_ciphers = RC4, MD5
smtp_tls_exclude_ciphers = aNULL
# Preferred form with Postfix >= 2.5:
smtp_tls_mandatory_protocols = !SSLv2
# Legacy form for Postfix < 2.5:
smtp_tls_mandatory_protocols = SSLv3, TLSv1
# Also available with Postfix >= 2.6:
smtp_tls_ciphers = medium
smtp_tls_protocols = !SSLv2
# Preferred form with Postfix >= 3.6:
smtp_tls_mandatory_protocols = >=TLSv1.2
smtp_tls_protocols = >=TLSv1
# Legacy form for Postfix < 3.6:
smtp_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
smtp_tls_protocols = !SSLv2,!SSLv3
CClliieenntt--ssiiddee SSMMTTPPSS ssuuppppoorrtt
These sections show how to send mail to a server that does not support
STARTTLS, but that provides the deprecated SMTPS service on TCP port 465.
Depending on the Postfix version, some additional tooling may be required.
STARTTLS, but that provides the SMTPS service on TCP port 465. Depending on the
Postfix version, some additional tooling may be required.
PPoossttffiixx >>== 33..00
@ -2185,7 +2177,7 @@ authentication. This is sufficient for testing, and for exchanging email with
sites that you have no trust relationship with. For real authentication you
need also enable DNSSEC record signing for your domain and publish TLSA records
and/or your Postfix public key certificate needs to be signed by a recognized
Certification Authority. To authenticate the certificates of remote host you
Certification Authority. To authenticate the certificates of a remote host you
need a DNSSEC-validating local resolver and to enable DANE authentication and/
or configure the Postfix SMTP client with a list of public key certificates of
Certification Authorities, but make sure to read about the limitations of the
@ -2403,7 +2395,7 @@ PPrriivvaattee CCeerrttiiffiiccaattiioonn AAuutthhoorr
Often servers that perform TLS client authentication will issue the
required certificates signed by their own CA. If you configure the client
certificate and key incorrectly, you will be unable to send mail to sites
that request client certificate, but don't require them from all clients.
that request a client certificate, but don't require them from all clients.
/etc/postfix/main.cf:
smtp_tls_CAfile = /etc/postfix/cacert.pem
@ -2451,6 +2443,10 @@ aapppprroopprriiaattee..
% mmaakkee mmaakkeeffiilleess CCCCAARRGGSS==""--DDUUSSEE__TTLLSS --II//uussrr//llooccaall//iinncclluuddee"" \\
AAUUXXLLIIBBSS==""--LL//uussrr//llooccaall//lliibb --llssssll --llccrryyppttoo""
If your OpenSSL shared library is in a directory that the RUN-TIME linker
does not know about, add a "-Wl,-R,/path/to/directory" option after "-
lcrypto".
On Solaris, specify the -R option as shown below:
% mmaakkee ttiiddyy # if you have left-over files from a previous build

View File

@ -1,9 +1,13 @@
# $NetBSD: main.cf,v 1.8 2020/03/18 19:05:13 christos Exp $
# $NetBSD: main.cf,v 1.9 2022/10/08 16:12:43 christos Exp $
#
# Global Postfix configuration file. This file lists only a subset
# of all parameters. For the syntax, and for a complete parameter
# list, see the postconf(5) manual page (command: "man 5 postconf").
#
# TIP: use the command "postconf -n" to view main.cf parameter
# settings, "postconf parametername" to view a specific parameter,
# and "postconf 'parametername=value'" to set a specific parameter.
#
# For common configuration examples, see BASIC_CONFIGURATION_README
# and STANDARD_CONFIGURATION_README. To find these documents, use
# the command "postconf html_directory readme_directory", or go to
@ -29,7 +33,7 @@
#
# The level below is what should be used with new (not upgrade) installs.
#
compatibility_level = 2
compatibility_level = 3.7
# On NetBSD we are built without EAI support, so we must disable utf8
smtputf8_enable=no
@ -260,11 +264,14 @@ unknown_local_recipient_reject_code = 550
# You can specify the list of "trusted" network addresses by hand
# or you can let Postfix do it for you (which is the default).
#
# By default (mynetworks_style = subnet), Postfix "trusts" SMTP
# clients in the same IP subnetworks as the local machine.
# On Linux, this works correctly only with interfaces specified
# with the "ifconfig" command.
# By default (mynetworks_style = host), Postfix "trusts" only
# the local machine.
#
# Specify "mynetworks_style = subnet" when Postfix should "trust"
# SMTP clients in the same IP subnetworks as the local machine.
# On Linux, this works correctly only with interfaces specified
# with the "ifconfig" or "ip" command.
#
# Specify "mynetworks_style = class" when Postfix should "trust" SMTP
# clients in the same IP class A/B/C networks as the local machine.
# Don't do this with a dialup site - it would cause Postfix to "trust"
@ -289,19 +296,21 @@ unknown_local_recipient_reject_code = 550
# of listing the patterns here. Specify type:table for table-based lookups
# (the value on the table right-hand side is not used).
#
#mynetworks = 168.100.189.0/28, 127.0.0.0/8
#mynetworks = 168.100.3.0/28, 127.0.0.0/8
#mynetworks = $config_directory/mynetworks
#mynetworks = hash:/etc/postfix/network_table
# The relay_domains parameter restricts what destinations this system will
# relay mail to. See the smtpd_recipient_restrictions description in
# postconf(5) for detailed information.
# relay mail to. See the smtpd_relay_restrictions and
# smtpd_recipient_restrictions descriptions in postconf(5) for detailed
# information.
#
# By default, Postfix relays mail
# - from "trusted" clients (IP address matches $mynetworks) to any destination,
# - from "trusted" clients (IP address matches $mynetworks, or is
# SASL authenticated) to any destination,
# - from "untrusted" clients to destinations that match $relay_domains or
# subdomains thereof, except addresses with sender-specified routing.
# The default relay_domains value is $mydestination.
# The default relay_domains value is empty.
#
# In addition to the above, the Postfix SMTP server by default accepts mail
# that Postfix is final destination for:
@ -321,7 +330,7 @@ unknown_local_recipient_reject_code = 550
# list this system as their primary or backup MX host. See the
# permit_mx_backup restriction description in postconf(5).
#
#relay_domains = $mydestination
#relay_domains =
# INTERNET OR INTRANET

View File

@ -1,4 +1,4 @@
# $NetBSD: master.cf,v 1.9 2020/03/18 19:05:13 christos Exp $
# $NetBSD: master.cf,v 1.10 2022/10/08 16:12:43 christos Exp $
#
#
# Postfix master process configuration file. For details on the format
@ -16,28 +16,40 @@
#smtpd pass - - n - - smtpd
#dnsblog unix - - n - 0 dnsblog
#tlsproxy unix - - n - 0 tlsproxy
# Choose one: enable submission for loopback clients only, or for any client.
#127.0.0.1:submission inet n - n - - smtpd
#submission inet n - n - - smtpd
# -o syslog_name=postfix/submission
# -o smtpd_tls_security_level=encrypt
# -o smtpd_sasl_auth_enable=yes
# -o smtpd_tls_auth_only=yes
# -o smtpd_reject_unlisted_recipient=no
# -o smtpd_client_restrictions=$mua_client_restrictions
# -o smtpd_helo_restrictions=$mua_helo_restrictions
# -o smtpd_sender_restrictions=$mua_sender_restrictions
# -o smtpd_recipient_restrictions=
# -o smtpd_relay_restrictions=permit_sasl_authenticated,reject
# Instead of specifying complex smtpd_<xxx>_restrictions here,
# specify "smtpd_<xxx>_restrictions=$mua_<xxx>_restrictions"
# here, and specify mua_<xxx>_restrictions in main.cf (where
# "<xxx>" is "client", "helo", "sender", "relay", or "recipient").
# -o smtpd_client_restrictions=
# -o smtpd_helo_restrictions=
# -o smtpd_sender_restrictions=
# -o smtpd_relay_restrictions=
# -o smtpd_recipient_restrictions=permit_sasl_authenticated,reject
# -o milter_macro_daemon_name=ORIGINATING
#smtps inet n - n - - smtpd
# -o syslog_name=postfix/smtps
# Choose one: enable submissions for loopback clients only, or for any client.
#127.0.0.1:submissions inet n - n - - smtpd
#submissions inet n - n - - smtpd
# -o syslog_name=postfix/submissions
# -o smtpd_tls_wrappermode=yes
# -o smtpd_sasl_auth_enable=yes
# -o smtpd_reject_unlisted_recipient=no
# -o smtpd_client_restrictions=$mua_client_restrictions
# -o smtpd_helo_restrictions=$mua_helo_restrictions
# -o smtpd_sender_restrictions=$mua_sender_restrictions
# -o smtpd_recipient_restrictions=
# -o smtpd_relay_restrictions=permit_sasl_authenticated,reject
# Instead of specifying complex smtpd_<xxx>_restrictions here,
# specify "smtpd_<xxx>_restrictions=$mua_<xxx>_restrictions"
# here, and specify mua_<xxx>_restrictions in main.cf (where
# "<xxx>" is "client", "helo", "sender", "relay", or "recipient").
# -o smtpd_client_restrictions=
# -o smtpd_helo_restrictions=
# -o smtpd_sender_restrictions=
# -o smtpd_relay_restrictions=
# -o smtpd_recipient_restrictions=permit_sasl_authenticated,reject
# -o milter_macro_daemon_name=ORIGINATING
#628 inet n - n - - qmqpd
pickup unix n - n 60 1 pickup

View File

@ -1,5 +1,5 @@
#!/bin/sh
# $NetBSD: post-install,v 1.3 2020/03/18 19:05:13 christos Exp $
# $NetBSD: post-install,v 1.4 2022/10/08 16:12:43 christos Exp $
#
# To view the formatted manual page of this file, type:
@ -146,7 +146,7 @@
# should not be in the command search path of any users.
# .IP command_directory
# The directory for Postfix administrative commands. This
# directory should be in the command search path of adminstrative users.
# directory should be in the command search path of administrative users.
# .IP queue_directory
# The directory for Postfix queues.
# .IP data_directory

View File

@ -1,4 +1,4 @@
# $NetBSD: postfix-files,v 1.7 2020/03/18 19:05:13 christos Exp $
# $NetBSD: postfix-files,v 1.8 2022/10/08 16:12:43 christos Exp $
#
# Commented out entries mean files not installed under NetBSD.
#
@ -135,7 +135,7 @@ $command_directory/postconf:f:root:-:755
$command_directory/postfix:f:root:-:755
$command_directory/postkick:f:root:-:755
$command_directory/postlock:f:root:-:755
$command_directory/postlog:f:root:-:755
$command_directory/postlog:f:root:$setgid_group:2755:u
$command_directory/postmap:f:root:-:755
$command_directory/postmulti:f:root:-:755
$command_directory/postsuper:f:root:-:755
@ -174,8 +174,8 @@ $manpage_directory/man1/postalias.1:f:root:-:644
$manpage_directory/man1/postcat.1:f:root:-:644
$manpage_directory/man1/postconf.1:f:root:-:644
$manpage_directory/man1/postdrop.1:f:root:-:644
$manpage_directory/man1/postfix.1:f:root:-:644
$manpage_directory/man1/postfix-tls.1:f:root:-:644
$manpage_directory/man1/postfix.1:f:root:-:644
$manpage_directory/man1/postkick.1:f:root:-:644
$manpage_directory/man1/postlock.1:f:root:-:644
$manpage_directory/man1/postlog.1:f:root:-:644
@ -279,6 +279,7 @@ $readme_directory/ADDRESS_REWRITING_README:f:root:-:644
$readme_directory/ADDRESS_VERIFICATION_README:f:root:-:644
$readme_directory/BACKSCATTER_README:f:root:-:644
$readme_directory/BASIC_CONFIGURATION_README:f:root:-:644
$readme_directory/BDAT_README:f:root:-:644
$readme_directory/BUILTIN_FILTER_README:f:root:-:644
#$readme_directory/CDB_README:f:root:-:644
$readme_directory/COMPATIBILITY_README:f:root:-:644
@ -300,16 +301,19 @@ $readme_directory/LDAP_README:f:root:-:644
$readme_directory/LOCAL_RECIPIENT_README:f:root:-:644
$readme_directory/MACOSX_README:f:root:-:644:o
$readme_directory/MAILDROP_README:f:root:-:644
$readme_directory/MAILLOG_README:f:root:-:644
$readme_directory/MEMCACHE_README:f:root:-:644
$readme_directory/MILTER_README:f:root:-:644
$readme_directory/MULTI_INSTANCE_README:f:root:-:644
$readme_directory/MYSQL_README:f:root:-:644
$readme_directory/SMTPUTF8_README:f:root:-:644
$readme_directory/SQLITE_README:f:root:-:644
$readme_directory/NFS_README:f:root:-:644
$readme_directory/OVERVIEW:f:root:-:644
#$readme_directory/PACKAGE_README:f:root:-:644
$readme_directory/PCRE_README:f:root:-:644
$readme_directory/PGSQL_README:f:root:-:644
$readme_directory/POSTSCREEN_3_5_README:f:root:-:644
$readme_directory/POSTSCREEN_README:f:root:-:644
$readme_directory/QMQP_README:f:root:-:644:o
$readme_directory/QSHAPE_README:f:root:-:644
@ -337,6 +341,7 @@ $html_directory/ADDRESS_REWRITING_README.html:f:root:-:644
$html_directory/ADDRESS_VERIFICATION_README.html:f:root:-:644
$html_directory/BACKSCATTER_README.html:f:root:-:644
$html_directory/BASIC_CONFIGURATION_README.html:f:root:-:644
$html_directory/BDAT_README.html:f:root:-:644
$html_directory/BUILTIN_FILTER_README.html:f:root:-:644
#$html_directory/CDB_README.html:f:root:-:644
$html_directory/COMPATIBILITY_README.html:f:root:-:644
@ -357,15 +362,19 @@ $html_directory/LDAP_README.html:f:root:-:644
#$html_directory/LMDB_README.html:f:root:-:644
$html_directory/LOCAL_RECIPIENT_README.html:f:root:-:644
$html_directory/MAILDROP_README.html:f:root:-:644
$html_directory/MAILLOG_README.html:f:root:-:644
$html_directory/MEMCACHE_README.html:f:root:-:644
$html_directory/MILTER_README.html:f:root:-:644
$html_directory/MULTI_INSTANCE_README.html:f:root:-:644
$html_directory/MYSQL_README.html:f:root:-:644
$html_directory/SMTPUTF8_README.html:f:root:-:644
$html_directory/SQLITE_README.html:f:root:-:644
$html_directory/NFS_README.html:f:root:-:644
$html_directory/OVERVIEW.html:f:root:-:644
$html_directory/PACKAGE_README.html:f:root:-:644
$html_directory/PCRE_README.html:f:root:-:644
$html_directory/PGSQL_README.html:f:root:-:644
$html_directory/POSTSCREEN_3_5_README.html:f:root:-:644
$html_directory/POSTSCREEN_README.html:f:root:-:644
$html_directory/QMQP_README.html:f:root:-:644:o
$html_directory/QSHAPE_README.html:f:root:-:644
@ -390,6 +399,7 @@ $html_directory/XFORWARD_README.html:f:root:-:644
$html_directory/access.5.html:f:root:-:644
$html_directory/aliases.5.html:f:root:-:644
$html_directory/anvil.8.html:f:root:-:644
$html_directory/bounce.5.html:f:root:-:644
$html_directory/bounce.8.html:f:root:-:644
$html_directory/canonical.5.html:f:root:-:644
$html_directory/cidr_table.5.html:f:root:-:644
@ -404,6 +414,7 @@ $html_directory/generic.5.html:f:root:-:644
$html_directory/header_checks.5.html:f:root:-:644
$html_directory/index.html:f:root:-:644
$html_directory/ldap_table.5.html:f:root:-:644
$html_directory/lmdb_table.5.html:f:root:-:644
$html_directory/lmtp.8.html:f:root:-:644
$html_directory/local.8.html:f:root:-:644
$html_directory/mailq.1.html:f:root:-:644
@ -426,6 +437,7 @@ $html_directory/postconf.5.html:f:root:-:644
$html_directory/postdrop.1.html:f:root:-:644
$html_directory/postfix-logo.jpg:f:root:-:644
$html_directory/postfix-manuals.html:f:root:-:644
$html_directory/postfix-tls.1.html:f:root:-:644
$html_directory/postfix-wrapper.5.html:f:root:-:644
$html_directory/postfix.1.html:f:root:-:644
$html_directory/postkick.1.html:f:root:-:644
@ -445,13 +457,16 @@ $html_directory/qmgr.8.html:f:root:-:644
#$html_directory/qmqpd.8.html:f:root:-:644
$html_directory/regexp_table.5.html:f:root:-:644
$html_directory/relocated.5.html:f:root:-:644
$html_directory/scache.8.html:f:root:-:644
$html_directory/sendmail.1.html:h:$html_directory/mailq.1.html:-:644
$html_directory/showq.8.html:f:root:-:644
$html_directory/smtp-sink.1.html:f:root:-:644
$html_directory/smtp-source.1.html:f:root:-:644
$html_directory/smtp.8.html:h:$html_directory/lmtp.8.html:-:644
$html_directory/smtpd.8.html:f:root:-:644
$html_directory/socketmap_table.5.html:f:root:-:644
$html_directory/spawn.8.html:f:root:-:644
$html_directory/tlsmgr.8.html:f:root:-:644
$html_directory/tlsproxy.8.html:f:root:-:644
#$html_directory/tcp_table.5.html:f:root:-:644
$html_directory/trace.8.html:h:$html_directory/bounce.8.html:-:644

View File

@ -1,5 +1,5 @@
#!/bin/sh
# $NetBSD: postfix-tls-script,v 1.3 2020/03/18 19:05:13 christos Exp $
# $NetBSD: postfix-tls-script,v 1.4 2022/10/08 16:12:43 christos Exp $
#
#++
@ -779,7 +779,7 @@ get_cache_db_type() {
deploy_server_cert() {
certfile=$1; shift
keyfile=$1; shift
deploy=$1; shift
case $# in 0) deploy=;; *) deploy=$1; shift;; esac
# Sets key_algo, key_param and cert_param
check_key "$keyfile" || return 1

View File

@ -1,5 +1,5 @@
#! /bin/sh
# $NetBSD: postmulti-script,v 1.2 2017/02/14 01:16:43 christos Exp $
# $NetBSD: postmulti-script,v 1.3 2022/10/08 16:12:43 christos Exp $
#
umask 022
@ -18,7 +18,7 @@ umask 022
# daemon_directory - From primary instance
# meta_directory - From primary instance
# shlib_directory - From primary instance
# config_directroy - config_directory of target instance
# config_directory - config_directory of target instance
# queue_directory - queue_directory of target instance
# data_directory - data_directory of target instance
#
@ -221,7 +221,7 @@ create|import)
# and drop from alternate_config_directories
#
# XXX: Must happen before set-permissions below, otherwise instance
# is treated as a non-slave instance by post-install via postfix(1).
# is treated as an independent instance by post-install via postfix(1).
#
update_cfdirs del $config_directory || exit 1
@ -229,7 +229,7 @@ create|import)
# queue_directory and data_directory, ...
#
# XXX: Must happen after instance list updates above, otherwise instance
# is treated as a non-slave instance by post-install via postfix(1).
# is treated as an independent instance by post-install via postfix(1).
#
postfix -c $config_directory set-permissions || exit 1
;;

View File

@ -7,7 +7,7 @@
<title>Postfix Address Verification </title>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
@ -22,7 +22,7 @@
<p> Recipient address verification may cause an increased load on
down-stream servers in the case of a dictionary attack or a flood
of backscatter bounces. Sender address verification may cause your
site to be blacklisted by some providers. See also the "<a
site to be denylisted by some providers. See also the "<a
href="#limitations">Limitations</a>" section below for more. </p>
<h2><a name="summary">What Postfix address verification can do for you</a></h2>
@ -211,7 +211,7 @@ address is deliverable. In reality, mail for a remote address can
bounce AFTER a preferred MTA accepts the recipient address, or AFTER
a preferred MTA accepts the message content. </p>
<li> <p> Some sites may blacklist you when you are probing them
<li> <p> Some sites may denylist you when you are probing them
too often (a probe is an SMTP session that does not deliver mail),
or when you are probing them too often for a non-existent address.
This is one reason why you should use sender address verification
@ -252,7 +252,7 @@ mis-configured sites that reject MAIL FROM: &lt;&gt;, while
probes from "double-bounce@$<a href="postconf.5.html#myorigin">myorigin</a>" would succeed. </p>
<li> <p> The downside of using a non-empty sender address is that
the address may end op on spammer mailing lists. Although Postfix
the address may end up on spammer mailing lists. Although Postfix
always discards mail to the double-bounce address, this still results
in wasted network bandwidth and server capacity. To defeat
address harvesting, Postfix 2.9 and later support time-dependent
@ -383,7 +383,7 @@ email</a></h2>
<p> Unfortunately, sender address verification cannot simply be
turned on for all email - you are likely to lose legitimate mail
from mis-configured systems. You almost certainly will have to set
up white lists for specific addresses, or even for entire domains.
up allow lists for specific addresses, or even for entire domains.
</p>
<p> To find out how sender address verification would affect your
@ -413,12 +413,12 @@ you can see what mail would be blocked: </p>
<p> This is also a good way to populate your cache with address
verification results before you start to actually reject mail. </p>
<p> The sender_access restriction is needed to whitelist domains
<p> The sender_access restriction is needed to allowlist domains
or addresses that are known to be OK. Although Postfix will not
mark a known-to-be-good address as bad after a probe fails, it is
better to be safe than sorry. </p>
<p> NOTE: You will have to whitelist sites such as securityfocus.com
<p> NOTE: You will have to allowlist sites such as securityfocus.com
and other sites that operate mailing lists that use a different
sender address for each posting (VERP). Such addresses pollute
the address verification cache quickly, and generate unnecessary

View File

@ -7,7 +7,7 @@
<title>Postfix Installation From Source Code </title>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
@ -534,7 +534,7 @@ built, with "make install" or "make upgrade". </p>
</pre>
</blockquote>
<p> As with the command "make makefiles, the command "make
<p> As with the command "make makefiles", the command "make
install/upgrade name=value..." will replace the string MAIL_VERSION
at the end of a configuration parameter value with the Postfix
release version. Do not try to specify something like $<a href="postconf.5.html#mail_version">mail_version</a>
@ -795,7 +795,7 @@ $ make
one or more non-default object libraries. Postfix 3.0 and later
specify some of their database library dependencies with <a href="CDB_README.html">AUXLIBS_CDB</a>,
<a href="LDAP_README.html">AUXLIBS_LDAP</a>, <a href="LMDB_README.html">AUXLIBS_LMDB</a>, <a href="MYSQL_README.html">AUXLIBS_MYSQL</a>, <a href="PCRE_README.html">AUXLIBS_PCRE</a>, <a href="PGSQL_README.html">AUXLIBS_PGSQL</a>,
<a href="SDBM_README.html">AUXLIBS_SDBM</a>, and <a href="SQLITE_README.html">AUXLIBS_SQLITE</a>, respectively. </td> </tr>
AUXLIBS_SDBM, and <a href="SQLITE_README.html">AUXLIBS_SQLITE</a>, respectively. </td> </tr>
<tr> <td colspan="2"> CC=compiler_command</td> <td> Specifies a
non-default compiler. On many systems, the default is <tt>gcc</tt>.
@ -863,6 +863,9 @@ support. By default, PCRE support is compiled in when the
for POSIX <tt>getpwnam_r/getpwuid_r</tt>. By default Postfix uses
these where they are known to be available. </td> </tr>
<tr> <td> </td> <td> -DNO_RES_NCALLS </td> <td> Do not build with
the threadsafe resolver(5) API (res_ninit() etc.). </td> </tr>
<tr> <td> </td> <td> -DNO_SIGSETJMP </td> <td> Use
<tt>setjmp()/longjmp()</tt> instead of <tt>sigsetjmp()/siglongjmp()</tt>.
By default, Postfix uses <tt>sigsetjmp()/siglongjmp()</tt> when
@ -1237,7 +1240,7 @@ of: </p>
<p> Follow the instructions in the "<a href="#mandatory">Mandatory
configuration file edits</a>" in section 10, and review the "<a
name="#hamlet">To chroot or not to chroot</a>" text in section
href="#hamlet">To chroot or not to chroot</a>" text in section
11. </p>
<p> Start the Postfix system: </p>
@ -1562,6 +1565,7 @@ following commands: </p>
<pre>
# newaliases
# sendmail -bi
# postalias /etc/aliases (pathname is system dependent!)
</pre>
</blockquote>

View File

@ -7,7 +7,7 @@
<title>Postfix TLS Support </title>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
@ -29,7 +29,7 @@ SMTP mail or with SASL authentication. </p>
the ability to encrypt mail and to authenticate remote SMTP clients
or servers. You also turn on hundreds of thousands of lines of
OpenSSL library code. Assuming that OpenSSL is written as carefully
as Wietse's own code, every 1000 lines introduce one additional bug
as Wietse's own code, every 1000 lines introduces one additional bug
into Postfix. </p>
<p> Topics covered in this document: </p>
@ -179,17 +179,17 @@ configurations will not accidentally enable TLS without certificates. </p>
<p> Note that server certificates are <b>not</b> optional in TLS 1.3. To
run without certificates you'd have to disable the TLS 1.3 protocol by
including '!TLSv1.3' in "<a href="postconf.5.html#smtpd_tls_protocols">smtpd_tls_protocols</a>" and perhaps also
"<a href="postconf.5.html#smtpd_tls_mandatory_protocols">smtpd_tls_mandatory_protocols</a>". It is simpler instead to just
configure a certificate chain. Certificate-less operation is not
recommended. <p>
including "&lt;=TLSv1.2" (or, for Postfix &lt; 3.6, "!TLSv1.3") in
"<a href="postconf.5.html#smtpd_tls_protocols">smtpd_tls_protocols</a>" and perhaps also "<a href="postconf.5.html#smtpd_tls_mandatory_protocols">smtpd_tls_mandatory_protocols</a>".
It is simpler instead to just configure a certificate chain.
Certificate-less operation is not recommended. <p>
<p> RSA, DSA and ECDSA (Postfix &ge; 2.6) certificates are supported.
Most sites only have RSA certificates. You can configure all three
at the same time, in which case the ciphersuite negotiated with the
remote SMTP client determines which certificate is used. If your
DNS zone is signed, and you want to publish DANE TLSA (<a href="http://tools.ietf.org/html/rfc6698">RFC 6698</a>,
<a href="http://tools.ietf.org/html/rfc7671">RFC 7671</a>, <a href="http://tools.ietf.org/html/rfc7672">RFC 7672</a>) records, these must match all of the configured
DNS zone is signed, and you want to publish DANE TLSA (<a href="https://tools.ietf.org/html/rfc6698">RFC 6698</a>,
<a href="https://tools.ietf.org/html/rfc7671">RFC 7671</a>, <a href="https://tools.ietf.org/html/rfc7672">RFC 7672</a>) records, these must match all of the configured
certificate chains. Since the best practice is to publish "3 1 1"
certificate associations, create a separate TLSA record to match
each public-key certificate digest. </p>
@ -201,7 +201,7 @@ client must receive the issuing CA certificates via the TLS handshake
or via public-key infrastructure. This means that the Postfix server
public-key certificate file must include the server certificate
first, then the issuing CA(s) (bottom-up order). The Postfix SMTP
server certificate must be usable as SSL server certificate and
server certificate must be usable as an SSL server certificate and
hence pass the "<tt>openssl verify -purpose sslserver ...</tt>" test.
</p>
@ -224,7 +224,7 @@ size of the server TLS handshake. </p>
</pre>
</blockquote>
<li> <p> If you publish DANE TLSA (<a href="http://tools.ietf.org/html/rfc6698">RFC 6698</a>, <a href="http://tools.ietf.org/html/rfc7671">RFC 7671</a>, <a href="http://tools.ietf.org/html/rfc7672">RFC 7672</a>)
<li> <p> If you publish DANE TLSA (<a href="https://tools.ietf.org/html/rfc6698">RFC 6698</a>, <a href="https://tools.ietf.org/html/rfc7671">RFC 7671</a>, <a href="https://tools.ietf.org/html/rfc7672">RFC 7672</a>)
"2 0 1" or "2 1 1" records to specify root CA certificate digests,
you must include the corresponding root CA certificates in the
"server.pem" certificate file. </p>
@ -280,7 +280,7 @@ single file can hold multiple <i>(key, cert, [chain])</i> sequences, one
per algorithm. It is typically simpler to keep the chain for each
algorithm in its own file. Most users are likely to deploy just a
single RSA chain, but with OpenSSL 1.1.1, it is possible to deploy up to
five chains, one each for RSA, ECDSA, ED25519, ED448 and even the
five chains, one each for RSA, ECDSA, ED25519, ED448, and even the
obsolete DSA. </p>
<blockquote>
@ -526,7 +526,7 @@ private key. This is intended behavior. </p>
<p> <a name="server_enforce">You can ENFORCE the use of TLS</a>,
so that the Postfix SMTP server announces STARTTLS and accepts no
mail without TLS encryption, by setting
"<a href="postconf.5.html#smtpd_tls_security_level">smtpd_tls_security_level</a> = encrypt". According to <a href="http://tools.ietf.org/html/rfc2487">RFC 2487</a> this
"<a href="postconf.5.html#smtpd_tls_security_level">smtpd_tls_security_level</a> = encrypt". According to <a href="https://tools.ietf.org/html/rfc2487">RFC 2487</a> 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. </p>
@ -540,7 +540,7 @@ by default and should only seldom be used. </p>
</pre>
</blockquote>
<p> TLS is sometimes used in the non-standard "wrapper" mode where
<p> TLS is also used in the "wrapper" mode where
a server always uses TLS, instead of announcing STARTTLS support
and waiting for remote SMTP clients to request TLS service. Some
clients, namely
@ -685,9 +685,9 @@ the cost of repeatedly negotiating TLS session keys is high.</p>
<p> Starting with Postfix 2.11, linked with a compatible OpenSSL
library (at least 0.9.8h, preferably 1.0.0 or later) the Postfix
SMTP server supports <a href="http://tools.ietf.org/html/rfc5077">RFC 5077</a> TLS session resumption without
server-side state when the remote SMTP client also supports <a href="http://tools.ietf.org/html/rfc5077">RFC</a>
<a href="http://tools.ietf.org/html/rfc5077">5077</a>. The session is encrypted by the server in a <i>session
SMTP server supports <a href="https://tools.ietf.org/html/rfc5077">RFC 5077</a> TLS session resumption without
server-side state when the remote SMTP client also supports <a href="https://tools.ietf.org/html/rfc5077">RFC</a>
<a href="https://tools.ietf.org/html/rfc5077">5077</a>. The session is encrypted by the server in a <i>session
ticket</i> returned to client for storage. When a client sends a
valid session ticket, the server decrypts it and resumes the session,
provided neither the ticket nor the session have expired. This
@ -720,7 +720,7 @@ Postfix-owned <a href="postconf.5.html#data_directory">data_directory</a>, and a
<p> 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). <a href="http://tools.ietf.org/html/rfc2246">RFC 2246</a>
default of 300s, but a longer time of 3600sec (=1 hour). <a href="https://tools.ietf.org/html/rfc2246">RFC 2246</a>
recommends a maximum of 24 hours. </p>
<p> Example: </p>
@ -783,13 +783,19 @@ table. </p> </dd>
<p> The digest algorithm used to compute the client certificate
fingerprints is specified with the <a href="postconf.5.html">main.cf</a> <a href="postconf.5.html#smtpd_tls_fingerprint_digest">smtpd_tls_fingerprint_digest</a>
parameter. The default is "md5", for compatibility with Postfix
versions &lt; 2.5. </p>
parameter. The default algorithm is <b>sha256</b> with Postfix &ge;
3.6 and the <b><a href="postconf.5.html#compatibility_level">compatibility_level</a></b> set to 3.6 or higher. With
Postfix &le; 3.5, the default algorithm is <b>md5</b>. The
best-practice algorithm is now <b>sha256</b>. Recent advances in hash
function cryptanalysis have led to md5 and sha1 being deprecated in
favor of sha256. However, as long as there are no known "second
pre-image" attacks against the older algorithms, their use in this
context, though not recommended, is still likely safe. </p>
<p> The <a href="postconf.5.html#permit_tls_all_clientcerts">permit_tls_all_clientcerts</a> feature must be used with caution,
because it can result in too many access permissions. Use this
feature only if a special CA issues the client certificates, and
only if this CA is listed as trusted CA. If other CAs are trusted,
only if this CA is listed as a trusted CA. If other CAs are trusted,
any owner of a valid client certificate would be authorized.
The <a href="postconf.5.html#permit_tls_all_clientcerts">permit_tls_all_clientcerts</a> feature can be practical for a
specially created email relay server. </p>
@ -847,30 +853,15 @@ key always in "PEM" format. We pipe the result to another OpenSSL
command that converts the key to DER and then to the "dgst" command
to compute the fingerprint. </p>
<p> The actual command to transform the key to DER format depends
on the version of OpenSSL used. With OpenSSL 1.0.0 and later, the
"pkey" command supports all key types. With OpenSSL 0.9.8 and
earlier, the key type is always RSA (nobody uses DSA, and EC
keys are not fully supported by 0.9.8), so the "rsa" command is
used. </p>
<p> Example: </p>
<blockquote>
<pre>
# OpenSSL 1.0 with all certificates and SHA-1 fingerprints.
$ openssl x509 -in cert.pem -noout -pubkey |
openssl pkey -pubin -outform DER |
openssl dgst -sha1 -c
(stdin)= 64:3f:1f:f6:e5:1e:d4:2a:56:8b:fc:09:1a:61:98:b5:bc:7c:60:58
# OpenSSL 0.9.8 with RSA certificates and MD5 fingerprints.
$ openssl x509 -in cert.pem -noout -pubkey |
openssl rsa -pubin -outform DER |
openssl dgst -md5 -c
(stdin)= f4:62:60:f6:12:8f:d5:8d:28:4d:13:a7:db:b2:ff:50
openssl dgst -sha256 -c
(stdin)= 64:3f:1f:f6:e5:1e:d4:2a:...:8b:fc:09:1a:61:98:b5:bc:7c:60:58
</pre>
</blockquote>
<p> Note: Postfix 2.9.0&ndash;2.9.5 computed the public key
fingerprint incorrectly. To use public-key fingerprints, upgrade
to Postfix 2.9.6 or later. </p>
<h3><a name="server_cipher">Server-side cipher controls</a> </h3>
@ -900,7 +891,7 @@ after the middle of 2015; older releases only disable SSLv2 for
mandatory TLS. The mandatory TLS protocol list is specified via the
<a href="postconf.5.html#smtpd_tls_mandatory_protocols">smtpd_tls_mandatory_protocols</a> configuration parameter. The
<a href="postconf.5.html#smtpd_tls_protocols">smtpd_tls_protocols</a> parameter (Postfix &ge; 2.6)
controls the SSL/TLS protocols used with opportunistic TLS. </p>
controls the TLS protocols used with opportunistic TLS. </p>
<p> Note that the OpenSSL library only supports protocol exclusion
(not inclusion). For this reason, Postfix can exclude only protocols
@ -918,8 +909,8 @@ that TLSv1.3 be explicitly disabled. Therefore, they are not
recommended, it is better and simpler to just configure a suitable
certificate. </p>
<p> Example, MSA that requires TLSv1 or higher, not SSLv2 or SSLv3,
with high grade ciphers: </p>
<p> Example, MSA that requires TLSv1.2 or higher, with high grade
ciphers: </p>
<blockquote>
<pre>
@ -929,10 +920,10 @@ with high grade ciphers: </p>
<a href="postconf.5.html#smtpd_tls_mandatory_ciphers">smtpd_tls_mandatory_ciphers</a> = high
<a href="postconf.5.html#smtpd_tls_mandatory_exclude_ciphers">smtpd_tls_mandatory_exclude_ciphers</a> = aNULL, MD5
<a href="postconf.5.html#smtpd_tls_security_level">smtpd_tls_security_level</a> = encrypt
# Preferred syntax with Postfix &ge; 2.5:
<a href="postconf.5.html#smtpd_tls_mandatory_protocols">smtpd_tls_mandatory_protocols</a> = !SSLv2, !SSLv3
# Preferred syntax with Postfix &ge; 3.6:
<a href="postconf.5.html#smtpd_tls_mandatory_protocols">smtpd_tls_mandatory_protocols</a> = &gt;=TLSv1.2
# Legacy syntax:
<a href="postconf.5.html#smtpd_tls_mandatory_protocols">smtpd_tls_mandatory_protocols</a> = TLSv1
<a href="postconf.5.html#smtpd_tls_mandatory_protocols">smtpd_tls_mandatory_protocols</a> = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
</pre>
</blockquote>
@ -1272,23 +1263,24 @@ just in case the transport table entries are not specified consistently. </p>
submission 587/tcp msa # mail message submission
/etc/postfix/tls_policy:
[example.net]:587 encrypt protocols=TLSv1 ciphers=high
[example.net]:msa encrypt protocols=TLSv1 ciphers=high
[example.net]:submission encrypt protocols=TLSv1 ciphers=high
# Postfix &ge; 3.6 "protocols" syntax
[example.net]:587 encrypt protocols=&gt;=TLSv1.2 ciphers=high
# Legacy "protocols" syntax
[example.net]:msa encrypt protocols=!SSLv2:!SSLv3 ciphers=high
</pre>
</blockquote>
<h4><a name="client_tls_dane">DANE TLS authentication.</a> </h4>
<p> The Postfix SMTP client supports two TLS security levels based
on DANE TLSA (<a href="http://tools.ietf.org/html/rfc6698">RFC 6698</a>, <a href="http://tools.ietf.org/html/rfc7671">RFC 7671</a>, <a href="http://tools.ietf.org/html/rfc7672">RFC 7672</a>) records. The opportunistic
on DANE TLSA (<a href="https://tools.ietf.org/html/rfc6698">RFC 6698</a>, <a href="https://tools.ietf.org/html/rfc7671">RFC 7671</a>, <a href="https://tools.ietf.org/html/rfc7672">RFC 7672</a>) records. The opportunistic
"dane" level and the mandatory "dane-only" level. </p>
<p> The "dane" level is a stronger form of <a
href="#client_tls_may">opportunistic</a> TLS that is resistant to
man in the middle and downgrade attacks when the destination domain
uses DNSSEC to publish DANE TLSA records for its MX hosts. If a
remote SMTP server has "usable" (see section 3 of <a href="http://tools.ietf.org/html/rfc7672">RFC 7672</a>) DANE
remote SMTP server has "usable" (see section 3 of <a href="https://tools.ietf.org/html/rfc7672">RFC 7672</a>) DANE
TLSA records, the server connection will be authenticated. When
DANE authentication fails, there is no fallback to unauthenticated
or plaintext delivery. </p>
@ -1323,7 +1315,7 @@ be signed and the Postfix SMTP client's operating system must be
configured to send its DNS queries to a recursive DNS nameserver
that is able to validate the signed records. Each MX host's DNS
zone needs to also be signed, and needs to publish DANE TLSA (see
section 3 of <a href="http://tools.ietf.org/html/rfc7672">RFC 7672</a>) records that specify how that MX host's TLS
section 3 of <a href="https://tools.ietf.org/html/rfc7672">RFC 7672</a>) records that specify how that MX host's TLS
certificate is to be verified. </p>
<p> TLSA records do not preempt the normal SMTP MX host
@ -1335,7 +1327,7 @@ see the documentation for the <a href="postconf.5.html#smtp_dns_support_level">s
parameter. The <a href="postconf.5.html#tls_dane_digests">tls_dane_digests</a> parameter controls the list of
supported digests. </p>
<p> As explained in section 3 of <a href="http://tools.ietf.org/html/rfc7672">RFC 7672</a>, certificate usages "0"
<p> As explained in section 3 of <a href="https://tools.ietf.org/html/rfc7672">RFC 7672</a>, certificate usages "0"
and "1", which are intended to "constrain" existing Web-PKI trust,
are not supported with MTA-to-MTA SMTP. Rather, TLSA records with
usages "0" and "1" are treated as "unusable". </p>
@ -1354,8 +1346,8 @@ records. </p>
security level is treated like a "mandatory" TLS security level,
and weak ciphers and protocols are disabled. Since DANE authenticates
server certificates the "aNULL" cipher-suites are transparently
excluded at this level, no need to configure this manually. <a href="http://tools.ietf.org/html/rfc7672">RFC</a>
<a href="http://tools.ietf.org/html/rfc7672">7672</a> (DANE) TLS authentication is available with Postfix 2.11 and
excluded at this level, no need to configure this manually. <a href="https://tools.ietf.org/html/rfc7672">RFC</a>
<a href="https://tools.ietf.org/html/rfc7672">7672</a> (DANE) TLS authentication is available with Postfix 2.11 and
later. </p>
<p> When a DANE TLSA record specifies a trust-anchor (TA) certificate
@ -1387,7 +1379,8 @@ if deployed on a system with an updated resolver library.
It will support DANE provided it supports TLSv1 and its TLSA records are
published in a DNSSEC signed zone. To receive DANE secured mail for multiple
domains, use the same hostname to add the server to each domain's MX
records. There are no plans to implement SNI in the Postfix SMTP server. </p>
records. The Postfix SMTP server supports SNI (Postfix 3.4 and later),
configured with <a href="postconf.5.html#tls_server_sni_maps">tls_server_sni_maps</a>. </p>
<p> Note: The Postfix SMTP client's internal stub DNS resolver is
DNSSEC-aware, but it does not itself validate DNSSEC records, rather
@ -1509,6 +1502,15 @@ match attributes can be employed. The ":" character is not used as a
delimiter as it occurs between each pair of fingerprint (hexadecimal)
digits. </p>
<p> The default algorithm is <b>sha256</b> with Postfix &ge; 3.6
and the <b><a href="postconf.5.html#compatibility_level">compatibility_level</a></b> set to 3.6 or higher; with Postfix
&le; 3.5, the default algorithm is <b>md5</b>. The
best-practice algorithm is now <b>sha256</b>. Recent advances in hash
function cryptanalysis have led to md5 and sha1 being deprecated in
favor of sha256. However, as long as there are no known "second
pre-image" attacks against the older algorithms, their use in this
context, though not recommended, is still likely safe. </p>
<p> Example: fingerprint TLS security with an internal mailhub.
Two matching fingerprints are listed. The <a href="postconf.5.html#relayhost">relayhost</a> may be multiple
physical hosts behind a load-balancer, each with its own private/public
@ -1520,10 +1522,10 @@ another, and both keys are trusted just prior to the transition. </p>
<pre>
<a href="postconf.5.html#relayhost">relayhost</a> = [mailhub.example.com]
<a href="postconf.5.html#smtp_tls_security_level">smtp_tls_security_level</a> = fingerprint
<a href="postconf.5.html#smtp_tls_fingerprint_digest">smtp_tls_fingerprint_digest</a> = md5
<a href="postconf.5.html#smtp_tls_fingerprint_digest">smtp_tls_fingerprint_digest</a> = sha256
<a href="postconf.5.html#smtp_tls_fingerprint_cert_match">smtp_tls_fingerprint_cert_match</a> =
3D:95:34:51:24:66:33:B9:D2:40:99:C0:C1:17:0B:D1
EC:3B:2D:B0:5B:B1:FB:6D:20:A3:9D:72:F6:8D:12:35
51:e9:af:2e:1e:40:1f:de:64:...:30:35:2d:09:16:31:5a:eb:82:76
b6:b4:72:34:e2:59:cd:fb:c2:...:63:0d:4d:cc:2c:7d:84:de:e6:2f
</pre>
</blockquote>
@ -1533,15 +1535,15 @@ As in the example above, we show two matching fingerprints: </p>
<pre>
/etc/postfix/<a href="postconf.5.html">main.cf</a>:
<a href="postconf.5.html#smtp_tls_policy_maps">smtp_tls_policy_maps</a> = <a href="DATABASE_README.html#types">hash</a>:/etc/postfix/tls_policy
<a href="postconf.5.html#smtp_tls_fingerprint_digest">smtp_tls_fingerprint_digest</a> = md5
<a href="postconf.5.html#smtp_tls_fingerprint_digest">smtp_tls_fingerprint_digest</a> = sha256
</pre>
</blockquote>
<blockquote>
<pre>
/etc/postfix/tls_policy:
example.com fingerprint
match=3D:95:34:51:24:66:33:B9:D2:40:99:C0:C1:17:0B:D1
match=EC:3B:2D:B0:5B:B1:FB:6D:20:A3:9D:72:F6:8D:12:35
match=51:e9:af:2e:1e:40:1f:de:...:35:2d:09:16:31:5a:eb:82:76
match=b6:b4:72:34:e2:59:cd:fb:...:0d:4d:cc:2c:7d:84:de:e6:2f
</pre>
</blockquote>
@ -1553,30 +1555,15 @@ key always in "PEM" format. We pipe the result to another OpenSSL
command that converts the key to DER and then to the "dgst" command
to compute the fingerprint. </p>
<p> The actual command to transform the key to DER format depends
on the version of OpenSSL used. With OpenSSL 1.0.0 and later, the
"pkey" command supports all key types. With OpenSSL 0.9.8 and
earlier, the key type is always RSA (nobody uses DSA, and EC
keys are not fully supported by 0.9.8), so the "rsa" command is
used. </p>
<p> Example: </p>
<blockquote>
<pre>
# OpenSSL 1.0 with all certificates and SHA-1 fingerprints.
$ openssl x509 -in cert.pem -noout -pubkey |
openssl pkey -pubin -outform DER |
openssl dgst -sha1 -c
(stdin)= 64:3f:1f:f6:e5:1e:d4:2a:56:8b:fc:09:1a:61:98:b5:bc:7c:60:58
# OpenSSL 0.9.8 with RSA certificates and MD5 fingerprints.
$ openssl x509 -in cert.pem -noout -pubkey |
openssl rsa -pubin -outform DER |
openssl dgst -md5 -c
(stdin)= f4:62:60:f6:12:8f:d5:8d:28:4d:13:a7:db:b2:ff:50
openssl dgst -sha256 -c
(stdin)= 64:3f:1f:f6:e5:1e:d4:2a:56:...:09:1a:61:98:b5:bc:7c:60:58
</pre>
</blockquote>
<p> Note: Postfix 2.9.0&ndash;2.9.5 computed the public key
fingerprint incorrectly. To use public-key fingerprints, upgrade
to Postfix 2.9.6 or later. </p>
<h4><a name="client_tls_verify"> Mandatory server certificate verification </a> </h4>
@ -1626,7 +1613,7 @@ verification as a default policy. </p>
<p> Mandatory server certificate verification as a default security
level may be appropriate if you know that you will only connect to
servers that support <a href="http://tools.ietf.org/html/rfc2487">RFC 2487</a> <i>and</i> that present verifiable
servers that support <a href="https://tools.ietf.org/html/rfc2487">RFC 2487</a> <i>and</i> 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 <a
@ -1700,7 +1687,7 @@ as a default policy. </p>
<p> 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 <a href="http://tools.ietf.org/html/rfc2487">RFC 2487</a> <i>and</i> that present
connect to servers that support <a href="https://tools.ietf.org/html/rfc2487">RFC 2487</a> <i>and</i> 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. </p>
@ -1876,7 +1863,7 @@ cipher used determines which certificate is presented. </p>
key/certificate pair as the Postfix SMTP server. If a certificate
is to be presented, it must be in "PEM" format. The private key
must not be encrypted, meaning: it must be accessible without
password. Both parts (certificate and private key) may be in the
a password. Both parts (certificate and private key) may be in the
same file. </p>
<p> With OpenSSL 1.1.1 and Postfix &ge; 3.4 it is also possible to
@ -1905,7 +1892,7 @@ As the "root" super-user create the client.pem file with: </p>
</blockquote>
<p> A Postfix SMTP client certificate supplied here must be usable
as SSL client certificate and hence pass the "openssl verify -purpose
as an SSL client certificate and hence pass the "openssl verify -purpose
sslclient ..." test. </p>
<p> A server that trusts the root CA has a local copy of the root
@ -1924,7 +1911,7 @@ single file can hold multiple <i>(key, cert, [chain])</i> sequences, one
per algorithm. It is typically simpler to keep the chain for each
algorithm in its own file. Most users are likely to deploy at most a
single RSA chain, but with OpenSSL 1.1.1, it is possible to deploy up
five chains, one each for RSA, ECDSA, ED25519, ED448 and even the
five chains, one each for RSA, ECDSA, ED25519, ED448, and even the
obsolete DSA. </p>
<blockquote>
@ -2115,7 +2102,7 @@ Postfix-owned <a href="postconf.5.html#data_directory">data_directory</a>, and a
<p> 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). <a href="http://tools.ietf.org/html/rfc2246">RFC 2246</a>
default of 300s, but a longer time of 3600s (=1 hour). <a href="https://tools.ietf.org/html/rfc2246">RFC 2246</a>
recommends a maximum of 24 hours. </p>
<p> Example: </p>
@ -2190,7 +2177,7 @@ When, as is current practice, the client verifies the insecurely
obtained MX hostname, it is subject to a DNS man-in-the-middle
attack. </p>
<p> Adoption of DNSSEC and <a href="http://tools.ietf.org/html/rfc6698">RFC6698</a> (DANE) may gradually (as domains
<p> Adoption of DNSSEC and <a href="https://tools.ietf.org/html/rfc6698">RFC6698</a> (DANE) may gradually (as domains
implement DNSSEC and publish TLSA records for their MX hosts) address
the DNS man-in-the-middle risk and provide scalable key management
for SMTP with TLS. Postfix &ge; 2.11 supports the new <a
@ -2303,7 +2290,7 @@ found, but none are usable, the effective security level is <a
href="#client_tls_encrypt">encrypt</a>. When usable TLSA records
are obtained for the remote SMTP server, SSLv2+3 are automatically
disabled (see <a href="postconf.5.html#smtp_tls_mandatory_protocols">smtp_tls_mandatory_protocols</a>), and the server certificate
must match the TLSA records. <a href="http://tools.ietf.org/html/rfc7672">RFC 7672</a> (DANE) TLS authentication
must match the TLSA records. <a href="https://tools.ietf.org/html/rfc7672">RFC 7672</a> (DANE) TLS authentication
and DNSSEC support is available with Postfix 2.11 and later. </dd>
<dt><b>dane-only</b></dt> <dd><a href="#client_tls_dane">Mandatory DANE TLS</a>.
@ -2312,7 +2299,7 @@ DNSSEC. If no TLSA records are found, or none are usable, no
connection is made to the server. When usable TLSA records are
obtained for the remote SMTP server, SSLv2+3 are automatically disabled
(see <a href="postconf.5.html#smtp_tls_mandatory_protocols">smtp_tls_mandatory_protocols</a>), and the server certificate must
match the TLSA records. <a href="http://tools.ietf.org/html/rfc7672">RFC 7672</a> (DANE) TLS authentication and
match the TLSA records. <a href="https://tools.ietf.org/html/rfc7672">RFC 7672</a> (DANE) TLS authentication and
DNSSEC support is available with Postfix 2.11 and later. </dd>
<dt><b>fingerprint</b></dt> <dd><a href="#client_tls_fprint">Certificate
@ -2345,10 +2332,10 @@ files. </dd>
<dt><b>secure</b></dt> <dd><a href="#client_tls_secure">Secure certificate
verification.</a> Mail is delivered only if the TLS handshake succeeds,
if the remote SMTP server certificate can be validated (not expired
or revoked, and signed by a trusted Certification Authority), and if the
server certificate name matches the optional "match" attribute (or the
<a href="postconf.5.html">main.cf</a> <a href="postconf.5.html#smtp_tls_secure_cert_match">smtp_tls_secure_cert_match</a> parameter value when no optional
and DNS forgery resistant remote SMTP certificate verification succeeds
(not expired or revoked, and signed by a trusted Certification Authority),
and if the server certificate name matches the optional "match" attribute
(or the <a href="postconf.5.html">main.cf</a> <a href="postconf.5.html#smtp_tls_secure_cert_match">smtp_tls_secure_cert_match</a> parameter value when no optional
"match" attribute is specified). With Postfix &ge; 2.11 the "tafile"
attribute optionally modifies trust chain verification in the same manner
as the "<a href="postconf.5.html#smtp_tls_trust_anchor_file">smtp_tls_trust_anchor_file</a>" parameter. The "tafile" attribute
@ -2399,7 +2386,7 @@ Example:
/etc/postfix/<a href="postconf.5.html">main.cf</a>:
<a href="postconf.5.html#smtp_tls_policy_maps">smtp_tls_policy_maps</a> = <a href="DATABASE_README.html#types">hash</a>:/etc/postfix/tls_policy
# Postfix 2.5 and later
<a href="postconf.5.html#smtp_tls_fingerprint_digest">smtp_tls_fingerprint_digest</a> = md5
<a href="postconf.5.html#smtp_tls_fingerprint_digest">smtp_tls_fingerprint_digest</a> = sha256
/etc/postfix/tls_policy:
example.edu none
example.mil may
@ -2410,10 +2397,12 @@ Example:
[mail.example.org]:587 secure match=nexthop
# Postfix 2.5 and later
[thumb.example.org] fingerprint
match=EC:3B:2D:B0:5B:B1:FB:6D:20:A3:9D:72:F6:8D:12:35
match=3D:95:34:51:24:66:33:B9:D2:40:99:C0:C1:17:0B:D1
# Postfix 2.6 and later
example.info may protocols=!SSLv2 ciphers=medium exclude=3DES
match=b6:b4:72:34:e2:59:cd:fb:...:0d:4d:cc:2c:7d:84:de:e6:2f
match=51:e9:af:2e:1e:40:1f:de:...:35:2d:09:16:31:5a:eb:82:76
# Postfix &ge; 3.6 "protocols" syntax
example.info may protocols=&gt;=TLSv1 ciphers=medium exclude=3DES
# Legacy protocols syntax
example.info may protocols=!SSLv2:!SSLv3 ciphers=medium exclude=3DES
</pre>
</blockquote>
@ -2508,7 +2497,7 @@ SMTP client will by default disable SSLv2 and SSLv3. The mandatory
TLS protocol list is specified via the
<a href="postconf.5.html#smtp_tls_mandatory_protocols">smtp_tls_mandatory_protocols</a> configuration parameter. The corresponding
<a href="postconf.5.html#smtp_tls_protocols">smtp_tls_protocols</a> parameter (Postfix &ge; 2.6) controls
the SSL/TLS protocols used with opportunistic TLS. </p>
the TLS protocols used with opportunistic TLS. </p>
<p> Example: </p>
@ -2518,20 +2507,20 @@ the SSL/TLS protocols used with opportunistic TLS. </p>
<a href="postconf.5.html#smtp_tls_mandatory_ciphers">smtp_tls_mandatory_ciphers</a> = medium
<a href="postconf.5.html#smtp_tls_mandatory_exclude_ciphers">smtp_tls_mandatory_exclude_ciphers</a> = RC4, MD5
<a href="postconf.5.html#smtp_tls_exclude_ciphers">smtp_tls_exclude_ciphers</a> = aNULL
# Preferred form with Postfix &ge; 2.5:
<a href="postconf.5.html#smtp_tls_mandatory_protocols">smtp_tls_mandatory_protocols</a> = !SSLv2
# Legacy form for Postfix &lt; 2.5:
<a href="postconf.5.html#smtp_tls_mandatory_protocols">smtp_tls_mandatory_protocols</a> = SSLv3, TLSv1
# Also available with Postfix &ge; 2.6:
<a href="postconf.5.html#smtp_tls_ciphers">smtp_tls_ciphers</a> = medium
<a href="postconf.5.html#smtp_tls_protocols">smtp_tls_protocols</a> = !SSLv2
# Preferred form with Postfix &ge; 3.6:
<a href="postconf.5.html#smtp_tls_mandatory_protocols">smtp_tls_mandatory_protocols</a> = &gt;=TLSv1.2
<a href="postconf.5.html#smtp_tls_protocols">smtp_tls_protocols</a> = &gt;=TLSv1
# Legacy form for Postfix &lt; 3.6:
<a href="postconf.5.html#smtp_tls_mandatory_protocols">smtp_tls_mandatory_protocols</a> = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
<a href="postconf.5.html#smtp_tls_protocols">smtp_tls_protocols</a> = !SSLv2,!SSLv3
</pre>
</blockquote>
<h3> <a name="client_smtps">Client-side SMTPS support </a> </h3>
<p> These sections show how to send mail to a server that does not
support STARTTLS, but that provides the deprecated SMTPS service
support STARTTLS, but that provides the SMTPS service
on TCP port 465. Depending on the Postfix version, some additional
tooling may be required. </p>
@ -2852,7 +2841,7 @@ for exchanging email with sites that you have no trust relationship
with. For real authentication you need also enable DNSSEC record
signing for your domain and publish TLSA records and/or your Postfix
public key certificate needs to be signed by a recognized Certification
Authority. To authenticate the certificates of remote host you
Authority. To authenticate the certificates of a remote host you
need a DNSSEC-validating local resolver and to enable <a
href="#client_tls_dane">DANE</a> authentication and/or configure
the Postfix SMTP client with a list of public key certificates of
@ -3007,7 +2996,7 @@ receiving and sending mail. It also enables logging of TLS connections
and recording of TLS use in the "Received" header. TLS session
caching is also enabled in the Postfix SMTP client. With Postfix
&ge; 2.10, the SMTP server does not need an explicit session cache
since session reuse is better handled via <a href="http://tools.ietf.org/html/rfc5077">RFC 5077</a> TLS session
since session reuse is better handled via <a href="https://tools.ietf.org/html/rfc5077">RFC 5077</a> TLS session
tickets. </p>
<h3><a name="private-ca">Private Certification Authority</a></h3>
@ -3123,7 +3112,7 @@ client certificates, unless there are servers which authenticate your mail
submission via client certificates. Often servers that perform TLS client
authentication will issue the required certificates signed by their own
CA. If you configure the client certificate and key incorrectly, you
will be unable to send mail to sites that request client certificate,
will be unable to send mail to sites that request a client certificate,
but don't require them from all clients. </p>
<blockquote>
@ -3193,6 +3182,10 @@ are in directory <tt>/usr/local/lib</tt>: </p>
</pre>
</blockquote>
<p> If your OpenSSL shared library is in a directory that the RUN-TIME
linker does not know about, add a "-Wl,-R,/path/to/directory" option after
"-lcrypto". </p>
<p> On Solaris, specify the <tt>-R</tt> option as shown below:
<blockquote>

File diff suppressed because it is too large Load Diff

View File

@ -90,10 +90,12 @@
# is unavailable on some recent Solaris distributions.
# .IP \fB-DNO_PCRE\fR
# Do not build with PCRE support.
# By default, PCRE support is compiled in when the \fBpcre-config\fR
# utility is installed.
# By default, PCRE support is compiled in when the \fBpcre2-config\fR
# or \fBpcre-config\fR utility are installed.
# .IP \fB-DNO_POSIX_GETPW_R\fR
# Disable support for POSIX getpwnam_r/getpwuid_r.
# .IP \fB-DNO_RES_NCALLS\fR
# Do not build with the threadsafe resolver(5) API (res_ninit() etc.).
# .IP \fB-DNO_SIGSETJMP\fR
# Use setjmp()/longjmp() instead of sigsetjmp()/siglongjmp().
# By default, Postfix uses sigsetjmp()/siglongjmp() when they
@ -182,6 +184,28 @@
# New York, NY 10011, USA
#--
# By now all shells must have functions.
error() {
# Alas, tput(1) is not portable so we can't use visual effects.
echo "ATTENTION:" 1>&2;
echo "ATTENTION:" $* 1>&2;
echo "ATTENTION:" 1>&2;
exit 1
}
# First, deal with unsupported usage.
case "$LD_LIBRARY_PATH" in
?*) error "Not supported: building with LD_LIBRARY_PATH";;
esac
env | grep '^AUXLIBS_' | while read line
do
case "$line" in
*-lpostfix-*) error "Not supported: linking plugins with -lpostfix-*: $line";;
esac
done || exit 1
# Emit system-dependent Makefile macro definitions to standard output.
echo "#----------------------------------------------------------------"
@ -203,16 +227,6 @@ ARFL=rv
# Ugly function to make our error message more visible among the
# garbage that is output by some versions of make(1).
# By now all shells must have functions.
error() {
# Alas, tput(1) is not portable so we can't use visual effects.
echo "ATTENTION:" 1>&2;
echo "ATTENTION:" $* 1>&2;
echo "ATTENTION:" 1>&2;
exit 1
}
case $# in
# Officially supported usage.
0) SYSTEM=`(uname -s) 2>/dev/null`
@ -228,19 +242,6 @@ case $# in
*) echo usage: $0 [system release] 1>&2; exit 1;;
esac
case "$SYSTEM" in
Linux)
case "`PATH=/bin:/usr/bin ldd /bin/sh`" in
*-musl-*)
case "$CCARGS" in
*-DNO_DNSSEC*) ;;
*) echo Warning: libc-musl breaks DANE/TLSA security. 1>&2
echo This build will not support DANE/TLSA. 1>&2
CCARGS="$CCARGS -DNO_DNSSEC";;
esac;;
esac;;
esac
case "$SYSTEM.$RELEASE" in
SCO_SV.3.2) SYSTYPE=SCO5
# Use the native compiler by default
@ -311,6 +312,33 @@ case "$SYSTEM.$RELEASE" in
: ${SHLIB_ENV="LD_LIBRARY_PATH=`pwd`/lib"}
: ${PLUGIN_LD="${CC} -shared"}
;;
FreeBSD.12*) SYSTYPE=FREEBSD12
: ${CC=cc}
: ${SHLIB_SUFFIX=.so}
: ${SHLIB_CFLAGS=-fPIC}
: ${SHLIB_LD="${CC} -shared"' -Wl,-soname,${LIB}'}
: ${SHLIB_RPATH='-Wl,-rpath,${SHLIB_DIR}'}
: ${SHLIB_ENV="LD_LIBRARY_PATH=`pwd`/lib"}
: ${PLUGIN_LD="${CC} -shared"}
;;
FreeBSD.13*) SYSTYPE=FREEBSD13
: ${CC=cc}
: ${SHLIB_SUFFIX=.so}
: ${SHLIB_CFLAGS=-fPIC}
: ${SHLIB_LD="${CC} -shared"' -Wl,-soname,${LIB}'}
: ${SHLIB_RPATH='-Wl,-rpath,${SHLIB_DIR}'}
: ${SHLIB_ENV="LD_LIBRARY_PATH=`pwd`/lib"}
: ${PLUGIN_LD="${CC} -shared"}
;;
FreeBSD.14*) SYSTYPE=FREEBSD14
: ${CC=cc}
: ${SHLIB_SUFFIX=.so}
: ${SHLIB_CFLAGS=-fPIC}
: ${SHLIB_LD="${CC} -shared"' -Wl,-soname,${LIB}'}
: ${SHLIB_RPATH='-Wl,-rpath,${SHLIB_DIR}'}
: ${SHLIB_ENV="LD_LIBRARY_PATH=`pwd`/lib"}
: ${PLUGIN_LD="${CC} -shared"}
;;
DragonFly.*) SYSTYPE=DRAGONFLY
;;
OpenBSD.2*) SYSTYPE=OPENBSD2
@ -337,6 +365,15 @@ case "$SYSTEM.$RELEASE" in
: ${SHLIB_ENV="LD_LIBRARY_PATH=`pwd`/lib"}
: ${PLUGIN_LD="${CC} -shared"}
;;
OpenBSD.7*) SYSTYPE=OPENBSD7
: ${CC=cc}
: ${SHLIB_SUFFIX=.so.1.0}
: ${SHLIB_CFLAGS=-fPIC}
: ${SHLIB_LD="${CC} -shared"' -Wl,-soname,${LIB}'}
: ${SHLIB_RPATH='-Wl,-rpath,${SHLIB_DIR}'}
: ${SHLIB_ENV="LD_LIBRARY_PATH=`pwd`/lib"}
: ${PLUGIN_LD="${CC} -shared"}
;;
ekkoBSD.1*) SYSTYPE=EKKOBSD1
;;
NetBSD.1*) SYSTYPE=NETBSD1
@ -356,8 +393,32 @@ case "$SYSTEM.$RELEASE" in
: ${SHLIB_RPATH='-Wl,-rpath,${SHLIB_DIR}'}
: ${SHLIB_ENV="LD_LIBRARY_PATH=`pwd`/lib"}
: ${PLUGIN_LD="${CC-gcc} -shared"}
;;
NetBSD.7*) SYSTYPE=NETBSD7
;;
NetBSD.7*) SYSTYPE=NETBSD7
: ${SHLIB_SUFFIX=.so}
: ${SHLIB_CFLAGS=-fPIC}
: ${SHLIB_LD="${CC-gcc} -shared"' -Wl,-soname,${LIB}'}
: ${SHLIB_RPATH='-Wl,-rpath,${SHLIB_DIR}'}
: ${SHLIB_ENV="LD_LIBRARY_PATH=`pwd`/lib"}
: ${PLUGIN_LD="${CC-gcc} -shared"}
;;
NetBSD.8*) SYSTYPE=NETBSD8
: ${SHLIB_SUFFIX=.so}
: ${SHLIB_CFLAGS=-fPIC}
: ${SHLIB_LD="${CC-gcc} -shared"' -Wl,-soname,${LIB}'}
: ${SHLIB_RPATH='-Wl,-rpath,${SHLIB_DIR}'}
: ${SHLIB_ENV="LD_LIBRARY_PATH=`pwd`/lib"}
: ${PLUGIN_LD="${CC-gcc} -shared"}
;;
NetBSD.9*) SYSTYPE=NETBSD9
: ${SHLIB_SUFFIX=.so}
: ${SHLIB_CFLAGS=-fPIC}
: ${SHLIB_LD="${CC-gcc} -shared"' -Wl,-soname,${LIB}'}
: ${SHLIB_RPATH='-Wl,-rpath,${SHLIB_DIR}'}
: ${SHLIB_ENV="LD_LIBRARY_PATH=`pwd`/lib"}
: ${PLUGIN_LD="${CC-gcc} -shared"}
;;
NetBSD.10*) SYSTYPE=NETBSD10
: ${SHLIB_SUFFIX=.so}
: ${SHLIB_CFLAGS=-fPIC}
: ${SHLIB_LD="${CC-gcc} -shared"' -Wl,-soname,${LIB}'}
@ -423,10 +484,6 @@ case "$SYSTEM.$RELEASE" in
CCARGS="$CCARGS -Dstrcasecmp=fix_strcasecmp \
-Dstrncasecmp=fix_strncasecmp"
STRCASE="strcasecmp.o"
# Avoid common types of braindamage
case "$LD_LIBRARY_PATH" in
?*) error "Don't set LD_LIBRARY_PATH";;
esac
case "${CC}" in
*" "*) ;;
*ucb*) error "Don't use /usr/ucb/cc or ucblib";;
@ -868,11 +925,17 @@ test -r /dev/urandom && CCARGS="$CCARGS -DHAS_DEV_URANDOM"
case "$CCARGS" in
*-DHAS_PCRE*) ;;
*-DNO_PCRE*) ;;
*) pcre_cflags=`(pcre-config --cflags) 2>/dev/null` &&
pcre_libs=`(pcre-config --libs) 2>/dev/null` && {
CCARGS="$CCARGS -DHAS_PCRE $pcre_cflags"
AUXLIBS_PCRE="$pcre_libs"
}
*) if pcre_cflags=`(pcre2-config --cflags) 2>/dev/null` &&
pcre_libs=`(pcre2-config --libs8) 2>/dev/null`
then
CCARGS="$CCARGS -DHAS_PCRE=2 $pcre_cflags"
AUXLIBS_PCRE="$pcre_libs"
elif pcre_cflags=`(pcre-config --cflags) 2>/dev/null` &&
pcre_libs=`(pcre-config --libs) 2>/dev/null`
then
CCARGS="$CCARGS -DHAS_PCRE=1 $pcre_cflags"
AUXLIBS_PCRE="$pcre_libs"
fi
;;
esac
@ -919,7 +982,7 @@ CCARGS="-I. -I../../include $CCARGS"
# "make makefiles name=value...". The replacement depends on usage
# context: the expanded release version in actual pathnames, or the
# unexpanded ${mail_version} in configuration parameter values (both
# main.cf and and built-in defaults).
# main.cf and built-in defaults).
# Helper function to determine DEF_MAIL_VERSION.
@ -1149,7 +1212,7 @@ esac
: ${CC=gcc} ${OPT='-O'} ${DEBUG='-g'} ${AWK=awk} \
${WARN='-Wall -Wno-comment -Wformat -Wimplicit -Wmissing-prototypes \
-Wparentheses -Wstrict-prototypes -Wswitch -Wuninitialized \
-Wunused -Wno-missing-braces -fcommon'}
-Wunused -Wno-missing-braces -fno-common'}
# Extract map type names from -DHAS_XXX compiler options. We avoid
# problems with tr(1) range syntax by using enumerations instead,
@ -1157,7 +1220,8 @@ ${WARN='-Wall -Wno-comment -Wformat -Wimplicit -Wmissing-prototypes \
# The following was validated in 2014 on FreeBSD/Linux and Solaris 9.
DEFINED_MAP_TYPES=`
echo $CCARGS | tr -cd '\- _ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789' |
echo $CCARGS | sed 's/=[^ ]*//g' |
tr -cd '\- _ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789' |
tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | ${AWK} '
{ for (n = 1; n <= NF; n++)
if ($n ~ /^-dhas_/)

View File

@ -1,4 +1,4 @@
.\" $NetBSD: makedefs.1,v 1.2 2020/03/18 19:05:14 christos Exp $
.\" $NetBSD: makedefs.1,v 1.3 2022/10/08 16:12:44 christos Exp $
.\"
.TH MAKEDEFS 1
.ad
@ -95,10 +95,12 @@ Do not build with NISPLUS support. Support for NISPLUS
is unavailable on some recent Solaris distributions.
.IP \fB\-DNO_PCRE\fR
Do not build with PCRE support.
By default, PCRE support is compiled in when the \fBpcre\-config\fR
utility is installed.
By default, PCRE support is compiled in when the \fBpcre2\-config\fR
or \fBpcre\-config\fR utility are installed.
.IP \fB\-DNO_POSIX_GETPW_R\fR
Disable support for POSIX getpwnam_r/getpwuid_r.
.IP \fB\-DNO_RES_NCALLS\fR
Do not build with the threadsafe resolver(5) API (res_ninit() etc.).
.IP \fB\-DNO_SIGSETJMP\fR
Use setjmp()/longjmp() instead of sigsetjmp()/siglongjmp().
By default, Postfix uses sigsetjmp()/siglongjmp() when they

View File

@ -1,4 +1,4 @@
.\" $NetBSD: postalias.1,v 1.3 2020/03/18 19:05:14 christos Exp $
.\" $NetBSD: postalias.1,v 1.4 2022/10/08 16:12:44 christos Exp $
.\"
.TH POSTALIAS 1
.ad
@ -20,7 +20,7 @@ Postfix alias database maintenance
The \fBpostalias\fR(1) command creates or queries one or more Postfix
alias databases, or updates an existing one. The input and output
file formats are expected to be compatible with Sendmail version 8,
and are expected to be suitable for the use as NIS alias maps.
and are expected to be suitable for use as NIS alias maps.
If the result files do not exist they will be created with the
same group and other read permissions as their source file.
@ -134,13 +134,18 @@ This is available on systems with support for \fBcdb\fR databases.
The output consists of two files, named \fIfile_name\fB.pag\fR and
\fIfile_name\fB.dir\fR.
This is available on systems with support for \fBdbm\fR databases.
.IP \fBhash\fR
The output is a hashed file, named \fIfile_name\fB.db\fR.
This is available on systems with support for \fBdb\fR databases.
.IP \fBfail\fR
A table that reliably fails all requests. The lookup table
name is used for logging only. This table exists to simplify
Postfix error tests.
.IP \fBhash\fR
The output is a hashed file, named \fIfile_name\fB.db\fR.
This is available on systems with support for \fBdb\fR databases.
.IP \fBlmdb\fR
The output is a btree\-based file, named \fIfile_name\fB.lmdb\fR.
\fBlmdb\fR supports concurrent writes and reads from different
processes, unlike other supported file\-based tables.
This is available on systems with support for \fBlmdb\fR databases.
.IP \fBsdbm\fR
The output consists of two files, named \fIfile_name\fB.pag\fR and
\fIfile_name\fB.dir\fR.
@ -199,17 +204,21 @@ hash or btree tables.
The default database type for use in \fBnewaliases\fR(1), \fBpostalias\fR(1)
and \fBpostmap\fR(1) commands.
.IP "\fBimport_environment (see 'postconf -d' output)\fR"
The list of environment parameters that a privileged Postfix
The list of environment variables that a privileged Postfix
process will import from a non\-Postfix parent process, or name=value
environment overrides.
.IP "\fBsmtputf8_enable (yes)\fR"
Enable preliminary SMTPUTF8 support for the protocols described
in RFC 6531..6533.
in RFC 6531, RFC 6532, and RFC 6533.
.IP "\fBsyslog_facility (mail)\fR"
The syslog facility of Postfix logging.
.IP "\fBsyslog_name (see 'postconf -d' output)\fR"
A prefix that is prepended to the process name in syslog
records, so that, for example, "smtpd" becomes "prefix/smtpd".
.PP
Available in Postfix 2.11 and later:
.IP "\fBlmdb_map_size (16777216)\fR"
The initial OpenLDAP LMDB database size limit in bytes.
.SH "STANDARDS"
.na
.nf

View File

@ -1,4 +1,4 @@
.\" $NetBSD: postcat.1,v 1.3 2020/03/18 19:05:14 christos Exp $
.\" $NetBSD: postcat.1,v 1.4 2022/10/08 16:12:44 christos Exp $
.\"
.TH POSTCAT 1
.ad
@ -54,6 +54,14 @@ Search the Postfix queue for the named \fIfiles\fR instead
of taking the names literally.
This feature is available in Postfix 2.0 and later.
.IP \fB\-r\fR
Print records in file order, don't follow pointer records.
This feature is available in Postfix 3.7 and later.
.IP "\fB\-s \fIoffset\fR"
Skip to the specified queue file offset.
This feature is available in Postfix 3.7 and later.
.IP \fB\-v\fR
Enable verbose logging for debugging purposes. Multiple \fB\-v\fR
options make the software increasingly verbose.

View File

@ -1,4 +1,4 @@
.\" $NetBSD: postconf.1,v 1.3 2020/03/18 19:05:14 christos Exp $
.\" $NetBSD: postconf.1,v 1.4 2022/10/08 16:12:44 christos Exp $
.\"
.TH POSTCONF 1
.ad
@ -173,7 +173,7 @@ With \fB\-F\fR, edit the \fBmaster.cf\fR configuration file,
and replace one or more service fields with new values as
specified with "\fIservice/type/field=value\fR" on the
\fBpostconf\fR(1) command line. Currently, the "command"
field contains the command name and command arguments. this
field contains the command name and command arguments. This
may change in the near future, so that the "command" field
contains only the command name, and a new "arguments"
pseudofield contains the command arguments.
@ -190,7 +190,8 @@ characters and whitespace on the \fBpostconf\fR(1) command
line.
The \fB\-e\fR option is no longer needed with Postfix version
2.8 and later.
2.8 and later, as it is assumed whenever a value is specified
(empty or non\-empty).
.IP \fB\-f\fR
Fold long lines when printing \fBmain.cf\fR or \fBmaster.cf\fR
configuration file entries, for human readability.
@ -210,8 +211,8 @@ fields.
This feature is available with Postfix 2.11 and later.
.IP \fB\-h\fR
Show parameter or attribute values without the "\fIname\fR
= " label that normally precedes the value.
Show parameter or attribute values without the "\fIname\fR = "
label that normally precedes the value.
.IP \fB\-H\fR
Show parameter or attribute names without the " = \fIvalue\fR"
that normally follows the name.
@ -429,12 +430,17 @@ to fold long lines for human readability (Postfix 2.9 and
later). To show settings that differ from built\-in defaults
only, use the following bash syntax:
.nf
comm \-23 <(postconf \-n) <(postconf \-d)
LANG=C comm \-23 <(postconf \-n) <(postconf \-d)
.fi
Replace "\-23" with "\-12" to show settings that duplicate
built\-in defaults.
.IP "\fB\-o \fIname=value\fR"
Override \fBmain.cf\fR parameter settings.
Override \fBmain.cf\fR parameter settings. This lets you see
the effect changing a parameter would have when it is used in
other configuration parameters, e.g.:
.nf
postconf \-x \-o stress=yes
.fi
This feature is available with Postfix 2.10 and later.
.IP \fB\-p\fR

View File

@ -1,4 +1,4 @@
.\" $NetBSD: postdrop.1,v 1.3 2020/03/18 19:05:14 christos Exp $
.\" $NetBSD: postdrop.1,v 1.4 2022/10/08 16:12:44 christos Exp $
.\"
.TH POSTDROP 1
.ad
@ -98,6 +98,18 @@ Available in Postfix version 2.2 and later:
.IP "\fBauthorized_submit_users (static:anyone)\fR"
List of users who are authorized to submit mail with the \fBsendmail\fR(1)
command (and with the privileged \fBpostdrop\fR(1) helper command).
.PP
Available in Postfix version 3.6 and later:
.IP "\fBlocal_login_sender_maps (static:*)\fR"
A list of lookup tables that are searched by the UNIX login name,
and that return a list of allowed envelope sender patterns separated
by space or comma.
.IP "\fBempty_address_local_login_sender_maps_lookup_key (<>)\fR"
The lookup key to be used in local_login_sender_maps tables, instead
of the null sender address.
.IP "\fBrecipient_delimiter (empty)\fR"
The set of characters that can separate an email address
localpart, user name, or a .forward file name from its extension.
.SH "FILES"
.na
.nf

View File

@ -1,4 +1,4 @@
.\" $NetBSD: postfix.1,v 1.4 2020/05/25 23:47:13 christos Exp $
.\" $NetBSD: postfix.1,v 1.5 2022/10/08 16:12:44 christos Exp $
.\"
.TH POSTFIX 1
.ad
@ -45,11 +45,15 @@ in the foreground, and enable \fBmaster\fR(8) "init" mode
when running as PID 1.
This command requires that multi\-instance support is
disabled (i.e. the multi_instance_directories parameter
value must be empty). When running Postfix inside a container,
mount the container host's /dev/log socket inside the
container (example: "docker run \-v /dev/log:/dev/log ...")
and specify a distinct Postfix "syslog_name" prefix that
identifies logging from the Postfix instance.
value must be empty).
When running Postfix inside a container, see MAILLOG_README
for logging to stdout. Postfix logs to syslog by default,
which requires a) running a syslogd process inside the
container, or b) mounting the container host's /dev/log
socket inside the container (example: "docker run \-v
/dev/log:/dev/log ..."), and c) a distinct Postfix "syslog_name"
prefix that identifies logging from the Postfix instance.
.IP \fBstop\fR
Stop the Postfix mail system in an orderly fashion. If
possible, running processes are allowed to terminate at
@ -201,6 +205,9 @@ The directory with Postfix\-writable data files (for example:
caches, pseudo\-random numbers).
.PP
Available in Postfix version 3.0 and later:
.IP "\fBcompatibility_level (0)\fR"
A safety net that causes Postfix to run with backwards\-compatible
default settings after an upgrade to a newer Postfix version.
.IP "\fBmeta_directory (see 'postconf -d' output)\fR"
The location of non\-executable files that are shared among
multiple Postfix instances, such as postfix\-files, dynamicmaps.cf,
@ -217,7 +224,7 @@ The location of the OpenSSL command line program \fBopenssl\fR(1).
.PP
Other configuration parameters:
.IP "\fBimport_environment (see 'postconf -d' output)\fR"
The list of environment parameters that a privileged Postfix
The list of environment variables that a privileged Postfix
process will import from a non\-Postfix parent process, or name=value
environment overrides.
.IP "\fBsyslog_facility (mail)\fR"
@ -266,8 +273,9 @@ The name of the \fBpostlogd\fR(8) service entry in master.cf.
.fi
Prior to Postfix version 2.6, all of the following files
were in \fB$config_directory\fR. Some files are now in
\fB$daemon_directory\fR so that they can be shared among
multiple instances that run the same Postfix version.
\fB$daemon_directory\fR or \fB$meta_directory\fR so that they
can be shared among multiple instances that run the same Postfix
version.
Use the command "\fBpostconf config_directory\fR" or
"\fBpostconf daemon_directory\fR" to expand the names
@ -277,10 +285,10 @@ into their actual values.
$config_directory/main.cf, Postfix configuration parameters
$config_directory/master.cf, Postfix daemon processes
$daemon_directory/postfix\-files, file/directory permissions
$daemon_directory/postfix\-script, administrative commands
$daemon_directory/post\-install, post\-installation configuration
$daemon_directory/dynamicmaps.cf, plug\-in database clients
$meta_directory/dynamicmaps.cf, plug\-in database clients
$meta_directory/postfix\-files, file/directory permissions
.SH "SEE ALSO"
.na
.nf
@ -288,6 +296,7 @@ Commands:
postalias(1), create/update/query alias database
postcat(1), examine Postfix queue file
postconf(1), Postfix configuration utility
postdrop(1), Postfix mail posting utility
postfix(1), Postfix control program
postfix\-tls(1), Postfix TLS management
postkick(1), trigger Postfix daemon
@ -336,7 +345,7 @@ anvil(8), Postfix connection/rate limiting
bounce(8), defer(8), trace(8), Delivery status reports
cleanup(8), canonicalize and enqueue message
discard(8), Postfix discard delivery agent
dnsblog(8), DNS black/whitelist logger
dnsblog(8), DNS allow/denylist logger
error(8), Postfix error delivery agent
flush(8), Postfix fast ETRN service
local(8), Postfix local delivery agent

View File

@ -1,4 +1,4 @@
.\" $NetBSD: postlog.1,v 1.3 2020/03/18 19:05:14 christos Exp $
.\" $NetBSD: postlog.1,v 1.4 2022/10/08 16:12:44 christos Exp $
.\"
.TH POSTLOG 1
.ad
@ -50,6 +50,16 @@ is used when none is specified.
.IP \fB\-v\fR
Enable verbose logging for debugging purposes. Multiple \fB\-v\fR
options make the software increasingly verbose.
.SH "SECURITY"
.na
.nf
.ad
.fi
The \fBpostlog\fR(1) command is designed to run with
set\-groupid privileges, so that it can connect to the
\fBpostlogd\fR(8) daemon process (Postfix 3.7 and later;
earlier implementations of this command must not have
set\-groupid or set\-userid permissions).
.SH "ENVIRONMENT"
.na
.nf
@ -98,6 +108,11 @@ syslogd(8), system logging
.ad
.fi
The Secure Mailer license must be distributed with this software.
.SH HISTORY
.ad
.fi
The \fBpostlog\fR(1) command was introduced with Postfix
version 3.4.
.SH "AUTHOR(S)"
.na
.nf

View File

@ -1,4 +1,4 @@
.\" $NetBSD: postmap.1,v 1.3 2020/03/18 19:05:14 christos Exp $
.\" $NetBSD: postmap.1,v 1.4 2022/10/08 16:12:44 christos Exp $
.\"
.TH POSTMAP 1
.ad
@ -48,7 +48,10 @@ starts with whitespace continues a logical line.
.PP
The \fIkey\fR and \fIvalue\fR are processed as is, except that
surrounding white space is stripped off. Whitespace in lookup
keys is supported as of Postfix 3.2.
keys is supported in Postfix 3.2 and later, by surrounding the
key with double quote characters `"'. Within the double quotes,
double quote `"' and backslash `\\' characters can be included
by quoting them with a preceding backslash.
When the \fB\-F\fR option is given, the \fIvalue\fR must
specify one or more filenames separated by comma and/or
@ -90,8 +93,8 @@ generates no body\-style lookup keys for attachment MIME
headers and for attached message/* headers.
.sp
NOTE: with "smtputf8_enable = yes", the \fB\-b\fR option
option disables UTF\-8 syntax checks on query keys and
lookup results. Specify the \fB\-U\fR option to force UTF\-8
disables UTF\-8 syntax checks on query keys and lookup
results. Specify the \fB\-U\fR option to force UTF\-8
syntax checks anyway.
.sp
This feature is available in Postfix version 2.6 and later.
@ -117,7 +120,9 @@ When querying a map, or listing a map, base64\-decode each
value. When creating a map from source file, process each
value as a list of filenames, concatenate the content of
those files, and store the base64\-encoded result instead
of the value (see INPUT FORMAT for details).
of the value (see INPUT FILE FORMAT for details).
.sp
This feature is available in Postfix version 3.4 and later.
.IP \fB\-h\fR
Enable message header query mode. When reading lookup keys
from standard input with "\fB\-q \-\fR", process the input
@ -222,13 +227,18 @@ This is available on systems with support for \fBcdb\fR databases.
The output consists of two files, named \fIfile_name\fB.pag\fR and
\fIfile_name\fB.dir\fR.
This is available on systems with support for \fBdbm\fR databases.
.IP \fBhash\fR
The output file is a hashed file, named \fIfile_name\fB.db\fR.
This is available on systems with support for \fBdb\fR databases.
.IP \fBfail\fR
A table that reliably fails all requests. The lookup table
name is used for logging only. This table exists to simplify
Postfix error tests.
.IP \fBhash\fR
The output file is a hashed file, named \fIfile_name\fB.db\fR.
This is available on systems with support for \fBdb\fR databases.
.IP \fBlmdb\fR
The output is a btree\-based file, named \fIfile_name\fB.lmdb\fR.
\fBlmdb\fR supports concurrent writes and reads from different
processes, unlike other supported file\-based tables.
This is available on systems with support for \fBlmdb\fR databases.
.IP \fBsdbm\fR
The output consists of two files, named \fIfile_name\fB.pag\fR and
\fIfile_name\fB.dir\fR.
@ -282,17 +292,21 @@ configuration files.
The default database type for use in \fBnewaliases\fR(1), \fBpostalias\fR(1)
and \fBpostmap\fR(1) commands.
.IP "\fBimport_environment (see 'postconf -d' output)\fR"
The list of environment parameters that a privileged Postfix
The list of environment variables that a privileged Postfix
process will import from a non\-Postfix parent process, or name=value
environment overrides.
.IP "\fBsmtputf8_enable (yes)\fR"
Enable preliminary SMTPUTF8 support for the protocols described
in RFC 6531..6533.
in RFC 6531, RFC 6532, and RFC 6533.
.IP "\fBsyslog_facility (mail)\fR"
The syslog facility of Postfix logging.
.IP "\fBsyslog_name (see 'postconf -d' output)\fR"
A prefix that is prepended to the process name in syslog
records, so that, for example, "smtpd" becomes "prefix/smtpd".
.PP
Available in Postfix 2.11 and later:
.IP "\fBlmdb_map_size (16777216)\fR"
The initial OpenLDAP LMDB database size limit in bytes.
.SH "SEE ALSO"
.na
.nf

View File

@ -1,4 +1,4 @@
.\" $NetBSD: postmulti.1,v 1.3 2020/03/18 19:05:14 christos Exp $
.\" $NetBSD: postmulti.1,v 1.4 2022/10/08 16:12:44 christos Exp $
.\"
.TH POSTMULTI 1
.ad
@ -222,7 +222,7 @@ instance a short name that is used to construct default
values for the private directories of the new instance. The
"\fB\-G \fIgroup\fR" option may be specified to assign the
instance to a group, otherwise, the new instance is not a
member of any groups.
member of any group.
.sp
The new instance main.cf is the stock main.cf with the
parameters that specify the locations of shared files cloned
@ -247,9 +247,9 @@ For example:
.RE
.IP
If any of these pathnames is not supplied, the program
attempts to generate the pathname by taking the corresponding
primary instance pathname, and by replacing the last pathname
component by the value of the \fB\-I\fR option.
attempts to generate the missing pathname(s) by taking the
corresponding primary instance pathname, and replacing the
last pathname component by the value of the \fB\-I\fR option.
.sp
If the instance configuration directory already exists, and
contains both a main.cf and master.cf file, \fBcreate\fR
@ -344,7 +344,7 @@ configuration files.
.IP "\fBdaemon_directory (see 'postconf -d' output)\fR"
The directory with Postfix support programs and daemon programs.
.IP "\fBimport_environment (see 'postconf -d' output)\fR"
The list of environment parameters that a privileged Postfix
The list of environment variables that a privileged Postfix
process will import from a non\-Postfix parent process, or name=value
environment overrides.
.IP "\fBmulti_instance_directories (empty)\fR"

View File

@ -1,4 +1,4 @@
.\" $NetBSD: postqueue.1,v 1.3 2020/03/18 19:05:14 christos Exp $
.\" $NetBSD: postqueue.1,v 1.4 2022/10/08 16:12:44 christos Exp $
.\"
.TH POSTQUEUE 1
.ad
@ -204,7 +204,7 @@ The location of all postfix administrative commands.
Optional list of destinations that are eligible for per\-destination
logfiles with mail that is queued to those destinations.
.IP "\fBimport_environment (see 'postconf -d' output)\fR"
The list of environment parameters that a privileged Postfix
The list of environment variables that a privileged Postfix
process will import from a non\-Postfix parent process, or name=value
environment overrides.
.IP "\fBqueue_directory (see 'postconf -d' output)\fR"

View File

@ -1,4 +1,4 @@
.\" $NetBSD: postsuper.1,v 1.3 2020/03/18 19:05:14 christos Exp $
.\" $NetBSD: postsuper.1,v 1.4 2022/10/08 16:12:44 christos Exp $
.\"
.TH POSTSUPER 1
.ad
@ -48,6 +48,17 @@ from standard input. For example, to delete all mail
with exactly one recipient \fBuser@example.com\fR:
.sp
.nf
postqueue \-j | jq -r '
# See JSON OBJECT FORMAT section in the postqueue(1) manpage
select(.recipients[0].address == "user@example.com")
| select(.recipients[1].address == null)
| .queue_id
' | postsuper \-d \-
.fi
.sp
(note the "jq -r" option), or the historical form:
.sp
.nf
mailq | tail \-n +2 | grep \-v '^ *(' | awk 'BEGIN { RS = "" }
# $7=sender, $8=recipient1, $9=recipient2
{ if ($8 == "user@example.com" && $9 == "")

View File

@ -1,4 +1,4 @@
.\" $NetBSD: posttls-finger.1,v 1.3 2020/03/18 19:05:14 christos Exp $
.\" $NetBSD: posttls-finger.1,v 1.4 2022/10/08 16:12:44 christos Exp $
.\"
.TH POSTTLS-FINGER 1
.ad
@ -20,7 +20,7 @@ Probe the TLS properties of an ESMTP or LMTP server.
and reports TLS\-related information about the server. With SMTP, the
destination is a domainname; with LMTP it is either a domainname
prefixed with \fBinet:\fR or a pathname prefixed with \fBunix:\fR. If
Postfix is built without TLS support, the resulting posttls\-finger
Postfix is built without TLS support, the resulting \fBposttls\-finger\fR(1)
program has very limited functionality, and only the \fB\-a\fR, \fB\-c\fR,
\fB\-h\fR, \fB\-o\fR, \fB\-S\fR, \fB\-t\fR, \fB\-T\fR and \fB\-v\fR options
are available.
@ -86,9 +86,9 @@ SMTP. The default TCP port for LMTP is 24.
Arguments:
.IP "\fB\-a\fR \fIfamily\fR (default: \fBany\fR)"
Address family preference: \fBipv4\fR, \fBipv6\fR or \fBany\fR. When
using \fBany\fR, posttls\-finger will randomly select one of the two as
the more preferred, and exhaust all MX preferences for the first
address family before trying any addresses for the other.
using \fBany\fR, \fBposttls\-finger\fR(1) will randomly select one of
the two as the more preferred, and exhaust all MX preferences for the
first address family before trying any addresses for the other.
.IP "\fB\-A\fR \fItrust\-anchor.pem\fR (default: none)"
A list of PEM trust\-anchor files that overrides CAfile and CApath
trust chain verification. Specify the option multiple times to
@ -104,11 +104,12 @@ certificate block. If you specify \fB\-F \fICAfile\fR or
\fB\-P \fICApath\fR, the OpenSSL library may augment the chain with
missing issuer certificates. To see the actual chain sent by the
remote SMTP server leave \fICAfile\fR and \fICApath\fR unset.
.IP "\fB\-d \fImdalg\fR (default: \fBsha1\fR)"
.IP "\fB\-d \fImdalg\fR (default: \fB$smtp_tls_fingerprint_digest\fR)"
The message digest algorithm to use for reporting remote SMTP server
fingerprints and matching against user provided certificate
fingerprints (with DANE TLSA records the algorithm is specified
in the DNS).
in the DNS). In Postfix versions prior to 3.6, the default value
was "md5".
.IP "\fB\-f\fR"
Lookup the associated DANE TLSA RRset even when a hostname is not an
alias and its address records lie in an unsigned zone. See
@ -118,8 +119,8 @@ The PEM formatted CAfile for remote SMTP server certificate
verification. By default no CAfile is used and no public CAs
are trusted.
.IP "\fB\-g \fIgrade\fR (default: medium)"
The minimum TLS cipher grade used by posttls\-finger. See
smtp_tls_mandatory_ciphers for details.
The minimum TLS cipher grade used by \fBposttls\-finger\fR(1).
See smtp_tls_mandatory_ciphers for details.
.IP "\fB\-h \fIhost_lookup\fR (default: \fBdns\fR)"
The hostname lookup methods used for the connection. See the
documentation of smtp_host_lookup for syntax and semantics.
@ -149,7 +150,7 @@ TLSA records are found, or all the records found are unusable, the
security level allows you to test certificate or public\-key
fingerprint matches before you deploy them in the policy table.
.IP
Note, since \fBposttls\-finger\fR does not actually deliver any email,
Note, since \fBposttls\-finger\fR(1) does not actually deliver any email,
the \fBnone\fR, \fBmay\fR and \fBencrypt\fR security levels are not
very useful. Since \fBmay\fR and \fBencrypt\fR don't require peer
certificates, they will often negotiate anonymous TLS ciphersuites,
@ -225,14 +226,14 @@ response; with these servers there will never be more than
The TLS policy for MX hosts with "secure" TLSA records when the
nexthop destination security level is \fBdane\fR, but the MX
record was found via an "insecure" MX lookup. See the main.cf
documentation for smtp_tls_insecure_mx_policy for details.
documentation for smtp_tls_dane_insecure_mx_policy for details.
.IP "\fB\-o \fIname=value\fR"
Specify zero or more times to override the value of the main.cf
parameter \fIname\fR with \fIvalue\fR. Possible use\-cases include
overriding the values of TLS library parameters, or "myhostname" to
configure the SMTP EHLO name sent to the remote server.
.IP "\fB\-p \fIprotocols\fR (default: !SSLv2)"
List of TLS protocols that posttls\-finger will exclude or include. See
.IP "\fB\-p \fIprotocols\fR (default: >=TLSv1)"
TLS protocols that \fBposttls\-finger\fR(1) will exclude or include. See
smtp_tls_mandatory_protocols for details.
.IP "\fB\-P \fICApath/\fR (default: none)"
The OpenSSL CApath/ directory (indexed via c_rehash(1)) for remote
@ -264,10 +265,10 @@ The SMTP/LMTP command timeout for EHLO/LHLO, STARTTLS and QUIT.
Enable verbose Postfix logging. Specify more than once to increase
the level of verbose logging.
.IP "\fB\-w\fR"
Enable outgoing TLS wrapper mode, or SMTPS support. This is typically
provided on port 465 by servers that are compatible with the ad\-hoc
SMTP in SSL protocol, rather than the standard STARTTLS protocol.
The destination \fIdomain\fR:\fIport\fR should of course provide such
Enable outgoing TLS wrapper mode, or SUBMISSIONS/SMTPS support. This
is typically provided on port 465 by servers that are compatible with
the SMTP\-in\-SSL protocol, rather than the STARTTLS protocol.
The destination \fIdomain\fR:\fIport\fR must of course provide such
a service.
.IP "\fB\-X\fR"
Enable \fBtlsproxy\fR(8) mode. This is an unsupported mode,

View File

@ -1,4 +1,4 @@
.\" $NetBSD: sendmail.1,v 1.3 2020/03/18 19:05:14 christos Exp $
.\" $NetBSD: sendmail.1,v 1.4 2022/10/08 16:12:44 christos Exp $
.\"
.TH SENDMAIL 1
.ad
@ -47,6 +47,9 @@ selected for delivery.
.IP \fB!\fR
The message is in the \fBhold\fR queue, i.e. no further delivery
attempt will be made until the mail is taken off hold.
.IP \fB#\fR
The message is forced to expire. See the \fBpostsuper\fR(1)
options \fB\-e\fR or \fB\-f\fR.
.RE
.IP
This mode of operation is implemented by executing the
@ -86,7 +89,7 @@ Initialize alias database. See the \fBnewaliases\fR
command above.
.IP \fB\-bl\fR
Go into daemon mode. To accept only local connections as
with Sendmail\'s \fB\-bl\fR option, specify "\fBinet_interfaces
with Sendmail's \fB\-bl\fR option, specify "\fBinet_interfaces
= loopback\fR" in the Postfix \fBmain.cf\fR configuration
file.
.IP \fB\-bm\fR
@ -145,7 +148,7 @@ parameter instead.
Initialize alias database. See the \fBnewaliases\fR
command above.
.IP "\fB\-i\fR"
When reading a message from standard input, don\'t treat a line
When reading a message from standard input, don't treat a line
with only a \fB.\fR character as the end of input.
.IP "\fB\-L \fIlabel\fR (ignored)"
The logging label. Use the \fBsyslog_name\fR configuration
@ -175,7 +178,7 @@ configuration parameter in \fBmain.cf\fR instead.
To send 8\-bit or binary content, use an appropriate MIME encapsulation
and specify the appropriate \fB\-B\fR command\-line option.
.IP "\fB\-oi\fR"
When reading a message from standard input, don\'t treat a line
When reading a message from standard input, don't treat a line
with only a \fB.\fR character as the end of input.
.IP "\fB\-om\fR (ignored)"
The sender is never eliminated from alias etc. expansions.
@ -260,10 +263,43 @@ Log mailer traffic. Use the \fBdebug_peer_list\fR and
.nf
.ad
.fi
By design, this program is not set\-user (or group) id. However,
it must handle data from untrusted, possibly remote, users.
Thus, the usual precautions need to be taken against malicious
inputs.
By design, this program is not set\-user (or group) id.
It is prepared to handle message content from untrusted,
possibly remote, users.
However, like most Postfix programs, this program does not
enforce a security policy on its command\-line arguments.
Instead, it relies on the UNIX system to enforce access
policies based on the effective user and group IDs of the
process. Concretely, this means that running Postfix commands
as root (from sudo or equivalent) on behalf of a non\-root
user is likely to create privilege escalation opportunities.
If an application runs any Postfix programs on behalf of
users that do not have normal shell access to Postfix
commands, then that application MUST restrict user\-specified
command\-line arguments to avoid privilege escalation.
.IP \(bu
Filter all command\-line arguments, for example arguments
that contain a pathname or that specify a database access
method. These pathname checks must reject user\-controlled
symlinks or hardlinks to sensitive files, and must not be
vulnerable to TOCTOU race attacks.
.IP \(bu
Disable command options processing for all command arguments
that contain user\-specified data. For example, the Postfix
\fBsendmail\fR(1) command line MUST be structured as follows:
.nf
\fB/path/to/sendmail\fR \fIsystem\-arguments\fR \fB\-\-\fR \fIuser\-arguments\fR
.fi
Here, the "\fB\-\-\fR" disables command option processing for
all \fIuser\-arguments\fR that follow.
.IP
Without the "\fB\-\-\fR", a malicious user could enable Postfix
\fBsendmail\fR(1) command options, by specifying an email
address that starts with "\fB\-\fR".
.SH DIAGNOSTICS
.ad
.fi
@ -314,12 +350,13 @@ Postfix system.
The external command to execute when a Postfix daemon program is
invoked with the \-D option.
.IP "\fBdebug_peer_level (2)\fR"
The increment in verbose logging level when a remote client or
server matches a pattern in the debug_peer_list parameter.
The increment in verbose logging level when a nexthop destination,
remote client or server name or network address matches a pattern
given with the debug_peer_list parameter.
.IP "\fBdebug_peer_list (empty)\fR"
Optional list of remote client or server hostname or network
address patterns that cause the verbose logging level to increase
by the amount specified in $debug_peer_level.
Optional list of nexthop destination, remote client or server
name or network address patterns that, if matched, cause the verbose
logging level to increase by the amount specified in $debug_peer_level.
.SH "ACCESS CONTROLS"
.na
.nf
@ -396,7 +433,7 @@ and \fBpostmap\fR(1) commands.
The time after which the sender receives a copy of the message
headers of mail that is still queued.
.IP "\fBimport_environment (see 'postconf -d' output)\fR"
The list of environment parameters that a privileged Postfix
The list of environment variables that a privileged Postfix
process will import from a non\-Postfix parent process, or name=value
environment overrides.
.IP "\fBmail_owner (postfix)\fR"

View File

@ -1,4 +1,4 @@
.\" $NetBSD: smtp-sink.1,v 1.2 2017/02/14 01:16:44 christos Exp $
.\" $NetBSD: smtp-sink.1,v 1.3 2022/10/08 16:12:44 christos Exp $
.\"
.TH SMTP-SINK 1
.ad
@ -199,7 +199,7 @@ specified in numeric or symbolic form.
.IP \fBunix:\fR\fIpathname\fR
Listen on the UNIX\-domain socket at \fIpathname\fR.
.IP \fIbacklog\fR
The maximum length the queue of pending connections,
The maximum length of the queue of pending connections,
as defined by the \fBlisten\fR(2) system call.
.SH "DUMP FILE FORMAT"
.na

View File

@ -1,4 +1,4 @@
.\" $NetBSD: access.5,v 1.3 2020/03/18 19:05:14 christos Exp $
.\" $NetBSD: access.5,v 1.4 2022/10/08 16:12:44 christos Exp $
.\"
.TH ACCESS 5
.ad
@ -37,7 +37,7 @@ or SQL, the same lookups are done as for ordinary indexed files.
Alternatively, the table can be provided as a regular\-expression
map where patterns are given as regular expressions, or lookups
can be directed to TCP\-based server. In those cases, the lookups
can be directed to a TCP\-based server. In those cases, the lookups
are done in a slightly different way as described below under
"REGULAR EXPRESSION TABLES" or "TCP\-BASED TABLES".
.SH "CASE FOLDING"
@ -221,7 +221,7 @@ Prior to Postfix 2.6, the SMTP reply code is 450.
.sp
This feature is available in Postfix 2.1 and later.
.IP "\fBDEFER_IF_PERMIT \fIoptional text...\fR
Defer the request if some later restriction would result in a
Defer the request if some later restriction would result in
an explicit or implicit PERMIT action.
Reply with "\fB$access_map_defer_code 4.7.1 \fI optional
text...\fR" when the

View File

@ -1,4 +1,4 @@
.\" $NetBSD: aliases.5,v 1.3 2020/03/18 19:05:14 christos Exp $
.\" $NetBSD: aliases.5,v 1.4 2022/10/08 16:12:44 christos Exp $
.\"
.TH ALIASES 5
.ad
@ -182,9 +182,8 @@ Enable special treatment for owner\-\fIlistname\fR entries in the
\fIlistname\fR\-request address localparts when the recipient_delimiter
is set to "\-".
.IP "\fBrecipient_delimiter (empty)\fR"
The set of characters that can separate a user name from its
extension (example: user+foo), or a .forward file name from its
extension (example: .forward+foo).
The set of characters that can separate an email address
localpart, user name, or a .forward file name from its extension.
.PP
Available in Postfix version 2.3 and later:
.IP "\fBfrozen_delivered_to (yes)\fR"

View File

@ -1,4 +1,4 @@
.\" $NetBSD: canonical.5,v 1.3 2020/03/18 19:05:14 christos Exp $
.\" $NetBSD: canonical.5,v 1.4 2022/10/08 16:12:44 christos Exp $
.\"
.TH CANONICAL 5
.ad
@ -35,7 +35,7 @@ or SQL, the same lookups are done as for ordinary indexed files.
Alternatively, the table can be provided as a regular\-expression
map where patterns are given as regular expressions, or lookups
can be directed to TCP\-based server. In those cases, the lookups
can be directed to a TCP\-based server. In those cases, the lookups
are done in a slightly different way as described below under
"REGULAR EXPRESSION TABLES" or "TCP\-BASED TABLES".
@ -252,7 +252,7 @@ Optional list of domains whose subdomain structure will be stripped
off in email addresses.
.IP "\fBmasquerade_exceptions (empty)\fR"
Optional list of user names that are not subjected to address
masquerading, even when their address matches $masquerade_domains.
masquerading, even when their addresses match $masquerade_domains.
.IP "\fBmydestination ($myhostname, localhost.$mydomain, localhost)\fR"
The list of domains that are delivered via the $local_transport
mail delivery transport.

View File

@ -1,4 +1,4 @@
.\" $NetBSD: cidr_table.5,v 1.3 2020/03/18 19:05:14 christos Exp $
.\" $NetBSD: cidr_table.5,v 1.4 2022/10/08 16:12:44 christos Exp $
.\"
.TH CIDR_TABLE 5
.ad
@ -112,6 +112,38 @@ an IPv4 address octet indicates octal notation).
Note: address information may be enclosed inside "[]" but
this form is not required.
.SH "INLINE SPECIFICATION"
.na
.nf
.ad
.fi
The contents of a table may be specified in the table name.
The basic syntax is:
.nf
main.cf:
\fIparameter\fR \fB= .. cidr:{ { \fIrule\-1\fB }, { \fIrule\-2\fB } .. } ..\fR
master.cf:
\fB.. \-o { \fIparameter\fR \fB= .. cidr:{ { \fIrule\-1\fB }, { \fIrule\-2\fB } .. } .. } ..\fR
.fi
Postfix ignores whitespace after '{' and before '}', and
writes each \fIrule\fR as one text line to an in\-memory
file:
.nf
in\-memory file:
rule\-1
rule\-2
..
.fi
Postfix parses the result as if it is a file in /etc/postfix.
Note: if a rule contains \fB$\fR, specify \fB$$\fR to keep
Postfix from trying to do \fI$name\fR expansion as it
evaluates a parameter value.
.SH "EXAMPLE SMTPD ACCESS MAP"
.na
.nf
@ -120,8 +152,8 @@ this form is not required.
smtpd_client_restrictions = ... cidr:/etc/postfix/client.cidr ...
/etc/postfix/client.cidr:
# Rule order matters. Put more specific whitelist entries
# before more general blacklist entries.
# Rule order matters. Put more specific allowlist entries
# before more general denylist entries.
192.168.1.1 OK
192.168.0.0/16 REJECT
2001:db8::1 OK

View File

@ -1,4 +1,4 @@
.\" $NetBSD: generic.5,v 1.3 2020/03/18 19:05:14 christos Exp $
.\" $NetBSD: generic.5,v 1.4 2022/10/08 16:12:44 christos Exp $
.\"
.TH GENERIC 5
.ad
@ -49,7 +49,7 @@ or SQL, the same lookups are done as for ordinary indexed files.
Alternatively, the table can be provided as a regular\-expression
map where patterns are given as regular expressions, or lookups
can be directed to TCP\-based server. In those case, the lookups
can be directed to a TCP\-based server. In those cases, the lookups
are done in a slightly different way as described below under
"REGULAR EXPRESSION TABLES" or "TCP\-BASED TABLES".
.SH "CASE FOLDING"
@ -156,7 +156,7 @@ pattern can be interpolated as \fB$1\fR, \fB$2\fR and so on.
This section describes how the table lookups change when lookups
are directed to a TCP\-based server. For a description of the TCP
client/server lookup protocol, see \fBtcp_table\fR(5).
This feature is not available up to and including Postfix version 2.4.
This feature is available in Postfix 2.5 and later.
Each lookup operation uses the entire address once. Thus,
\fIuser@domain\fR mail addresses are not broken up into their
@ -206,29 +206,32 @@ The table format does not understand quoting conventions.
The following \fBmain.cf\fR parameters are especially relevant.
The text below provides only a parameter summary. See
\fBpostconf\fR(5) for more details including examples.
.IP \fBsmtp_generic_maps\fR
Address mapping lookup table for envelope and header sender
and recipient addresses while delivering mail via SMTP.
.IP \fBpropagate_unmatched_extensions\fR
A list of address rewriting or forwarding mechanisms that propagate
an address extension from the original address to the result.
Specify zero or more of \fBcanonical\fR, \fBvirtual\fR, \fBalias\fR,
\fBforward\fR, \fBinclude\fR, or \fBgeneric\fR.
.IP "\fBsmtp_generic_maps (empty)\fR"
Optional lookup tables that perform address rewriting in the
Postfix SMTP client, typically to transform a locally valid address into
a globally valid address when sending mail across the Internet.
.IP "\fBpropagate_unmatched_extensions (canonical, virtual)\fR"
What address lookup tables copy an address extension from the lookup
key to the lookup result.
.PP
Other parameters of interest:
.IP \fBinet_interfaces\fR
The network interface addresses that this system receives mail on.
You need to stop and start Postfix when this parameter changes.
.IP \fBproxy_interfaces\fR
Other interfaces that this machine receives mail on by way of a
proxy agent or network address translator.
.IP \fBmydestination\fR
List of domains that this mail system considers local.
.IP \fBmyorigin\fR
The domain that is appended to locally\-posted mail.
.IP \fBowner_request_special\fR
Give special treatment to \fBowner\-\fIxxx\fR and \fIxxx\fB\-request\fR
addresses.
.IP "\fBinet_interfaces (all)\fR"
The network interface addresses that this mail system receives
mail on.
.IP "\fBproxy_interfaces (empty)\fR"
The network interface addresses that this mail system receives mail
on by way of a proxy or network address translation unit.
.IP "\fBmydestination ($myhostname, localhost.$mydomain, localhost)\fR"
The list of domains that are delivered via the $local_transport
mail delivery transport.
.IP "\fBmyorigin ($myhostname)\fR"
The domain name that locally\-posted mail appears to come
from, and that locally posted mail is delivered to.
.IP "\fBowner_request_special (yes)\fR"
Enable special treatment for owner\-\fIlistname\fR entries in the
\fBaliases\fR(5) file, and don't split owner\-\fIlistname\fR and
\fIlistname\fR\-request address localparts when the recipient_delimiter
is set to "\-".
.SH "SEE ALSO"
.na
.nf

View File

@ -1,4 +1,4 @@
.\" $NetBSD: ldap_table.5,v 1.3 2020/03/18 19:05:14 christos Exp $
.\" $NetBSD: ldap_table.5,v 1.4 2022/10/08 16:12:44 christos Exp $
.\"
.TH LDAP_TABLE 5
.ad
@ -158,9 +158,9 @@ Otherwise, the search is suppressed and returns no results.
For the \fBsearch_base\fR parameter, the upper\-case equivalents
of the above expansions behave identically to their lower\-case
counter\-parts. With the \fBresult_format\fR parameter (previously
called \fBresult_filter\fR see the COMPATIBILITY section and below),
they expand to the corresponding components of input key rather
than the result value.
called \fBresult_filter\fR see the OTHER OBSOLETE FEATURES section
and below), they expand to the corresponding components of input
key rather than the result value.
.IP "\fB%[1\-9]\fR"
The patterns %1, %2, ... %9 are replaced by the corresponding
most significant component of the input key's domain. If the
@ -201,9 +201,9 @@ Otherwise, the search is suppressed and returns no results.
The upper\-case equivalents of the above expansions behave in the
\fBquery_filter\fR parameter identically to their lower\-case
counter\-parts. With the \fBresult_format\fR parameter (previously
called \fBresult_filter\fR see the COMPATIBILITY section and below),
they expand to the corresponding components of input key rather
than the result value.
called \fBresult_filter\fR see the OTHER OBSOLETE FEATURES section
and below), they expand to the corresponding components of input
key rather than the result value.
.IP
The above %S, %U and %D expansions are available with Postfix 2.2
and later.
@ -280,7 +280,7 @@ with old configuration files.
NOTE: DO NOT put quotes around the result format!
.IP "\fBdomain (default: no domain list)\fR"
This is a list of domain names, paths to files, or
dictionaries. When specified, only fully qualified search
"type:table" databases. When specified, only fully qualified search
keys with a *non\-empty* localpart and a matching domain
are eligible for lookup: 'user' lookups, bare domain lookups
and "@domain" lookups are not performed. This can significantly

View File

@ -1,4 +1,4 @@
.\" $NetBSD: lmdb_table.5,v 1.2 2017/02/14 01:16:44 christos Exp $
.\" $NetBSD: lmdb_table.5,v 1.3 2022/10/08 16:12:44 christos Exp $
.\"
.TH LMDB_TABLE 5
.ad
@ -49,9 +49,9 @@ email addresses without the localpart, address extension
or domain portion. This behavior is also found with, for
example, btree:, hash:, or ldap: tables.
Unlike other flat\-file Postfix databases, changes to
an LMDB database do not trigger automatic daemon program
restart, and do not require "\fBpostfix reload\fR".
Changes to an LMDB database do not trigger an automatic
daemon restart, and do not require a daemon restart with
"\fBpostfix reload\fR".
.SH "RELIABILITY"
.na
.nf
@ -98,8 +98,8 @@ to the per\-process fcntl(2) locks.
Short\-lived programs automatically pick up changes to
main.cf. With long\-running daemon programs, Use the command
"\fBpostfix reload\fR" after a configuration change.
.IP "\fBlmdb_map_size (default: 16777216)\fR"
The initial LMDB database size limit in bytes.
.IP "\fBlmdb_map_size (16777216)\fR"
The initial OpenLDAP LMDB database size limit in bytes.
.SH "SEE ALSO"
.na
.nf

View File

@ -1,4 +1,4 @@
.\" $NetBSD: master.5,v 1.3 2020/03/18 19:05:14 christos Exp $
.\" $NetBSD: master.5,v 1.4 2022/10/08 16:12:44 christos Exp $
.\"
.TH MASTER 5
.ad
@ -15,7 +15,7 @@ The Postfix mail system is implemented by small number of
a larger number of services that run in the background.
Postfix services are implemented by daemon processes. These
run in the background under control of the \fBmaster\fR(8)
run in the background, started on\-demand by the \fBmaster\fR(8)
process. The master.cf configuration file defines how a
client program connects to a service, and what daemon
program runs when a service is requested. Most daemon
@ -26,7 +26,7 @@ serving \fBmax_use\fR clients, or after inactivity for
All daemons specified here must speak a Postfix\-internal
protocol. In order to execute non\-Postfix software use the
\fBlocal\fR(8), \fBpipe\fR(8) or \fBspawn\fR(8) services, or
run the server under control by \fBinetd\fR(8) or equivalent.
execute the software with \fBinetd\fR(8) or equivalent.
.PP
After changing master.cf you must execute "\fBpostfix reload\fR"
to reload the configuration.
@ -125,7 +125,9 @@ implemented with streams sockets.
This feature is available as of Postfix version 2.5.
.RE
.IP "\fBPrivate (default: y)\fR"
Whether or not access is restricted to the mail system.
Whether a service is internal to Postfix (pathname starts
with \fBprivate/\fR), or exposed through Postfix command\-line
tools (pathname starts with \fBpublic/\fR).
Internet (type \fBinet\fR) services can't be private.
.IP "\fBUnprivileged (default: y)\fR"
Whether the service runs with root privileges or as the
@ -135,7 +137,7 @@ main.cf file).
.sp
The \fBlocal\fR(8), \fBpipe\fR(8), \fBspawn\fR(8), and
\fBvirtual\fR(8) daemons require privileges.
.IP "\fBChroot (default: Postfix >= 3.0: n, Postfix <3.0: y)\fR"
.IP "\fBChroot (default: Postfix >= 3.0: n, Postfix < 3.0: y)\fR"
Whether or not the service runs chrooted to the mail queue
directory (pathname is controlled by the \fBqueue_directory\fR
configuration variable in the main.cf file).

View File

@ -1,4 +1,4 @@
.\" $NetBSD: mysql_table.5,v 1.3 2020/03/18 19:05:14 christos Exp $
.\" $NetBSD: mysql_table.5,v 1.4 2022/10/08 16:12:44 christos Exp $
.\"
.TH MYSQL_TABLE 5
.ad
@ -24,7 +24,7 @@ Alternatively, lookup tables can be specified as MySQL databases.
In order to use MySQL lookups, define a MySQL source as a lookup
table in main.cf, for example:
.nf
alias_maps = mysql:/etc/mysql\-aliases.cf
alias_maps = mysql:/etc/postfix/mysql\-aliases.cf
.fi
The file /etc/postfix/mysql\-aliases.cf has the same format as
@ -58,8 +58,9 @@ return the key itself or a constant value.
.IP "\fBhosts\fR"
The hosts that Postfix will try to connect to and query from.
Specify \fIunix:\fR for UNIX domain sockets, \fIinet:\fR for TCP
connections (default). Example:
connections (default). Examples:
.nf
hosts = inet:host1.some.domain inet:host2.some.domain:port
hosts = host1.some.domain host2.some.domain:port
hosts = unix:/file/name
.fi
@ -202,10 +203,10 @@ This parameter is available with Postfix 2.2 and later.
NOTE: DO NOT put quotes around the result format!
.IP "\fBdomain (default: no domain list)\fR"
This is a list of domain names, paths to files, or
dictionaries. When specified, only fully qualified search
keys with a *non\-empty* localpart and a matching domain
are eligible for lookup: 'user' lookups, bare domain lookups
This is a list of domain names, paths to files, or "type:table"
databases. When specified, only fully qualified search keys
with a *non\-empty* localpart and a matching domain are
eligible for lookup: 'user' lookups, bare domain lookups
and "@domain" lookups are not performed. This can significantly
reduce the query load on the MySQL server.
.nf

View File

@ -1,4 +1,4 @@
.\" $NetBSD: pcre_table.5,v 1.2 2017/02/14 01:16:44 christos Exp $
.\" $NetBSD: pcre_table.5,v 1.3 2022/10/08 16:12:44 christos Exp $
.\"
.TH PCRE_TABLE 5
.ad
@ -37,6 +37,10 @@ as described in the SYNOPSIS above. Use "\fBpostmap \-hmq
\-\fR <\fIfile\fR" for header_checks(5) patterns, and
"\fBpostmap \-bmq \-\fR <\fIfile\fR" for body_checks(5)
(Postfix 2.6 and later).
This driver can be built with the pcre2 library (Postfix
3.7 and later), or with the legacy pcre library (all Postfix
versions).
.SH "COMPATIBILITY"
.na
.nf
@ -85,7 +89,7 @@ A logical line starts with non\-whitespace text. A line that
starts with whitespace continues a logical line.
.PP
Each pattern is a perl\-like regular expression. The expression
delimiter can be any non\-alphanumerical character, except
delimiter can be any non\-alphanumeric character, except
whitespace or characters
that have special meaning (traditionally the forward slash is used).
The regular expression can contain whitespace.
@ -98,12 +102,12 @@ characters after the pattern:
Toggles the case sensitivity flag. By default, matching is case
insensitive.
.IP "\fBm\fR (default: off)"
Toggles the PCRE_MULTILINE flag. When this flag is on, the \fB^\fR
Toggles the pcre MULTILINE flag. When this flag is on, the \fB^\fR
and \fB$\fR metacharacters match immediately after and immediately
before a newline character, respectively, in addition to
matching at the start and end of the subject string.
.IP "\fBs\fR (default: on)"
Toggles the PCRE_DOTALL flag. When this flag is on, the \fB.\fR
Toggles the pcre DOTALL flag. When this flag is on, the \fB.\fR
metacharacter matches the newline character. With
Postfix versions prior to 2.0, the flag is off by
default, which is inconvenient for multi\-line message header
@ -116,31 +120,33 @@ the pattern, escape it with backslash.
.sp
Note: do not use \fB#\fIcomment\fR after patterns.
.IP "\fBA\fR (default: off)"
Toggles the PCRE_ANCHORED flag. When this flag is on,
Toggles the pcre ANCHORED flag. When this flag is on,
the pattern is forced to be "anchored", that is, it is
constrained to match only at the start of the string which
is being searched (the "subject string"). This effect can
also be achieved by appropriate constructs in the pattern
itself.
.IP "\fBE\fR (default: off)"
Toggles the PCRE_DOLLAR_ENDONLY flag. When this flag is on,
Toggles the pcre DOLLAR_ENDONLY flag. When this flag is on,
a \fB$\fR metacharacter in the pattern matches only at the
end of the subject string. Without this flag, a dollar also
matches immediately before the final character if it is a
newline character (but not before any other newline
characters). This flag is ignored if PCRE_MULTILINE
characters). This flag is ignored if the pcre MULTILINE
flag is set.
.IP "\fBU\fR (default: off)"
Toggles the ungreedy matching flag. When this flag is on,
Toggles the pcre UNGREEDY flag. When this flag is on,
the pattern matching engine inverts the "greediness" of
the quantifiers so that they are not greedy by default,
but become greedy if followed by "?". This flag can also
set by a (?U) modifier within the pattern.
.IP "\fBX\fR (default: off)"
Toggles the PCRE_EXTRA flag.
Toggles the pcre EXTRA flag.
When this flag is on, any backslash in a pattern that is
followed by a letter that has no special meaning causes an
error, thus reserving these combinations for future expansion.
This feature is not supported with PCRE2.
.SH "SEARCH ORDER"
.na
.nf
@ -167,10 +173,43 @@ string is requested with $1, $2, etc.; specify $$ to produce
a $ character as output.
The macros in the result string may need to be written as
${n} or $(n) if they aren't followed by whitespace.
This feature does not support pcre2 substring names.
Note: since negated patterns (those preceded by \fB!\fR) return a
result when the expression does not match, substitutions are not
available for negated patterns.
.SH "INLINE SPECIFICATION"
.na
.nf
.ad
.fi
The contents of a table may be specified in the table name.
The basic syntax is:
.nf
main.cf:
\fIparameter\fR \fB= .. pcre:{ { \fIrule\-1\fB }, { \fIrule\-2\fB } .. } ..\fR
master.cf:
\fB.. \-o { \fIparameter\fR \fB= .. pcre:{ { \fIrule\-1\fB }, { \fIrule\-2\fB } .. } .. } ..\fR
.fi
Postfix ignores whitespace after '{' and before '}', and
writes each \fIrule\fR as one text line to an in\-memory
file:
.nf
in\-memory file:
rule\-1
rule\-2
..
.fi
Postfix parses the result as if it is a file in /etc/postfix.
Note: if a rule contains \fB$\fR, specify \fB$$\fR to keep
Postfix from trying to do \fI$name\fR expansion as it
evaluates a parameter value.
.SH "EXAMPLE SMTPD ACCESS MAP"
.na
.nf

View File

@ -1,4 +1,4 @@
.\" $NetBSD: pgsql_table.5,v 1.3 2020/03/18 19:05:14 christos Exp $
.\" $NetBSD: pgsql_table.5,v 1.4 2022/10/08 16:12:44 christos Exp $
.\"
.TH PGSQL_TABLE 5
.ad
@ -24,7 +24,7 @@ Alternatively, lookup tables can be specified as PostgreSQL
databases. In order to use PostgreSQL lookups, define a
PostgreSQL source as a lookup table in main.cf, for example:
.nf
alias_maps = pgsql:/etc/pgsql\-aliases.cf
alias_maps = pgsql:/etc/postfix/pgsql\-aliases.cf
.fi
The file /etc/postfix/pgsql\-aliases.cf has the same format as
@ -65,6 +65,7 @@ are accepted and ignored for backwards compatibility.
Examples:
.nf
hosts = postgresql://username@example.com/tablename?sslmode=require
hosts = inet:host1.some.domain inet:host2.some.domain:port
hosts = host1.some.domain host2.some.domain:port
hosts = unix:/file/name
.fi
@ -142,7 +143,7 @@ in prior releases the precedence was, from highest to lowest,
\fBselect_function\fR, \fBquery\fR, \fBselect_field\fR, ...
With Postfix 2.2 the \fBquery\fR parameter has highest precedence,
see COMPATIBILITY above.
see OBSOLETE QUERY INTERFACES below.
NOTE: DO NOT put quotes around the \fBquery\fR parameter.
.IP "\fBresult_format (default: \fB%s\fR)\fR"
@ -188,8 +189,8 @@ This parameter is available with Postfix 2.2 and later.
NOTE: DO NOT put quotes around the result format!
.IP "\fBdomain (default: no domain list)\fR"
This is a list of domain names, paths to files, or
dictionaries. When specified, only fully qualified search
This is a list of domain names, paths to files, or "type:table"
databases. When specified, only fully qualified search
keys with a *non\-empty* localpart and a matching domain
are eligible for lookup: 'user' lookups, bare domain lookups
and "@domain" lookups are not performed. This can significantly

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
.\" $NetBSD: regexp_table.5,v 1.2 2017/02/14 01:16:44 christos Exp $
.\" $NetBSD: regexp_table.5,v 1.3 2022/10/08 16:12:44 christos Exp $
.\"
.TH REGEXP_TABLE 5
.ad
@ -135,6 +135,38 @@ ${n} or $(n) if they aren't followed by whitespace.
Note: since negated patterns (those preceded by \fB!\fR) return a
result when the expression does not match, substitutions are not
available for negated patterns.
.SH "INLINE SPECIFICATION"
.na
.nf
.ad
.fi
The contents of a table may be specified in the table name.
The basic syntax is:
.nf
main.cf:
\fIparameter\fR \fB= .. regexp:{ { \fIrule\-1\fB }, { \fIrule\-2\fB } .. } ..\fR
master.cf:
\fB.. \-o { \fIparameter\fR \fB= .. regexp:{ { \fIrule\-1\fB }, { \fIrule\-2\fB } .. } .. } ..\fR
.fi
Postfix ignores whitespace after '{' and before '}', and
writes each \fIrule\fR as one text line to an in\-memory
file:
.nf
in\-memory file:
rule\-1
rule\-2
..
.fi
Postfix parses the result as if it is a file in /etc/postfix.
Note: if a rule contains \fB$\fR, specify \fB$$\fR to keep
Postfix from trying to do \fI$name\fR expansion as it
evaluates a parameter value.
.SH "EXAMPLE SMTPD ACCESS MAP"
.na
.nf

View File

@ -1,4 +1,4 @@
.\" $NetBSD: relocated.5,v 1.2 2017/02/14 01:16:44 christos Exp $
.\" $NetBSD: relocated.5,v 1.3 2022/10/08 16:12:44 christos Exp $
.\"
.TH RELOCATED 5
.ad
@ -29,7 +29,7 @@ or SQL, the same lookups are done as for ordinary indexed files.
Alternatively, the table can be provided as a regular\-expression
map where patterns are given as regular expressions, or lookups
can be directed to TCP\-based server. In those case, the lookups
can be directed to a TCP\-based server. In those case, the lookups
are done in a slightly different way as described below under
"REGULAR EXPRESSION TABLES" or "TCP\-BASED TABLES".
@ -102,7 +102,7 @@ directed to a TCP\-based server. For a description of regular
expression lookup table syntax, see \fBregexp_table\fR(5) or
\fBpcre_table\fR(5). For a description of the TCP client/server
table lookup protocol, see \fBtcp_table\fR(5).
This feature is not available up to and including Postfix version 2.4.
This feature is available in Postfix 2.5 and later.
Each pattern is a regular expression that is applied to the entire
address being looked up. Thus, \fIuser@domain\fR mail addresses are not
@ -123,7 +123,7 @@ pattern can be interpolated as \fB$1\fR, \fB$2\fR and so on.
This section describes how the table lookups change when lookups
are directed to a TCP\-based server. For a description of the TCP
client/server lookup protocol, see \fBtcp_table\fR(5).
This feature is not available up to and including Postfix version 2.4.
This feature is available in Postfix 2.5 and later.
Each lookup operation uses the entire address once. Thus,
\fIuser@domain\fR mail addresses are not broken up into their
@ -143,20 +143,23 @@ The table format does not understand quoting conventions.
The following \fBmain.cf\fR parameters are especially relevant.
The text below provides only a parameter summary. See
\fBpostconf\fR(5) for more details including examples.
.IP \fBrelocated_maps\fR
List of lookup tables for relocated users or sites.
.IP "\fBrelocated_maps (empty)\fR"
Optional lookup tables with new contact information for users or
domains that no longer exist.
.PP
Other parameters of interest:
.IP \fBinet_interfaces\fR
The network interface addresses that this system receives mail on.
You need to stop and start Postfix when this parameter changes.
.IP \fBmydestination\fR
List of domains that this mail system considers local.
.IP \fBmyorigin\fR
The domain that is appended to locally\-posted mail.
.IP \fBproxy_interfaces\fR
Other interfaces that this machine receives mail on by way of a
proxy agent or network address translator.
.IP "\fBinet_interfaces (all)\fR"
The network interface addresses that this mail system receives
mail on.
.IP "\fBmydestination ($myhostname, localhost.$mydomain, localhost)\fR"
The list of domains that are delivered via the $local_transport
mail delivery transport.
.IP "\fBmyorigin ($myhostname)\fR"
The domain name that locally\-posted mail appears to come
from, and that locally posted mail is delivered to.
.IP "\fBproxy_interfaces (empty)\fR"
The network interface addresses that this mail system receives mail
on by way of a proxy or network address translation unit.
.SH "SEE ALSO"
.na
.nf

View File

@ -1,4 +1,4 @@
.\" $NetBSD: sqlite_table.5,v 1.3 2020/03/18 19:05:14 christos Exp $
.\" $NetBSD: sqlite_table.5,v 1.4 2022/10/08 16:12:44 christos Exp $
.\"
.TH SQLITE_TABLE 5
.ad
@ -24,7 +24,7 @@ Alternatively, lookup tables can be specified as SQLite databases.
In order to use SQLite lookups, define an SQLite source as a lookup
table in main.cf, for example:
.nf
alias_maps = sqlite:/etc/sqlite\-aliases.cf
alias_maps = sqlite:/etc/postfix/sqlite\-aliases.cf
.fi
The file /etc/postfix/sqlite\-aliases.cf has the same format as
@ -168,8 +168,8 @@ This parameter is available with Postfix 2.2 and later.
NOTE: DO NOT put quotes around the result format!
.IP "\fBdomain (default: no domain list)\fR"
This is a list of domain names, paths to files, or
dictionaries. When specified, only fully qualified search
This is a list of domain names, paths to files, or "type:table"
databases. When specified, only fully qualified search
keys with a *non\-empty* localpart and a matching domain
are eligible for lookup: 'user' lookups, bare domain lookups
and "@domain" lookups are not performed. This can significantly

View File

@ -1,4 +1,4 @@
.\" $NetBSD: transport.5,v 1.3 2020/03/18 19:05:14 christos Exp $
.\" $NetBSD: transport.5,v 1.4 2022/10/08 16:12:44 christos Exp $
.\"
.TH TRANSPORT 5
.ad
@ -62,7 +62,7 @@ or SQL, the same lookups are done as for ordinary indexed files.
Alternatively, the table can be provided as a regular\-expression
map where patterns are given as regular expressions, or lookups
can be directed to TCP\-based server. In those case, the lookups
can be directed to a TCP\-based server. In those case, the lookups
are done in a slightly different way as described below under
"REGULAR EXPRESSION TABLES" or "TCP\-BASED TABLES".
.SH "CASE FOLDING"
@ -91,7 +91,8 @@ A logical line starts with non\-whitespace text. A line that
starts with whitespace continues a logical line.
.PP
The \fIpattern\fR specifies an email address, a domain name, or
a domain name hierarchy, as described in section "TABLE LOOKUP".
a domain name hierarchy, as described in section "TABLE
SEARCH ORDER".
The \fIresult\fR is of the form \fItransport:nexthop\fR and
specifies how or where to deliver mail. This is described in

View File

@ -1,4 +1,4 @@
.\" $NetBSD: virtual.5,v 1.3 2020/03/18 19:05:14 christos Exp $
.\" $NetBSD: virtual.5,v 1.4 2022/10/08 16:12:44 christos Exp $
.\"
.TH VIRTUAL 5
.ad
@ -55,7 +55,7 @@ or SQL, the same lookups are done as for ordinary indexed files.
Alternatively, the table can be provided as a regular\-expression
map where patterns are given as regular expressions, or lookups
can be directed to TCP\-based server. In those case, the lookups
can be directed to a TCP\-based server. In those case, the lookups
are done in a slightly different way as described below under
"REGULAR EXPRESSION TABLES" or "TCP\-BASED TABLES".
.SH "CASE FOLDING"
@ -103,7 +103,7 @@ Redirect mail for \fIuser\fR@\fIsite\fR to \fIaddress\fR when
$\fBmydestination\fR, or when it is listed in $\fBinet_interfaces\fR
or $\fBproxy_interfaces\fR.
.sp
This functionality overlaps with functionality of the local
This functionality overlaps with the functionality of the local
\fIaliases\fR(5) database. The difference is that \fBvirtual\fR(5)
mapping can be applied to non\-local addresses.
.IP "@\fIdomain address, address, ...\fR"
@ -163,7 +163,7 @@ When a mail address localpart contains the optional recipient delimiter
The \fBpropagate_unmatched_extensions\fR parameter controls whether
an unmatched address extension (\fI+foo\fR) is propagated to the
result of table lookup.
result of a table lookup.
.SH "VIRTUAL ALIAS DOMAINS"
.na
.nf
@ -248,7 +248,7 @@ pattern can be interpolated as \fB$1\fR, \fB$2\fR and so on.
This section describes how the table lookups change when lookups
are directed to a TCP\-based server. For a description of the TCP
client/server lookup protocol, see \fBtcp_table\fR(5).
This feature is not available up to and including Postfix version 2.4.
This feature is available in Postfix 2.5 and later.
Each lookup operation uses the entire address once. Thus,
\fIuser@domain\fR mail addresses are not broken up into their
@ -271,9 +271,9 @@ and for default values. Use the "\fBpostfix reload\fR" command after
a configuration change.
.IP "\fBvirtual_alias_maps ($virtual_maps)\fR"
Optional lookup tables that alias specific mail addresses or domains
to other local or remote address.
to other local or remote addresses.
.IP "\fBvirtual_alias_domains ($virtual_alias_maps)\fR"
Postfix is final destination for the specified list of virtual
Postfix is the final destination for the specified list of virtual
alias domains, that is, domains for which all addresses are aliased
to addresses in other local or remote domains.
.IP "\fBpropagate_unmatched_extensions (canonical, virtual)\fR"

View File

@ -1,4 +1,4 @@
.\" $NetBSD: bounce.8,v 1.3 2020/03/18 19:05:14 christos Exp $
.\" $NetBSD: bounce.8,v 1.4 2022/10/08 16:12:44 christos Exp $
.\"
.TH BOUNCE 8
.ad
@ -138,6 +138,16 @@ mail origin classes.
Available in Postfix 3.3 and later:
.IP "\fBservice_name (read\-only)\fR"
The master.cf service name of a Postfix daemon process.
.PP
Available in Postfix 3.6 and later:
.IP "\fBenable_threaded_bounces (no)\fR"
Enable non\-delivery, success, and delay notifications that link
to the original message by including a References: and In\-Reply\-To:
header with the original Message\-ID value.
.PP
Available in Postfix 3.7 and later:
.IP "\fBheader_from_format (standard)\fR"
The format of the Postfix\-generated \fBFrom:\fR header.
.SH "FILES"
.na
.nf

View File

@ -1,4 +1,4 @@
.\" $NetBSD: cleanup.8,v 1.3 2020/03/18 19:05:14 christos Exp $
.\" $NetBSD: cleanup.8,v 1.4 2022/10/08 16:12:44 christos Exp $
.\"
.TH CLEANUP 8
.ad
@ -18,38 +18,55 @@ The \fBcleanup\fR(8) daemon processes inbound mail, inserts it
into the \fBincoming\fR mail queue, and informs the queue
manager of its arrival.
The \fBcleanup\fR(8) daemon always performs the following transformations:
The \fBcleanup\fR(8) daemon performs the following transformations:
.IP \(bu
Insert missing message headers: (\fBResent\-\fR) \fBFrom:\fR,
\fBTo:\fR, \fBMessage\-Id:\fR, and \fBDate:\fR.
.br
This is enabled with the \fBlocal_header_rewrite_clients\fR and
\fBalways_add_missing_headers\fR parameter settings.
.IP \(bu
Transform envelope and header addresses to the standard
\fIuser@fully\-qualified\-domain\fR form that is expected by other
Postfix programs.
This task is delegated to the \fBtrivial\-rewrite\fR(8) daemon.
This task depends on the \fBtrivial\-rewrite\fR(8) daemon.
.br
The header transformation is enabled with the
\fBlocal_header_rewrite_clients\fR parameter setting.
.IP \(bu
Eliminate duplicate envelope recipient addresses.
.br
This is enabled with the \fBduplicate_filter_limit\fR
parameter setting.
.IP \(bu
Remove message headers: \fBBcc\fR, \fBContent\-Length\fR,
\fBResent\-Bcc\fR, \fBReturn\-Path\fR.
.PP
The following address transformations are optional:
.br
This is enabled with the message_drop_headers parameter
setting.
.IP \(bu
Optionally, rewrite all envelope and header addresses according
to the mappings specified in the \fBcanonical\fR(5) lookup tables.
.br
The header transformation is enabled with the
\fBlocal_header_rewrite_clients\fR parameter setting.
.IP \(bu
Optionally, masquerade envelope sender addresses and message
header addresses (i.e. strip host or domain information below
all domains listed in the \fBmasquerade_domains\fR parameter,
except for user names listed in \fBmasquerade_exceptions\fR).
By default, address masquerading does not affect envelope recipients.
.br
The header transformation is enabled with the
\fBlocal_header_rewrite_clients\fR parameter setting.
.IP \(bu
Optionally, expand envelope recipients according to information
found in the \fBvirtual\fR(5) lookup tables.
found in the \fBvirtual_alias_maps\fR lookup tables.
.PP
The \fBcleanup\fR(8) daemon performs sanity checks on the content of
each message. When it finds a problem, by default it returns a
diagnostic status to the client, and leaves it up to the client
diagnostic status to the cleanup service client, and leaves
it up to the client
to deal with the problem. Alternatively, the client can request
the \fBcleanup\fR(8) daemon to bounce the message back to the sender
in case of trouble.
@ -115,6 +132,8 @@ Available in Postfix version 3.0 and later:
.IP "\fBmessage_drop_headers (bcc, content\-length, resent\-bcc, return\-path)\fR"
Names of message headers that the \fBcleanup\fR(8) daemon will remove
after applying \fBheader_checks\fR(5) and before invoking Milter applications.
.IP "\fBheader_from_format (standard)\fR"
The format of the Postfix\-generated \fBFrom:\fR header.
.SH "BUILT-IN CONTENT FILTERING CONTROLS"
.na
.nf
@ -166,8 +185,9 @@ The mail filter protocol version and optional protocol extensions
for communication with a Milter application; prior to Postfix 2.6
the default protocol is 2.
.IP "\fBmilter_default_action (tempfail)\fR"
The default action when a Milter (mail filter) application is
unavailable or mis\-configured.
The default action when a Milter (mail filter) response is
unavailable (for example, bad Postfix configuration or Milter
failure).
.IP "\fBmilter_macro_daemon_name ($myhostname)\fR"
The {daemon_name} macro value for Milter (mail filter) applications.
.IP "\fBmilter_macro_v ($mail_name $mail_version)\fR"

View File

@ -1,4 +1,4 @@
.\" $NetBSD: dnsblog.8,v 1.3 2020/03/18 19:05:14 christos Exp $
.\" $NetBSD: dnsblog.8,v 1.4 2022/10/08 16:12:44 christos Exp $
.\"
.TH DNSBLOG 8
.ad
@ -6,7 +6,7 @@
.SH NAME
dnsblog
\-
Postfix DNS white/blacklist logger
Postfix DNS allow/denylist logger
.SH "SYNOPSIS"
.na
.nf
@ -15,7 +15,7 @@ Postfix DNS white/blacklist logger
.ad
.fi
The \fBdnsblog\fR(8) server implements an ad\-hoc DNS
white/blacklist lookup service. This may eventually be
allow/denylist lookup service. This may eventually be
replaced by an UDP client that is built directly into the
\fBpostscreen\fR(8) server.
.SH "PROTOCOL"
@ -24,8 +24,8 @@ replaced by an UDP client that is built directly into the
.ad
.fi
With each connection, the \fBdnsblog\fR(8) server receives
a DNS white/blacklist domain name, an IP address, and an ID.
If the IP address is listed under the DNS white/blacklist, the
a DNS allow/denylist domain name, an IP address, and an ID.
If the IP address is listed under the DNS allow/denylist, the
\fBdnsblog\fR(8) server logs the match and replies with the
query arguments plus an address list with the resulting IP
addresses, separated by whitespace, and the reply TTL.
@ -57,7 +57,7 @@ configuration files.
How much time a Postfix daemon process may take to handle a
request before it is terminated by a built\-in watchdog timer.
.IP "\fBpostscreen_dnsbl_sites (empty)\fR"
Optional list of DNS white/blacklist domains, filters and weight
Optional list of DNS allow/denylist domains, filters and weight
factors.
.IP "\fBipc_timeout (3600s)\fR"
The time limit for sending or receiving information over an internal

View File

@ -1,4 +1,4 @@
.\" $NetBSD: local.8,v 1.3 2020/03/18 19:05:14 christos Exp $
.\" $NetBSD: local.8,v 1.4 2022/10/08 16:12:44 christos Exp $
.\"
.TH LOCAL 8
.ad
@ -63,12 +63,18 @@ directory), \fB$shell\fR (recipient shell), \fB$recipient\fR
(complete recipient address), \fB$extension\fR (recipient address
extension), \fB$domain\fR (recipient domain), \fB$local\fR
(entire recipient address localpart) and
\fB$recipient_delimiter.\fR The forms \fI${name?value}\fR and
\fI${name:value}\fR expand conditionally to \fIvalue\fR when
\fI$name\fR is (is not) defined.
Characters that may have special meaning to the shell or file system
are replaced by underscores. The list of acceptable characters
is specified with the \fBforward_expansion_filter\fR configuration
\fB$recipient_delimiter.\fR The forms \fI${name?value}\fR
and \fI${name?{value}}\fR (Postfix 3.0 and later) expand
conditionally to \fIvalue\fR when \fI$name\fR is defined,
and the forms \fI${name:value}\fR \fI${name:{value}}\fR
(Postfix 3.0 and later) expand conditionally to \fIvalue\fR
when \fI$name\fR is not defined. The form
\fI${name?{value1}:{value2}}\fR (Postfix 3.0 and later)
expands conditionally to \fIvalue1\fR when \fI$name\fR is
defined, or \fIvalue2\fR otherwise. Characters that may
have special meaning to the shell or file system are replaced
with underscores. The list of acceptable characters is
specified with the \fBforward_expansion_filter\fR configuration
parameter.
An alias or ~/.\fBforward\fR file may list any combination of external
@ -182,13 +188,18 @@ to interpolation of \fB$user\fR (recipient username),
address), \fB$extension\fR (recipient address extension),
\fB$domain\fR (recipient domain), \fB$local\fR (entire
recipient address localpart) and \fB$recipient_delimiter.\fR
The forms \fI${name?value}\fR and \fI${name:value}\fR expand
conditionally to \fIvalue\fR when \fI$name\fR is (is not)
defined. Characters that may have special meaning to the
shell or file system are replaced by underscores. The list
of acceptable characters is specified with the
\fBexecution_directory_expansion_filter\fR configuration
parameter.
The forms \fI${name?value}\fR and \fI${name?{value}}\fR
(Postfix 3.0 and later) expand conditionally to \fIvalue\fR
when \fI$name\fR is defined, and the forms \fI${name:value}\fR
and \fI${name:{value}}\fR (Postfix 3.0 and later) expand
conditionally to \fIvalue\fR when \fI$name\fR is not defined.
The form \fI${name?{value1}:{value2}}\fR (Postfix 3.0 and
later) expands conditionally to \fIvalue1\fR when \fI$name\fR
is defined, or \fIvalue2\fR otherwise. Characters that may
have special meaning to the shell or file system are replaced
with underscores. The list of acceptable characters
is specified with the \fBexecution_directory_expansion_filter\fR
configuration parameter.
The command is executed directly where possible. Assistance by the
shell (\fB/bin/sh\fR on UNIX systems) is used only when the command
@ -210,7 +221,7 @@ non\-zero exit status.
A limited amount of message context is exported via environment
variables. Characters that may have special meaning to the shell
are replaced by underscores. The list of acceptable characters
are replaced with underscores. The list of acceptable characters
is specified with the \fBcommand_expansion_filter\fR configuration
parameter.
.IP \fBSHELL\fR
@ -477,7 +488,7 @@ Optional catch\-all destination for unknown \fBlocal\fR(8) recipients.
Available in Postfix version 2.2 and later:
.IP "\fBcommand_execution_directory (empty)\fR"
The \fBlocal\fR(8) delivery agent working directory for delivery to
external command.
external commands.
.SH "MAILBOX LOCKING CONTROLS"
.na
.nf
@ -532,7 +543,7 @@ Restrict the characters that the \fBlocal\fR(8) delivery agent allows in
$name expansions of $mailbox_command and $command_execution_directory.
.IP "\fBdefault_privs (nobody)\fR"
The default rights used by the \fBlocal\fR(8) delivery agent for delivery
to external file or command.
to an external file or command.
.IP "\fBforward_expansion_filter (see 'postconf -d' output)\fR"
Restrict the characters that the \fBlocal\fR(8) delivery agent allows in
$name expansions of $forward_path.
@ -566,7 +577,7 @@ to non\-Postfix processes.
The time limit for sending or receiving information over an internal
communication channel.
.IP "\fBlocal_command_shell (empty)\fR"
Optional shell program for \fBlocal\fR(8) delivery to non\-Postfix command.
Optional shell program for \fBlocal\fR(8) delivery to non\-Postfix commands.
.IP "\fBmax_idle (100s)\fR"
The maximum amount of time that an idle Postfix daemon process waits
for an incoming connection before terminating voluntarily.
@ -587,9 +598,8 @@ key to the lookup result.
.IP "\fBqueue_directory (see 'postconf -d' output)\fR"
The location of the Postfix top\-level queue directory.
.IP "\fBrecipient_delimiter (empty)\fR"
The set of characters that can separate a user name from its
extension (example: user+foo), or a .forward file name from its
extension (example: .forward+foo).
The set of characters that can separate an email address
localpart, user name, or a .forward file name from its extension.
.IP "\fBrequire_home_directory (no)\fR"
Require that a \fBlocal\fR(8) recipient's home directory exists
before mail delivery is attempted.

View File

@ -1,4 +1,4 @@
.\" $NetBSD: master.8,v 1.3 2020/03/18 19:05:14 christos Exp $
.\" $NetBSD: master.8,v 1.4 2022/10/08 16:12:44 christos Exp $
.\"
.TH MASTER 8
.ad
@ -155,7 +155,7 @@ invoked with the \-D option.
.IP "\fBinet_interfaces (all)\fR"
The network interface addresses that this mail system receives
mail on.
.IP "\fBinet_protocols (all)\fR"
.IP "\fBinet_protocols (see 'postconf -d output')\fR"
The Internet protocols Postfix will attempt to use when making
or accepting connections.
.IP "\fBimport_environment (see 'postconf -d' output)\fR"
@ -180,6 +180,10 @@ records, so that, for example, "smtpd" becomes "prefix/smtpd".
Available in Postfix 3.3 and later:
.IP "\fBservice_name (read\-only)\fR"
The master.cf service name of a Postfix daemon process.
.PP
Available in Postfix 3.6 and later:
.IP "\fBknown_tcp_ports (lmtp=24, smtp=25, smtps=submissions=465, submission=587)\fR"
Optional setting that avoids lookups in the \fBservices\fR(5) database.
.SH "FILES"
.na
.nf

View File

@ -1,4 +1,4 @@
.\" $NetBSD: pipe.8,v 1.3 2020/03/18 19:05:14 christos Exp $
.\" $NetBSD: pipe.8,v 1.4 2022/10/08 16:12:44 christos Exp $
.\"
.TH PIPE 8
.ad
@ -182,6 +182,7 @@ specify \fB$sender\fR as an argument by itself:
.nf
\fIRight\fR: command \-f $sender \-\- $recipient
.fi
NOTE: DO NOT put quotes around the command, $sender, or $recipient.
.IP
This feature is available as of Postfix 2.3.
.IP "\fBsize\fR=\fIsize_limit\fR (optional)"
@ -429,9 +430,8 @@ The process name of a Postfix command or daemon process.
.IP "\fBqueue_directory (see 'postconf -d' output)\fR"
The location of the Postfix top\-level queue directory.
.IP "\fBrecipient_delimiter (empty)\fR"
The set of characters that can separate a user name from its
extension (example: user+foo), or a .forward file name from its
extension (example: .forward+foo).
The set of characters that can separate an email address
localpart, user name, or a .forward file name from its extension.
.IP "\fBsyslog_facility (mail)\fR"
The syslog facility of Postfix logging.
.IP "\fBsyslog_name (see 'postconf -d' output)\fR"

View File

@ -1,4 +1,4 @@
.\" $NetBSD: postlogd.8,v 1.2 2020/03/18 19:05:14 christos Exp $
.\" $NetBSD: postlogd.8,v 1.3 2022/10/08 16:12:44 christos Exp $
.\"
.TH POSTLOGD 8
.ad
@ -36,8 +36,8 @@ Other non\-daemon Postfix programs will never write directly to
with the operation of some of these programs). These programs
can log to \fBpostlogd\fR(8) if they are run by the super\-user,
or if their executable file has set\-gid permission. Do not
set this permission on programs other than \fBpostdrop\fR(1)
and \fBpostqueue\fR(1).
set this permission on programs other than \fBpostdrop\fR(1),
\fBpostqueue\fR(1) and (Postfix >= 3.7) \fBpostlog\fR(1).
.SH "CONFIGURATION PARAMETERS"
.na
.nf

View File

@ -1,4 +1,4 @@
.\" $NetBSD: postscreen.8,v 1.3 2020/03/18 19:05:14 christos Exp $
.\" $NetBSD: postscreen.8,v 1.4 2022/10/08 16:12:44 christos Exp $
.\"
.TH POSTSCREEN 8
.ad
@ -31,9 +31,9 @@ Alternatively, a site could set up a dedicated, non\-postscreen,
"port 25" server that provides \fBsubmission\fR service and
client authentication, but no MX service.
\fBpostscreen\fR(8) maintains a temporary whitelist for
\fBpostscreen\fR(8) maintains a temporary allowlist for
clients that have passed a number of tests. When an SMTP
client IP address is whitelisted, \fBpostscreen\fR(8) hands
client IP address is allowlisted, \fBpostscreen\fR(8) hands
off the connection immediately to a Postfix SMTP server
process. This minimizes the overhead for legitimate mail.
@ -144,6 +144,10 @@ Available in Postfix version 3.4 and later:
.IP "\fBpostscreen_reject_footer_maps ($smtpd_reject_footer_maps)\fR"
Optional lookup table for information that is appended after a 4XX
or 5XX \fBpostscreen\fR(8) server response.
.PP
Available in Postfix 3.6 and later:
.IP "\fBrespectful_logging (see 'postconf -d' output)\fR"
Avoid logging that implies white is better than black.
.SH "TROUBLE SHOOTING CONTROLS"
.na
.nf
@ -171,36 +175,33 @@ proxy agent.
.IP "\fBpostscreen_upstream_proxy_timeout (5s)\fR"
The time limit for the proxy protocol specified with the
postscreen_upstream_proxy_protocol parameter.
.SH "PERMANENT WHITE/BLACKLIST TEST"
.SH "PERMANENT ALLOW/DENYLIST TEST"
.na
.nf
.ad
.fi
This test is executed immediately after a remote SMTP client
connects. If a client is permanently whitelisted, the client
connects. If a client is permanently allowlisted, the client
will be handed off immediately to a Postfix SMTP server
process.
.IP "\fBpostscreen_access_list (permit_mynetworks)\fR"
Permanent white/blacklist for remote SMTP client IP addresses.
Permanent allow/denylist for remote SMTP client IP addresses.
.IP "\fBpostscreen_blacklist_action (ignore)\fR"
The action that \fBpostscreen\fR(8) takes when a remote SMTP client is
permanently blacklisted with the postscreen_access_list parameter.
Renamed to postscreen_denylist_action in Postfix 3.6.
.SH "MAIL EXCHANGER POLICY TESTS"
.na
.nf
.ad
.fi
When \fBpostscreen\fR(8) is configured to monitor all primary
and backup MX addresses, it can refuse to whitelist clients
and backup MX addresses, it can refuse to allowlist clients
that connect to a backup MX address only. For small sites,
this requires configuring primary and backup MX addresses
on the same MTA. Larger sites would have to share the
\fBpostscreen\fR(8) cache between primary and backup MTAs,
which would introduce a common point of failure.
.IP "\fBpostscreen_whitelist_interfaces (static:all)\fR"
A list of local \fBpostscreen\fR(8) server IP addresses where a
non\-whitelisted remote SMTP client can obtain \fBpostscreen\fR(8)'s temporary
whitelist status.
Renamed to postscreen_allowlist_interfaces in Postfix 3.6.
.SH "BEFORE 220 GREETING TESTS"
.na
.nf
@ -223,7 +224,7 @@ A mapping from actual DNSBL domain name which includes a secret
password, to the DNSBL domain name that postscreen will reply with
when it rejects mail.
.IP "\fBpostscreen_dnsbl_sites (empty)\fR"
Optional list of DNS white/blacklist domains, filters and weight
Optional list of DNS allow/denylist domains, filters and weight
factors.
.IP "\fBpostscreen_dnsbl_threshold (1)\fR"
The inclusive lower bound for blocking a remote SMTP client, based on
@ -250,13 +251,24 @@ connections to.
.PP
Available in Postfix version 2.11 and later:
.IP "\fBpostscreen_dnsbl_whitelist_threshold (0)\fR"
Allow a remote SMTP client to skip "before" and "after 220
greeting" protocol tests, based on its combined DNSBL score as
defined with the postscreen_dnsbl_sites parameter.
Renamed to postscreen_dnsbl_allowlist_threshold in Postfix 3.6.
.PP
Available in Postfix version 3.0 and later:
.IP "\fBpostscreen_dnsbl_timeout (10s)\fR"
The time limit for DNSBL or DNSWL lookups.
.PP
Available in Postfix version 3.6 and later:
.IP "\fBpostscreen_denylist_action (ignore)\fR"
The action that \fBpostscreen\fR(8) takes when a remote SMTP client is
permanently denylisted with the postscreen_access_list parameter.
.IP "\fBpostscreen_allowlist_interfaces (static:all)\fR"
A list of local \fBpostscreen\fR(8) server IP addresses where a
non\-allowlisted remote SMTP client can obtain \fBpostscreen\fR(8)'s temporary
allowlist status.
.IP "\fBpostscreen_dnsbl_allowlist_threshold (0)\fR"
Allow a remote SMTP client to skip "before" and "after 220
greeting" protocol tests, based on its combined DNSBL score as
defined with the postscreen_dnsbl_sites parameter.
.SH "AFTER 220 GREETING TESTS"
.na
.nf
@ -308,7 +320,7 @@ The amount of time between \fBpostscreen\fR(8) cache cleanup runs.
Persistent storage for the \fBpostscreen\fR(8) server decisions.
.IP "\fBpostscreen_cache_retention_time (7d)\fR"
The amount of time that \fBpostscreen\fR(8) will cache an expired
temporary whitelist entry before it is removed.
temporary allowlist entry before it is removed.
.IP "\fBpostscreen_bare_newline_ttl (30d)\fR"
The amount of time that \fBpostscreen\fR(8) will use the result from
a successful "bare newline" SMTP protocol test.
@ -351,7 +363,7 @@ built\-in SMTP protocol engine.
The number of clients that can be waiting for service from a
real Postfix SMTP server process.
.IP "\fBpostscreen_pre_queue_limit ($default_process_limit)\fR"
The number of non\-whitelisted clients that can be waiting for
The number of non\-allowlisted clients that can be waiting for
a decision whether they will receive service from a real Postfix
SMTP server
process.
@ -422,7 +434,7 @@ The email address form that will be used in non\-debug logging
.nf
smtpd(8), Postfix SMTP server
tlsproxy(8), Postfix TLS proxy server
dnsblog(8), DNS black/whitelist logger
dnsblog(8), DNS allow/denylist logger
postlogd(8), Postfix logging
syslogd(8), system logging
.SH "README FILES"

View File

@ -1,4 +1,4 @@
.\" $NetBSD: qmqpd.8,v 1.3 2020/03/18 19:05:14 christos Exp $
.\" $NetBSD: qmqpd.8,v 1.4 2022/10/08 16:12:44 christos Exp $
.\"
.TH QMQPD 8
.ad
@ -108,12 +108,13 @@ The time limit for sending or receiving information over the network.
.ad
.fi
.IP "\fBdebug_peer_level (2)\fR"
The increment in verbose logging level when a remote client or
server matches a pattern in the debug_peer_list parameter.
The increment in verbose logging level when a nexthop destination,
remote client or server name or network address matches a pattern
given with the debug_peer_list parameter.
.IP "\fBdebug_peer_list (empty)\fR"
Optional list of remote client or server hostname or network
address patterns that cause the verbose logging level to increase
by the amount specified in $debug_peer_level.
Optional list of nexthop destination, remote client or server
name or network address patterns that, if matched, cause the verbose
logging level to increase by the amount specified in $debug_peer_level.
.IP "\fBsoft_bounce (no)\fR"
Safety net to keep mail queued that would otherwise be returned to
the sender.

View File

@ -1,4 +1,4 @@
.\" $NetBSD: smtp.8,v 1.3 2020/03/18 19:05:14 christos Exp $
.\" $NetBSD: smtp.8,v 1.4 2022/10/08 16:12:44 christos Exp $
.\"
.TH SMTP 8
.ad
@ -326,12 +326,14 @@ Available in Postfix version 2.8 and later:
.IP "\fBsmtp_dns_resolver_options (empty)\fR"
DNS Resolver options for the Postfix SMTP client.
.PP
Available in Postfix version 2.9 and later:
Available in Postfix version 2.9 \- 3.6:
.IP "\fBsmtp_per_record_deadline (no)\fR"
Change the behavior of the smtp_*_timeout time limits, from a
time limit per read or write system call, to a time limit to send
or receive a complete record (an SMTP command line, SMTP response
line, SMTP message content line, or TLS protocol message).
.PP
Available in Postfix version 2.9 and later:
.IP "\fBsmtp_send_dummy_mail_auth (no)\fR"
Whether or not to append the "AUTH=<>" option to the MAIL
FROM command in SASL\-authenticated SMTP sessions.
@ -358,6 +360,26 @@ Available in Postfix 3.5 and later:
.IP "\fBinfo_log_address_format (external)\fR"
The email address form that will be used in non\-debug logging
(info, warning, etc.).
.PP
Available in Postfix 3.6 and later:
.IP "\fBdnssec_probe (ns:.)\fR"
The DNS query type (default: "ns") and DNS query name (default:
".") that Postfix may use to determine whether DNSSEC validation
is available.
.IP "\fBknown_tcp_ports (lmtp=24, smtp=25, smtps=submissions=465, submission=587)\fR"
Optional setting that avoids lookups in the \fBservices\fR(5) database.
.PP
Available in Postfix version 3.7 and later:
.IP "\fBsmtp_per_request_deadline (no)\fR"
Change the behavior of the smtp_*_timeout time limits, from a
time limit per plaintext or TLS read or write call, to a combined
time limit for sending a complete SMTP request and for receiving a
complete SMTP response.
.IP "\fBsmtp_min_data_rate (500)\fR"
The minimum plaintext data transfer rate in bytes/second for
DATA requests, when deadlines are enabled with smtp_per_request_deadline.
.IP "\fBheader_from_format (standard)\fR"
The format of the Postfix\-generated \fBFrom:\fR header.
.SH "MIME PROCESSING CONTROLS"
.na
.nf
@ -484,9 +506,9 @@ when TLS is not already enabled for that server.
Optional lookup tables with the Postfix SMTP client TLS security
policy by next\-hop destination; when a non\-empty value is specified,
this overrides the obsolete smtp_tls_per_site parameter.
.IP "\fBsmtp_tls_mandatory_protocols (!SSLv2, !SSLv3)\fR"
List of SSL/TLS protocols that the Postfix SMTP client will use with
mandatory TLS encryption.
.IP "\fBsmtp_tls_mandatory_protocols (see 'postconf -d' output)\fR"
TLS protocols that the Postfix SMTP client will use with mandatory
TLS encryption.
.IP "\fBsmtp_tls_scert_verifydepth (9)\fR"
The verification depth for remote SMTP server certificates.
.IP "\fBsmtp_tls_secure_cert_match (nexthop, dot\-nexthop)\fR"
@ -529,14 +551,14 @@ Available in Postfix version 2.5 and later:
List of acceptable remote SMTP server certificate fingerprints for
the "fingerprint" TLS security level (\fBsmtp_tls_security_level\fR =
fingerprint).
.IP "\fBsmtp_tls_fingerprint_digest (md5)\fR"
.IP "\fBsmtp_tls_fingerprint_digest (see 'postconf -d' output)\fR"
The message digest algorithm used to construct remote SMTP server
certificate fingerprints.
.PP
Available in Postfix version 2.6 and later:
.IP "\fBsmtp_tls_protocols (!SSLv2, !SSLv3)\fR"
List of TLS protocols that the Postfix SMTP client will exclude or
include with opportunistic TLS encryption.
.IP "\fBsmtp_tls_protocols (see postconf -d output)\fR"
TLS protocols that the Postfix SMTP client will use with
opportunistic TLS encryption.
.IP "\fBsmtp_tls_ciphers (medium)\fR"
The minimum TLS cipher grade that the Postfix SMTP client
will use with opportunistic TLS encryption.
@ -578,7 +600,7 @@ Request that the Postfix SMTP client connects using the
legacy SMTPS protocol instead of using the STARTTLS command.
.PP
Available in Postfix version 3.1 and later:
.IP "\fBsmtp_tls_dane_insecure_mx_policy (dane)\fR"
.IP "\fBsmtp_tls_dane_insecure_mx_policy (see 'postconf -d' output)\fR"
The TLS policy for MX hosts with "secure" TLSA records when the
nexthop destination security level is \fBdane\fR, but the MX
record was found via an "insecure" MX lookup.
@ -694,7 +716,7 @@ Available in Postfix version 2.3 and later:
Time limit for connection cache connect, send or receive
operations.
.PP
Available in Postfix version 2.9 and later:
Available in Postfix version 2.9 \- 3.6:
.IP "\fBsmtp_per_record_deadline (no)\fR"
Change the behavior of the smtp_*_timeout time limits, from a
time limit per read or write system call, to a time limit to send
@ -711,6 +733,16 @@ Available in Postfix version 3.4 and later:
.IP "\fBsmtp_tls_connection_reuse (no)\fR"
Try to make multiple deliveries per TLS\-encrypted connection.
.PP
Available in Postfix version 3.7 and later:
.IP "\fBsmtp_per_request_deadline (no)\fR"
Change the behavior of the smtp_*_timeout time limits, from a
time limit per plaintext or TLS read or write call, to a combined
time limit for sending a complete SMTP request and for receiving a
complete SMTP response.
.IP "\fBsmtp_min_data_rate (500)\fR"
The minimum plaintext data transfer rate in bytes/second for
DATA requests, when deadlines are enabled with smtp_per_request_deadline.
.PP
Implemented in the qmgr(8) daemon:
.IP "\fBtransport_destination_concurrency_limit ($default_destination_concurrency_limit)\fR"
A transport\-specific override for the
@ -746,12 +778,13 @@ used for DNS lookups.
.ad
.fi
.IP "\fBdebug_peer_level (2)\fR"
The increment in verbose logging level when a remote client or
server matches a pattern in the debug_peer_list parameter.
The increment in verbose logging level when a nexthop destination,
remote client or server name or network address matches a pattern
given with the debug_peer_list parameter.
.IP "\fBdebug_peer_list (empty)\fR"
Optional list of remote client or server hostname or network
address patterns that cause the verbose logging level to increase
by the amount specified in $debug_peer_level.
Optional list of nexthop destination, remote client or server
name or network address patterns that, if matched, cause the verbose
logging level to increase by the amount specified in $debug_peer_level.
.IP "\fBerror_notice_recipient (postmaster)\fR"
The recipient of postmaster notifications about mail delivery
problems that are caused by policy, resource, software or protocol
@ -784,7 +817,7 @@ Disable DNS lookups in the Postfix SMTP and LMTP clients.
.IP "\fBinet_interfaces (all)\fR"
The network interface addresses that this mail system receives
mail on.
.IP "\fBinet_protocols (all)\fR"
.IP "\fBinet_protocols (see 'postconf -d output')\fR"
The Internet protocols Postfix will attempt to use when making
or accepting connections.
.IP "\fBipc_timeout (3600s)\fR"
@ -862,6 +895,11 @@ The default TCP port that the Postfix SMTP client connects to.
Available in Postfix 3.3 and later:
.IP "\fBservice_name (read\-only)\fR"
The master.cf service name of a Postfix daemon process.
.PP
Available in Postfix 3.7 and later:
.IP "\fBsmtp_bind_address_enforce (no)\fR"
Defer delivery when the Postfix SMTP client cannot apply the
smtp_bind_address or smtp_bind_address6 setting.
.SH "SEE ALSO"
.na
.nf

View File

@ -1,4 +1,4 @@
.\" $NetBSD: smtpd.8,v 1.3 2020/03/18 19:05:14 christos Exp $
.\" $NetBSD: smtpd.8,v 1.4 2022/10/08 16:12:44 christos Exp $
.\"
.TH SMTPD 8
.ad
@ -151,7 +151,7 @@ Available in Postfix version 2.7 and later:
.IP "\fBsmtpd_command_filter (empty)\fR"
A mechanism to transform commands from remote SMTP clients.
.PP
Available in Postfix version 2.9 and later:
Available in Postfix version 2.9 \- 3.6:
.IP "\fBsmtpd_per_record_deadline (normal: no, overload: yes)\fR"
Change the behavior of the smtpd_timeout and smtpd_starttls_timeout
time limits, from a
@ -162,6 +162,23 @@ line, SMTP message content line, or TLS protocol message).
Available in Postfix version 3.0 and later:
.IP "\fBsmtpd_dns_reply_filter (empty)\fR"
Optional filter for Postfix SMTP server DNS lookup results.
.PP
Available in Postfix version 3.6 and later:
.IP "\fBsmtpd_relay_before_recipient_restrictions (see 'postconf -d' output)\fR"
Evaluate smtpd_relay_restrictions before smtpd_recipient_restrictions.
.IP "\fBknown_tcp_ports (lmtp=24, smtp=25, smtps=submissions=465, submission=587)\fR"
Optional setting that avoids lookups in the \fBservices\fR(5) database.
.PP
Available in Postfix version 3.7 and later:
.IP "\fBsmtpd_per_request_deadline (normal: no, overload: yes)\fR"
Change the behavior of the smtpd_timeout and smtpd_starttls_timeout
time limits, from a time limit per plaintext or TLS read or write
call, to a combined time limit for receiving a complete SMTP request
and for sending a complete SMTP response.
.IP "\fBsmtpd_min_data_rate (500)\fR"
The minimum plaintext data transfer rate in bytes/second for
DATA and BDAT requests, when deadlines are enabled with
smtpd_per_request_deadline.
.SH "ADDRESS REWRITING CONTROLS"
.na
.nf
@ -379,6 +396,11 @@ selected with \fBsmtpd_sasl_type\fR and \fBsmtpd_sasl_path\fR.
Available in Postfix version 3.4 and later:
.IP "\fBsmtpd_sasl_response_limit (12288)\fR"
The maximum length of a SASL client's response to a server challenge.
.PP
Available in Postfix 3.6 and later:
.IP "\fBsmtpd_sasl_mechanism_filter (!external, static:rest)\fR"
If non\-empty, a filter for the SASL mechanism names that the
Postfix SMTP server will announce in the EHLO response.
.SH "STARTTLS SUPPORT CONTROLS"
.na
.nf
@ -441,9 +463,9 @@ use with mandatory TLS encryption.
.IP "\fBsmtpd_tls_mandatory_exclude_ciphers (empty)\fR"
Additional list of ciphers or cipher types to exclude from the
Postfix SMTP server cipher list at mandatory TLS security levels.
.IP "\fBsmtpd_tls_mandatory_protocols (!SSLv2, !SSLv3)\fR"
The SSL/TLS protocols accepted by the Postfix SMTP server with
mandatory TLS encryption.
.IP "\fBsmtpd_tls_mandatory_protocols (see 'postconf -d' output)\fR"
TLS protocols accepted by the Postfix SMTP server with mandatory TLS
encryption.
.IP "\fBsmtpd_tls_received_header (no)\fR"
Request that the Postfix SMTP server produces Received: message
headers that include information about the protocol and cipher used,
@ -472,16 +494,15 @@ The OpenSSL cipherlist for "NULL" grade ciphers that provide
authentication without encryption.
.PP
Available in Postfix version 2.5 and later:
.IP "\fBsmtpd_tls_fingerprint_digest (md5)\fR"
The message digest algorithm to construct remote SMTP
client\-certificate
fingerprints or public key fingerprints (Postfix 2.9 and later)
for \fBcheck_ccert_access\fR and \fBpermit_tls_clientcerts\fR.
.IP "\fBsmtpd_tls_fingerprint_digest (see 'postconf -d' output)\fR"
The message digest algorithm to construct remote SMTP client\-certificate
fingerprints or public key fingerprints (Postfix 2.9 and later) for
\fBcheck_ccert_access\fR and \fBpermit_tls_clientcerts\fR.
.PP
Available in Postfix version 2.6 and later:
.IP "\fBsmtpd_tls_protocols (!SSLv2, !SSLv3)\fR"
List of TLS protocols that the Postfix SMTP server will exclude
or include with opportunistic TLS encryption.
.IP "\fBsmtpd_tls_protocols (see postconf -d output)\fR"
TLS protocols accepted by the Postfix SMTP server with opportunistic
TLS encryption.
.IP "\fBsmtpd_tls_ciphers (medium)\fR"
The minimum TLS cipher grade that the Postfix SMTP server
will use with opportunistic TLS encryption.
@ -613,12 +634,13 @@ Postfix mail system. The methods vary from making the software log
a lot of detail, to running some daemon processes under control of
a call tracer or debugger.
.IP "\fBdebug_peer_level (2)\fR"
The increment in verbose logging level when a remote client or
server matches a pattern in the debug_peer_list parameter.
The increment in verbose logging level when a nexthop destination,
remote client or server name or network address matches a pattern
given with the debug_peer_list parameter.
.IP "\fBdebug_peer_list (empty)\fR"
Optional list of remote client or server hostname or network
address patterns that cause the verbose logging level to increase
by the amount specified in $debug_peer_level.
Optional list of nexthop destination, remote client or server
name or network address patterns that, if matched, cause the verbose
logging level to increase by the amount specified in $debug_peer_level.
.IP "\fBerror_notice_recipient (postmaster)\fR"
The recipient of postmaster notifications about mail delivery
problems that are caused by policy, resource, software or protocol
@ -679,7 +701,7 @@ mail on.
.IP "\fBproxy_interfaces (empty)\fR"
The network interface addresses that this mail system receives mail
on by way of a proxy or network address translation unit.
.IP "\fBinet_protocols (all)\fR"
.IP "\fBinet_protocols (see 'postconf -d output')\fR"
The Internet protocols Postfix will attempt to use when making
or accepting connections.
.IP "\fBlocal_recipient_maps (proxy:unix:passwd.byname $alias_maps)\fR"
@ -748,8 +770,12 @@ The maximal size in bytes of a message, including envelope information.
The maximal number of recipients that the Postfix SMTP server
accepts per message delivery request.
.IP "\fBsmtpd_timeout (normal: 300s, overload: 10s)\fR"
The time limit for sending a Postfix SMTP server response and for
receiving a remote SMTP client request.
When the Postfix SMTP server wants to send an SMTP server
response, how long the Postfix SMTP server will wait for an underlying
network write operation to complete; and when the Postfix SMTP
server Postfix wants to receive an SMTP client request, how long
the Postfix SMTP server will wait for an underlying network read
operation to complete.
.IP "\fBsmtpd_history_flush_threshold (100)\fR"
The maximal number of lines in the Postfix SMTP server command history
before it is flushed upon receipt of EHLO, RSET, or end of DATA.
@ -786,7 +812,7 @@ The maximal number of new (i.e., uncached) TLS sessions that a
remote SMTP client is allowed to negotiate with this service per
time unit.
.PP
Available in Postfix version 2.9 and later:
Available in Postfix version 2.9 \- 3.6:
.IP "\fBsmtpd_per_record_deadline (normal: no, overload: yes)\fR"
Change the behavior of the smtpd_timeout and smtpd_starttls_timeout
time limits, from a
@ -799,6 +825,19 @@ Available in Postfix version 3.1 and later:
The maximal number of AUTH commands that any client is allowed to
send to this service per time unit, regardless of whether or not
Postfix actually accepts those commands.
.PP
Available in Postfix version 3.7 and later:
.IP "\fBsmtpd_per_request_deadline (normal: no, overload: yes)\fR"
Change the behavior of the smtpd_timeout and smtpd_starttls_timeout
time limits, from a time limit per plaintext or TLS read or write
call, to a combined time limit for receiving a complete SMTP request
and for sending a complete SMTP response.
.IP "\fBsmtpd_min_data_rate (500)\fR"
The minimum plaintext data transfer rate in bytes/second for
DATA and BDAT requests, when deadlines are enabled with
smtpd_per_request_deadline.
.IP "\fBheader_from_format (standard)\fR"
The format of the Postfix\-generated \fBFrom:\fR header.
.SH "TARPIT CONTROLS"
.na
.nf
@ -1117,9 +1156,8 @@ The process name of a Postfix command or daemon process.
.IP "\fBqueue_directory (see 'postconf -d' output)\fR"
The location of the Postfix top\-level queue directory.
.IP "\fBrecipient_delimiter (empty)\fR"
The set of characters that can separate a user name from its
extension (example: user+foo), or a .forward file name from its
extension (example: .forward+foo).
The set of characters that can separate an email address
localpart, user name, or a .forward file name from its extension.
.IP "\fBsmtpd_banner ($myhostname ESMTP $mail_name)\fR"
The text that follows the 220 status code in the SMTP greeting
banner.
@ -1130,7 +1168,7 @@ A prefix that is prepended to the process name in syslog
records, so that, for example, "smtpd" becomes "prefix/smtpd".
.PP
Available in Postfix version 2.2 and later:
.IP "\fBsmtpd_forbidden_commands (CONNECT, GET, POST)\fR"
.IP "\fBsmtpd_forbidden_commands (CONNECT GET POST regexp:{{/^[^A\-Z]/ Bogus}})\fR"
List of commands that cause the Postfix SMTP server to immediately
terminate the session with a 221 code.
.PP

View File

@ -1,4 +1,4 @@
.\" $NetBSD: spawn.8,v 1.3 2020/03/18 19:05:14 christos Exp $
.\" $NetBSD: spawn.8,v 1.4 2022/10/08 16:12:44 christos Exp $
.\"
.TH SPAWN 8
.ad
@ -20,7 +20,7 @@ It listens on a port as specified in the Postfix \fBmaster.cf\fR file
and spawns an external command whenever a connection is established.
The connection can be made over local IPC (such as UNIX\-domain
sockets) or over non\-local IPC (such as TCP sockets).
The command\'s standard input, output and error streams are connected
The command's standard input, output and error streams are connected
directly to the communication endpoint.
This daemon expects to be run from the \fBmaster\fR(8) process

View File

@ -1,4 +1,4 @@
.\" $NetBSD: tlsproxy.8,v 1.3 2020/03/18 19:05:14 christos Exp $
.\" $NetBSD: tlsproxy.8,v 1.4 2022/10/08 16:12:44 christos Exp $
.\"
.TH TLSPROXY 8
.ad
@ -16,8 +16,8 @@ Postfix TLS proxy
.fi
The \fBtlsproxy\fR(8) server implements a two\-way TLS proxy. It
is used by the \fBpostscreen\fR(8) server to talk SMTP\-over\-TLS
with remote SMTP clients that are not whitelisted (including
clients whose whitelist status has expired), and by the
with remote SMTP clients that are not allowlisted (including
clients whose allowlist status has expired), and by the
\fBsmtp\fR(8) client to support TLS connection reuse, but it
should also work for non\-SMTP protocols.
@ -294,12 +294,6 @@ The name of the parameter that provides the tlsproxy_client_loglevel
value.
.IP "\fBtlsproxy_client_scert_verifydepth ($smtp_tls_scert_verifydepth)\fR"
The verification depth for remote TLS server certificates.
.IP "\fBtlsproxy_client_security_level ($smtp_tls_security_level)\fR"
The default TLS security level for the Postfix \fBtlsproxy\fR(8)
client.
.IP "\fBtlsproxy_client_policy_maps ($smtp_tls_policy_maps)\fR"
Optional lookup tables with the Postfix \fBtlsproxy\fR(8) client TLS
security policy by next\-hop destination.
.IP "\fBtlsproxy_client_use_tls ($smtp_use_tls)\fR"
Opportunistic mode: use TLS when a remote server announces TLS
support.
@ -309,6 +303,22 @@ Enforcement mode: require that SMTP servers use TLS encryption.
Optional lookup tables with the Postfix \fBtlsproxy\fR(8) client TLS
usage policy by next\-hop destination and by remote TLS server
hostname.
.PP
Available in Postfix version 3.4\-3.6:
.IP "\fBtlsproxy_client_level ($smtp_tls_security_level)\fR"
The default TLS security level for the Postfix \fBtlsproxy\fR(8)
client.
.IP "\fBtlsproxy_client_policy ($smtp_tls_policy_maps)\fR"
Optional lookup tables with the Postfix \fBtlsproxy\fR(8) client TLS
security policy by next\-hop destination.
.PP
Available in Postfix version 3.7 and later:
.IP "\fBtlsproxy_client_security_level ($smtp_tls_security_level)\fR"
The default TLS security level for the Postfix \fBtlsproxy\fR(8)
client.
.IP "\fBtlsproxy_client_policy_maps ($smtp_tls_policy_maps)\fR"
Optional lookup tables with the Postfix \fBtlsproxy\fR(8) client TLS
security policy by next\-hop destination.
.SH "OBSOLETE STARTTLS SUPPORT CONTROLS"
.na
.nf
@ -322,6 +332,11 @@ but do not require that clients use TLS encryption.
.IP "\fBtlsproxy_enforce_tls ($smtpd_enforce_tls)\fR"
Mandatory TLS: announce STARTTLS support to remote SMTP clients, and
require that clients use TLS encryption.
.IP "\fBtlsproxy_client_use_tls ($smtp_use_tls)\fR"
Opportunistic mode: use TLS when a remote server announces TLS
support.
.IP "\fBtlsproxy_client_enforce_tls ($smtp_enforce_tls)\fR"
Enforcement mode: require that SMTP servers use TLS encryption.
.SH "RESOURCE CONTROLS"
.na
.nf

View File

@ -1,4 +1,4 @@
.\" $NetBSD: trivial-rewrite.8,v 1.3 2020/03/18 19:05:14 christos Exp $
.\" $NetBSD: trivial-rewrite.8,v 1.4 2022/10/08 16:12:44 christos Exp $
.\"
.TH TRIVIAL-REWRITE 8
.ad
@ -58,7 +58,7 @@ Resolve the address for address verification purposes.
.ad
.fi
The \fBtrivial\-rewrite\fR(8) servers run under control by
the Postfix master
the Postfix master(8)
server. Each server can handle multiple simultaneous connections.
When all servers are busy while a client connects, the master
creates a new server process, provided that the trivial\-rewrite
@ -137,9 +137,8 @@ addresses without domain information.
With locally submitted mail, append the string ".$mydomain" to
addresses that have no ".domain" information.
.IP "\fBrecipient_delimiter (empty)\fR"
The set of characters that can separate a user name from its
extension (example: user+foo), or a .forward file name from its
extension (example: .forward+foo).
The set of characters that can separate an email address
localpart, user name, or a .forward file name from its extension.
.IP "\fBswap_bangpath (yes)\fR"
Enable the rewriting of "site!user" into "user@site".
.PP
@ -177,7 +176,7 @@ A list of Postfix features where the pattern "example.com" also
matches subdomains of example.com,
instead of requiring an explicit ".example.com" pattern.
.IP "\fBrelayhost (empty)\fR"
The next\-hop destination of non\-local mail; overrides non\-local
The next\-hop destination(s) for non\-local mail; overrides non\-local
domains in recipient addresses.
.IP "\fBtransport_maps (empty)\fR"
Optional lookup tables with mappings from recipient address to

View File

@ -1,4 +1,4 @@
.\" $NetBSD: verify.8,v 1.3 2020/03/18 19:05:14 christos Exp $
.\" $NetBSD: verify.8,v 1.4 2022/10/08 16:12:44 christos Exp $
.\"
.TH VERIFY 8
.ad
@ -78,7 +78,7 @@ Recipient verification may cause an increased load on
down\-stream servers in the case of a dictionary attack or
a flood of backscatter bounces.
Sender address verification may cause your site to be
blacklisted by some providers.
denylisted by some providers.
If the persistent database ever gets corrupted then the world
comes to an end and human intervention is needed. This violates

View File

@ -1,4 +1,4 @@
.\" $NetBSD: virtual.8,v 1.3 2020/03/18 19:05:14 christos Exp $
.\" $NetBSD: virtual.8,v 1.4 2022/10/08 16:12:44 christos Exp $
.\"
.TH VIRTUAL 8
.ad
@ -156,7 +156,7 @@ RFC 822 (ARPA Internet Text Messages)
.ad
.fi
Mail bounces when the recipient has no mailbox or when the
recipient is over disk quota. In all other cases, mail for
recipient is over disk quota. In all other problem cases, mail for
an existing recipient is deferred and a warning is logged.
Problems and transactions are logged to \fBsyslogd\fR(8)
@ -211,7 +211,7 @@ delivery.
.PP
Available in Postfix version 2.0 and later:
.IP "\fBvirtual_mailbox_domains ($virtual_mailbox_maps)\fR"
Postfix is final destination for the specified list of domains;
Postfix is the final destination for the specified list of domains;
mail is delivered via the $virtual_transport mail delivery transport.
.IP "\fBvirtual_transport (virtual)\fR"
The default mail delivery transport and next\-hop destination for

View File

@ -1,4 +1,4 @@
/* $NetBSD: comment.c,v 1.1.1.1 2022/10/08 16:09:04 christos Exp $ */
/* $NetBSD: comment.c,v 1.2 2022/10/08 16:12:44 christos Exp $ */
#include <stdio.h>

View File

@ -110,7 +110,7 @@
# This parameter setting is recorded in the installed main.cf file.
# .IP command_directory
# The final destination directory for Postfix administrative commands.
# This directory should be in the command search path of adminstrative
# This directory should be in the command search path of administrative
# users. The built-in default directory name is system dependent.
# This parameter setting is recorded in the installed main.cf file.
# .IP html_directory
@ -405,7 +405,7 @@ in the command search path of any users."
command_directory_prompt="the final destination directory for
installed Postfix administrative commands. This directory should
be in the command search path of adminstrative users."
be in the command search path of administrative users."
queue_directory_prompt="the final destination directory for Postfix
queues."

View File

@ -7,7 +7,7 @@
<title>Postfix Address Verification </title>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
@ -22,7 +22,7 @@
<p> Recipient address verification may cause an increased load on
down-stream servers in the case of a dictionary attack or a flood
of backscatter bounces. Sender address verification may cause your
site to be blacklisted by some providers. See also the "<a
site to be denylisted by some providers. See also the "<a
href="#limitations">Limitations</a>" section below for more. </p>
<h2><a name="summary">What Postfix address verification can do for you</a></h2>
@ -211,7 +211,7 @@ address is deliverable. In reality, mail for a remote address can
bounce AFTER a preferred MTA accepts the recipient address, or AFTER
a preferred MTA accepts the message content. </p>
<li> <p> Some sites may blacklist you when you are probing them
<li> <p> Some sites may denylist you when you are probing them
too often (a probe is an SMTP session that does not deliver mail),
or when you are probing them too often for a non-existent address.
This is one reason why you should use sender address verification
@ -252,7 +252,7 @@ mis-configured sites that reject MAIL FROM: &lt;&gt;, while
probes from "double-bounce@$myorigin" would succeed. </p>
<li> <p> The downside of using a non-empty sender address is that
the address may end op on spammer mailing lists. Although Postfix
the address may end up on spammer mailing lists. Although Postfix
always discards mail to the double-bounce address, this still results
in wasted network bandwidth and server capacity. To defeat
address harvesting, Postfix 2.9 and later support time-dependent
@ -383,7 +383,7 @@ email</a></h2>
<p> Unfortunately, sender address verification cannot simply be
turned on for all email - you are likely to lose legitimate mail
from mis-configured systems. You almost certainly will have to set
up white lists for specific addresses, or even for entire domains.
up allow lists for specific addresses, or even for entire domains.
</p>
<p> To find out how sender address verification would affect your
@ -413,12 +413,12 @@ you can see what mail would be blocked: </p>
<p> This is also a good way to populate your cache with address
verification results before you start to actually reject mail. </p>
<p> The sender_access restriction is needed to whitelist domains
<p> The sender_access restriction is needed to allowlist domains
or addresses that are known to be OK. Although Postfix will not
mark a known-to-be-good address as bad after a probe fails, it is
better to be safe than sorry. </p>
<p> NOTE: You will have to whitelist sites such as securityfocus.com
<p> NOTE: You will have to allowlist sites such as securityfocus.com
and other sites that operate mailing lists that use a different
sender address for each posting (VERP). Such addresses pollute
the address verification cache quickly, and generate unnecessary

View File

@ -7,7 +7,7 @@
<title>Postfix Installation From Source Code </title>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
@ -534,7 +534,7 @@ built, with "make install" or "make upgrade". </p>
</pre>
</blockquote>
<p> As with the command "make makefiles, the command "make
<p> As with the command "make makefiles", the command "make
install/upgrade name=value..." will replace the string MAIL_VERSION
at the end of a configuration parameter value with the Postfix
release version. Do not try to specify something like $mail_version
@ -863,6 +863,9 @@ support. By default, PCRE support is compiled in when the
for POSIX <tt>getpwnam_r/getpwuid_r</tt>. By default Postfix uses
these where they are known to be available. </td> </tr>
<tr> <td> </td> <td> -DNO_RES_NCALLS </td> <td> Do not build with
the threadsafe resolver(5) API (res_ninit() etc.). </td> </tr>
<tr> <td> </td> <td> -DNO_SIGSETJMP </td> <td> Use
<tt>setjmp()/longjmp()</tt> instead of <tt>sigsetjmp()/siglongjmp()</tt>.
By default, Postfix uses <tt>sigsetjmp()/siglongjmp()</tt> when
@ -1237,7 +1240,7 @@ of: </p>
<p> Follow the instructions in the "<a href="#mandatory">Mandatory
configuration file edits</a>" in section 10, and review the "<a
name="#hamlet">To chroot or not to chroot</a>" text in section
href="#hamlet">To chroot or not to chroot</a>" text in section
11. </p>
<p> Start the Postfix system: </p>
@ -1562,6 +1565,7 @@ following commands: </p>
<pre>
# newaliases
# sendmail -bi
# postalias /etc/aliases (pathname is system dependent!)
</pre>
</blockquote>

View File

@ -7,7 +7,7 @@
<title>Postfix TLS Support </title>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
@ -29,7 +29,7 @@ SMTP mail or with SASL authentication. </p>
the ability to encrypt mail and to authenticate remote SMTP clients
or servers. You also turn on hundreds of thousands of lines of
OpenSSL library code. Assuming that OpenSSL is written as carefully
as Wietse's own code, every 1000 lines introduce one additional bug
as Wietse's own code, every 1000 lines introduces one additional bug
into Postfix. </p>
<p> Topics covered in this document: </p>
@ -179,10 +179,10 @@ configurations will not accidentally enable TLS without certificates. </p>
<p> Note that server certificates are <b>not</b> optional in TLS 1.3. To
run without certificates you'd have to disable the TLS 1.3 protocol by
including '!TLSv1.3' in "smtpd_tls_protocols" and perhaps also
"smtpd_tls_mandatory_protocols". It is simpler instead to just
configure a certificate chain. Certificate-less operation is not
recommended. <p>
including "&lt;=TLSv1.2" (or, for Postfix &lt; 3.6, "!TLSv1.3") in
"smtpd_tls_protocols" and perhaps also "smtpd_tls_mandatory_protocols".
It is simpler instead to just configure a certificate chain.
Certificate-less operation is not recommended. <p>
<p> RSA, DSA and ECDSA (Postfix &ge; 2.6) certificates are supported.
Most sites only have RSA certificates. You can configure all three
@ -201,7 +201,7 @@ client must receive the issuing CA certificates via the TLS handshake
or via public-key infrastructure. This means that the Postfix server
public-key certificate file must include the server certificate
first, then the issuing CA(s) (bottom-up order). The Postfix SMTP
server certificate must be usable as SSL server certificate and
server certificate must be usable as an SSL server certificate and
hence pass the "<tt>openssl verify -purpose sslserver ...</tt>" test.
</p>
@ -280,7 +280,7 @@ single file can hold multiple <i>(key, cert, [chain])</i> sequences, one
per algorithm. It is typically simpler to keep the chain for each
algorithm in its own file. Most users are likely to deploy just a
single RSA chain, but with OpenSSL 1.1.1, it is possible to deploy up to
five chains, one each for RSA, ECDSA, ED25519, ED448 and even the
five chains, one each for RSA, ECDSA, ED25519, ED448, and even the
obsolete DSA. </p>
<blockquote>
@ -540,7 +540,7 @@ by default and should only seldom be used. </p>
</pre>
</blockquote>
<p> TLS is sometimes used in the non-standard "wrapper" mode where
<p> TLS is also used in the "wrapper" mode where
a server always uses TLS, instead of announcing STARTTLS support
and waiting for remote SMTP clients to request TLS service. Some
clients, namely
@ -783,13 +783,19 @@ table. </p> </dd>
<p> The digest algorithm used to compute the client certificate
fingerprints is specified with the main.cf smtpd_tls_fingerprint_digest
parameter. The default is "md5", for compatibility with Postfix
versions &lt; 2.5. </p>
parameter. The default algorithm is <b>sha256</b> with Postfix &ge;
3.6 and the <b>compatibility_level</b> set to 3.6 or higher. With
Postfix &le; 3.5, the default algorithm is <b>md5</b>. The
best-practice algorithm is now <b>sha256</b>. Recent advances in hash
function cryptanalysis have led to md5 and sha1 being deprecated in
favor of sha256. However, as long as there are no known "second
pre-image" attacks against the older algorithms, their use in this
context, though not recommended, is still likely safe. </p>
<p> The permit_tls_all_clientcerts feature must be used with caution,
because it can result in too many access permissions. Use this
feature only if a special CA issues the client certificates, and
only if this CA is listed as trusted CA. If other CAs are trusted,
only if this CA is listed as a trusted CA. If other CAs are trusted,
any owner of a valid client certificate would be authorized.
The permit_tls_all_clientcerts feature can be practical for a
specially created email relay server. </p>
@ -847,30 +853,15 @@ key always in "PEM" format. We pipe the result to another OpenSSL
command that converts the key to DER and then to the "dgst" command
to compute the fingerprint. </p>
<p> The actual command to transform the key to DER format depends
on the version of OpenSSL used. With OpenSSL 1.0.0 and later, the
"pkey" command supports all key types. With OpenSSL 0.9.8 and
earlier, the key type is always RSA (nobody uses DSA, and EC
keys are not fully supported by 0.9.8), so the "rsa" command is
used. </p>
<p> Example: </p>
<blockquote>
<pre>
# OpenSSL 1.0 with all certificates and SHA-1 fingerprints.
$ openssl x509 -in cert.pem -noout -pubkey |
openssl pkey -pubin -outform DER |
openssl dgst -sha1 -c
(stdin)= 64:3f:1f:f6:e5:1e:d4:2a:56:8b:fc:09:1a:61:98:b5:bc:7c:60:58
# OpenSSL 0.9.8 with RSA certificates and MD5 fingerprints.
$ openssl x509 -in cert.pem -noout -pubkey |
openssl rsa -pubin -outform DER |
openssl dgst -md5 -c
(stdin)= f4:62:60:f6:12:8f:d5:8d:28:4d:13:a7:db:b2:ff:50
openssl dgst -sha256 -c
(stdin)= 64:3f:1f:f6:e5:1e:d4:2a:...:8b:fc:09:1a:61:98:b5:bc:7c:60:58
</pre>
</blockquote>
<p> Note: Postfix 2.9.0&ndash;2.9.5 computed the public key
fingerprint incorrectly. To use public-key fingerprints, upgrade
to Postfix 2.9.6 or later. </p>
<h3><a name="server_cipher">Server-side cipher controls</a> </h3>
@ -900,7 +891,7 @@ after the middle of 2015; older releases only disable SSLv2 for
mandatory TLS. The mandatory TLS protocol list is specified via the
smtpd_tls_mandatory_protocols configuration parameter. The
smtpd_tls_protocols parameter (Postfix &ge; 2.6)
controls the SSL/TLS protocols used with opportunistic TLS. </p>
controls the TLS protocols used with opportunistic TLS. </p>
<p> Note that the OpenSSL library only supports protocol exclusion
(not inclusion). For this reason, Postfix can exclude only protocols
@ -918,8 +909,8 @@ that TLSv1.3 be explicitly disabled. Therefore, they are not
recommended, it is better and simpler to just configure a suitable
certificate. </p>
<p> Example, MSA that requires TLSv1 or higher, not SSLv2 or SSLv3,
with high grade ciphers: </p>
<p> Example, MSA that requires TLSv1.2 or higher, with high grade
ciphers: </p>
<blockquote>
<pre>
@ -929,10 +920,10 @@ with high grade ciphers: </p>
smtpd_tls_mandatory_ciphers = high
smtpd_tls_mandatory_exclude_ciphers = aNULL, MD5
smtpd_tls_security_level = encrypt
# Preferred syntax with Postfix &ge; 2.5:
smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3
# Preferred syntax with Postfix &ge; 3.6:
smtpd_tls_mandatory_protocols = &gt;=TLSv1.2
# Legacy syntax:
smtpd_tls_mandatory_protocols = TLSv1
smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
</pre>
</blockquote>
@ -1272,9 +1263,10 @@ just in case the transport table entries are not specified consistently. </p>
submission 587/tcp msa # mail message submission
/etc/postfix/tls_policy:
[example.net]:587 encrypt protocols=TLSv1 ciphers=high
[example.net]:msa encrypt protocols=TLSv1 ciphers=high
[example.net]:submission encrypt protocols=TLSv1 ciphers=high
# Postfix &ge; 3.6 "protocols" syntax
[example.net]:587 encrypt protocols=&gt;=TLSv1.2 ciphers=high
# Legacy "protocols" syntax
[example.net]:msa encrypt protocols=!SSLv2:!SSLv3 ciphers=high
</pre>
</blockquote>
@ -1387,7 +1379,8 @@ if deployed on a system with an updated resolver library.
It will support DANE provided it supports TLSv1 and its TLSA records are
published in a DNSSEC signed zone. To receive DANE secured mail for multiple
domains, use the same hostname to add the server to each domain's MX
records. There are no plans to implement SNI in the Postfix SMTP server. </p>
records. The Postfix SMTP server supports SNI (Postfix 3.4 and later),
configured with tls_server_sni_maps. </p>
<p> Note: The Postfix SMTP client's internal stub DNS resolver is
DNSSEC-aware, but it does not itself validate DNSSEC records, rather
@ -1509,6 +1502,15 @@ match attributes can be employed. The ":" character is not used as a
delimiter as it occurs between each pair of fingerprint (hexadecimal)
digits. </p>
<p> The default algorithm is <b>sha256</b> with Postfix &ge; 3.6
and the <b>compatibility_level</b> set to 3.6 or higher; with Postfix
&le; 3.5, the default algorithm is <b>md5</b>. The
best-practice algorithm is now <b>sha256</b>. Recent advances in hash
function cryptanalysis have led to md5 and sha1 being deprecated in
favor of sha256. However, as long as there are no known "second
pre-image" attacks against the older algorithms, their use in this
context, though not recommended, is still likely safe. </p>
<p> Example: fingerprint TLS security with an internal mailhub.
Two matching fingerprints are listed. The relayhost may be multiple
physical hosts behind a load-balancer, each with its own private/public
@ -1520,10 +1522,10 @@ another, and both keys are trusted just prior to the transition. </p>
<pre>
relayhost = [mailhub.example.com]
smtp_tls_security_level = fingerprint
smtp_tls_fingerprint_digest = md5
smtp_tls_fingerprint_digest = sha256
smtp_tls_fingerprint_cert_match =
3D:95:34:51:24:66:33:B9:D2:40:99:C0:C1:17:0B:D1
EC:3B:2D:B0:5B:B1:FB:6D:20:A3:9D:72:F6:8D:12:35
51:e9:af:2e:1e:40:1f:de:64:...:30:35:2d:09:16:31:5a:eb:82:76
b6:b4:72:34:e2:59:cd:fb:c2:...:63:0d:4d:cc:2c:7d:84:de:e6:2f
</pre>
</blockquote>
@ -1533,15 +1535,15 @@ As in the example above, we show two matching fingerprints: </p>
<pre>
/etc/postfix/main.cf:
smtp_tls_policy_maps = hash:/etc/postfix/tls_policy
smtp_tls_fingerprint_digest = md5
smtp_tls_fingerprint_digest = sha256
</pre>
</blockquote>
<blockquote>
<pre>
/etc/postfix/tls_policy:
example.com fingerprint
match=3D:95:34:51:24:66:33:B9:D2:40:99:C0:C1:17:0B:D1
match=EC:3B:2D:B0:5B:B1:FB:6D:20:A3:9D:72:F6:8D:12:35
match=51:e9:af:2e:1e:40:1f:de:...:35:2d:09:16:31:5a:eb:82:76
match=b6:b4:72:34:e2:59:cd:fb:...:0d:4d:cc:2c:7d:84:de:e6:2f
</pre>
</blockquote>
@ -1553,30 +1555,15 @@ key always in "PEM" format. We pipe the result to another OpenSSL
command that converts the key to DER and then to the "dgst" command
to compute the fingerprint. </p>
<p> The actual command to transform the key to DER format depends
on the version of OpenSSL used. With OpenSSL 1.0.0 and later, the
"pkey" command supports all key types. With OpenSSL 0.9.8 and
earlier, the key type is always RSA (nobody uses DSA, and EC
keys are not fully supported by 0.9.8), so the "rsa" command is
used. </p>
<p> Example: </p>
<blockquote>
<pre>
# OpenSSL 1.0 with all certificates and SHA-1 fingerprints.
$ openssl x509 -in cert.pem -noout -pubkey |
openssl pkey -pubin -outform DER |
openssl dgst -sha1 -c
(stdin)= 64:3f:1f:f6:e5:1e:d4:2a:56:8b:fc:09:1a:61:98:b5:bc:7c:60:58
# OpenSSL 0.9.8 with RSA certificates and MD5 fingerprints.
$ openssl x509 -in cert.pem -noout -pubkey |
openssl rsa -pubin -outform DER |
openssl dgst -md5 -c
(stdin)= f4:62:60:f6:12:8f:d5:8d:28:4d:13:a7:db:b2:ff:50
openssl dgst -sha256 -c
(stdin)= 64:3f:1f:f6:e5:1e:d4:2a:56:...:09:1a:61:98:b5:bc:7c:60:58
</pre>
</blockquote>
<p> Note: Postfix 2.9.0&ndash;2.9.5 computed the public key
fingerprint incorrectly. To use public-key fingerprints, upgrade
to Postfix 2.9.6 or later. </p>
<h4><a name="client_tls_verify"> Mandatory server certificate verification </a> </h4>
@ -1876,7 +1863,7 @@ cipher used determines which certificate is presented. </p>
key/certificate pair as the Postfix SMTP server. If a certificate
is to be presented, it must be in "PEM" format. The private key
must not be encrypted, meaning: it must be accessible without
password. Both parts (certificate and private key) may be in the
a password. Both parts (certificate and private key) may be in the
same file. </p>
<p> With OpenSSL 1.1.1 and Postfix &ge; 3.4 it is also possible to
@ -1905,7 +1892,7 @@ As the "root" super-user create the client.pem file with: </p>
</blockquote>
<p> A Postfix SMTP client certificate supplied here must be usable
as SSL client certificate and hence pass the "openssl verify -purpose
as an SSL client certificate and hence pass the "openssl verify -purpose
sslclient ..." test. </p>
<p> A server that trusts the root CA has a local copy of the root
@ -1924,7 +1911,7 @@ single file can hold multiple <i>(key, cert, [chain])</i> sequences, one
per algorithm. It is typically simpler to keep the chain for each
algorithm in its own file. Most users are likely to deploy at most a
single RSA chain, but with OpenSSL 1.1.1, it is possible to deploy up
five chains, one each for RSA, ECDSA, ED25519, ED448 and even the
five chains, one each for RSA, ECDSA, ED25519, ED448, and even the
obsolete DSA. </p>
<blockquote>
@ -2345,10 +2332,10 @@ files. </dd>
<dt><b>secure</b></dt> <dd><a href="#client_tls_secure">Secure certificate
verification.</a> Mail is delivered only if the TLS handshake succeeds,
if the remote SMTP server certificate can be validated (not expired
or revoked, and signed by a trusted Certification Authority), and if the
server certificate name matches the optional "match" attribute (or the
main.cf smtp_tls_secure_cert_match parameter value when no optional
and DNS forgery resistant remote SMTP certificate verification succeeds
(not expired or revoked, and signed by a trusted Certification Authority),
and if the server certificate name matches the optional "match" attribute
(or the main.cf smtp_tls_secure_cert_match parameter value when no optional
"match" attribute is specified). With Postfix &ge; 2.11 the "tafile"
attribute optionally modifies trust chain verification in the same manner
as the "smtp_tls_trust_anchor_file" parameter. The "tafile" attribute
@ -2399,7 +2386,7 @@ Example:
/etc/postfix/main.cf:
smtp_tls_policy_maps = hash:/etc/postfix/tls_policy
# Postfix 2.5 and later
smtp_tls_fingerprint_digest = md5
smtp_tls_fingerprint_digest = sha256
/etc/postfix/tls_policy:
example.edu none
example.mil may
@ -2410,10 +2397,12 @@ Example:
[mail.example.org]:587 secure match=nexthop
# Postfix 2.5 and later
[thumb.example.org] fingerprint
match=EC:3B:2D:B0:5B:B1:FB:6D:20:A3:9D:72:F6:8D:12:35
match=3D:95:34:51:24:66:33:B9:D2:40:99:C0:C1:17:0B:D1
# Postfix 2.6 and later
example.info may protocols=!SSLv2 ciphers=medium exclude=3DES
match=b6:b4:72:34:e2:59:cd:fb:...:0d:4d:cc:2c:7d:84:de:e6:2f
match=51:e9:af:2e:1e:40:1f:de:...:35:2d:09:16:31:5a:eb:82:76
# Postfix &ge; 3.6 "protocols" syntax
example.info may protocols=&gt;=TLSv1 ciphers=medium exclude=3DES
# Legacy protocols syntax
example.info may protocols=!SSLv2:!SSLv3 ciphers=medium exclude=3DES
</pre>
</blockquote>
@ -2508,7 +2497,7 @@ SMTP client will by default disable SSLv2 and SSLv3. The mandatory
TLS protocol list is specified via the
smtp_tls_mandatory_protocols configuration parameter. The corresponding
smtp_tls_protocols parameter (Postfix &ge; 2.6) controls
the SSL/TLS protocols used with opportunistic TLS. </p>
the TLS protocols used with opportunistic TLS. </p>
<p> Example: </p>
@ -2518,20 +2507,20 @@ the SSL/TLS protocols used with opportunistic TLS. </p>
smtp_tls_mandatory_ciphers = medium
smtp_tls_mandatory_exclude_ciphers = RC4, MD5
smtp_tls_exclude_ciphers = aNULL
# Preferred form with Postfix &ge; 2.5:
smtp_tls_mandatory_protocols = !SSLv2
# Legacy form for Postfix &lt; 2.5:
smtp_tls_mandatory_protocols = SSLv3, TLSv1
# Also available with Postfix &ge; 2.6:
smtp_tls_ciphers = medium
smtp_tls_protocols = !SSLv2
# Preferred form with Postfix &ge; 3.6:
smtp_tls_mandatory_protocols = &gt;=TLSv1.2
smtp_tls_protocols = &gt;=TLSv1
# Legacy form for Postfix &lt; 3.6:
smtp_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
smtp_tls_protocols = !SSLv2,!SSLv3
</pre>
</blockquote>
<h3> <a name="client_smtps">Client-side SMTPS support </a> </h3>
<p> These sections show how to send mail to a server that does not
support STARTTLS, but that provides the deprecated SMTPS service
support STARTTLS, but that provides the SMTPS service
on TCP port 465. Depending on the Postfix version, some additional
tooling may be required. </p>
@ -2852,7 +2841,7 @@ for exchanging email with sites that you have no trust relationship
with. For real authentication you need also enable DNSSEC record
signing for your domain and publish TLSA records and/or your Postfix
public key certificate needs to be signed by a recognized Certification
Authority. To authenticate the certificates of remote host you
Authority. To authenticate the certificates of a remote host you
need a DNSSEC-validating local resolver and to enable <a
href="#client_tls_dane">DANE</a> authentication and/or configure
the Postfix SMTP client with a list of public key certificates of
@ -3123,7 +3112,7 @@ client certificates, unless there are servers which authenticate your mail
submission via client certificates. Often servers that perform TLS client
authentication will issue the required certificates signed by their own
CA. If you configure the client certificate and key incorrectly, you
will be unable to send mail to sites that request client certificate,
will be unable to send mail to sites that request a client certificate,
but don't require them from all clients. </p>
<blockquote>
@ -3193,6 +3182,10 @@ are in directory <tt>/usr/local/lib</tt>: </p>
</pre>
</blockquote>
<p> If your OpenSSL shared library is in a directory that the RUN-TIME
linker does not know about, add a "-Wl,-R,/path/to/directory" option after
"-lcrypto". </p>
<p> On Solaris, specify the <tt>-R</tt> option as shown below:
<blockquote>

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
/* $NetBSD: anvil.c,v 1.3 2020/03/18 19:05:15 christos Exp $ */
/* $NetBSD: anvil.c,v 1.4 2022/10/08 16:12:44 christos Exp $ */
/*++
/* NAME
@ -1008,6 +1008,21 @@ static void post_jail_init(char *unused_name, char **unused_argv)
MAIL_VERSION_STAMP_DECLARE;
/* post_accept - announce our protocol */
static void post_accept(VSTREAM *stream, char *unused_name,
char **unused_argv, HTABLE *unused_table)
{
/*
* Announce the protocol.
*/
attr_print_plain(stream, ATTR_FLAG_NONE,
SEND_ATTR_STR(MAIL_ATTR_PROTO, MAIL_ATTR_PROTO_ANVIL),
ATTR_TYPE_END);
(void) vstream_fflush(stream);
}
/* main - pass control to the multi-threaded skeleton */
int main(int argc, char **argv)
@ -1026,6 +1041,7 @@ int main(int argc, char **argv)
multi_server_main(argc, argv, anvil_service,
CA_MAIL_SERVER_TIME_TABLE(time_table),
CA_MAIL_SERVER_POST_INIT(post_jail_init),
CA_MAIL_SERVER_POST_ACCEPT(post_accept),
CA_MAIL_SERVER_SOLITARY,
CA_MAIL_SERVER_PRE_DISCONN(anvil_service_done),
CA_MAIL_SERVER_EXIT(anvil_status_dump),

View File

@ -1,4 +1,4 @@
/* $NetBSD: bounce.c,v 1.3 2020/03/18 19:05:15 christos Exp $ */
/* $NetBSD: bounce.c,v 1.4 2022/10/08 16:12:45 christos Exp $ */
/*++
/* NAME
@ -126,6 +126,16 @@
/* Available in Postfix 3.3 and later:
/* .IP "\fBservice_name (read-only)\fR"
/* The master.cf service name of a Postfix daemon process.
/* .PP
/* Available in Postfix 3.6 and later:
/* .IP "\fBenable_threaded_bounces (no)\fR"
/* Enable non-delivery, success, and delay notifications that link
/* to the original message by including a References: and In-Reply-To:
/* header with the original Message-ID value.
/* .PP
/* Available in Postfix 3.7 and later:
/* .IP "\fBheader_from_format (standard)\fR"
/* The format of the Postfix-generated \fBFrom:\fR header.
/* FILES
/* /var/spool/postfix/bounce/* non-delivery records
/* /var/spool/postfix/defer/* non-delivery records
@ -179,6 +189,7 @@
#include <mail_addr.h>
#include <rcpt_buf.h>
#include <dsb_scan.h>
#include <hfrom_format.h>
/* Single-threaded server skeleton. */
@ -199,6 +210,8 @@ char *var_bounce_rcpt;
char *var_2bounce_rcpt;
char *var_delay_rcpt;
char *var_bounce_tmpl;
bool var_threaded_bounce;
char *var_hfrom_format; /* header_from_format */
/*
* We're single threaded, so we can avoid some memory allocation overhead.
@ -217,6 +230,11 @@ static DSN_BUF *dsn_buf;
*/
BOUNCE_TEMPLATES *bounce_templates;
/*
* From: header format.
*/
int bounce_hfrom_format;
#define STR vstring_str
#define VS_NEUTER(s) printable(vstring_str(s), '?')
@ -529,6 +547,14 @@ static void bounce_service(VSTREAM *client, char *service_name, char **argv)
if (mail_queue_name_ok(service_name) == 0)
msg_fatal("malformed service name: %s", service_name);
/*
* Announce the protocol.
*/
attr_print(client, ATTR_FLAG_NONE,
SEND_ATTR_STR(MAIL_ATTR_PROTO, MAIL_ATTR_PROTO_BOUNCE),
ATTR_TYPE_END);
(void) vstream_fflush(client);
/*
* Read and validate the first parameter of the client request. Let the
* request-specific protocol routines take care of the remainder.
@ -607,6 +633,7 @@ static void pre_jail_init(char *unused_name, char **unused_argv)
static void post_jail_init(char *service_name, char **unused_argv)
{
bounce_hfrom_format = hfrom_format_parse(VAR_HFROM_FORMAT, var_hfrom_format);
/*
* Special case: dump bounce templates. This is not part of the master(5)
@ -660,6 +687,11 @@ int main(int argc, char **argv)
VAR_2BOUNCE_RCPT, DEF_2BOUNCE_RCPT, &var_2bounce_rcpt, 1, 0,
VAR_DELAY_RCPT, DEF_DELAY_RCPT, &var_delay_rcpt, 1, 0,
VAR_BOUNCE_TMPL, DEF_BOUNCE_TMPL, &var_bounce_tmpl, 0, 0,
VAR_HFROM_FORMAT, DEF_HFROM_FORMAT, &var_hfrom_format, 1, 0,
0,
};
static const CONFIG_NBOOL_TABLE nbool_table[] = {
VAR_THREADED_BOUNCE, DEF_THREADED_BOUNCE, &var_threaded_bounce,
0,
};
@ -675,6 +707,7 @@ int main(int argc, char **argv)
CA_MAIL_SERVER_INT_TABLE(int_table),
CA_MAIL_SERVER_STR_TABLE(str_table),
CA_MAIL_SERVER_TIME_TABLE(time_table),
CA_MAIL_SERVER_NBOOL_TABLE(nbool_table),
CA_MAIL_SERVER_PRE_INIT(pre_jail_init),
CA_MAIL_SERVER_POST_INIT(post_jail_init),
CA_MAIL_SERVER_UNLIMITED,

View File

@ -1,4 +1,4 @@
/* $NetBSD: bounce_notify_util.c,v 1.3 2020/03/18 19:05:15 christos Exp $ */
/* $NetBSD: bounce_notify_util.c,v 1.4 2022/10/08 16:12:45 christos Exp $ */
/*++
/* NAME
@ -208,12 +208,14 @@
#include <deliver_completed.h>
#include <dsn_mask.h>
#include <smtputf8.h>
#include <header_opts.h>
/* Application-specific. */
#include "bounce_service.h"
#define STR vstring_str
#define LEN VSTRING_LEN
/* bounce_mail_alloc - initialize */
@ -230,6 +232,10 @@ static BOUNCE_INFO *bounce_mail_alloc(const char *service,
{
BOUNCE_INFO *bounce_info;
int rec_type;
int prev_type;
int all_headers_seen = 0;
int skip_message_segment = 0;
int in_envelope = 1;
/*
* Bundle up a bunch of parameters and initialize information that will
@ -268,6 +274,7 @@ static BOUNCE_INFO *bounce_mail_alloc(const char *service,
bounce_info->arrival_time = 0;
bounce_info->orig_offs = 0;
bounce_info->message_size = 0;
bounce_info->orig_msgid = vstring_alloc(100);
bounce_info->rcpt_buf = rcpt_buf;
bounce_info->dsn_buf = dsn_buf;
bounce_info->log_handle = log_handle;
@ -317,8 +324,9 @@ static BOUNCE_INFO *bounce_mail_alloc(const char *service,
DELIVER_LOCK_MODE) < 0)
msg_fatal("cannot get shared lock on %s: %m",
VSTREAM_PATH(bounce_info->orig_fp));
while ((rec_type = rec_get(bounce_info->orig_fp,
bounce_info->buf, 0)) > 0) {
for (prev_type = 0;
(rec_type = rec_get(bounce_info->orig_fp, bounce_info->buf, 0)) > 0;
prev_type = rec_type) {
/*
* Postfix version dependent: data offset in SIZE record.
@ -362,12 +370,101 @@ static BOUNCE_INFO *bounce_mail_alloc(const char *service,
msg_warn("%s: no sender before message content record",
bounce_info->queue_id);
bounce_info->orig_offs = vstream_ftell(bounce_info->orig_fp);
break;
if (var_threaded_bounce == 0)
skip_message_segment = 1;
else
in_envelope = 0;
}
/*
* Extract Message-ID for threaded bounces.
*/
else if (in_envelope == 0
&& (rec_type == REC_TYPE_NORM || rec_type == REC_TYPE_CONT)) {
const HEADER_OPTS *hdr;
char *cp;
/*
* Skip records that we cannot use. Degrade if we could not
* skip over the message content.
*/
if (var_threaded_bounce == 0 || all_headers_seen
|| prev_type == REC_TYPE_CONT) {
/* void */ ;
}
/*
* Extract message-id header value.
*/
else if (is_header(STR(bounce_info->buf))) {
if ((hdr = header_opts_find(
vstring_str(bounce_info->buf))) != 0
&& hdr->type == HDR_MESSAGE_ID) {
vstring_truncate(bounce_info->buf,
trimblanks(STR(bounce_info->buf),
LEN(bounce_info->buf))
- STR(bounce_info->buf));
cp = STR(bounce_info->buf) + strlen(hdr->name) + 1;
while (ISSPACE(*cp))
cp++;
if (*cp == '<' && vstring_end(bounce_info->buf)[-1] == '>')
vstring_strcpy(bounce_info->orig_msgid, cp);
else
msg_warn("%s: ignoring malformed Message-ID",
bounce_info->queue_id);
}
}
/*
* Skip remainder of multiline header.
*/
else if (ISSPACE(*STR(bounce_info->buf))) {
/* void */ ;
}
/*
* Start of body.
*/
else {
all_headers_seen = 1;
skip_message_segment = 1;
}
}
/*
* In case we ever want to process records from the extracted
* segment, and in case there was no "start of body" event.
*/
else if (rec_type == REC_TYPE_XTRA) {
if (VSTRING_LEN(bounce_info->orig_msgid) == 0)
if (var_threaded_bounce)
all_headers_seen = 1;
in_envelope = 1;
}
/*
* Are we done yet?
*/
if (bounce_info->orig_offs > 0
&& bounce_info->arrival_time > 0
&& VSTRING_LEN(bounce_info->sender) > 0)
&& VSTRING_LEN(bounce_info->sender) > 0
&& (var_threaded_bounce == 0 || all_headers_seen
|| VSTRING_LEN(bounce_info->orig_msgid) > 0)) {
break;
}
/*
* Skip over (the remainder of) the message segment. If that
* fails, degrade.
*/
if (skip_message_segment) {
if (vstream_fseek(bounce_info->orig_fp,
bounce_info->orig_offs +
bounce_info->message_size,
SEEK_SET) < 0)
/* void */ ;
skip_message_segment = 0;
}
}
}
return (bounce_info);
@ -441,6 +538,7 @@ void bounce_mail_free(BOUNCE_INFO *bounce_info)
if (bounce_log_close(bounce_info->log_handle))
msg_warn("%s: read bounce log %s: %m",
bounce_info->queue_id, bounce_info->queue_id);
vstring_free(bounce_info->orig_msgid);
rcpb_free(bounce_info->rcpt_buf);
dsb_free(bounce_info->dsn_buf);
}
@ -476,6 +574,15 @@ int bounce_header(VSTREAM *bounce, BOUNCE_INFO *bounce_info,
STR(quote_822_local(bounce_info->buf, dest)),
postmaster_copy);
/*
* References and Reply-To header that references the original message-id
* for better threading in MUAs.
*/
if (VSTRING_LEN(bounce_info->orig_msgid) > 0) {
post_mail_fprintf(bounce, "References: %s", STR(bounce_info->orig_msgid));
post_mail_fprintf(bounce, "In-Reply-To: %s", STR(bounce_info->orig_msgid));
}
/*
* Auto-Submitted header, as per RFC 3834.
*/
@ -711,7 +818,7 @@ int bounce_recipient_dsn(VSTREAM *bounce, BOUNCE_INFO *bounce_info)
* relayed.". Postfix adds an ORCPT parameter under these conditions.
*
* Therefore, all down-stream MTAs will send DSNs with Original-Recipient
* field ontaining this same ORCPT value. When a down-stream MTA can use
* field containing this same ORCPT value. When a down-stream MTA can use
* that information in their DSNs, it makes no sense that an up-stream
* MTA can't use that same information in its own DSNs.
*

View File

@ -1,4 +1,4 @@
/* $NetBSD: bounce_notify_util_tester.c,v 1.1.1.1 2022/10/08 16:09:06 christos Exp $ */
/* $NetBSD: bounce_notify_util_tester.c,v 1.2 2022/10/08 16:12:45 christos Exp $ */
/*
* System library.

View File

@ -1,4 +1,4 @@
/* $NetBSD: bounce_service.h,v 1.2 2017/02/14 01:16:44 christos Exp $ */
/* $NetBSD: bounce_service.h,v 1.3 2022/10/08 16:12:45 christos Exp $ */
/*++
/* NAME
@ -25,6 +25,11 @@
*/
#include <bounce_template.h>
/*
* bounce_service.c
*/
extern int bounce_hfrom_format;
/*
* bounce_append_service.c
*/
@ -82,6 +87,7 @@ typedef struct {
long orig_offs; /* start of content */
time_t arrival_time; /* time of arrival */
long message_size; /* size of content */
VSTRING *orig_msgid; /* original message-id */
RCPT_BUF *rcpt_buf; /* recipient info */
DSN_BUF *dsn_buf; /* delivery status info */
BOUNCE_LOG *log_handle; /* open logfile */

View File

@ -1,4 +1,4 @@
/* $NetBSD: bounce_template.c,v 1.3 2020/03/18 19:05:15 christos Exp $ */
/* $NetBSD: bounce_template.c,v 1.4 2022/10/08 16:12:45 christos Exp $ */
/*++
/* NAME
@ -46,7 +46,6 @@
/* int IS_FAILURE_TEMPLATE(template)
/* int IS_DELAY_TEMPLATE(template)
/* int IS_SUCCESS_TEMPLATE(template)
/* int IS_VERIFY_TEMPLATE(template)
/* BOUNCE_TEMPLATE *template;
/* DESCRIPTION
/* This module implements the built-in and external bounce
@ -100,6 +99,11 @@
/* IBM T.J. Watson Research
/* P.O. Box 704
/* Yorktown Heights, NY 10598, USA
/*
/* Wietse Venema
/* Google, Inc.
/* 111 8th Avenue
/* New York, NY 10011, USA
/*--*/
/* System library. */
@ -129,10 +133,12 @@
#include <mail_proto.h>
#include <mail_conf.h>
#include <is_header.h>
#include <hfrom_format.h>
/* Application-specific. */
#include <bounce_template.h>
#include <bounce_service.h>
/*
* The following tables implement support for bounce template expansions of
@ -332,7 +338,7 @@ static void bounce_template_parse_buffer(BOUNCE_TEMPLATE *tp)
if (strcasecmp("charset", cp) == 0) {
tp->mime_charset = hval;
} else if (strcasecmp("from", cp) == 0) {
tp->from = hval;
tp->std_from = tp->obs_from = hval;
} else if (strcasecmp("subject", cp) == 0) {
tp->subject = hval;
} else if (strcasecmp("postmaster-subject", cp) == 0) {
@ -489,7 +495,8 @@ void bounce_template_headers(BOUNCE_XP_PRN_FN out_fn, VSTREAM *fp,
if (tp->flags & BOUNCE_TMPL_FLAG_NEW_BUFFER)
bounce_template_parse_buffer(tp);
out_fn(fp, "From: %s", tp->from);
out_fn(fp, "From: %s", bounce_hfrom_format == HFROM_FORMAT_CODE_STD ?
tp->std_from : tp->obs_from);
out_fn(fp, "Subject: %s", tp->postmaster_subject && postmaster_copy ?
tp->postmaster_subject : tp->subject);
out_fn(fp, "To: %s", rcpt);
@ -531,7 +538,8 @@ void bounce_template_dump(VSTREAM *fp, BOUNCE_TEMPLATE *tp)
bounce_template_parse_buffer(tp);
vstream_fprintf(fp, "Charset: %s\n", tp->mime_charset);
vstream_fprintf(fp, "From: %s\n", tp->from);
vstream_fprintf(fp, "From: %s\n", bounce_hfrom_format == HFROM_FORMAT_CODE_STD ?
tp->std_from : tp->obs_from);
vstream_fprintf(fp, "Subject: %s\n", tp->subject);
if (tp->postmaster_subject)
vstream_fprintf(fp, "Postmaster-Subject: %s\n",

View File

@ -1,4 +1,4 @@
/* $NetBSD: bounce_template.h,v 1.2 2017/02/14 01:16:44 christos Exp $ */
/* $NetBSD: bounce_template.h,v 1.3 2022/10/08 16:12:45 christos Exp $ */
#ifndef _BOUNCE_TEMPLATE_H_INCLUDED_
#define _BOUNCE_TEMPLATE_H_INCLUDED_
@ -29,7 +29,8 @@ typedef struct BOUNCE_TEMPLATE {
const char *origin; /* built-in or pathname */
const char *mime_charset; /* character set (configurable) */
const char *mime_encoding; /* 7bit or 8bit (derived) */
const char *from; /* originator (configurable) */
const char *obs_from; /* originator (configurable) */
const char *std_from; /* originator (configurable) */
const char *subject; /* general subject (configurable) */
const char *postmaster_subject; /* postmaster subject (configurable) */
const char **message_text; /* message text (configurable) */
@ -47,7 +48,6 @@ typedef struct BOUNCE_TEMPLATE {
#define IS_FAILURE_TEMPLATE(t) ((t)->class[0] == BOUNCE_TMPL_CLASS_FAILURE[0])
#define IS_DELAY_TEMPLATE(t) ((t)->class[0] == BOUNCE_TMPL_CLASS_DELAY[0])
#define IS_SUCCESS_TEMPLATE(t) ((t)->class[0] == BOUNCE_TMPL_CLASS_SUCCESS[0])
#define IS_VERIFY_TEMPLATE(t) ((t)->class[0] == BOUNCE_TMPL_CLASS_verify[0])
#define bounce_template_encoding(t) ((t)->mime_encoding)
#define bounce_template_charset(t) ((t)->mime_charset)
@ -91,6 +91,11 @@ void bounce_templates_dump(VSTREAM *, BOUNCE_TEMPLATES *);
/* IBM T.J. Watson Research
/* P.O. Box 704
/* Yorktown Heights, NY 10598, USA
/*
/* Wietse Venema
/* Google, Inc.
/* 111 8th Avenue
/* New York, NY 10011, USA
/*--*/
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: bounce_templates.c,v 1.2 2017/02/14 01:16:44 christos Exp $ */
/* $NetBSD: bounce_templates.c,v 1.3 2022/10/08 16:12:45 christos Exp $ */
/*++
/* NAME
@ -65,6 +65,11 @@
/* IBM T.J. Watson Research
/* P.O. Box 704
/* Yorktown Heights, NY 10598, USA
/*
/* Wietse Venema
/* Google, Inc.
/* 111 8th Avenue
/* New York, NY 10011, USA
/*--*/
/* System library. */
@ -116,6 +121,7 @@ static const BOUNCE_TEMPLATE def_bounce_failure_template = {
"us-ascii",
MAIL_ATTR_ENC_7BIT,
MAIL_ADDR_MAIL_DAEMON " (Mail Delivery System)",
"Mail Delivery System <" MAIL_ADDR_MAIL_DAEMON ">",
"Undelivered Mail Returned to Sender",
"Postmaster Copy: Undelivered Mail",
def_bounce_failure_body,
@ -132,8 +138,7 @@ static const char *def_bounce_delay_body[] = {
"# THIS IS A WARNING ONLY. YOU DO NOT NEED TO RESEND YOUR MESSAGE. #",
"####################################################################",
"",
"Your message could not be delivered for more than $delay_warning_time_hours hour(s)."
,
"Your message could not be delivered for more than $delay_warning_time_hours hour(s).",
"It will be retried until it is $maximal_queue_lifetime_days day(s) old.",
"",
"For further assistance, please send mail to " MAIL_ADDR_POSTMASTER ".",
@ -152,6 +157,7 @@ static const BOUNCE_TEMPLATE def_bounce_delay_template = {
"us-ascii",
MAIL_ATTR_ENC_7BIT,
MAIL_ADDR_MAIL_DAEMON " (Mail Delivery System)",
"Mail Delivery System <" MAIL_ADDR_MAIL_DAEMON ">",
"Delayed Mail (still being retried)",
"Postmaster Warning: Delayed Mail",
def_bounce_delay_body,
@ -181,6 +187,7 @@ static const BOUNCE_TEMPLATE def_bounce_success_template = {
"us-ascii",
MAIL_ATTR_ENC_7BIT,
MAIL_ADDR_MAIL_DAEMON " (Mail Delivery System)",
"Mail Delivery System <" MAIL_ADDR_MAIL_DAEMON ">",
"Successful Mail Delivery Report",
0,
def_bounce_success_body,
@ -207,6 +214,7 @@ static const BOUNCE_TEMPLATE def_bounce_verify_template = {
"us-ascii",
MAIL_ATTR_ENC_7BIT,
MAIL_ADDR_MAIL_DAEMON " (Mail Delivery System)",
"Mail Delivery System <" MAIL_ADDR_MAIL_DAEMON ">",
"Mail Delivery Status Report",
0,
def_bounce_verify_body,

View File

@ -1,4 +1,4 @@
/* $NetBSD: cleanup.c,v 1.7 2020/03/18 19:05:15 christos Exp $ */
/* $NetBSD: cleanup.c,v 1.8 2022/10/08 16:12:45 christos Exp $ */
/*++
/* NAME
@ -12,38 +12,55 @@
/* into the \fBincoming\fR mail queue, and informs the queue
/* manager of its arrival.
/*
/* The \fBcleanup\fR(8) daemon always performs the following transformations:
/* The \fBcleanup\fR(8) daemon performs the following transformations:
/* .IP \(bu
/* Insert missing message headers: (\fBResent-\fR) \fBFrom:\fR,
/* \fBTo:\fR, \fBMessage-Id:\fR, and \fBDate:\fR.
/* .br
/* This is enabled with the \fBlocal_header_rewrite_clients\fR and
/* \fBalways_add_missing_headers\fR parameter settings.
/* .IP \(bu
/* Transform envelope and header addresses to the standard
/* \fIuser@fully-qualified-domain\fR form that is expected by other
/* Postfix programs.
/* This task is delegated to the \fBtrivial-rewrite\fR(8) daemon.
/* This task depends on the \fBtrivial-rewrite\fR(8) daemon.
/* .br
/* The header transformation is enabled with the
/* \fBlocal_header_rewrite_clients\fR parameter setting.
/* .IP \(bu
/* Eliminate duplicate envelope recipient addresses.
/* .br
/* This is enabled with the \fBduplicate_filter_limit\fR
/* parameter setting.
/* .IP \(bu
/* Remove message headers: \fBBcc\fR, \fBContent-Length\fR,
/* \fBResent-Bcc\fR, \fBReturn-Path\fR.
/* .PP
/* The following address transformations are optional:
/* .br
/* This is enabled with the message_drop_headers parameter
/* setting.
/* .IP \(bu
/* Optionally, rewrite all envelope and header addresses according
/* to the mappings specified in the \fBcanonical\fR(5) lookup tables.
/* .br
/* The header transformation is enabled with the
/* \fBlocal_header_rewrite_clients\fR parameter setting.
/* .IP \(bu
/* Optionally, masquerade envelope sender addresses and message
/* header addresses (i.e. strip host or domain information below
/* all domains listed in the \fBmasquerade_domains\fR parameter,
/* except for user names listed in \fBmasquerade_exceptions\fR).
/* By default, address masquerading does not affect envelope recipients.
/* .br
/* The header transformation is enabled with the
/* \fBlocal_header_rewrite_clients\fR parameter setting.
/* .IP \(bu
/* Optionally, expand envelope recipients according to information
/* found in the \fBvirtual\fR(5) lookup tables.
/* found in the \fBvirtual_alias_maps\fR lookup tables.
/* .PP
/* The \fBcleanup\fR(8) daemon performs sanity checks on the content of
/* each message. When it finds a problem, by default it returns a
/* diagnostic status to the client, and leaves it up to the client
/* diagnostic status to the cleanup service client, and leaves
/* it up to the client
/* to deal with the problem. Alternatively, the client can request
/* the \fBcleanup\fR(8) daemon to bounce the message back to the sender
/* in case of trouble.
@ -99,6 +116,8 @@
/* .IP "\fBmessage_drop_headers (bcc, content-length, resent-bcc, return-path)\fR"
/* Names of message headers that the \fBcleanup\fR(8) daemon will remove
/* after applying \fBheader_checks\fR(5) and before invoking Milter applications.
/* .IP "\fBheader_from_format (standard)\fR"
/* The format of the Postfix-generated \fBFrom:\fR header.
/* BUILT-IN CONTENT FILTERING CONTROLS
/* .ad
/* .fi
@ -146,8 +165,9 @@
/* for communication with a Milter application; prior to Postfix 2.6
/* the default protocol is 2.
/* .IP "\fBmilter_default_action (tempfail)\fR"
/* The default action when a Milter (mail filter) application is
/* unavailable or mis-configured.
/* The default action when a Milter (mail filter) response is
/* unavailable (for example, bad Postfix configuration or Milter
/* failure).
/* .IP "\fBmilter_macro_daemon_name ($myhostname)\fR"
/* The {daemon_name} macro value for Milter (mail filter) applications.
/* .IP "\fBmilter_macro_v ($mail_name $mail_version)\fR"
@ -505,6 +525,7 @@ static void cleanup_service(VSTREAM *src, char *unused_service, char **argv)
* about the whole operation.
*/
attr_print(src, ATTR_FLAG_NONE,
SEND_ATTR_STR(MAIL_ATTR_PROTO, MAIL_ATTR_PROTO_CLEANUP),
SEND_ATTR_STR(MAIL_ATTR_QUEUEID, state->queue_id),
ATTR_TYPE_END);
if (attr_scan(src, ATTR_FLAG_STRICT,

View File

@ -1,4 +1,4 @@
/* $NetBSD: cleanup.h,v 1.9 2020/03/18 19:05:15 christos Exp $ */
/* $NetBSD: cleanup.h,v 1.10 2022/10/08 16:12:45 christos Exp $ */
/*++
/* NAME
@ -119,8 +119,6 @@ typedef struct CLEANUP_STATE {
VSTRING *milter_ext_from; /* externalized sender */
VSTRING *milter_ext_rcpt; /* externalized recipient */
VSTRING *milter_err_text; /* milter call-back reply */
HBC_CHECKS *milter_hbc_checks; /* Milter header checks */
VSTRING *milter_hbc_reply; /* Milter header checks reply */
VSTRING *milter_dsn_buf; /* Milter DSN parsing buffer */
/*
@ -320,6 +318,7 @@ extern int cleanup_bounce(CLEANUP_STATE *);
/*
* cleanup_milter.c.
*/
extern void cleanup_milter_header_checks_init(void);
extern void cleanup_milter_receive(CLEANUP_STATE *, int);
extern void cleanup_milter_inspect(CLEANUP_STATE *, MILTERS *);
extern void cleanup_milter_emul_mail(CLEANUP_STATE *, MILTERS *, const char *);
@ -354,9 +353,7 @@ extern void cleanup_body_edit_free(CLEANUP_STATE *);
/*
* From: header formatting.
*/
#define HFROM_FORMAT_CODE_STD 0
#define HFROM_FORMAT_CODE_OBS 1
extern int hfrom_format_code;
extern int cleanup_hfrom_format;
/* LICENSE
/* .ad

View File

@ -1,4 +1,4 @@
/* $NetBSD: cleanup_api.c,v 1.3 2020/03/18 19:05:15 christos Exp $ */
/* $NetBSD: cleanup_api.c,v 1.4 2022/10/08 16:12:45 christos Exp $ */
/*++
/* NAME
@ -263,7 +263,7 @@ int cleanup_flush(CLEANUP_STATE *state)
* (mail submitted with the Postfix sendmail command, mail forwarded by
* the local(8) delivery agent, or mail re-queued with "postsuper -r"),
* send a bounce notification, reset the error flags in case of success,
* and request deletion of the the incoming queue file and of the
* and request deletion of the incoming queue file and of the
* optional DSN SUCCESS records from virtual alias expansion.
*
* XXX It would make no sense to knowingly report success after we already

View File

@ -1,4 +1,4 @@
/* $NetBSD: cleanup_body_edit.c,v 1.2 2020/03/18 19:05:15 christos Exp $ */
/* $NetBSD: cleanup_body_edit.c,v 1.3 2022/10/08 16:12:45 christos Exp $ */
/*++
/* NAME
@ -209,9 +209,16 @@ int cleanup_body_edit_write(CLEANUP_STATE *state, int rec_type,
/*
* Finally, output the queue file record.
*/
CLEANUP_OUT_BUF(state, REC_TYPE_NORM, buf);
CLEANUP_OUT_BUF(state, rec_type, buf);
curr_rp->write_offs = vstream_ftell(state->dst);
/*
* Sanity check.
*/
if (curr_rp->len > 0
&& curr_rp->write_offs > curr_rp->start + curr_rp->len)
msg_panic("%s: write past end of body segment", myname);
return (0);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: cleanup_init.c,v 1.6 2020/03/18 19:05:15 christos Exp $ */
/* $NetBSD: cleanup_init.c,v 1.7 2022/10/08 16:12:45 christos Exp $ */
/*++
/* NAME
@ -104,6 +104,7 @@
#include <mail_version.h> /* milter_macro_v */
#include <ext_prop.h>
#include <flush_clnt.h>
#include <hfrom_format.h>
/* Application-specific. */
@ -287,7 +288,7 @@ MILTERS *cleanup_milters;
/*
* From: header format.
*/
int hfrom_format_code;
int cleanup_hfrom_format;
/* cleanup_all - callback for the runtime error handler */
@ -431,6 +432,8 @@ void cleanup_pre_jail(char *unused_name, char **unused_argv)
var_milt_eod_macros,
var_milt_unk_macros,
var_milt_macro_deflts);
if (*var_milt_head_checks)
cleanup_milter_header_checks_init();
flush_init();
}
@ -439,11 +442,6 @@ void cleanup_pre_jail(char *unused_name, char **unused_argv)
void cleanup_post_jail(char *unused_name, char **unused_argv)
{
static const NAME_CODE hfrom_format_table[] = {
HFROM_FORMAT_NAME_STD, HFROM_FORMAT_CODE_STD,
HFROM_FORMAT_NAME_OBS, HFROM_FORMAT_CODE_OBS,
0, -1,
};
/*
* Optionally set the file size resource limit. XXX This limits the
@ -477,8 +475,5 @@ void cleanup_post_jail(char *unused_name, char **unused_argv)
/*
* From: header formatting.
*/
if ((hfrom_format_code = name_code(hfrom_format_table,
NAME_CODE_FLAG_NONE, var_hfrom_format)) < 0)
msg_fatal("invalid setting: %s = %s",
VAR_HFROM_FORMAT, var_hfrom_format);
cleanup_hfrom_format = hfrom_format_parse(VAR_HFROM_FORMAT, var_hfrom_format);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: cleanup_message.c,v 1.3 2020/03/18 19:05:15 christos Exp $ */
/* $NetBSD: cleanup_message.c,v 1.4 2022/10/08 16:12:45 christos Exp $ */
/*++
/* NAME
@ -91,6 +91,7 @@
#include <dsn_util.h>
#include <conv_time.h>
#include <info_log_addr_form.h>
#include <hfrom_format.h>
/* Application-specific. */
@ -682,7 +683,7 @@ static void cleanup_header_done_callback(void *context)
/*
* Future proofing: the Milter client's header suppression algorithm
* assumes that the MTA prepends its own Received: header. This
* assupmtion may be violated after some source-code update. The
* assumption may be violated after some source-code update. The
* following check ensures consistency, at least for local submission.
*/
if (state->hop_count < 1) {
@ -762,13 +763,11 @@ static void cleanup_header_done_callback(void *context)
|| (cp = strchr(state->fullname, '\n')) != 0)
*cp = ' ';
switch (hfrom_format_code) {
/*
* "From: phrase <route-addr>". Quote the phrase if it
* contains specials or the "%!" legacy address operators.
*/
case HFROM_FORMAT_CODE_STD:
/*
* "From: phrase <route-addr>". Quote the phrase if it contains
* specials or the "%!" legacy address operators.
*/
if (cleanup_hfrom_format == HFROM_FORMAT_CODE_STD) {
vstring_sprintf(state->temp2, "%sFrom: ", state->resent);
if (state->fullname[strcspn(state->fullname,
"%!" LEX_822_SPECIALS)] == 0) {
@ -778,26 +777,25 @@ static void cleanup_header_done_callback(void *context)
} else {
token = tok822_alloc(TOK822_QSTRING, state->fullname);
}
tok822_externalize(state->temp2, token, TOK822_STR_NONE);
tok822_free(token);
vstring_sprintf_append(state->temp2, " <%s>",
if (token) {
tok822_externalize(state->temp2, token, TOK822_STR_NONE);
tok822_free(token);
vstring_strcat(state->temp2, " ");
}
vstring_sprintf_append(state->temp2, "<%s>",
vstring_str(state->temp1));
break;
}
/*
* "From: addr-spec (ctext)". This is the obsolete form.
*/
case HFROM_FORMAT_CODE_OBS:
/*
* "From: addr-spec (ctext)". This is the obsolete form.
*/
else {
vstring_sprintf(state->temp2, "%sFrom: %s ",
state->resent, vstring_str(state->temp1));
vstring_sprintf(state->temp1, "(%s)", state->fullname);
token = tok822_parse(vstring_str(state->temp1));
tok822_externalize(state->temp2, token, TOK822_STR_NONE);
tok822_free_tree(token);
break;
default:
msg_panic("%s: unknown header format %d",
myname, hfrom_format_code);
}
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: cleanup_milter.c,v 1.3 2020/03/18 19:05:15 christos Exp $ */
/* $NetBSD: cleanup_milter.c,v 1.4 2022/10/08 16:12:45 christos Exp $ */
/*++
/* NAME
@ -8,6 +8,8 @@
/* SYNOPSIS
/* #include <cleanup.h>
/*
/* void cleanup_milter_header_checks_init(void)
/*
/* void cleanup_milter_receive(state, count)
/* CLEANUP_STATE *state;
/* int count;
@ -34,6 +36,9 @@
/* filter (milter) applications, including in-place queue file
/* modification.
/*
/* cleanup_milter_header_checks_init() does pre-jail
/* initializations.
/*
/* cleanup_milter_receive() receives mail filter definitions,
/* typically from an smtpd(8) server process, and registers
/* local call-back functions for macro expansion and for queue
@ -224,6 +229,8 @@
/*#define msg_verbose 2*/
static HBC_CHECKS *cleanup_milter_hbc_checks;
static VSTRING *cleanup_milter_hbc_reply;
static void cleanup_milter_set_error(CLEANUP_STATE *, int);
static const char *cleanup_add_rcpt_par(void *, const char *, const char *);
@ -347,9 +354,9 @@ static char *cleanup_milter_hbc_extend(void *context, const char *command,
state->errs |= CLEANUP_STAT_CONT;
state->flags &= ~CLEANUP_FLAG_FILTER_ALL;
cleanup_milter_hbc_log(context, "reject", where, buf, state->reason);
vstring_sprintf(state->milter_hbc_reply, "%d %s",
vstring_sprintf(cleanup_milter_hbc_reply, "%d %s",
detail->smtp, state->reason);
STR(state->milter_hbc_reply)[0] = *state->reason;
STR(cleanup_milter_hbc_reply)[0] = *state->reason;
return ((char *) buf);
}
if (STREQUAL(command, "FILTER", cmd_len)) {
@ -370,7 +377,7 @@ static char *cleanup_milter_hbc_extend(void *context, const char *command,
}
if (STREQUAL(command, "DISCARD", cmd_len)) {
cleanup_milter_hbc_log(context, "discard", where, buf, optional_text);
vstring_strcpy(state->milter_hbc_reply, "D");
vstring_strcpy(cleanup_milter_hbc_reply, "D");
state->flags |= CLEANUP_FLAG_DISCARD;
state->flags &= ~CLEANUP_FLAG_FILTER_ALL;
return ((char *) buf);
@ -411,7 +418,7 @@ static int cleanup_milter_header_checks(CLEANUP_STATE *state, VSTRING *buf)
* end-of-message stage, therefore all the header operations are relative
* to the primary message header.
*/
ret = hbc_header_checks((void *) state, state->milter_hbc_checks,
ret = hbc_header_checks((void *) state, cleanup_milter_hbc_checks,
MIME_HDR_PRIMARY, (HEADER_OPTS *) 0,
buf, (off_t) 0);
if (ret == 0) {
@ -506,8 +513,10 @@ static void cleanup_milter_hbc_add_meta_records(CLEANUP_STATE *state)
/* cleanup_milter_header_checks_init - initialize post-Milter header checks */
static void cleanup_milter_header_checks_init(CLEANUP_STATE *state)
void cleanup_milter_header_checks_init(void)
{
static const char myname[] = "cleanup_milter_header_checks_init";
#define NO_NESTED_HDR_NAME ""
#define NO_NESTED_HDR_VALUE ""
#define NO_MIME_HDR_NAME ""
@ -519,30 +528,60 @@ static void cleanup_milter_header_checks_init(CLEANUP_STATE *state)
cleanup_milter_hbc_extend,
};
state->milter_hbc_checks =
if (*var_milt_head_checks == 0)
msg_panic("%s: %s is empty", myname, VAR_MILT_HEAD_CHECKS);
if (cleanup_milter_hbc_checks)
msg_panic("%s: cleanup_milter_hbc_checks is not null", myname);
cleanup_milter_hbc_checks =
hbc_header_checks_create(VAR_MILT_HEAD_CHECKS, var_milt_head_checks,
NO_MIME_HDR_NAME, NO_MIME_HDR_VALUE,
NO_NESTED_HDR_NAME, NO_NESTED_HDR_VALUE,
&call_backs);
state->milter_hbc_reply = vstring_alloc(100);
if (cleanup_milter_hbc_reply)
msg_panic("%s: cleanup_milter_hbc_reply is not null", myname);
cleanup_milter_hbc_reply = vstring_alloc(100);
}
#ifdef TEST
/* cleanup_milter_header_checks_deinit - undo cleanup_milter_header_checks_init */
static void cleanup_milter_header_checks_deinit(void)
{
static const char myname[] = "cleanup_milter_header_checks_deinit";
if (cleanup_milter_hbc_checks == 0)
msg_panic("%s: cleanup_milter_hbc_checks is null", myname);
hbc_header_checks_free(cleanup_milter_hbc_checks);
cleanup_milter_hbc_checks = 0;
if (cleanup_milter_hbc_reply == 0)
msg_panic("%s: cleanup_milter_hbc_reply is null", myname);
vstring_free(cleanup_milter_hbc_reply);
cleanup_milter_hbc_reply = 0;
}
#endif
/* cleanup_milter_header_checks_reinit - re-init post-Milter header checks */
static void cleanup_milter_header_checks_reinit(CLEANUP_STATE *state)
{
if (state->filter)
myfree(state->filter);
state->filter = 0;
if (state->redirect)
myfree(state->redirect);
state->redirect = 0;
VSTRING_RESET(cleanup_milter_hbc_reply);
}
/* cleanup_milter_hbc_finish - finalize post-Milter header checks */
static void cleanup_milter_hbc_finish(CLEANUP_STATE *state)
{
if (state->milter_hbc_checks)
hbc_header_checks_free(state->milter_hbc_checks);
state->milter_hbc_checks = 0;
if (state->milter_hbc_reply)
vstring_free(state->milter_hbc_reply);
state->milter_hbc_reply = 0;
if (CLEANUP_OUT_OK(state)
&& !CLEANUP_MILTER_REJECTING_OR_DISCARDING_MESSAGE(state)
&& (state->filter || state->redirect))
@ -646,7 +685,7 @@ static const char *cleanup_add_header(void *context, const char *name,
*/
buf = vstring_alloc(100);
vstring_sprintf(buf, "%s:%s%s", name, space, value);
if (state->milter_hbc_checks) {
if (cleanup_milter_hbc_checks) {
if (cleanup_milter_header_checks(state, buf) == 0
|| (state->flags & CLEANUP_FLAG_DISCARD)) {
vstring_free(buf);
@ -709,8 +748,8 @@ static const char *cleanup_add_header(void *context, const char *name,
* In case of error while doing record output.
*/
return (CLEANUP_OUT_OK(state) == 0 ? cleanup_milter_error(state, 0) :
state->milter_hbc_reply && LEN(state->milter_hbc_reply) ?
STR(state->milter_hbc_reply) : 0);
cleanup_milter_hbc_reply && LEN(cleanup_milter_hbc_reply) ?
STR(cleanup_milter_hbc_reply) : 0);
/*
* Note: state->append_hdr_pt_target never changes.
@ -1034,7 +1073,7 @@ static const char *cleanup_patch_header(CLEANUP_STATE *state,
* be dropped.
*/
vstring_sprintf(buf, "%s:%s%s", new_hdr_name, hdr_space, new_hdr_value);
if (state->milter_hbc_checks
if (cleanup_milter_hbc_checks
&& cleanup_milter_header_checks(state, buf) == 0)
CLEANUP_PATCH_HEADER_RETURN(0);
@ -1103,8 +1142,8 @@ static const char *cleanup_patch_header(CLEANUP_STATE *state,
*/
CLEANUP_PATCH_HEADER_RETURN(
CLEANUP_OUT_OK(state) == 0 ? cleanup_milter_error(state, 0) :
state->milter_hbc_reply && LEN(state->milter_hbc_reply) ?
STR(state->milter_hbc_reply) : 0);
cleanup_milter_hbc_reply && LEN(cleanup_milter_hbc_reply) ?
STR(cleanup_milter_hbc_reply) : 0);
/*
* Note: state->append_hdr_pt_target never changes.
@ -1805,6 +1844,11 @@ static const char *cleanup_del_rcpt(void *context, const char *ext_rcpt)
}
count++;
}
if (var_enable_orcpt)
/* Matches been_here() call in cleanup_out_recipient(). */
been_here_drop(state->dups, "%s\n%d\n%s\n%s",
dsn_orcpt ? dsn_orcpt : "", dsn_notify,
orig_rcpt ? orig_rcpt : "", STR(int_rcpt_buf));
/* FALLTHROUGH */
case REC_TYPE_DRCP: /* canceled recipient */
case REC_TYPE_DONE: /* can't happen */
@ -1820,6 +1864,9 @@ static const char *cleanup_del_rcpt(void *context, const char *ext_rcpt)
break;
}
}
/* Matches been_here_fixed() call in cleanup_out_recipient(). */
if (var_enable_orcpt == 0 && count > 0)
been_here_drop_fixed(state->dups, STR(int_rcpt_buf));
if (msg_verbose)
msg_info("%s: deleted %d records for recipient \"%s\"",
@ -1830,7 +1877,8 @@ static const char *cleanup_del_rcpt(void *context, const char *ext_rcpt)
/* cleanup_repl_body - replace message body */
static const char *cleanup_repl_body(void *context, int cmd, VSTRING *buf)
static const char *cleanup_repl_body(void *context, int cmd, int rec_type,
VSTRING *buf)
{
const char *myname = "cleanup_repl_body";
CLEANUP_STATE *state = (CLEANUP_STATE *) context;
@ -1842,7 +1890,7 @@ static const char *cleanup_repl_body(void *context, int cmd, VSTRING *buf)
*/
switch (cmd) {
case MILTER_BODY_LINE:
if (cleanup_body_edit_write(state, REC_TYPE_NORM, buf) < 0)
if (cleanup_body_edit_write(state, rec_type, buf) < 0)
return (cleanup_milter_error(state, errno));
break;
case MILTER_BODY_START:
@ -1977,8 +2025,8 @@ static const char *cleanup_milter_apply(CLEANUP_STATE *state, const char *event,
* Don't process our own milter_header/body checks replies. See comments
* in cleanup_milter_hbc_extend().
*/
if (state->milter_hbc_reply &&
strcmp(resp, STR(state->milter_hbc_reply)) == 0)
if (cleanup_milter_hbc_reply &&
strcmp(resp, STR(cleanup_milter_hbc_reply)) == 0)
return (0);
/*
@ -2079,7 +2127,7 @@ static const char *cleanup_milter_apply(CLEANUP_STATE *state, const char *event,
static void cleanup_milter_client_init(CLEANUP_STATE *state)
{
static INET_PROTO_INFO *proto_info;
static const INET_PROTO_INFO *proto_info;
const char *proto_attr;
/*
@ -2144,7 +2192,7 @@ void cleanup_milter_inspect(CLEANUP_STATE *state, MILTERS *milters)
* Prologue: prepare for Milter header/body checks.
*/
if (*var_milt_head_checks)
cleanup_milter_header_checks_init(state);
cleanup_milter_header_checks_reinit(state);
/*
* Process mail filter replies. The reply format is verified by the mail
@ -2541,6 +2589,16 @@ int main(int unused_argc, char **argv)
} else {
msg_warn("bad verbose argument");
}
} else if (strcmp(argv->argv[0], "line_length_limit") == 0) {
if (argv->argc != 2) {
msg_warn("bad line_length_limit argument count: %ld",
(long) argv->argc);
} else if (alldig(argv->argv[1]) == 0) {
msg_warn("bad line_length_limit argument count: %ld",
(long) argv->argc);
} else if ((var_line_limit = atoi(argv->argv[1])) < DEF_LINE_LIMIT) {
msg_warn("bad line_length_limit argument");
}
} else if (strcmp(argv->argv[0], "open") == 0) {
if (state->dst != 0) {
msg_info("closing %s", VSTREAM_PATH(state->dst));
@ -2551,6 +2609,18 @@ int main(int unused_argc, char **argv)
} else {
open_queue_file(state, argv->argv[1]);
}
} else if (strcmp(argv->argv[0], "enable_original_recipient") == 0) {
if (argv->argc == 1) {
msg_info("enable_original_recipient: %d", var_enable_orcpt);
} else if (argv->argc != 2) {
msg_warn("bad enable_original_recipient argument count: %ld",
(long) argv->argc);
} else if (!alldig(argv->argv[1])) {
msg_warn("non-numeric enable_original_recipient argument: %s",
argv->argv[1]);
} else {
var_enable_orcpt = atoi(argv->argv[1]);
}
} else if (state->dst == 0) {
msg_warn("no open queue file");
} else if (strcmp(argv->argv[0], "close") == 0) {
@ -2558,9 +2628,10 @@ int main(int unused_argc, char **argv)
cleanup_milter_hbc_finish(state);
myfree(var_milt_head_checks);
var_milt_head_checks = "";
cleanup_milter_header_checks_deinit();
}
close_queue_file(state);
} else if (state->milter_hbc_reply && LEN(state->milter_hbc_reply)) {
} else if (cleanup_milter_hbc_reply && LEN(cleanup_milter_hbc_reply)) {
/* Postfix libmilter would skip further requests. */
msg_info("ignoring: %s %s %s", argv->argv[0],
argv->argc > 1 ? argv->argv[1] : "",
@ -2646,10 +2717,13 @@ int main(int unused_argc, char **argv)
msg_warn("open %s file: %m", argv->argv[1]);
} else {
buf = vstring_alloc(100);
cleanup_repl_body(state, MILTER_BODY_START, buf);
cleanup_repl_body(state, MILTER_BODY_START,
REC_TYPE_NORM, buf);
while (vstring_get_nonl(buf, fp) != VSTREAM_EOF)
cleanup_repl_body(state, MILTER_BODY_LINE, buf);
cleanup_repl_body(state, MILTER_BODY_END, buf);
cleanup_repl_body(state, MILTER_BODY_LINE,
REC_TYPE_NORM, buf);
cleanup_repl_body(state, MILTER_BODY_END,
REC_TYPE_NORM, buf);
vstring_free(buf);
vstream_fclose(fp);
}
@ -2662,7 +2736,7 @@ int main(int unused_argc, char **argv)
msg_warn("can't change header checks");
} else {
var_milt_head_checks = mystrdup(argv->argv[1]);
cleanup_milter_header_checks_init(state);
cleanup_milter_header_checks_init();
}
} else if (strcmp(argv->argv[0], "sender_bcc_maps") == 0) {
if (argv->argc != 2) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: cleanup_out.c,v 1.2 2017/02/14 01:16:44 christos Exp $ */
/* $NetBSD: cleanup_out.c,v 1.3 2022/10/08 16:12:45 christos Exp $ */
/*++
/* NAME
@ -66,6 +66,11 @@
/* IBM T.J. Watson Research
/* P.O. Box 704
/* Yorktown Heights, NY 10598, USA
/*
/* Wietse Venema
/* Google, Inc.
/* 111 8th Avenue
/* New York, NY 10011, USA
/*--*/
/* System library. */
@ -120,6 +125,9 @@ void cleanup_out(CLEANUP_STATE *state, int type, const char *string, ssize_t
#define TEXT_RECORD(t) ((t) == REC_TYPE_NORM || (t) == REC_TYPE_CONT)
if (msg_verbose && !TEXT_RECORD(type))
msg_info("cleanup_out: %c %.*s", type, (int) len, string);
if (var_line_limit <= 0)
msg_panic("cleanup_out: bad line length limit: %d", var_line_limit);
do {

View File

@ -1,4 +1,4 @@
/* $NetBSD: cleanup_out_recipient.c,v 1.3 2020/03/18 19:05:15 christos Exp $ */
/* $NetBSD: cleanup_out_recipient.c,v 1.4 2022/10/08 16:12:45 christos Exp $ */
/*++
/* NAME
@ -157,6 +157,7 @@ void cleanup_out_recipient(CLEANUP_STATE *state,
if ((state->flags & CLEANUP_FLAG_MAP_OK) == 0
|| cleanup_virt_alias_maps == 0) {
/* Matches been_here_drop{,_fixed}() calls cleanup_del_rcpt(). */
if ((var_enable_orcpt ?
been_here(state->dups, "%s\n%d\n%s\n%s",
dsn_orcpt, dsn_notify, orcpt, recip) :

View File

@ -1,4 +1,4 @@
/* $NetBSD: cleanup_state.c,v 1.3 2020/03/18 19:05:15 christos Exp $ */
/* $NetBSD: cleanup_state.c,v 1.4 2022/10/08 16:12:45 christos Exp $ */
/*++
/* NAME
@ -109,8 +109,6 @@ CLEANUP_STATE *cleanup_state_alloc(VSTREAM *src)
state->append_hdr_pt_target = -1;
state->append_meta_pt_offset = -1;
state->append_meta_pt_target = -1;
state->milter_hbc_checks = 0;
state->milter_hbc_reply = 0;
state->rcpt_count = 0;
state->reason = 0;
state->smtp_reply = 0;

View File

@ -1,4 +1,4 @@
/* $NetBSD: dns.h,v 1.4 2020/05/25 23:47:13 christos Exp $ */
/* $NetBSD: dns.h,v 1.5 2022/10/08 16:12:45 christos Exp $ */
#ifndef _DNS_H_INCLUDED_
#define _DNS_H_INCLUDED_
@ -54,6 +54,17 @@
(cp) += 4; \
}
#endif
/*
* Provide API compatibility for systems without res_nxxx() API. Also
* require calling dns_get_h_errno() instead of directly accessing the
* global h_errno variable. We should not count on that being updated.
*/
#if !defined(NO_RES_NCALLS) && defined(__RES) && (__RES >= 19991006)
#define USE_RES_NCALLS
#undef h_errno
#define h_errno use_dns_get_h_errno_instead_of_h_errno
#endif
/*
@ -231,6 +242,7 @@ extern int dns_lookup_rl(const char *, unsigned, DNS_RR **, VSTRING *,
VSTRING *, int *, int,...);
extern int dns_lookup_rv(const char *, unsigned, DNS_RR **, VSTRING *,
VSTRING *, int *, int, unsigned *);
extern int dns_get_h_errno(void);
#define dns_lookup(name, type, rflags, list, fqdn, why) \
dns_lookup_x((name), (type), (rflags), (list), (fqdn), (why), (int *) 0, \
@ -246,7 +258,12 @@ extern int dns_lookup_rv(const char *, unsigned, DNS_RR **, VSTRING *,
(lflags), (ltype))
/*
* Request flags.
* The dns_lookup() rflag that requests DNSSEC validation.
*/
#define DNS_WANT_DNSSEC_VALIDATION(rflags) ((rflags) & RES_USE_DNSSEC)
/*
* lflags.
*/
#define DNS_REQ_FLAG_STOP_OK (1<<0)
#define DNS_REQ_FLAG_STOP_INVAL (1<<1)
@ -311,6 +328,18 @@ extern int dns_rr_filter_execute(DNS_RR **);
*/
const char *dns_str_resflags(unsigned long);
/*
* dns_sec.c.
*/
#define DNS_SEC_FLAG_AVAILABLE (1<<0) /* got some DNSSEC validated reply */
#define DNS_SEC_FLAG_DONT_PROBE (1<<1) /* probe already sent, or disabled */
#define DNS_SEC_STATS_SET(flags) (dns_sec_stats |= (flags))
#define DNS_SEC_STATS_TEST(flags) (dns_sec_stats & (flags))
extern int dns_sec_stats; /* See DNS_SEC_FLAG_XXX above */
extern void dns_sec_probe(int);
/* LICENSE
/* .ad
/* .fi

View File

@ -1,4 +1,4 @@
/* $NetBSD: dns_lookup.c,v 1.6 2020/05/25 23:47:13 christos Exp $ */
/* $NetBSD: dns_lookup.c,v 1.7 2022/10/08 16:12:45 christos Exp $ */
/*++
/* NAME
@ -33,6 +33,8 @@
/* VSTRING *why;
/* int lflags;
/* unsigned *ltype;
/*
/* int dns_get_h_errno()
/* AUXILIARY FUNCTIONS
/* extern int var_dns_ncache_ttl_fix;
/*
@ -85,6 +87,10 @@
/* an invalid name is reported as a DNS_INVAL result, while
/* malformed replies are reported as transient errors.
/*
/* dns_get_h_errno() returns the last error. This deprecates
/* usage of the global h_errno variable. We should not rely
/* on that being updated.
/*
/* dns_lookup_l() and dns_lookup_v() allow the user to specify
/* a list of resource types.
/*
@ -173,6 +179,12 @@
/* Pointer to storage for the reply RCODE value. This gives
/* more detailed information than DNS_FAIL, DNS_RETRY, etc.
/* DIAGNOSTICS
/* If DNSSEC validation is requested but the response is not
/* DNSSEC validated, dns_lookup() will send a one-time probe
/* query as configured with the \fBdnssec_probe\fR configuration
/* parameter, and will log a warning when the probe response
/* was not DNSSEC validated.
/* .PP
/* dns_lookup() returns one of the following codes and sets the
/* \fIwhy\fR argument accordingly:
/* .IP DNS_OK
@ -284,41 +296,45 @@ typedef struct DNS_REPLY {
#define INET_ADDR_LEN 4 /* XXX */
#define INET6_ADDR_LEN 16 /* XXX */
#if __RES < 20030124
/*
* Use the threadsafe resolver API if available, not because it is theadsafe,
* but because it has more functionality.
*/
#ifdef USE_RES_NCALLS
static struct __res_state dns_res_state;
static int
res_ninit(res_state res)
{
int error;
#define DNS_RES_NINIT res_ninit
#define DNS_RES_NMKQUERY res_nmkquery
#define DNS_RES_NSEARCH res_nsearch
#define DNS_RES_NSEND res_nsend
#define DNS_GET_H_ERRNO(statp) ((statp)->res_h_errno)
if ((error = res_init()) < 0)
return error;
*res = _res;
return error;
}
static int
res_nsearch(res_state statp, const char *dname, int class, int type,
u_char *answer, int anslen)
{
return res_search(dname, class, type, answer, anslen);
}
static int
res_nmkquery(res_state statp, int op, const char *dname, int class,
int type, const u_char *data, int datalen, const u_char *newrr,
u_char *buf, int buflen)
{
return res_mkquery(op, dname, class, type, data, datalen, newrr,
buf, buflen);
}
/*
* Alias new resolver API calls to the legacy resolver API which stores
* resolver and error state in global variables.
*/
#else
#define dns_res_state _res
#define DNS_RES_NINIT(statp) res_init()
#define DNS_RES_NMKQUERY(statp, op, dname, class, type, data, datalen, \
newrr, buf, buflen) \
res_mkquery((op), (dname), (class), (type), (data), (datalen), \
(newrr), (buf), (buflen))
#define DNS_RES_NSEARCH(statp, dname, class, type, answer, anslen) \
res_search((dname), (class), (type), (answer), (anslen))
#define DNS_RES_NSEND(statp, msg, msglen, answer, anslen) \
res_send((msg), (msglen), (answer), (anslen))
#define DNS_GET_H_ERRNO(statp) (h_errno)
#endif
#ifdef USE_SET_H_ERRNO
#define DNS_SET_H_ERRNO(statp, err) (set_h_errno(err))
#else
#define DNS_SET_H_ERRNO(statp, err) (DNS_GET_H_ERRNO(statp) = (err))
#endif
/*
* To improve postscreen's whitelisting support, we need to know how long a
* To improve postscreen's allowlisting support, we need to know how long a
* DNSBL "not found" answer is valid. The 2010 implementation assumed it was
* valid for 3600 seconds. That is too long by 2015 standards.
*
@ -347,10 +363,10 @@ res_nmkquery(res_state statp, int op, const char *dname, int class,
*/
#ifdef HAVE_RES_SEND
/* dns_res_query - a res_query() clone that can return negative replies */
/* dns_neg_query - a res_query() clone that can return negative replies */
static int dns_res_query(res_state res, const char *name, int class, int type,
unsigned char *answer, int anslen)
static int dns_neg_query(const char *name, int class, int type,
unsigned char *answer, int anslen)
{
unsigned char msg_buf[MAX_DNS_QUERY_SIZE];
HEADER *reply_header = (HEADER *) answer;
@ -378,33 +394,36 @@ static int dns_res_query(res_state res, const char *name, int class, int type,
#define NO_MKQUERY_DATA_LEN ((int) 0)
#define NO_MKQUERY_NEWRR ((unsigned char *) 0)
if ((len = res_nmkquery(res, QUERY, name, class, type, NO_MKQUERY_DATA_BUF,
NO_MKQUERY_DATA_LEN, NO_MKQUERY_NEWRR, msg_buf, sizeof(msg_buf))) < 0) {
SET_H_ERRNO(NO_RECOVERY);
if ((len = DNS_RES_NMKQUERY(&dns_res_state,
QUERY, name, class, type, NO_MKQUERY_DATA_BUF,
NO_MKQUERY_DATA_LEN, NO_MKQUERY_NEWRR,
msg_buf, sizeof(msg_buf))) < 0) {
DNS_SET_H_ERRNO(&dns_res_state, NO_RECOVERY);
if (msg_verbose)
msg_info("res_mkquery() failed");
msg_info("res_nmkquery() failed");
return (len);
} else if ((len = res_nsend(res, msg_buf, len, answer, anslen)) < 0) {
SET_H_ERRNO(TRY_AGAIN);
} else if ((len = DNS_RES_NSEND(&dns_res_state,
msg_buf, len, answer, anslen)) < 0) {
DNS_SET_H_ERRNO(&dns_res_state, TRY_AGAIN);
if (msg_verbose)
msg_info("res_send() failed");
msg_info("res_nsend() failed");
return (len);
} else {
switch (reply_header->rcode) {
case NXDOMAIN:
SET_H_ERRNO(HOST_NOT_FOUND);
DNS_SET_H_ERRNO(&dns_res_state, HOST_NOT_FOUND);
break;
case NOERROR:
if (reply_header->ancount != 0)
SET_H_ERRNO(0);
DNS_SET_H_ERRNO(&dns_res_state, 0);
else
SET_H_ERRNO(NO_DATA);
DNS_SET_H_ERRNO(&dns_res_state, NO_DATA);
break;
case SERVFAIL:
SET_H_ERRNO(TRY_AGAIN);
DNS_SET_H_ERRNO(&dns_res_state, TRY_AGAIN);
break;
default:
SET_H_ERRNO(NO_RECOVERY);
DNS_SET_H_ERRNO(&dns_res_state, NO_RECOVERY);
break;
}
return (len);
@ -413,10 +432,10 @@ static int dns_res_query(res_state res, const char *name, int class, int type,
#endif
/* dns_res_search - res_search() that can return negative replies */
/* dns_neg_search - res_search() that can return negative replies */
static int dns_res_search(res_state res, const char *name, int class, int type,
unsigned char *answer, int anslen, int keep_notfound)
static int dns_neg_search(const char *name, int class, int type,
unsigned char *answer, int anslen, int keep_notfound)
{
int len;
@ -438,10 +457,19 @@ static int dns_res_search(res_state res, const char *name, int class, int type,
if (keep_notfound)
/* Prepare for returning a null-padded server reply. */
memset(answer, 0, anslen);
len = res_nquery(res, name, class, type, answer, anslen);
len = DNS_RES_NSEARCH(&dns_res_state, name, class, type, answer, anslen);
/* Begin API creep workaround. */
if (len < 0 && DNS_GET_H_ERRNO(&dns_res_state) == 0) {
DNS_SET_H_ERRNO(&dns_res_state, TRY_AGAIN);
msg_warn("res_nsearch(state, \"%s\", %d, %d, %p, %d) returns %d"
" with h_errno==0 -- setting h_errno=TRY_AGAIN",
name, class, type, answer, anslen, len);
}
/* End API creep workaround. */
if (len > 0) {
SET_H_ERRNO(0);
} else if (keep_notfound && NOT_FOUND_H_ERRNO(h_errno)) {
DNS_SET_H_ERRNO(&dns_res_state, 0);
} else if (keep_notfound
&& NOT_FOUND_H_ERRNO(DNS_GET_H_ERRNO(&dns_res_state))) {
/* Expect to return a null-padded server reply. */
len = anslen;
}
@ -450,15 +478,12 @@ static int dns_res_search(res_state res, const char *name, int class, int type,
/* dns_query - query name server and pre-parse the reply */
static int dns_query(const char *name, int type, unsigned flags,
DNS_REPLY *reply, VSTRING *why, unsigned lflags)
DNS_REPLY *reply, VSTRING *why, unsigned lflags)
{
HEADER *reply_header;
int len;
unsigned long saved_options;
/* For efficiency, we are not called from multiple threads */
static struct __res_state res;
int keep_notfound = (lflags & DNS_REQ_FLAG_NCACHE_TTL);
/*
@ -472,7 +497,8 @@ static int dns_query(const char *name, int type, unsigned flags,
/*
* Initialize the name service.
*/
if ((res.options & RES_INIT) == 0 && res_ninit(&res) < 0) {
if ((dns_res_state.options & RES_INIT) == 0
&& DNS_RES_NINIT(&dns_res_state) < 0) {
if (why)
vstring_strcpy(why, "Name service initialization failure");
return (DNS_FAIL);
@ -492,7 +518,7 @@ static int dns_query(const char *name, int type, unsigned flags,
*/
#define XTRA_FLAGS (RES_USE_EDNS0 | RES_TRUSTAD)
if (flags & RES_USE_DNSSEC)
if (DNS_WANT_DNSSEC_VALIDATION(flags))
flags |= (RES_USE_EDNS0 | RES_TRUSTAD);
/*
@ -511,35 +537,47 @@ static int dns_query(const char *name, int type, unsigned flags,
*/
#define SAVE_FLAGS (USER_FLAGS | XTRA_FLAGS)
saved_options = (res.options & SAVE_FLAGS);
saved_options = (dns_res_state.options & SAVE_FLAGS);
/*
* Perform the lookup. Claim that the information cannot be found if and
* only if the name server told us so.
*/
for (;;) {
res.options &= ~saved_options;
res.options |= flags;
dns_res_state.options &= ~saved_options;
dns_res_state.options |= flags;
if (keep_notfound && var_dns_ncache_ttl_fix) {
len = dns_res_query(&res, (char *) name, C_IN, type, reply->buf,
#ifdef HAVE_RES_SEND
len = dns_neg_query((char *) name, C_IN, type, reply->buf,
reply->buf_len);
#else
var_dns_ncache_ttl_fix = 0;
msg_warn("system library does not support %s=yes"
" -- ignoring this setting", VAR_DNS_NCACHE_TTL_FIX);
len = dns_neg_search((char *) name, C_IN, type, reply->buf,
reply->buf_len, keep_notfound);
#endif
} else {
len = dns_res_search(&res, (char *) name, C_IN, type, reply->buf,
len = dns_neg_search((char *) name, C_IN, type, reply->buf,
reply->buf_len, keep_notfound);
}
res.options &= ~flags;
res.options |= saved_options;
dns_res_state.options &= ~flags;
dns_res_state.options |= saved_options;
reply_header = (HEADER *) reply->buf;
reply->rcode = reply_header->rcode;
if (h_errno != 0) {
if ((reply->dnssec_ad = !!reply_header->ad) != 0)
DNS_SEC_STATS_SET(DNS_SEC_FLAG_AVAILABLE);
if (DNS_GET_H_ERRNO(&dns_res_state) != 0) {
if (why)
vstring_sprintf(why, "Host or domain name not found. "
"Name service error for name=%s type=%s: %s",
name, dns_strtype(type), dns_strerror(h_errno));
name, dns_strtype(type),
dns_strerror(DNS_GET_H_ERRNO(&dns_res_state)));
if (msg_verbose)
msg_info("dns_query: %s (%s): %s",
name, dns_strtype(type), dns_strerror(h_errno));
switch (h_errno) {
name, dns_strtype(type),
dns_strerror(DNS_GET_H_ERRNO(&dns_res_state)));
switch (DNS_GET_H_ERRNO(&dns_res_state)) {
case NO_RECOVERY:
return (DNS_FAIL);
case HOST_NOT_FOUND:
@ -569,7 +607,7 @@ static int dns_query(const char *name, int type, unsigned flags,
*/
if (len < 0)
msg_panic("dns_query: bad length %d (h_errno=%s)",
len, dns_strerror(h_errno));
len, dns_strerror(DNS_GET_H_ERRNO(&dns_res_state)));
/*
* Paranoia.
@ -582,13 +620,8 @@ static int dns_query(const char *name, int type, unsigned flags,
/*
* Initialize the reply structure. Some structure members are filled on
* the fly while the reply is being parsed. Coerce AD bit to boolean.
* the fly while the reply is being parsed.
*/
#if RES_USE_DNSSEC != 0
reply->dnssec_ad = (flags & RES_USE_DNSSEC) ? !!reply_header->ad : 0;
#else
reply->dnssec_ad = 0;
#endif
SET_HAVE_DNS_REPLY_PACKET(reply, len);
reply->query_start = reply->buf + sizeof(HEADER);
reply->answer_start = 0;
@ -603,13 +636,13 @@ static int dns_query(const char *name, int type, unsigned flags,
* Future proofing. If this reaches the panic call, then some code change
* introduced a bug.
*/
if (h_errno == 0) {
if (DNS_GET_H_ERRNO(&dns_res_state) == 0) {
return (DNS_OK);
} else if (keep_notfound) {
return (DNS_NOTFOUND);
} else {
msg_panic("dns_query: unexpected reply status: %s",
dns_strerror(h_errno));
dns_strerror(DNS_GET_H_ERRNO(&dns_res_state)));
}
}
@ -906,7 +939,9 @@ static int dns_get_answer(const char *orig_name, DNS_REPLY *reply, int type,
CORRUPT(DNS_RETRY);
if ((status = dns_get_fixed(pos, &fixed)) != DNS_OK)
CORRUPT(status);
if (!valid_rr_name(rr_name, "resource name", fixed.type, reply))
if (strcmp(orig_name, ".") == 0 && *rr_name == 0)
/* Allow empty response name for root queries. */ ;
else if (!valid_rr_name(rr_name, "resource name", fixed.type, reply))
CORRUPT(DNS_INVAL);
if (fqdn)
vstring_strcpy(fqdn, rr_name);
@ -987,21 +1022,21 @@ int dns_lookup_x(const char *name, unsigned type, unsigned flags,
name);
if (rcode)
*rcode = NXDOMAIN;
SET_H_ERRNO(HOST_NOT_FOUND);
DNS_SET_H_ERRNO(&dns_res_state, HOST_NOT_FOUND);
return (DNS_NOTFOUND);
}
/*
* The Linux resolver misbehaves when given an invalid domain name.
*/
if (!valid_hostname(name, DONT_GRIPE)) {
if (strcmp(name, ".") && !valid_hostname(name, DONT_GRIPE)) {
if (why)
vstring_sprintf(why,
"Name service error for %s: invalid host or domain name",
name);
if (rcode)
*rcode = NXDOMAIN;
SET_H_ERRNO(HOST_NOT_FOUND);
DNS_SET_H_ERRNO(&dns_res_state, HOST_NOT_FOUND);
return (DNS_NOTFOUND);
}
@ -1031,6 +1066,10 @@ int dns_lookup_x(const char *name, unsigned type, unsigned flags,
(void) dns_get_answer(orig_name, &reply, T_SOA, rrlist, fqdn,
cname, c_len, &maybe_secure);
}
if (DNS_WANT_DNSSEC_VALIDATION(flags)
&& !DNS_SEC_STATS_TEST(DNS_SEC_FLAG_AVAILABLE | \
DNS_SEC_FLAG_DONT_PROBE))
dns_sec_probe(flags); /* XXX Clobbers 'reply' */
return (status);
}
@ -1040,6 +1079,10 @@ int dns_lookup_x(const char *name, unsigned type, unsigned flags,
*/
status = dns_get_answer(orig_name, &reply, type, rrlist, fqdn,
cname, c_len, &maybe_secure);
if (DNS_WANT_DNSSEC_VALIDATION(flags)
&& !DNS_SEC_STATS_TEST(DNS_SEC_FLAG_AVAILABLE | \
DNS_SEC_FLAG_DONT_PROBE))
dns_sec_probe(flags); /* XXX Clobbers 'reply' */
switch (status) {
default:
if (why)
@ -1051,7 +1094,7 @@ int dns_lookup_x(const char *name, unsigned type, unsigned flags,
if (why)
vstring_sprintf(why, "Domain %s does not accept mail (nullMX)",
name);
SET_H_ERRNO(NO_DATA);
DNS_SET_H_ERRNO(&dns_res_state, NO_DATA);
return (status);
case DNS_OK:
if (rrlist && dns_rr_filter_maps) {
@ -1120,7 +1163,7 @@ int dns_lookup_rl(const char *name, unsigned flags, DNS_RR **rrlist,
vstring_strcpy(hpref_rtext ? hpref_rtext : \
(hpref_rtext = vstring_alloc(VSTRING_LEN(why))), \
vstring_str(why)); \
hpref_h_errno = h_errno; \
hpref_h_errno = DNS_GET_H_ERRNO(&dns_res_state); \
} while (0)
/* Restore intermediate highest-priority result. */
@ -1130,7 +1173,7 @@ int dns_lookup_rl(const char *name, unsigned flags, DNS_RR **rrlist,
*rcode = hpref_rcode; \
if (why && status != DNS_OK) \
vstring_strcpy(why, vstring_str(hpref_rtext)); \
SET_H_ERRNO(hpref_h_errno); \
DNS_SET_H_ERRNO(&dns_res_state, hpref_h_errno); \
} while (0)
if (rrlist)
@ -1222,3 +1265,10 @@ int dns_lookup_rv(const char *name, unsigned flags, DNS_RR **rrlist,
vstring_free(hpref_rtext);
return (status);
}
/* dns_get_h_errno - get the last lookup status */
int dns_get_h_errno(void)
{
return (DNS_GET_H_ERRNO(&dns_res_state));
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: dns_sec.c,v 1.1.1.1 2022/10/08 16:09:06 christos Exp $ */
/* $NetBSD: dns_sec.c,v 1.2 2022/10/08 16:12:45 christos Exp $ */
/*++
/* NAME

View File

@ -1,4 +1,4 @@
/* $NetBSD: test_dns_lookup.c,v 1.2 2017/02/14 01:16:44 christos Exp $ */
/* $NetBSD: test_dns_lookup.c,v 1.3 2022/10/08 16:12:45 christos Exp $ */
/*++
/* NAME
@ -79,8 +79,10 @@ int main(int argc, char **argv)
int ch;
int lflags = DNS_REQ_FLAG_NONE;
var_dnssec_probe = "";
msg_vstream_init(argv[0], VSTREAM_ERR);
while ((ch = GETOPT(argc, argv, "f:npv")) > 0) {
while ((ch = GETOPT(argc, argv, "f:npvs")) > 0) {
switch (ch) {
case 'v':
msg_verbose++;
@ -94,6 +96,9 @@ int main(int argc, char **argv)
case 'p':
var_dns_ncache_ttl_fix = 1;
break;
case 's':
var_dnssec_probe = DEF_DNSSEC_PROBE;
break;
default:
usage(argv);
}

View File

@ -1,23 +1,23 @@
/* $NetBSD: dnsblog.c,v 1.3 2020/03/18 19:05:15 christos Exp $ */
/* $NetBSD: dnsblog.c,v 1.4 2022/10/08 16:12:45 christos Exp $ */
/*++
/* NAME
/* dnsblog 8
/* SUMMARY
/* Postfix DNS white/blacklist logger
/* Postfix DNS allow/denylist logger
/* SYNOPSIS
/* \fBdnsblog\fR [generic Postfix daemon options]
/* DESCRIPTION
/* The \fBdnsblog\fR(8) server implements an ad-hoc DNS
/* white/blacklist lookup service. This may eventually be
/* allow/denylist lookup service. This may eventually be
/* replaced by an UDP client that is built directly into the
/* \fBpostscreen\fR(8) server.
/* PROTOCOL
/* .ad
/* .fi
/* With each connection, the \fBdnsblog\fR(8) server receives
/* a DNS white/blacklist domain name, an IP address, and an ID.
/* If the IP address is listed under the DNS white/blacklist, the
/* a DNS allow/denylist domain name, an IP address, and an ID.
/* If the IP address is listed under the DNS allow/denylist, the
/* \fBdnsblog\fR(8) server logs the match and replies with the
/* query arguments plus an address list with the resulting IP
/* addresses, separated by whitespace, and the reply TTL.
@ -45,7 +45,7 @@
/* How much time a Postfix daemon process may take to handle a
/* request before it is terminated by a built-in watchdog timer.
/* .IP "\fBpostscreen_dnsbl_sites (empty)\fR"
/* Optional list of DNS white/blacklist domains, filters and weight
/* Optional list of DNS allow/denylist domains, filters and weight
/* factors.
/* .IP "\fBipc_timeout (3600s)\fR"
/* The time limit for sending or receiving information over an internal

View File

@ -1,4 +1,4 @@
/* $NetBSD: flush.c,v 1.3 2020/03/18 19:05:16 christos Exp $ */
/* $NetBSD: flush.c,v 1.4 2022/10/08 16:12:45 christos Exp $ */
/*++
/* NAME
@ -231,7 +231,7 @@ static DOMAIN_LIST *flush_domains;
* Silly little macros.
*/
#define STR(x) vstring_str(x)
#define STREQ(x,y) ((x) == (y) || strcmp(x,y) == 0)
#define STREQ(x,y) (STRREF(x) == STRREF(y) || strcmp(x,y) == 0)
/*
* Forward declarations resulting from breaking up routines according to
@ -481,7 +481,7 @@ static int flush_one_file(const char *queue_id, VSTRING *queue_file,
path, queue_name, MAIL_QUEUE_INCOMING);
/*
* If we got here, we achieved something, so let's claim succes.
* If we got here, we achieved something, so let's claim success.
*/
return (1);
}
@ -701,6 +701,14 @@ static int flush_request_receive(VSTREAM *client_stream, VSTRING *request)
{
int count;
/*
* Announce the protocol.
*/
attr_print(client_stream, ATTR_FLAG_NONE,
SEND_ATTR_STR(MAIL_ATTR_PROTO, MAIL_ATTR_PROTO_FLUSH),
ATTR_TYPE_END);
(void) vstream_fflush(client_stream);
/*
* Kluge: choose the protocol depending on the request size.
*/

View File

@ -1,4 +1,4 @@
/* $NetBSD: abounce.c,v 1.2 2017/02/14 01:16:45 christos Exp $ */
/* $NetBSD: abounce.c,v 1.3 2022/10/08 16:12:45 christos Exp $ */
/*++
/* NAME
@ -171,6 +171,11 @@
/* IBM T.J. Watson Research
/* P.O. Box 704
/* Yorktown Heights, NY 10598, USA
/*
/* Wietse Venema
/* Google, Inc.
/* 111 8th Avenue
/* New York, NY 10011, USA
/*--*/
/* System library. */
@ -204,10 +209,11 @@ typedef struct {
int command; /* bounce request type */
int flags; /* bounce options */
char *id; /* queue ID for logging */
VSTRING *request; /* serialized request */
ABOUNCE_FN callback; /* application callback */
void *context; /* application context */
VSTREAM *fp; /* server I/O handle */
} ABOUNCE;
} ABOUNCE_STATE;
/*
* Encapsulate common code.
@ -217,11 +223,6 @@ typedef struct {
event_request_timer((callback), (context), (timeout)); \
} while (0)
#define ABOUNCE_EVENT_DISABLE(fd, callback, context) do { \
event_cancel_timer((callback), (context)); \
event_disable_readwrite(fd); \
} while (0)
/*
* If we set the reply timeout too short, then we make the problem worse by
* increasing overload. With 1000s timeout mail will keep flowing, but there
@ -230,11 +231,30 @@ typedef struct {
*/
#define ABOUNCE_TIMEOUT 1000
/*
* The initial buffer size for a serialized request.
*/
#define ABOUNCE_BUFSIZE VSTREAM_BUFSIZE
/*
* We share most of the verp and non-verp code paths.
*/
#define ABOUNCE_NO_VERP ((char *) 0)
/*
* SLMs.
*/
#define STR(x) vstring_str(x)
#define LEN(x) VSTRING_LEN(x)
/* abounce_done - deliver status to application and clean up pseudo thread */
static void abounce_done(ABOUNCE *ap, int status)
static void abounce_done(ABOUNCE_STATE *ap, int status)
{
(void) vstream_fclose(ap->fp);
if (ap->fp) {
event_disable_readwrite(vstream_fileno(ap->fp));
(void) vstream_fclose(ap->fp);
}
if (status != 0 && (ap->flags & BOUNCE_FLAG_CLEAN) == 0)
msg_info("%s: status=deferred (%s failed)", ap->id,
ap->command == BOUNCE_CMD_FLUSH ? "bounce" :
@ -244,65 +264,125 @@ static void abounce_done(ABOUNCE *ap, int status)
"whatever");
ap->callback(status, ap->context);
myfree(ap->id);
vstring_free(ap->request);
myfree((void *) ap);
}
/* abounce_event - resume pseudo thread after server reply event */
/* abounce_receive - receive server reply */
static void abounce_event(int event, void *context)
static void abounce_receive(int event, void *context)
{
ABOUNCE *ap = (ABOUNCE *) context;
ABOUNCE_STATE *ap = (ABOUNCE_STATE *) context;
int status;
ABOUNCE_EVENT_DISABLE(vstream_fileno(ap->fp), abounce_event, context);
abounce_done(ap, (event != EVENT_TIME
&& attr_scan(ap->fp, ATTR_FLAG_STRICT,
RECV_ATTR_INT(MAIL_ATTR_STATUS, &status),
ATTR_TYPE_END) == 1) ? status : -1);
if (event != EVENT_TIME)
event_cancel_timer(abounce_receive, context);
if (event == EVENT_READ
&& attr_scan(ap->fp, ATTR_FLAG_STRICT,
RECV_ATTR_INT(MAIL_ATTR_STATUS, &status),
ATTR_TYPE_END) == 1) {
abounce_done(ap, status);
} else {
abounce_done(ap, -1);
}
}
/* abounce_request_verp - suspend pseudo thread until server reply event */
/* abounce_send - send the request and suspend until the server replies */
static void abounce_request_verp(const char *class, const char *service,
int command, int flags,
const char *queue, const char *id,
const char *encoding,
int smtputf8,
const char *sender,
const char *dsn_envid,
int dsn_ret,
const char *verp,
ABOUNCE_FN callback,
void *context)
static void abounce_send(int event, void *context)
{
ABOUNCE *ap;
ABOUNCE_STATE *ap = (ABOUNCE_STATE *) context;
/*
* Save pseudo thread state. Connect to the server. Send the request and
* suspend the pseudo thread until the server replies (or dies).
* Receive the server's protocol name announcement. At this point the
* server is ready to receive a request without blocking the sender. Send
* the request and suspend until the server replies (or dies).
*/
ap = (ABOUNCE *) mymalloc(sizeof(*ap));
if (event != EVENT_TIME)
event_cancel_timer(abounce_send, context);
non_blocking(vstream_fileno(ap->fp), BLOCKING);
if (event == EVENT_READ
&& attr_scan(ap->fp, ATTR_FLAG_STRICT,
RECV_ATTR_STREQ(MAIL_ATTR_PROTO, MAIL_ATTR_PROTO_BOUNCE),
ATTR_TYPE_END) == 0
&& vstream_fwrite(ap->fp, STR(ap->request),
LEN(ap->request)) == LEN(ap->request)
&& vstream_fflush(ap->fp) == 0) {
ABOUNCE_EVENT_ENABLE(vstream_fileno(ap->fp), abounce_receive,
(void *) ap, ABOUNCE_TIMEOUT);
} else {
abounce_done(ap, -1);
}
}
/* abounce_connect - connect and suspend until the server replies */
static void abounce_connect(const char *class, const char *service,
int command, int flags,
const char *queue, const char *id,
const char *encoding, int smtputf8,
const char *sender,
const char *dsn_envid, int dsn_ret,
const char *verp, ABOUNCE_FN callback,
void *context)
{
ABOUNCE_STATE *ap;
/*
* Save pseudo thread state. Connect to the server. Prior to Postfix 3.6
* the asynchronous bounce flush/warn client called mail_connect_wait()
* which sleeps and retries several times before terminating with a fatal
* error. This block-and-sleep behavior was not consistent with a) the
* rest of the code in this module, and with b) the synchronous bounce
* client which gives up immediately. It should be safe to give up
* immediately because that leaves the bounce/defer/trace logs in the
* queue. In particular, this should not increase the simultaneous number
* of asynchronous bounce/defer/trace flush/warn requests that are in
* flight.
*/
ap = (ABOUNCE_STATE *) mymalloc(sizeof(*ap));
ap->command = command;
ap->flags = flags;
ap->id = mystrdup(id);
ap->request = vstring_alloc(ABOUNCE_BUFSIZE);
ap->callback = callback;
ap->context = context;
ap->fp = mail_connect_wait(class, service);
ap->fp = mail_connect(class, service, NON_BLOCKING);
if (attr_print(ap->fp, ATTR_FLAG_NONE,
SEND_ATTR_INT(MAIL_ATTR_NREQ, command),
SEND_ATTR_INT(MAIL_ATTR_FLAGS, flags),
SEND_ATTR_STR(MAIL_ATTR_QUEUE, queue),
SEND_ATTR_STR(MAIL_ATTR_QUEUEID, id),
SEND_ATTR_STR(MAIL_ATTR_ENCODING, encoding),
SEND_ATTR_INT(MAIL_ATTR_SMTPUTF8, smtputf8),
SEND_ATTR_STR(MAIL_ATTR_SENDER, sender),
SEND_ATTR_STR(MAIL_ATTR_DSN_ENVID, dsn_envid),
SEND_ATTR_INT(MAIL_ATTR_DSN_RET, dsn_ret),
SEND_ATTR_STR(MAIL_ATTR_VERPDL, verp),
ATTR_TYPE_END) == 0
&& vstream_fflush(ap->fp) == 0) {
ABOUNCE_EVENT_ENABLE(vstream_fileno(ap->fp), abounce_event,
/*
* Format the request now, so that we don't have to save a lot of
* arguments now and format the request later.
*/
if (ap->fp != 0) {
/* Note: all code paths must terminate or enable I/O events. */
VSTREAM *mp = vstream_memopen(ap->request, O_WRONLY);
if (attr_print(mp, ATTR_FLAG_MORE,
SEND_ATTR_INT(MAIL_ATTR_NREQ, command),
SEND_ATTR_INT(MAIL_ATTR_FLAGS, flags),
SEND_ATTR_STR(MAIL_ATTR_QUEUE, queue),
SEND_ATTR_STR(MAIL_ATTR_QUEUEID, id),
SEND_ATTR_STR(MAIL_ATTR_ENCODING, encoding),
SEND_ATTR_INT(MAIL_ATTR_SMTPUTF8, smtputf8),
SEND_ATTR_STR(MAIL_ATTR_SENDER, sender),
SEND_ATTR_STR(MAIL_ATTR_DSN_ENVID, dsn_envid),
SEND_ATTR_INT(MAIL_ATTR_DSN_RET, dsn_ret),
ATTR_TYPE_END) != 0
|| (verp != 0
&& attr_print(mp, ATTR_FLAG_MORE,
SEND_ATTR_STR(MAIL_ATTR_VERPDL, verp),
ATTR_TYPE_END) != 0)
|| attr_print(mp, ATTR_FLAG_NONE,
ATTR_TYPE_END) != 0
|| vstream_fclose(mp) != 0)
msg_panic("abounce_connect: write request to memory stream: %m");
/*
* Suspend until the server replies (or dies).
*/
ABOUNCE_EVENT_ENABLE(vstream_fileno(ap->fp), abounce_send,
(void *) ap, ABOUNCE_TIMEOUT);
} else {
abounce_done(ap, -1);
@ -318,9 +398,9 @@ void abounce_flush_verp(int flags, const char *queue, const char *id,
ABOUNCE_FN callback,
void *context)
{
abounce_request_verp(MAIL_CLASS_PRIVATE, var_bounce_service,
BOUNCE_CMD_VERP, flags, queue, id, encoding, smtputf8,
sender, dsn_envid, dsn_ret, verp, callback, context);
abounce_connect(MAIL_CLASS_PRIVATE, var_bounce_service,
BOUNCE_CMD_VERP, flags, queue, id, encoding, smtputf8,
sender, dsn_envid, dsn_ret, verp, callback, context);
}
/* adefer_flush_verp - asynchronous defer flush */
@ -332,52 +412,9 @@ void adefer_flush_verp(int flags, const char *queue, const char *id,
ABOUNCE_FN callback, void *context)
{
flags |= BOUNCE_FLAG_DELRCPT;
abounce_request_verp(MAIL_CLASS_PRIVATE, var_defer_service,
BOUNCE_CMD_VERP, flags, queue, id, encoding, smtputf8,
sender, dsn_envid, dsn_ret, verp, callback, context);
}
/* abounce_request - suspend pseudo thread until server reply event */
static void abounce_request(const char *class, const char *service,
int command, int flags,
const char *queue, const char *id,
const char *encoding, int smtputf8,
const char *sender,
const char *dsn_envid, int dsn_ret,
ABOUNCE_FN callback, void *context)
{
ABOUNCE *ap;
/*
* Save pseudo thread state. Connect to the server. Send the request and
* suspend the pseudo thread until the server replies (or dies).
*/
ap = (ABOUNCE *) mymalloc(sizeof(*ap));
ap->command = command;
ap->flags = flags;
ap->id = mystrdup(id);
ap->callback = callback;
ap->context = context;
ap->fp = mail_connect_wait(class, service);
if (attr_print(ap->fp, ATTR_FLAG_NONE,
SEND_ATTR_INT(MAIL_ATTR_NREQ, command),
SEND_ATTR_INT(MAIL_ATTR_FLAGS, flags),
SEND_ATTR_STR(MAIL_ATTR_QUEUE, queue),
SEND_ATTR_STR(MAIL_ATTR_QUEUEID, id),
SEND_ATTR_STR(MAIL_ATTR_ENCODING, encoding),
SEND_ATTR_INT(MAIL_ATTR_SMTPUTF8, smtputf8),
SEND_ATTR_STR(MAIL_ATTR_SENDER, sender),
SEND_ATTR_STR(MAIL_ATTR_DSN_ENVID, dsn_envid),
SEND_ATTR_INT(MAIL_ATTR_DSN_RET, dsn_ret),
ATTR_TYPE_END) == 0
&& vstream_fflush(ap->fp) == 0) {
ABOUNCE_EVENT_ENABLE(vstream_fileno(ap->fp), abounce_event,
(void *) ap, ABOUNCE_TIMEOUT);
} else {
abounce_done(ap, -1);
}
abounce_connect(MAIL_CLASS_PRIVATE, var_defer_service,
BOUNCE_CMD_VERP, flags, queue, id, encoding, smtputf8,
sender, dsn_envid, dsn_ret, verp, callback, context);
}
/* abounce_flush - asynchronous bounce flush */
@ -388,9 +425,9 @@ void abounce_flush(int flags, const char *queue, const char *id,
int dsn_ret, ABOUNCE_FN callback,
void *context)
{
abounce_request(MAIL_CLASS_PRIVATE, var_bounce_service, BOUNCE_CMD_FLUSH,
abounce_connect(MAIL_CLASS_PRIVATE, var_bounce_service, BOUNCE_CMD_FLUSH,
flags, queue, id, encoding, smtputf8, sender, dsn_envid,
dsn_ret, callback, context);
dsn_ret, ABOUNCE_NO_VERP, callback, context);
}
/* adefer_flush - asynchronous defer flush */
@ -401,9 +438,9 @@ void adefer_flush(int flags, const char *queue, const char *id,
int dsn_ret, ABOUNCE_FN callback, void *context)
{
flags |= BOUNCE_FLAG_DELRCPT;
abounce_request(MAIL_CLASS_PRIVATE, var_defer_service, BOUNCE_CMD_FLUSH,
abounce_connect(MAIL_CLASS_PRIVATE, var_defer_service, BOUNCE_CMD_FLUSH,
flags, queue, id, encoding, smtputf8, sender, dsn_envid,
dsn_ret, callback, context);
dsn_ret, ABOUNCE_NO_VERP, callback, context);
}
/* adefer_warn - send copy of defer log to sender as warning bounce */
@ -413,9 +450,9 @@ void adefer_warn(int flags, const char *queue, const char *id,
const char *sender, const char *dsn_envid,
int dsn_ret, ABOUNCE_FN callback, void *context)
{
abounce_request(MAIL_CLASS_PRIVATE, var_defer_service, BOUNCE_CMD_WARN,
abounce_connect(MAIL_CLASS_PRIVATE, var_defer_service, BOUNCE_CMD_WARN,
flags, queue, id, encoding, smtputf8, sender, dsn_envid,
dsn_ret, callback, context);
dsn_ret, ABOUNCE_NO_VERP, callback, context);
}
/* atrace_flush - asynchronous trace flush */
@ -425,7 +462,7 @@ void atrace_flush(int flags, const char *queue, const char *id,
const char *sender, const char *dsn_envid,
int dsn_ret, ABOUNCE_FN callback, void *context)
{
abounce_request(MAIL_CLASS_PRIVATE, var_trace_service, BOUNCE_CMD_TRACE,
abounce_connect(MAIL_CLASS_PRIVATE, var_trace_service, BOUNCE_CMD_TRACE,
flags, queue, id, encoding, smtputf8, sender, dsn_envid,
dsn_ret, callback, context);
dsn_ret, ABOUNCE_NO_VERP, callback, context);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: anvil_clnt.c,v 1.3 2020/03/18 19:05:16 christos Exp $ */
/* $NetBSD: anvil_clnt.c,v 1.4 2022/10/08 16:12:45 christos Exp $ */
/*++
/* NAME
@ -172,6 +172,15 @@
#define ANVIL_IDENT(service, addr) \
printable(concatenate(service, ":", addr, (char *) 0), '?')
/* anvil_clnt_handshake - receive server protocol announcement */
static int anvil_clnt_handshake(VSTREAM *stream)
{
return (attr_scan_plain(stream, ATTR_FLAG_STRICT,
RECV_ATTR_STREQ(MAIL_ATTR_PROTO, MAIL_ATTR_PROTO_ANVIL),
ATTR_TYPE_END));
}
/* anvil_clnt_create - instantiate connection rate service client */
ANVIL_CLNT *anvil_clnt_create(void)
@ -188,6 +197,9 @@ ANVIL_CLNT *anvil_clnt_create(void)
#else
anvil_clnt = attr_clnt_create(var_anvil_service, var_ipc_timeout, 0, 0);
#endif
attr_clnt_control(anvil_clnt,
ATTR_CLNT_CTL_HANDSHAKE, anvil_clnt_handshake,
ATTR_CLNT_CTL_END);
return ((ANVIL_CLNT *) anvil_clnt);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: been_here.c,v 1.3 2020/03/18 19:05:16 christos Exp $ */
/* $NetBSD: been_here.c,v 1.4 2022/10/08 16:12:45 christos Exp $ */
/*++
/* NAME
@ -28,6 +28,14 @@
/* BH_TABLE *dup_filter;
/* char *format;
/*
/* int been_here_drop_fixed(dup_filter, string)
/* BH_TABLE *dup_filter;
/* char *string;
/*
/* int been_here_drop(dup_filter, format, ...)
/* BH_TABLE *dup_filter;
/* char *format;
/*
/* void been_here_free(dup_filter)
/* BH_TABLE *dup_filter;
/* DESCRIPTION
@ -48,6 +56,16 @@
/* been_here_check_fixed() and been_here_check() are similar
/* but do not update the duplicate filter.
/*
/* been_here_drop_fixed() looks up a fixed string in the given
/* table, and deletes the entry if the string was found. The
/* result is non-zero (true) if the string was found, zero
/* (false) otherwise.
/*
/* been_here_drop() formats its arguments, looks up the result
/* in the given table, and removes the entry if the formatted
/* result was found. The result is non-zero (true) if the
/* formatted result was found, zero (false) otherwise.
/*
/* been_here_free() releases storage for a duplicate filter.
/*
/* Arguments:
@ -78,6 +96,11 @@
/* IBM T.J. Watson Research
/* P.O. Box 704
/* Yorktown Heights, NY 10598, USA
/*
/* Wietse Venema
/* Google, Inc.
/* 111 8th Avenue
/* New York, NY 10011, USA
/*--*/
/* System library. */
@ -251,3 +274,64 @@ int been_here_check_fixed(BH_TABLE *dup_filter, const char *string)
return (status);
}
/* been_here_drop - remove filter entry with finer control */
int been_here_drop(BH_TABLE *dup_filter, const char *fmt,...)
{
VSTRING *buf = vstring_alloc(100);
int status;
va_list ap;
/*
* Construct the string to be dropped.
*/
va_start(ap, fmt);
vstring_vsprintf(buf, fmt, ap);
va_end(ap);
/*
* Drop the filter entry.
*/
status = been_here_drop_fixed(dup_filter, vstring_str(buf));
/*
* Cleanup.
*/
vstring_free(buf);
return (status);
}
/* been_here_drop_fixed - remove filter entry */
int been_here_drop_fixed(BH_TABLE *dup_filter, const char *string)
{
VSTRING *folded_string;
const char *lookup_key;
int status;
/*
* Special processing: case insensitive lookup.
*/
if (dup_filter->flags & BH_FLAG_FOLD) {
folded_string = vstring_alloc(100);
lookup_key = casefold(folded_string, string);
} else {
folded_string = 0;
lookup_key = string;
}
/*
* Drop the filter entry.
*/
if ((status = been_here_check_fixed(dup_filter, lookup_key)) != 0)
htable_delete(dup_filter->table, lookup_key, (void (*) (void *)) 0);
/*
* Cleanup.
*/
if (folded_string)
vstring_free(folded_string);
return (status);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: been_here.h,v 1.2 2020/03/18 19:05:16 christos Exp $ */
/* $NetBSD: been_here.h,v 1.3 2022/10/08 16:12:45 christos Exp $ */
#ifndef _BEEN_HERE_H_INCLUDED_
#define _BEEN_HERE_H_INCLUDED_
@ -37,6 +37,8 @@ extern int been_here_fixed(BH_TABLE *, const char *);
extern int PRINTFLIKE(2, 3) been_here(BH_TABLE *, const char *,...);
extern int been_here_check_fixed(BH_TABLE *, const char *);
extern int PRINTFLIKE(2, 3) been_here_check(BH_TABLE *, const char *,...);
extern int been_here_drop_fixed(BH_TABLE *, const char *);
extern int PRINTFLIKE(2, 3) been_here_drop(BH_TABLE *, const char *,...);
/* LICENSE
/* .ad
@ -47,6 +49,11 @@ extern int PRINTFLIKE(2, 3) been_here_check(BH_TABLE *, const char *,...);
/* IBM T.J. Watson Research
/* P.O. Box 704
/* Yorktown Heights, NY 10598, USA
/*
/* Wietse Venema
/* Google, Inc.
/* 111 8th Avenue
/* New York, NY 10011, USA
/*--*/
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: bounce.c,v 1.2 2017/02/14 01:16:45 christos Exp $ */
/* $NetBSD: bounce.c,v 1.3 2022/10/08 16:12:45 christos Exp $ */
/*++
/* NAME
@ -188,6 +188,11 @@
/* IBM T.J. Watson Research
/* P.O. Box 704
/* Yorktown Heights, NY 10598, USA
/*
/* Wietse Venema
/* Google, Inc.
/* 111 8th Avenue
/* New York, NY 10011, USA
/*--*/
/* System library. */
@ -312,11 +317,12 @@ int bounce_append_intern(int flags, const char *id, MSG_STATS *stats,
if (mail_command_client(MAIL_CLASS_PRIVATE, var_soft_bounce ?
var_defer_service : var_bounce_service,
MAIL_ATTR_PROTO_BOUNCE,
SEND_ATTR_INT(MAIL_ATTR_NREQ, BOUNCE_CMD_APPEND),
SEND_ATTR_INT(MAIL_ATTR_FLAGS, flags),
SEND_ATTR_STR(MAIL_ATTR_QUEUEID, id),
SEND_ATTR_FUNC(rcpt_print, (void *) rcpt),
SEND_ATTR_FUNC(dsn_print, (void *) &my_dsn),
SEND_ATTR_FUNC(rcpt_print, (const void *) rcpt),
SEND_ATTR_FUNC(dsn_print, (const void *) &my_dsn),
ATTR_TYPE_END) == 0
&& ((flags & DEL_REQ_FLAG_RECORD) == 0
|| trace_append(flags, id, stats, rcpt, relay,
@ -355,6 +361,7 @@ int bounce_flush(int flags, const char *queue, const char *id,
if (var_soft_bounce)
return (-1);
if (mail_command_client(MAIL_CLASS_PRIVATE, var_bounce_service,
MAIL_ATTR_PROTO_BOUNCE,
SEND_ATTR_INT(MAIL_ATTR_NREQ, BOUNCE_CMD_FLUSH),
SEND_ATTR_INT(MAIL_ATTR_FLAGS, flags),
SEND_ATTR_STR(MAIL_ATTR_QUEUE, queue),
@ -389,6 +396,7 @@ int bounce_flush_verp(int flags, const char *queue, const char *id,
if (var_soft_bounce)
return (-1);
if (mail_command_client(MAIL_CLASS_PRIVATE, var_bounce_service,
MAIL_ATTR_PROTO_BOUNCE,
SEND_ATTR_INT(MAIL_ATTR_NREQ, BOUNCE_CMD_VERP),
SEND_ATTR_INT(MAIL_ATTR_FLAGS, flags),
SEND_ATTR_STR(MAIL_ATTR_QUEUE, queue),
@ -496,6 +504,7 @@ int bounce_one_intern(int flags, const char *queue, const char *id,
my_dsn.action = "failed";
if (mail_command_client(MAIL_CLASS_PRIVATE, var_bounce_service,
MAIL_ATTR_PROTO_BOUNCE,
SEND_ATTR_INT(MAIL_ATTR_NREQ, BOUNCE_CMD_ONE),
SEND_ATTR_INT(MAIL_ATTR_FLAGS, flags),
SEND_ATTR_STR(MAIL_ATTR_QUEUE, queue),
@ -505,8 +514,8 @@ int bounce_one_intern(int flags, const char *queue, const char *id,
SEND_ATTR_STR(MAIL_ATTR_SENDER, sender),
SEND_ATTR_STR(MAIL_ATTR_DSN_ENVID, dsn_envid),
SEND_ATTR_INT(MAIL_ATTR_DSN_RET, dsn_ret),
SEND_ATTR_FUNC(rcpt_print, (void *) rcpt),
SEND_ATTR_FUNC(dsn_print, (void *) &my_dsn),
SEND_ATTR_FUNC(rcpt_print, (const void *) rcpt),
SEND_ATTR_FUNC(dsn_print, (const void *) &my_dsn),
ATTR_TYPE_END) == 0
&& ((flags & DEL_REQ_FLAG_RECORD) == 0
|| trace_append(flags, id, stats, rcpt, relay,

View File

@ -1,4 +1,4 @@
/* $NetBSD: cleanup_strerror.c,v 1.1.1.2 2022/10/08 16:09:07 christos Exp $ */
/* $NetBSD: cleanup_strerror.c,v 1.2 2022/10/08 16:12:45 christos Exp $ */
/*++
/* NAME

View File

@ -1,4 +1,4 @@
/* $NetBSD: cleanup_user.h,v 1.2 2017/02/14 01:16:45 christos Exp $ */
/* $NetBSD: cleanup_user.h,v 1.3 2022/10/08 16:12:45 christos Exp $ */
#ifndef _CLEANUP_USER_H_INCLUDED_
#define _CLEANUP_USER_H_INCLUDED_
@ -64,6 +64,7 @@
#define CLEANUP_STAT_RCPT (1<<6) /* No recipients found */
#define CLEANUP_STAT_PROXY (1<<7) /* Proxy reject */
#define CLEANUP_STAT_DEFER (1<<8) /* Temporary reject */
#define CLEANUP_STAT_NOPERM (1<<9) /* Denied by non-content policy */
/*
* These are set when we can't bounce even if we were asked to.
@ -102,6 +103,11 @@ extern const char *cleanup_strflags(unsigned);
/* IBM T.J. Watson Research
/* P.O. Box 704
/* Yorktown Heights, NY 10598, USA
/*
/* Wietse Venema
/* Google, Inc.
/* 111 8th Avenue
/* New York, NY 10011, USA
/*--*/
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: clnt_stream.c,v 1.3 2020/03/18 19:05:16 christos Exp $ */
/* $NetBSD: clnt_stream.c,v 1.4 2022/10/08 16:12:45 christos Exp $ */
/*++
/* NAME
@ -8,11 +8,15 @@
/* SYNOPSIS
/* #include <clnt_stream.h>
/*
/* CLNT_STREAM *clnt_stream_create(class, service, timeout, ttl)
/* typedef void (*CLNT_STREAM_HANDSHAKE_FN)(VSTREAM *)
/*
/* CLNT_STREAM *clnt_stream_create(class, service, timeout, ttl,
/* handshake)
/* const char *class;
/* const char *service;
/* int timeout;
/* int ttl;
/* CLNT_STREAM_HANDSHAKE_FN *handshake;
/*
/* VSTREAM *clnt_stream_access(clnt_stream)
/* CLNT_STREAM *clnt_stream;
@ -35,6 +39,8 @@
/*
/* clnt_stream_access() returns an open stream to the service specified
/* to clnt_stream_create(). The stream instance may change between calls.
/* This function returns null when the handshake function returned an
/* error.
/*
/* clnt_stream_recover() recovers from a server-initiated disconnect
/* that happened in the middle of an I/O operation.
@ -51,6 +57,10 @@
/* Idle time after which the client disconnects.
/* .IP ttl
/* Upper bound on the time that a connection is allowed to persist.
/* .IP handshake
/* Null pointer, or pointer to function that will be called
/* at the start of a new connection and that returns 0 in case
/* of success.
/* DIAGNOSTICS
/* Warnings: communication failure. Fatal error: mail system is down,
/* out of memory.
@ -65,6 +75,11 @@
/* IBM T.J. Watson Research
/* P.O. Box 704
/* Yorktown Heights, NY 10598, USA
/*
/* Wietse Venema
/* Google, Inc.
/* 111 8th Avenue
/* New York, NY 10011, USA
/*--*/
/* System library. */
@ -95,6 +110,7 @@ struct CLNT_STREAM {
VSTREAM *vstream; /* buffered I/O */
int timeout; /* time before client disconnect */
int ttl; /* time before client disconnect */
CLNT_STREAM_HANDSHAKE_FN handshake;
char *class; /* server class */
char *service; /* server name */
};
@ -207,6 +223,7 @@ void clnt_stream_recover(CLNT_STREAM *clnt_stream)
VSTREAM *clnt_stream_access(CLNT_STREAM *clnt_stream)
{
CLNT_STREAM_HANDSHAKE_FN handshake;
/*
* Open a stream or restart the idle timer.
@ -215,20 +232,26 @@ VSTREAM *clnt_stream_access(CLNT_STREAM *clnt_stream)
*/
if (clnt_stream->vstream == 0) {
clnt_stream_open(clnt_stream);
handshake = clnt_stream->handshake;
} else if (readable(vstream_fileno(clnt_stream->vstream))) {
clnt_stream_close(clnt_stream);
clnt_stream_open(clnt_stream);
handshake = clnt_stream->handshake;
} else {
event_request_timer(clnt_stream_event, (void *) clnt_stream,
clnt_stream->timeout);
handshake = 0;
}
if (handshake != 0 && handshake(clnt_stream->vstream) != 0)
return (0);
return (clnt_stream->vstream);
}
/* clnt_stream_create - create client stream connection */
CLNT_STREAM *clnt_stream_create(const char *class, const char *service,
int timeout, int ttl)
int timeout, int ttl,
CLNT_STREAM_HANDSHAKE_FN handshake)
{
CLNT_STREAM *clnt_stream;
@ -239,6 +262,7 @@ CLNT_STREAM *clnt_stream_create(const char *class, const char *service,
clnt_stream->vstream = 0;
clnt_stream->timeout = timeout;
clnt_stream->ttl = ttl;
clnt_stream->handshake = handshake;
clnt_stream->class = mystrdup(class);
clnt_stream->service = mystrdup(service);
return (clnt_stream);

Some files were not shown because too many files have changed in this diff Show More