2
0
mirror of https://github.com/vdukhovni/postfix synced 2025-08-30 05:38:06 +00:00

postfix-2.3-20050328

This commit is contained in:
Wietse Venema 2005-03-28 00:00:00 -05:00 committed by Viktor Dukhovni
parent da30144878
commit c1e35cbf92
60 changed files with 469 additions and 304 deletions

View File

@ -1,46 +1,31 @@
Postfix enhanced status code implementation notes
=================================================
Enhanced status code support is implemented in stages. In the first
stage, the goal is to minimize code changes (it's several hundred
pages of context diffs already). For this reason, the pre-existing
status variables (success, defer, etc.) are not updated atomically
with the enhanced status code; instead, enhanced status codes are
updated separately. This means one has to be careful when making
updates to the code, so that things won't go out of sync.
RFC 3463 Enhanced status code support is implemented in stages. In
the first stage, the goal is to minimize code changes (it's several
hundred pages of context diffs already). For this reason, the
pre-existing status variables (success, defer, etc.) are still
updated separately from the diagnostic text and the RFC 3463 enhanced
status code. All this means that one has to be careful when updating
the code, to keep things in sync.
Specific issues that one should be aware of:
- In the SMTP client, either update the enhanced status code and
text whenever smtp_errno or resp->code are updated, or place an
explicit comment that no update is needed.
- In the SMTP client, update the enhanced status code and text
whenever smtp_errno or resp->code are updated, or place an explicit
comment that says no update is needed.
- In the SMTP client, don't worry about the first enhanced status
- In the SMTP client, don't worry about the initial enhanced status
digit when reporting failure to look up or connect to a host. For
convenience, the SMTP client top-level code automatically changes
it into '4' or '5' as appropriate.
the initial digit into '4' or '5' as appropriate.
- The above two points also apply to the LMTP client; this delivery
agent is on life support until its functionality is merged with the
SMTP client.
- The above two points also apply to the LMTP client.
- In the SMTP server, don't worry about the first enhanced status
digit when a restriction rejects access. For convenience, the
smtpd_check_reject() routine automatically changes it into '4' or
'5' as appropriate.
- The pipe, local and virtual delivery agents never update the
diagnostic text without also updating the enhanced status code. The
main chore here is to choose appropriate enhanced status codes.
- Don't rely on the system errno value after calling a routine that
updates the enhanced status code upon failure. Use the enhanced
status code (and diagnostic text) instead. Currently there are two
exceptions to this rule: mail_copy() for historical reasons may or
may not return explicit error reports (fixing this requires that
pipe_command() be restructured); and the maildir delivery routines
log a helpful warning when delivery fails with EACCES. This just
happens to work because maildir needs no file locking.
- In the SMTP server, don't worry about the initial enhanced status
code digit when an smtpd_mumble_restriction rejects access. For
convenience, the smtpd_check_reject() routine automatically changes
the initial digit into '4' or '5' as appropriate.
- Some low-level support routines update the diagnostic text but
not the enhanced status code. To identify these, search for functions
@ -48,14 +33,29 @@ that are called with why->vstring as output parameter, and make
sure that the caller updates the enhanced status code in all
appropriate cases.
- By design, the pipe, local and virtual delivery agent code never
update the diagnostic text separately from the enhanced status code.
- Don't rely on the system errno value after calling a routine that
performs or prepares for mail delivery. Instead, have that routine
update the enhanced status code (and text) when the error happens.
This was an issue with mailbox, maildir and file delivery. Currently
there remain two exceptions to this rule: mail_copy() for historical
reasons may or may not return explicit error reports (fixing this
requires that pipe_command() be restructured); and the maildir
delivery routines log a helpful warning when delivery fails with
EACCES. The latter happens to work because mbox_open() does not
need to unlock the output file, so it won't clobber the errno value.
- Avoid passing around strings that combine enhanced status code
and diagnostic text, because the compiler can't help to enforce
consistency. Currently there are two exceptions to this rule: the
cleanup server status reply, and the delivery agent status reply.
Once these protocols are updated we can remove the dns_prepend()
routine.
that everything has a status code. Currently there are two exceptions
to this rule: the cleanup server status reply, and the delivery
agent status reply. Once these protocols are updated we can remove
the dns_prepend() routine. The third exception, enhanced status
codes in external command output, is a feature.
- The bounce/defer/sent modules will catch the cases where an
enhanced status code does not match the reject/defer/success status.
These discrepancies are logged as a warning, and the enhanced status
code is replaced by a generic one.
- The bounce/defer/sent library modules will catch the cases where
an enhanced status code does not match the reject/defer/success
status. They log a warning message, and replace the incorrect
enhanced status code by a generic one.

View File

@ -10487,7 +10487,7 @@ Apologies for any names omitted.
20050321-27
Support for RFC 1893 enhanced status codes. See also the
Support for RFC 3463 enhanced status codes. See also the
ENHANCED_STATUS_README file for background.
New module to pass around (status code + text) instead of
@ -10497,13 +10497,14 @@ Apologies for any names omitted.
enhanced status codes. Files: global/sys_exits.c,
global/cleanup_strerror.c.
Incompatible change: centralized mapping of errno values
to delivery status codes after failed delivery to mailbox,
maildir, or file. Error codes EACCES, EAGAIN, ESTALE are
4.2.0 temporary errors, ENOSPC is a 4.3.0 temporary error,
EDQUOT and EFBIG are 5.2.2 hard errors, and everything else
is a 5.2.0 hard error. This means that local(8) will bounce
less mail, while virtual(8) will defer less mail. File:
Cleanup: centralized mapping of errno values to delivery
status codes after failed delivery to mailbox, maildir, or
file. Error codes EAGAIN, and ESTALE are 4.2.0 temporary
errors; ENOSPC is a 4.3.0 temporary error; and EDQUOT and
EFBIG are 5.2.2 hard errors. For backwards compatibility,
the result of other errors depends on the delivery agent:
with local(8) everything else is a 5.2.0 hard error, and
with virtual(8) everything else is soft 4.2.0 error. File:
global/mbox_open.c.
20050324
@ -10534,13 +10535,19 @@ Apologies for any names omitted.
20050327
Bugfix: the SMTP client did not ask the queue manager to
reduce destination concurrency after a "lost connection"
or "connection timed out" errror. File: smtp/smtp_trouble.c.
Bugfix: the SMTP and LMTP clients did not ask the queue
manager to reduce destination concurrency when "lost
connection" or "connection timed out" happened AFTER Postfix
received the server greeting. Files: smtp/smtp_trouble.c,
lmtp/lmtp-trouble.c.
Workaround: FreeBSD has incompatibly changed the output
format from "od", breaking regression test portability.
The TLS client session cache ID is now derived from the
server IP address, TCP Port, and server HELO hostname
if available. File: smtp/smtp_proto.c.
Open problems:
Med: disable header address rewriting after XCLIENT?

View File

@ -11,38 +11,48 @@ instead, a new snapshot is released.
The mail_release_date configuration parameter (format: yyyymmdd)
specifies the release date of a stable release or snapshot release.
See RELEASE_NOTES-2.2 for changes introduced during the development
of Postfix version 2.2.
Incompatibility with Postfix 2.1 and earlier
============================================
Incompatible changes with snapshot 20050327
===========================================
If you upgrade from Postfix 2.1 or earlier, read RELEASE_NOTES-2.2
before proceeding.
local(8) and virtual(8) now handle the same errors in the same way.
This means that local(8) will defer some mail that it older versions
would bounce, and that virtual(8) will bounce some mail that older
versions would defer.
Incompatibility with snapshot 20050328
======================================
Specifically, error codes EACCES, EAGAIN, ESTALE are soft (4.2.0)
errors, ENOSPC is a soft (4.3.0) error, EDQUOT and EFBIG are hard
(5.2.2) errors, and everything else is a hard (5.2.0) error.
After you upgrade from Postfix 2.2 or 2.3 you need to execute
"postfix reload", otherwise you will keep running the old Postfix
queue manager, which gives no special treatment to the enhanced
status codes that it receives from Postfix delivery agents.
Major changes with snapshot 20050327
Major changes with snapshot 20050328
====================================
This release introduces support for RFC 1893 enhanced status codes.
For example, status code "5.1.1" means "recipient unknown". Postfix
recognizes enhanced status codes in remote server replies, and
generates enhanced status codes when it responds to mail delivery
requests. This improves the communication with mail clients that
hide error messages from users.
This release introduces support for RFC 3463 enhanced status codes.
For example, status code 5.1.1 means "recipient unknown". Postfix
recognizes enhanced status codes in remote server replies, generates
enhanced status codes while handling email, and reports enhanced
status codes in non-delivery notifications. This improves the user
interaction with mail clients that hide the text of error messages
from users.
You can, but don't have to, specify RFC 1893 enhanced status codes
in Postfix access maps or header/body_checks. Example:
You can, but don't have to, specify RFC 3463 enhanced status codes
in the output from commands that receive mail from a pipe. If a
command terminates with non-zero exit status, and an enhanced status
code is present at the beginning of the command output, then that
status code takes precedence over the non-zero exit status.
You can, but don't have to, specify RFC 3463 enhanced status codes
in Postfix access maps, header/body_checks REJECT actions, or in
RBL replies. For example:
REJECT 5.7.1 You can't go here from there
(5.7.1 means "no authorization, message refused"). Enhanced status
code support is also available in RBL reply templates.
The status 5.7.1 means "no authorization, message refused", and is
the default for access maps, header/body_checks REJECT actions, and
for RBL replies.
If you do specify an enhanced status code, Postfix will automatically
change the first digit into a '4' or '5' as appropriate.
If you specify your own enhanced status code, the Postfix SMTP
server will automatically change a leading '5' digit (hard error)
into '4' where appropriate. This is needed, for example, with
soft_bounce=yes.

View File

@ -18,7 +18,7 @@ DISCARD(8) DISCARD(8)
queue file, a sender address, a domain or host name that
is treated as the reason for discarding the mail, and
recipient information. The reason may be prefixed with an
<a href="http://www.faqs.org/rfcs/rfc1893.html">RFC 1893</a>-compatible detail code. This program expects to
<a href="http://www.faqs.org/rfcs/rfc3463.html">RFC 3463</a>-compatible detail code. This program expects to
be run from the <a href="master.8.html"><b>master</b>(8)</a> process manager.
The <a href="discard.8.html"><b>discard</b>(8)</a> delivery agent pretends to deliver all

View File

@ -18,7 +18,7 @@ ERROR(8) ERROR(8)
queue file, a sender address, a domain or host name that
is treated as the reason for non-delivery, and recipient
information. The reason may be prefixed with an RFC
1893-compatible detail code. This program expects to be
3463-compatible detail code. This program expects to be
run from the <a href="master.8.html"><b>master</b>(8)</a> process manager.
The <a href="error.8.html"><b>error</b>(8)</a> delivery agent bounces all recipients in the

View File

@ -63,10 +63,11 @@ LMTP(8) LMTP(8)
<a href="http://www.faqs.org/rfcs/rfc1652.html">RFC 1652</a> (8bit-MIME transport)
<a href="http://www.faqs.org/rfcs/rfc1870.html">RFC 1870</a> (Message Size Declaration)
<a href="http://www.faqs.org/rfcs/rfc2033.html">RFC 2033</a> (LMTP protocol)
<a href="http://www.faqs.org/rfcs/rfc2034.html">RFC 2034</a> (Enhanced Error Codes)
<a href="http://www.faqs.org/rfcs/rfc2034.html">RFC 2034</a> (Enhanced Status codes)
<a href="http://www.faqs.org/rfcs/rfc2554.html">RFC 2554</a> (AUTH command)
<a href="http://www.faqs.org/rfcs/rfc2821.html">RFC 2821</a> (SMTP protocol)
<a href="http://www.faqs.org/rfcs/rfc2920.html">RFC 2920</a> (SMTP Pipelining)
<a href="http://www.faqs.org/rfcs/rfc3463.html">RFC 3463</a> (Enhanced Status codes)
<b>DIAGNOSTICS</b>
Problems and transactions are logged to <b>syslogd</b>(8). Cor-

View File

@ -172,7 +172,14 @@ LOCAL(8) LOCAL(8)
ery status reports. A command is forcibly terminated if
it does not complete within <b><a href="postconf.5.html#command_time_limit">command_time_limit</a></b> seconds.
Command exit status codes are expected to follow the con-
ventions defined in &lt;<b>sysexits.h</b>&gt;.
ventions defined in &lt;<b>sysexits.h</b>&gt;. Exit status 0 means
normal successful completion.
Postfix version 2.3 and later support <a href="http://www.faqs.org/rfcs/rfc3463.html">RFC 3463</a>-style
enhanced status codes. If a command terminates with a
non-zero exit status, and the command output begins with
an enhanced status code, this status code takes precedence
over the non-zero exit status.
A limited amount of message context is exported via envi-
ronment variables. Characters that may have special mean-
@ -304,6 +311,7 @@ LOCAL(8) LOCAL(8)
<b>STANDARDS</b>
<a href="http://www.faqs.org/rfcs/rfc822.html">RFC 822</a> (ARPA Internet Text Messages)
<a href="http://www.faqs.org/rfcs/rfc3463.html">RFC 3463</a> (Enhanced status codes)
<b>DIAGNOSTICS</b>
Problems and transactions are logged to <b>syslogd</b>(8). Cor-

View File

@ -272,9 +272,19 @@ PIPE(8) PIPE(8)
This information is modified by the <b>u</b> flag
for case folding.
<b>STANDARDS</b>
<a href="http://www.faqs.org/rfcs/rfc3463.html">RFC 3463</a> (Enhanced status codes)
<b>DIAGNOSTICS</b>
Command exit status codes are expected to follow the con-
ventions defined in &lt;<b>sysexits.h</b>&gt;.
ventions defined in &lt;<b>sysexits.h</b>&gt;. Exit status 0 means
normal successful completion.
Postfix version 2.3 and later support <a href="http://www.faqs.org/rfcs/rfc3463.html">RFC 3463</a>-style
enhanced status codes. If a command terminates with a
non-zero exit status, and the command output begins with
an enhanced status code, this status code takes precedence
over the non-zero exit status.
Problems and transactions are logged to <b>syslogd</b>(8). Cor-
rupted message files are marked so that the queue manager

View File

@ -1710,7 +1710,10 @@ address, or Recipient address. </dd>
<dt><b>$rbl_code</b></dt>
<dd>The numerical SMTP response code, as specified with the
<a href="postconf.5.html#maps_rbl_reject_code">maps_rbl_reject_code</a> configuration parameter. </dd>
<a href="postconf.5.html#maps_rbl_reject_code">maps_rbl_reject_code</a> configuration parameter. Note: The numerical
SMTP response code is required, and must appear at the start of the
reply. With Postfix 2.3 and later this information may be followed
by an <a href="http://www.faqs.org/rfcs/rfc3463.html">RFC 3463</a> enhanced status code. </dd>
<dt><b>$rbl_domain</b></dt>

View File

@ -56,12 +56,13 @@ SMTP(8) SMTP(8)
<a href="http://www.faqs.org/rfcs/rfc1652.html">RFC 1652</a> (8bit-MIME transport)
<a href="http://www.faqs.org/rfcs/rfc1870.html">RFC 1870</a> (Message Size Declaration)
<a href="http://www.faqs.org/rfcs/rfc2045.html">RFC 2045</a> (MIME: Format of Internet Message Bodies)
<a href="http://www.faqs.org/rfcs/rfc2034.html">RFC 2034</a> (Enhanced Error Codes)
<a href="http://www.faqs.org/rfcs/rfc2034.html">RFC 2034</a> (Enhanced Status Codes)
<a href="http://www.faqs.org/rfcs/rfc2046.html">RFC 2046</a> (MIME: Media Types)
<a href="http://www.faqs.org/rfcs/rfc2554.html">RFC 2554</a> (AUTH command)
<a href="http://www.faqs.org/rfcs/rfc2821.html">RFC 2821</a> (SMTP protocol)
<a href="http://www.faqs.org/rfcs/rfc2920.html">RFC 2920</a> (SMTP Pipelining)
<a href="http://www.faqs.org/rfcs/rfc3207.html">RFC 3207</a> (STARTTLS command)
<a href="http://www.faqs.org/rfcs/rfc3463.html">RFC 3463</a> (Enhanced Status Codes)
<b>DIAGNOSTICS</b>
Problems and transactions are logged to <b>syslogd</b>(8). Cor-

View File

@ -43,11 +43,12 @@ SMTPD(8) SMTPD(8)
<a href="http://www.faqs.org/rfcs/rfc1869.html">RFC 1869</a> (SMTP service extensions)
<a href="http://www.faqs.org/rfcs/rfc1870.html">RFC 1870</a> (Message Size Declaration)
<a href="http://www.faqs.org/rfcs/rfc1985.html">RFC 1985</a> (ETRN command)
<a href="http://www.faqs.org/rfcs/rfc2034.html">RFC 2034</a> (Enhanced Error Codes)
<a href="http://www.faqs.org/rfcs/rfc2034.html">RFC 2034</a> (Enhanced Status Codes)
<a href="http://www.faqs.org/rfcs/rfc2554.html">RFC 2554</a> (AUTH command)
<a href="http://www.faqs.org/rfcs/rfc2821.html">RFC 2821</a> (SMTP protocol)
<a href="http://www.faqs.org/rfcs/rfc2920.html">RFC 2920</a> (SMTP Pipelining)
<a href="http://www.faqs.org/rfcs/rfc3207.html">RFC 3207</a> (STARTTLS command)
<a href="http://www.faqs.org/rfcs/rfc3463.html">RFC 3463</a> (Enhanced Status Codes)
<b>DIAGNOSTICS</b>
Problems and transactions are logged to <b>syslogd</b>(8).

View File

@ -929,7 +929,10 @@ The blacklisted entity type: Client host, Helo command, Sender
address, or Recipient address.
.IP "\fB$rbl_code\fR"
The numerical SMTP response code, as specified with the
maps_rbl_reject_code configuration parameter.
maps_rbl_reject_code configuration parameter. Note: The numerical
SMTP response code is required, and must appear at the start of the
reply. With Postfix 2.3 and later this information may be followed
by an RFC 3463 enhanced status code.
.IP "\fB$rbl_domain\fR"
The RBL domain where $rbl_what is blacklisted.
.IP "\fB$rbl_reason\fR"

View File

@ -17,7 +17,7 @@ delivery requests from
the queue manager. Each request specifies a queue file, a sender
address, a domain or host name that is treated as the reason for
discarding the mail, and recipient information.
The reason may be prefixed with an RFC 1893-compatible detail code.
The reason may be prefixed with an RFC 3463-compatible detail code.
This program expects to be run from the \fBmaster\fR(8) process
manager.

View File

@ -17,7 +17,7 @@ requests from
the queue manager. Each request specifies a queue file, a sender
address, a domain or host name that is treated as the reason for
non-delivery, and recipient information.
The reason may be prefixed with an RFC 1893-compatible detail code.
The reason may be prefixed with an RFC 3463-compatible detail code.
This program expects to be run from the \fBmaster\fR(8) process
manager.

View File

@ -60,10 +60,11 @@ RFC 1651 (SMTP service extensions)
RFC 1652 (8bit-MIME transport)
RFC 1870 (Message Size Declaration)
RFC 2033 (LMTP protocol)
RFC 2034 (Enhanced Error Codes)
RFC 2034 (Enhanced Status codes)
RFC 2554 (AUTH command)
RFC 2821 (SMTP protocol)
RFC 2920 (SMTP Pipelining)
RFC 3463 (Enhanced Status codes)
.SH DIAGNOSTICS
.ad
.fi

View File

@ -185,6 +185,13 @@ error) is captured for inclusion with non-delivery status reports.
A command is forcibly terminated if it does not complete within
\fBcommand_time_limit\fR seconds. Command exit status codes are
expected to follow the conventions defined in <\fBsysexits.h\fR>.
Exit status 0 means normal successful completion.
Postfix version 2.3 and later support RFC 3463-style enhanced
status codes. If a command terminates with a non-zero exit
status, and the command output begins with an enhanced
status code, this status code takes precedence over the
non-zero exit status.
A limited amount of message context is exported via environment
variables. Characters that may have special meaning to the shell
@ -317,6 +324,7 @@ parameter.
.na
.nf
RFC 822 (ARPA Internet Text Messages)
RFC 3463 (Enhanced status codes)
.SH DIAGNOSTICS
.ad
.fi

View File

@ -221,11 +221,22 @@ into as many command-line arguments as there are recipients.
.sp
This information is modified by the \fBu\fR flag for case folding.
.RE
.SH "STANDARDS"
.na
.nf
RFC 3463 (Enhanced status codes)
.SH DIAGNOSTICS
.ad
.fi
Command exit status codes are expected to
follow the conventions defined in <\fBsysexits.h\fR>.
Exit status 0 means normal successful completion.
Postfix version 2.3 and later support RFC 3463-style enhanced
status codes. If a command terminates with a non-zero exit
status, and the command output begins with an enhanced
status code, this status code takes precedence over the
non-zero exit status.
Problems and transactions are logged to \fBsyslogd\fR(8).
Corrupted message files are marked so that the queue manager

View File

@ -57,12 +57,13 @@ RFC 1651 (SMTP service extensions)
RFC 1652 (8bit-MIME transport)
RFC 1870 (Message Size Declaration)
RFC 2045 (MIME: Format of Internet Message Bodies)
RFC 2034 (Enhanced Error Codes)
RFC 2034 (Enhanced Status Codes)
RFC 2046 (MIME: Media Types)
RFC 2554 (AUTH command)
RFC 2821 (SMTP protocol)
RFC 2920 (SMTP Pipelining)
RFC 3207 (STARTTLS command)
RFC 3463 (Enhanced Status Codes)
.SH DIAGNOSTICS
.ad
.fi

View File

@ -46,11 +46,12 @@ RFC 1652 (8bit-MIME transport)
RFC 1869 (SMTP service extensions)
RFC 1870 (Message Size Declaration)
RFC 1985 (ETRN command)
RFC 2034 (Enhanced Error Codes)
RFC 2034 (Enhanced Status Codes)
RFC 2554 (AUTH command)
RFC 2821 (SMTP protocol)
RFC 2920 (SMTP Pipelining)
RFC 3207 (STARTTLS command)
RFC 3463 (Enhanced Status Codes)
.SH DIAGNOSTICS
.ad
.fi

View File

@ -992,7 +992,10 @@ address, or Recipient address. </dd>
<dt><b>$rbl_code</b></dt>
<dd>The numerical SMTP response code, as specified with the
maps_rbl_reject_code configuration parameter. </dd>
maps_rbl_reject_code configuration parameter. Note: The numerical
SMTP response code is required, and must appear at the start of the
reply. With Postfix 2.3 and later this information may be followed
by an RFC 3463 enhanced status code. </dd>
<dt><b>$rbl_domain</b></dt>

View File

@ -11,7 +11,7 @@
/* the queue manager. Each request specifies a queue file, a sender
/* address, a domain or host name that is treated as the reason for
/* discarding the mail, and recipient information.
/* The reason may be prefixed with an RFC 1893-compatible detail code.
/* The reason may be prefixed with an RFC 3463-compatible detail code.
/* This program expects to be run from the \fBmaster\fR(8) process
/* manager.
/*

View File

@ -11,7 +11,7 @@
/* the queue manager. Each request specifies a queue file, a sender
/* address, a domain or host name that is treated as the reason for
/* non-delivery, and recipient information.
/* The reason may be prefixed with an RFC 1893-compatible detail code.
/* The reason may be prefixed with an RFC 3463-compatible detail code.
/* This program expects to be run from the \fBmaster\fR(8) process
/* manager.
/*

View File

@ -620,12 +620,61 @@ deliver_request.o: mail_open_ok.h
deliver_request.o: mail_proto.h
deliver_request.o: mail_queue.h
deliver_request.o: recipient_list.h
dict_ldap.o: ../../include/argv.h
dict_ldap.o: ../../include/binhash.h
dict_ldap.o: ../../include/dict.h
dict_ldap.o: ../../include/match_list.h
dict_ldap.o: ../../include/match_ops.h
dict_ldap.o: ../../include/msg.h
dict_ldap.o: ../../include/mymalloc.h
dict_ldap.o: ../../include/stringops.h
dict_ldap.o: ../../include/sys_defs.h
dict_ldap.o: ../../include/vbuf.h
dict_ldap.o: ../../include/vstream.h
dict_ldap.o: ../../include/vstring.h
dict_ldap.o: cfg_parser.h
dict_ldap.o: db_common.h
dict_ldap.o: dict_ldap.c
dict_ldap.o: dict_ldap.h
dict_ldap.o: string_list.h
dict_mysql.o: ../../include/argv.h
dict_mysql.o: ../../include/dict.h
dict_mysql.o: ../../include/events.h
dict_mysql.o: ../../include/find_inet.h
dict_mysql.o: ../../include/match_list.h
dict_mysql.o: ../../include/match_ops.h
dict_mysql.o: ../../include/msg.h
dict_mysql.o: ../../include/mymalloc.h
dict_mysql.o: ../../include/myrand.h
dict_mysql.o: ../../include/split_at.h
dict_mysql.o: ../../include/sys_defs.h
dict_mysql.o: ../../include/vbuf.h
dict_mysql.o: ../../include/vstream.h
dict_mysql.o: ../../include/vstring.h
dict_mysql.o: cfg_parser.h
dict_mysql.o: db_common.h
dict_mysql.o: dict_mysql.c
dict_mysql.o: dict_mysql.h
dict_mysql.o: string_list.h
dict_pgsql.o: ../../include/argv.h
dict_pgsql.o: ../../include/dict.h
dict_pgsql.o: ../../include/events.h
dict_pgsql.o: ../../include/find_inet.h
dict_pgsql.o: ../../include/match_list.h
dict_pgsql.o: ../../include/match_ops.h
dict_pgsql.o: ../../include/msg.h
dict_pgsql.o: ../../include/mymalloc.h
dict_pgsql.o: ../../include/myrand.h
dict_pgsql.o: ../../include/split_at.h
dict_pgsql.o: ../../include/sys_defs.h
dict_pgsql.o: ../../include/vbuf.h
dict_pgsql.o: ../../include/vstream.h
dict_pgsql.o: ../../include/vstring.h
dict_pgsql.o: cfg_parser.h
dict_pgsql.o: db_common.h
dict_pgsql.o: dict_pgsql.c
dict_pgsql.o: dict_pgsql.h
dict_pgsql.o: string_list.h
dict_proxy.o: ../../include/argv.h
dict_proxy.o: ../../include/attr.h
dict_proxy.o: ../../include/dict.h

View File

@ -127,7 +127,7 @@
/* Name of the host that the message could not be delivered to.
/* This information is used for syslogging only.
/* .IP dsn
/* X.YY.ZZ Error detail as specified in RFC 1893.
/* X.YY.ZZ Error detail as specified in RFC 3463.
/* .IP entry
/* Message arrival time.
/* .IP orig_rcpt

View File

@ -10,7 +10,7 @@
/* .in +4
/* const unsigned status; /* cleanup status */
/* const int smtp; /* RFC 821 */
/* const char *dsn; /* RFC 1893 */
/* const char *dsn; /* RFC 3463 */
/* const char *text; /* free text */
/* .in -4
/* } CLEANUP_STAT_DETAIL;

View File

@ -71,7 +71,7 @@
typedef struct {
const unsigned status; /* CLEANUP_STAT_MUMBLE */
const int smtp; /* RFC 821 */
const char *dsn; /* RFC 1893 */
const char *dsn; /* RFC 3463 */
const char *text; /* free text */
} CLEANUP_STAT_DETAIL;

View File

@ -107,7 +107,7 @@
/* .IP entry
/* Message arrival time.
/* .IP dsn
/* X.YY.ZZ Error detail as specified in RFC 1893.
/* X.YY.ZZ Error detail as specified in RFC 3463.
/* .IP format
/* The reason for non-delivery.
/* .IP ap

View File

@ -65,7 +65,7 @@
/* by the caller when all delivery to the destination in
/* \fInexthop\fR should be deferred. The value of the
/* \fIhop_status\fR member is the reason, with optional
/* RFC 1893-style detail at the beginning; it is passed
/* RFC 3463-style detail at the beginning; it is passed
/* to myfree().
/*
/* deliver_request_done() reports the delivery status back to the

View File

@ -8,7 +8,7 @@
/*
/* typedef struct {
/* .in +4
/* char dsn[...]; /* RFC 1893 */
/* char dsn[...]; /* RFC 3463 */
/* const char *text; /* Free text */
/* .in -4
/* } DSN_SPLIT;
@ -24,7 +24,7 @@
/*
/* typedef struct {
/* .in +4
/* char dsn[...]; /* RFC 1893 */
/* char dsn[...]; /* RFC 3463 */
/* VSTRING *text; /* Free text */
/* .in -4
/* } DSN_VSTRING;
@ -43,19 +43,19 @@
/* size_t dsn_valid(text)
/* const char *text;
/* DESCRIPTION
/* The functions in this module manipulate pairs of RFC 1893
/* The functions in this module manipulate pairs of RFC 3463
/* X.X.X detail codes and descriptive free text.
/*
/* dsn_split() splits text into an RFC 1893 detail code and
/* dsn_split() splits text into an RFC 3463 detail code and
/* descriptive free text. When the text does not start with
/* a detail code, the specified default detail code is used
/* instead. Whitespace before the optional detail code or
/* text is skipped. dsn_split() returns a copy of the RFC
/* 1893 detail code, and returns a pointer to (not copy of)
/* 3463 detail code, and returns a pointer to (not copy of)
/* the remainder of the text. The result value is the first
/* argument.
/*
/* dsn_prepend() prepends the specified default RFC 1893 detail
/* dsn_prepend() prepends the specified default RFC 3463 detail
/* code to the specified text if no detail code is present in
/* the text. This function produces the same result as calling
/* concatenate() with the results from dsn_split(). The result
@ -63,7 +63,7 @@
/* detail code or text is skipped.
/*
/* dsn_vstring_alloc() creates initialized storage for an RFC
/* 1893 detail code and descriptive free text.
/* 3463 detail code and descriptive free text.
/*
/* dsn_vstring_update() updates the detail code, the descriptive
/* free text, or both. Specify a null pointer (or zero-length
@ -72,19 +72,19 @@
/* dsn_vstring_free() recycles the storage that was allocated
/* by dsn_vstring_alloc() and dsn_vstring_update().
/*
/* dsn_valid() returns the length of the RFC 1893 detail code
/* dsn_valid() returns the length of the RFC 3463 detail code
/* at the beginning of text, or zero. It does not skip initial
/* whitespace.
/*
/* Arguments:
/* .IP def_dsn
/* Null-terminated default RFC 1893 detail code that will be
/* Null-terminated default RFC 3463 detail code that will be
/* used when the free text does not start with one.
/* .IP dp
/* Pointer to storage for copy of DSN detail code, and for
/* pointer to free text.
/* .IP dsn
/* Null-terminated RFC 1893 detail code.
/* Null-terminated RFC 3463 detail code.
/* .IP text
/* Null-terminated free text.
/* .IP vp
@ -123,7 +123,7 @@
#include <dsn_util.h>
/* dsn_valid - check RFC 1893 enhanced status code, return length or zero */
/* dsn_valid - check RFC 3463 enhanced status code, return length or zero */
size_t dsn_valid(const char *text)
{
@ -157,7 +157,7 @@ DSN_SPLIT *dsn_split(DSN_SPLIT *dp, const char *def_dsn, const char *text)
size_t len;
/*
* Look for an optional RFC 1893 enhanced status code.
* Look for an optional RFC 3463 enhanced status code.
*
* XXX If we want to enforce that the first digit of the status code in the
* text matches the default status code, then pipe_command() needs to be

View File

@ -29,7 +29,7 @@
* Split flat text into detail code and free text.
*/
typedef struct {
char dsn[DSN_BUFSIZE]; /* RFC 1893 X.XXX.XXX detail */
char dsn[DSN_BUFSIZE]; /* RFC 3463 X.XXX.XXX detail */
const char *text; /* free text */
} DSN_SPLIT;
@ -50,7 +50,7 @@ extern char *dsn_prepend(const char *, const char *);
* Easy to update pair of detail code and free text.
*/
typedef struct {
char dsn[DSN_LEN + 1]; /* RFC 1893 X.XXX.XXX detail */
char dsn[DSN_LEN + 1]; /* RFC 3463 X.XXX.XXX detail */
VSTRING *vstring; /* free text */
} DSN_VSTRING;

View File

@ -53,7 +53,7 @@
/* .IP status
/* bounced, deferred, sent, and so on.
/* .IP detail
/* X.YY.ZZ Error detail as specified in RFC 1893.
/* X.YY.ZZ Error detail as specified in RFC 3463.
/* .IP entry
/* Message arrival time.
/* .IP format

View File

@ -269,7 +269,8 @@ int mail_copy(const char *sender,
dsn_vstring_update(why, TRY_AGAIN_ERROR(errno) ? "4.3.0" : "5.3.0",
"error reading message: %m");
if (why && write_error)
dsn_vstring_update(why, mbox_dsn(errno), "error writing message: %m");
dsn_vstring_update(why, mbox_dsn(errno, "5.3.0"),
"error writing message: %m");
/*
* Use flag+errno description when the optional verbose description is

View File

@ -1689,7 +1689,7 @@ extern int var_access_map_code;
extern char *var_rbl_reply_maps;
#define VAR_DEF_RBL_REPLY "default_rbl_reply"
#define DEF_DEF_RBL_REPLY "$rbl_code 5.7.1 Service unavailable; $rbl_class [$rbl_what] blocked using $rbl_domain${rbl_reason?; $rbl_reason}"
#define DEF_DEF_RBL_REPLY "$rbl_code Service unavailable; $rbl_class [$rbl_what] blocked using $rbl_domain${rbl_reason?; $rbl_reason}"
extern char *var_def_rbl_reply;
#define REJECT_MAPS_RBL "reject_maps_rbl" /* backwards compat */

View File

@ -20,7 +20,7 @@
* Patches change the patchlevel and the release date. Snapshots change the
* release date only.
*/
#define MAIL_RELEASE_DATE "20050327"
#define MAIL_RELEASE_DATE "20050328"
#define MAIL_VERSION_NUMBER "2.3"
#define VAR_MAIL_VERSION "mail_version"

View File

@ -13,7 +13,8 @@
/* .in -4
/* } MBOX;
/*
/* MBOX *mbox_open(path, flags, mode, st, user, group, lock_style, why)
/* MBOX *mbox_open(path, flags, mode, st, user, group, lock_style,
/* def_dsn, why)
/* const char *path;
/* int flags;
/* int mode;
@ -21,13 +22,15 @@
/* uid_t user;
/* gid_t group;
/* int lock_style;
/* const char *def_dsn;
/* DSN_VSTRING *why;
/*
/* void mbox_release(mbox)
/* MBOX *mbox;
/*
/* const char *mbox_dsn(err)
/* const char *mbox_dsn(err, def_dsn)
/* int err;
/* const char *def_dsn;
/* DESCRIPTION
/* This module manages access to UNIX mailbox-style files.
/*
@ -39,12 +42,22 @@
/* The \fBlock_style\fR argument specifies a lock style from
/* mbox_lock_mask(). Locks are applied to regular files only.
/* The result is a handle that must be destroyed by mbox_release().
/* The \fBdef_dsn\fR argument is given to mbox_dsn().
/*
/* mbox_release() releases the named mailbox. It is up to the
/* application to close the stream.
/*
/* mbox_dsn() translates an errno value to a mailbox related
/* DSN detail code.
/* enhanced status code.
/* .IP "EAGAIN, ESTALE"
/* These result in a 4.2.0 soft error (mailbox problem).
/* .IP ENOSPC
/* This results in a 4.3.0 soft error (mail system full).
/* .IP "EDQUOT, EFBIG"
/* These result in a 5.2.2 hard error (mailbox full).
/* .PP
/* All other errors are assigned the specified default error
/* code. Typically, one would specify 4.2.0 or 5.2.0.
/* DIAGNOSTICS
/* mbox_open() returns a null pointer in case of problems, and
/* sets errno to EAGAIN if someone else has exclusive access.
@ -90,7 +103,8 @@
MBOX *mbox_open(const char *path, int flags, int mode, struct stat * st,
uid_t chown_uid, gid_t chown_gid,
int lock_style, DSN_VSTRING *why)
int lock_style, const char *def_dsn,
DSN_VSTRING *why)
{
struct stat local_statbuf;
MBOX *mp;
@ -113,7 +127,7 @@ MBOX *mbox_open(const char *path, int flags, int mode, struct stat * st,
st = &local_statbuf;
if ((fp = safe_open(path, flags | O_NONBLOCK, mode, st,
chown_uid, chown_gid, why->vstring)) == 0) {
dsn_vstring_update(why, mbox_dsn(errno), "");
dsn_vstring_update(why, mbox_dsn(errno, def_dsn), "");
return (0);
}
close_on_exec(vstream_fileno(fp), CLOSE_ON_EXEC);
@ -137,13 +151,13 @@ MBOX *mbox_open(const char *path, int flags, int mode, struct stat * st,
if (dot_lockfile(path, why->vstring) == 0) {
locked |= MBOX_DOT_LOCK;
} else if (errno == EEXIST) {
dsn_vstring_update(why, mbox_dsn(EAGAIN), "");
dsn_vstring_update(why, mbox_dsn(EAGAIN, def_dsn), "");
vstream_fclose(fp);
return (0);
} else if (lock_style & MBOX_DOT_LOCK_MAY_FAIL) {
msg_warn("%s", vstring_str(why->vstring));
} else {
dsn_vstring_update(why, mbox_dsn(errno), "");
dsn_vstring_update(why, mbox_dsn(errno, def_dsn), "");
vstream_fclose(fp);
return (0);
}
@ -163,7 +177,7 @@ MBOX *mbox_open(const char *path, int flags, int mode, struct stat * st,
&& HUNKY_DORY(MBOX_FCNTL_LOCK, MYFLOCK_STYLE_FCNTL)) {
locked |= lock_style;
} else {
dsn_vstring_update(why, mbox_dsn(errno), "");
dsn_vstring_update(why, mbox_dsn(errno, def_dsn), "");
if (locked & MBOX_DOT_LOCK)
dot_unlockfile(path);
vstream_fclose(fp);
@ -187,8 +201,8 @@ void mbox_release(MBOX *mp)
* (AFS), the only way to find out if a file was written successfully is
* to close it, and therefore the close() operation is in the mail_copy()
* routine. If we really insist on owning the vstream member, then we
* should export appropriate methods that mail_copy() can use in order
* to manipulate a message stream.
* should export appropriate methods that mail_copy() can use in order to
* manipulate a message stream.
*/
if (mp->locked & MBOX_DOT_LOCK)
dot_unlockfile(mp->path);
@ -198,10 +212,10 @@ void mbox_release(MBOX *mp)
/* mbox_dsn - map errno value to mailbox-related DSN detail */
const char *mbox_dsn(int err)
const char *mbox_dsn(int err, const char *def_dsn)
{
#define TRY_AGAIN_ERROR(e) \
(e == EACCES || e == EAGAIN || e == ESTALE)
(e == EAGAIN || e == ESTALE)
#define SYSTEM_FULL_ERROR(e) \
(e == ENOSPC)
#define MBOX_FULL_ERROR(e) \
@ -210,5 +224,5 @@ const char *mbox_dsn(int err)
return (TRY_AGAIN_ERROR(err) ? "4.2.0" :
SYSTEM_FULL_ERROR(err) ? "4.3.0" :
MBOX_FULL_ERROR(err) ? "5.2.2" :
"5.2.0");
def_dsn);
}

View File

@ -31,9 +31,10 @@ typedef struct {
VSTREAM *fp; /* open stream or null */
int locked; /* what locks were set */
} MBOX;
extern MBOX *mbox_open(const char *, int, int, struct stat *, uid_t, gid_t, int, DSN_VSTRING *);
extern MBOX *mbox_open(const char *, int, int, struct stat *, uid_t, gid_t,
int, const char *, DSN_VSTRING *);
extern void mbox_release(MBOX *);
extern const char *mbox_dsn(int);
extern const char *mbox_dsn(int, const char *);
/* LICENSE
/* .ad

View File

@ -16,7 +16,7 @@
/* output is captured for diagnostics purposes.
/*
/* If the command invokes exit() with a non-zero status,
/* the delivery status is taken from an RFC 1893-style code
/* the delivery status is taken from an RFC 3463-style code
/* at the beginning of command output. If that information is
/* unavailable, the delivery status is taken from the command
/* exit status as per <sysexits.h>.

View File

@ -66,7 +66,7 @@
/* .IP relay
/* Name of the host we're talking to.
/* .IP dsn
/* X.YY.ZZ Error detail as specified in RFC 1893.
/* X.YY.ZZ Error detail as specified in RFC 3463.
/* .IP entry
/* Message arrival time.
/* .IP format

View File

@ -9,7 +9,7 @@
/* typedef struct {
/* .in +4
/* int status; /* exit status */
/* const char *dsn; /* RFC 1893 */
/* const char *dsn; /* RFC 3463 */
/* const char *text; /* free text */
/* .in -4
/* } SYS_EXITS_DETAIL;

View File

@ -70,7 +70,7 @@
/* .IP entry
/* Message arrival time.
/* .IP dsn
/* X.YY.ZZ Error detail as specified in RFC 1893.
/* X.YY.ZZ Error detail as specified in RFC 3463.
/* .IP action
/* "deliverable", "undeliverable", and so on.
/* .IP format

View File

@ -54,7 +54,7 @@
/* .IP relay
/* Name of the host we're talking to.
/* .IP dsn
/* X.YY.ZZ Error detail as specified in RFC 1893.
/* X.YY.ZZ Error detail as specified in RFC 3463.
/* .IP entry
/* Message arrival time.
/* .IP status

View File

@ -50,10 +50,11 @@
/* RFC 1652 (8bit-MIME transport)
/* RFC 1870 (Message Size Declaration)
/* RFC 2033 (LMTP protocol)
/* RFC 2034 (Enhanced Error Codes)
/* RFC 2034 (Enhanced Status codes)
/* RFC 2554 (AUTH command)
/* RFC 2821 (SMTP protocol)
/* RFC 2920 (SMTP Pipelining)
/* RFC 3463 (Enhanced Status codes)
/* DIAGNOSTICS
/* Problems and transactions are logged to \fBsyslogd\fR(8).
/* Corrupted message files are marked so that the queue manager can

View File

@ -387,10 +387,12 @@ maildir.o: ../../include/mail_params.h
maildir.o: ../../include/make_dirs.h
maildir.o: ../../include/maps.h
maildir.o: ../../include/mbox_conf.h
maildir.o: ../../include/mbox_open.h
maildir.o: ../../include/msg.h
maildir.o: ../../include/mymalloc.h
maildir.o: ../../include/recipient_list.h
maildir.o: ../../include/resolve_clnt.h
maildir.o: ../../include/safe_open.h
maildir.o: ../../include/sane_fsops.h
maildir.o: ../../include/sent.h
maildir.o: ../../include/set_eugid.h

View File

@ -161,7 +161,8 @@ int deliver_file(LOCAL_STATE state, USER_ATTR usr_attr, char *path)
set_eugid(usr_attr.uid, usr_attr.gid);
mp = mbox_open(path, O_APPEND | O_CREAT | O_WRONLY,
S_IRUSR | S_IWUSR, &st, -1, -1,
local_mbox_lock_mask | MBOX_DOT_LOCK_MAY_FAIL, why);
local_mbox_lock_mask | MBOX_DOT_LOCK_MAY_FAIL,
"5.2.0", why);
if (mp != 0) {
if (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)) {
vstream_fclose(mp->fp);

View File

@ -171,6 +171,13 @@
/* A command is forcibly terminated if it does not complete within
/* \fBcommand_time_limit\fR seconds. Command exit status codes are
/* expected to follow the conventions defined in <\fBsysexits.h\fR>.
/* Exit status 0 means normal successful completion.
/*
/* Postfix version 2.3 and later support RFC 3463-style enhanced
/* status codes. If a command terminates with a non-zero exit
/* status, and the command output begins with an enhanced
/* status code, this status code takes precedence over the
/* non-zero exit status.
/*
/* A limited amount of message context is exported via environment
/* variables. Characters that may have special meaning to the shell
@ -295,6 +302,7 @@
/* parameter.
/* STANDARDS
/* RFC 822 (ARPA Internet Text Messages)
/* RFC 3463 (Enhanced status codes)
/* DIAGNOSTICS
/* Problems and transactions are logged to \fBsyslogd\fR(8).
/* Corrupted message files are marked so that the queue

View File

@ -186,7 +186,7 @@ static int deliver_mailbox_file(LOCAL_STATE state, USER_ATTR usr_attr)
set_eugid(spool_uid, spool_gid);
mp = mbox_open(mailbox, O_APPEND | O_WRONLY | O_CREAT,
S_IRUSR | S_IWUSR, &st, chown_uid, chown_gid,
local_mbox_lock_mask, why);
local_mbox_lock_mask, "5.2.0", why);
if (mp != 0) {
if (spool_uid != usr_attr.uid || spool_gid != usr_attr.gid)
set_eugid(usr_attr.uid, usr_attr.gid);

View File

@ -66,6 +66,7 @@
#include <sent.h>
#include <mail_params.h>
#include <dsn_util.h>
#include <mbox_open.h>
/* Application-specific. */
@ -189,9 +190,11 @@ int deliver_maildir(LOCAL_STATE state, USER_ATTR usr_attr, char *path)
&& (errno != ENOENT
|| make_dirs(tmpdir, 0700) < 0
|| (dst = vstream_fopen(tmpfile, O_WRONLY | O_CREAT | O_EXCL, 0600)) == 0)) {
dsn_vstring_update(why, "5.2.0", "create maildir file %s: %m", tmpfile);
dsn_vstring_update(why, mbox_dsn(errno, "5.2.0"),
"create maildir file %s: %m", tmpfile);
} else if (fstat(vstream_fileno(dst), &st) < 0) {
dsn_vstring_update(why, "5.2.0", "create maildir file %s: %m", tmpfile);
dsn_vstring_update(why, mbox_dsn(errno, "5.2.0"),
"create maildir file %s: %m", tmpfile);
} else {
vstring_sprintf(buf, "%lu.V%lxI%lxM%lu.%s",
(unsigned long) starttime.tv_sec,
@ -206,7 +209,7 @@ int deliver_maildir(LOCAL_STATE state, USER_ATTR usr_attr, char *path)
&& (errno != ENOENT
|| (make_dirs(curdir, 0700), make_dirs(newdir, 0700)) < 0
|| sane_link(tmpfile, newfile) < 0)) {
dsn_vstring_update(why, "5.2.0",
dsn_vstring_update(why, mbox_dsn(errno, "5.2.0"),
"create maildir file %s: %m", newfile);
mail_copy_status = MAIL_COPY_STAT_WRITE;
}

View File

@ -25,7 +25,7 @@
/* .IP recipient
/* The recipient that will not be delivered.
/* .IP dsn
/* RFC 1893 detail code.
/* RFC 3463 detail code.
/* .IP format
/* Free-format text that describes why delivery will not happen.
/* DIAGNOSTICS

View File

@ -47,7 +47,7 @@
/* .IP transport
/* Specifies a message delivery transport.
/* .IP dsn
/* X.YY.ZZ Error detail as specified in RFC 1893.
/* X.YY.ZZ Error detail as specified in RFC 3463.
/* .IP reason
/* Free-format text that describes why delivery is deferred; this
/* used for logging purposes, and for updating the message-specific

View File

@ -211,9 +211,18 @@
/* .sp
/* This information is modified by the \fBu\fR flag for case folding.
/* .RE
/* STANDARDS
/* RFC 3463 (Enhanced status codes)
/* DIAGNOSTICS
/* Command exit status codes are expected to
/* follow the conventions defined in <\fBsysexits.h\fR>.
/* Exit status 0 means normal successful completion.
/*
/* Postfix version 2.3 and later support RFC 3463-style enhanced
/* status codes. If a command terminates with a non-zero exit
/* status, and the command output begins with an enhanced
/* status code, this status code takes precedence over the
/* non-zero exit status.
/*
/* Problems and transactions are logged to \fBsyslogd\fR(8).
/* Corrupted message files are marked so that the queue manager

View File

@ -222,7 +222,7 @@ int main(int argc, char **argv)
why = dsn_vstring_alloc(1);
if ((mp = mbox_open(folder, O_APPEND | O_WRONLY | O_CREAT,
S_IRUSR | S_IWUSR, (struct stat *) 0,
-1, -1, lock_mask, why)) == 0)
-1, -1, lock_mask, "5.2.0", why)) == 0)
msg_fatal("open file %s: %s", folder, vstring_str(why->vstring));
/*

View File

@ -25,7 +25,7 @@
/* .IP recipient
/* The recipient that will not be delivered.
/* .IP dsn
/* RFC 1893 detail code.
/* RFC 3463 detail code.
/* .IP format
/* Free-format text that describes why delivery will not happen.
/* DIAGNOSTICS

View File

@ -47,7 +47,7 @@
/* .IP transport
/* Specifies a message delivery transport.
/* .IP dsn
/* X.YY.ZZ Error detail as specified in RFC 1893.
/* X.YY.ZZ Error detail as specified in RFC 3463.
/* .IP reason
/* Free-format text that describes why delivery is deferred; this
/* used for logging purposes, and for updating the message-specific

View File

@ -47,12 +47,13 @@
/* RFC 1652 (8bit-MIME transport)
/* RFC 1870 (Message Size Declaration)
/* RFC 2045 (MIME: Format of Internet Message Bodies)
/* RFC 2034 (Enhanced Error Codes)
/* RFC 2034 (Enhanced Status Codes)
/* RFC 2046 (MIME: Media Types)
/* RFC 2554 (AUTH command)
/* RFC 2821 (SMTP protocol)
/* RFC 2920 (SMTP Pipelining)
/* RFC 3207 (STARTTLS command)
/* RFC 3463 (Enhanced Status Codes)
/* DIAGNOSTICS
/* Problems and transactions are logged to \fBsyslogd\fR(8).
/* Corrupted message files are marked so that the queue manager can

View File

@ -601,7 +601,7 @@ static int smtp_start_tls(SMTP_STATE *state, int misc_flags)
*/
serverid = vstring_alloc(10);
vstring_sprintf(serverid, "%s:%u", session->addr, ntohs(session->port));
if (session->helo && strcasecmp(session->host, session->helo) != 0)
if (session->helo != 0)
vstring_sprintf_append(serverid, ":%s", session->helo);
session->tls_context =
tls_client_start(smtp_tls_ctx, session->stream,

View File

@ -36,11 +36,12 @@
/* RFC 1869 (SMTP service extensions)
/* RFC 1870 (Message Size Declaration)
/* RFC 1985 (ETRN command)
/* RFC 2034 (Enhanced Error Codes)
/* RFC 2034 (Enhanced Status Codes)
/* RFC 2554 (AUTH command)
/* RFC 2821 (SMTP protocol)
/* RFC 2920 (SMTP Pipelining)
/* RFC 3207 (STARTTLS command)
/* RFC 3463 (Enhanced Status Codes)
/* DIAGNOSTICS
/* Problems and transactions are logged to \fBsyslogd\fR(8).
/*
@ -71,7 +72,7 @@
/* Disable the SMTP VRFY command.
/* .IP "\fBsmtpd_noop_commands (empty)\fR"
/* List of commands that the Postfix SMTP server replies to with "250
/* 2.0.0 Ok", without doing any syntax checks and without changing state.
/* Ok", without doing any syntax checks and without changing state.
/* .IP "\fBstrict_rfc821_envelopes (no)\fR"
/* Require that addresses received in SMTP MAIL FROM and RCPT TO
/* commands are enclosed with <>, and that those addresses do
@ -1045,7 +1046,7 @@ static int helo_cmd(SMTPD_STATE *state, int argc, SMTPD_TOKEN *argv)
/*
* RFC 2034: the text part of all 2xx, 4xx, and 5xx SMTP responses other
* than the initial greeting and any response to HELO or EHLO are
* prefaced with a status code as defined in RFC 1893.
* prefaced with a status code as defined in RFC 3463.
*/
if (argc < 2) {
state->error_mask |= MAIL_ERROR_PROTOCOL;
@ -1093,7 +1094,7 @@ static int ehlo_cmd(SMTPD_STATE *state, int argc, SMTPD_TOKEN *argv)
*
* RFC 2034: the text part of all 2xx, 4xx, and 5xx SMTP responses other
* than the initial greeting and any response to HELO or EHLO are
* prefaced with a status code as defined in RFC 1893.
* prefaced with a status code as defined in RFC 3463.
*/
if (argc < 2) {
state->error_mask |= MAIL_ERROR_PROTOCOL;
@ -3034,7 +3035,7 @@ static void smtpd_proto(SMTPD_STATE *state, const char *service)
/*
* RFC 2034: the text part of all 2xx, 4xx, and 5xx SMTP responses
* other than the initial greeting and any response to HELO or EHLO
* are prefaced with a status code as defined in RFC 1893.
* are prefaced with a status code as defined in RFC 3463.
*/
else {
smtpd_chat_reply(state, "220 %s", var_smtpd_banner);

View File

@ -1844,7 +1844,7 @@ static int check_table_result(SMTPD_STATE *state, const char *table,
int status;
const char *cmd_text;
int cmd_len;
static char def_dsn[] = "0.0.0";
static char def_dsn[] = "5.7.1";
DSN_SPLIT dp;
/*
@ -2035,7 +2035,7 @@ static int check_table_result(SMTPD_STATE *state, const char *table,
* 4xx or 5xx means NO as well. smtpd_check_reject() will validate the
* response status code.
*
* If the caller specifies an RFC 1893 enhanced status code, put it
* If the caller specifies an RFC 3463 enhanced status code, put it
* immediately after the SMTP status code as described in RFC 2034.
*/
if (cmd_len == 3 && *cmd_text

View File

@ -104,9 +104,11 @@ maildir.o: ../../include/mail_params.h
maildir.o: ../../include/make_dirs.h
maildir.o: ../../include/maps.h
maildir.o: ../../include/mbox_conf.h
maildir.o: ../../include/mbox_open.h
maildir.o: ../../include/msg.h
maildir.o: ../../include/mymalloc.h
maildir.o: ../../include/recipient_list.h
maildir.o: ../../include/safe_open.h
maildir.o: ../../include/sane_fsops.h
maildir.o: ../../include/sent.h
maildir.o: ../../include/set_eugid.h

View File

@ -117,7 +117,7 @@ static int deliver_mailbox_file(LOCAL_STATE state, USER_ATTR usr_attr)
set_eugid(usr_attr.uid, usr_attr.gid);
mp = mbox_open(usr_attr.mailbox, O_APPEND | O_WRONLY | O_CREAT,
S_IRUSR | S_IWUSR, &st, -1, -1,
virtual_mbox_lock_mask, why);
virtual_mbox_lock_mask, "4.2.0", why);
if (mp != 0) {
if (S_ISREG(st.st_mode) == 0) {
vstream_fclose(mp->fp);

View File

@ -60,6 +60,7 @@
#include <defer.h>
#include <sent.h>
#include <mail_params.h>
#include <mbox_open.h>
/* Application-specific. */
@ -182,9 +183,11 @@ int deliver_maildir(LOCAL_STATE state, USER_ATTR usr_attr)
&& (errno != ENOENT
|| make_dirs(tmpdir, 0700) < 0
|| (dst = vstream_fopen(tmpfile, O_WRONLY | O_CREAT | O_EXCL, 0600)) == 0)) {
dsn_vstring_update(why, "5.2.0", "create maildir file %s: %m", tmpfile);
dsn_vstring_update(why, mbox_dsn(errno, "4.2.0"),
"create maildir file %s: %m", tmpfile);
} else if (fstat(vstream_fileno(dst), &st) < 0) {
dsn_vstring_update(why, "5.2.0", "create maildir file %s: %m", tmpfile);
dsn_vstring_update(why, mbox_dsn(errno, "4.2.0"),
"create maildir file %s: %m", tmpfile);
} else {
vstring_sprintf(buf, "%lu.V%lxI%lxM%lu.%s",
(unsigned long) starttime.tv_sec,
@ -199,7 +202,7 @@ int deliver_maildir(LOCAL_STATE state, USER_ATTR usr_attr)
&& (errno != ENOENT
|| (make_dirs(curdir, 0700), make_dirs(newdir, 0700)) < 0
|| sane_link(tmpfile, newfile) < 0)) {
dsn_vstring_update(why, "5.2.0",
dsn_vstring_update(why, mbox_dsn(errno, "4.2.0"),
"create maildir file %s: %m", newfile);
mail_copy_status = MAIL_COPY_STAT_WRITE;
}