~ubuntu-branches/ubuntu/maverick/postfix/maverick-security

« back to all changes in this revision

Viewing changes to src/smtp/smtp_rcpt.c

  • Committer: Bazaar Package Importer
  • Author(s): LaMont Jones, Wietse Venema, LaMont Jones
  • Date: 2009-06-03 14:17:08 UTC
  • mfrom: (1.1.22 upstream)
  • Revision ID: james.westby@ubuntu.com-20090603141708-o9u59xlor7nmd2x1
[Wietse Venema]

* New upstream release: 2.6.2~rc1

[LaMont Jones]

* move postfix-add-{filter,policy} manpages to section 8, and deliver
* provide: default-mta on ubuntu

Show diffs side-by-side

added added

removed removed

Lines of Context:
116
116
 
117
117
/* Global library. */
118
118
 
 
119
#include <mail_params.h>
119
120
#include <deliver_request.h>            /* smtp_rcpt_done */
120
121
#include <deliver_completed.h>          /* smtp_rcpt_done */
121
122
#include <sent.h>                       /* smtp_rcpt_done */
132
133
    DELIVER_REQUEST *request = state->request;
133
134
    SMTP_SESSION *session = state->session;
134
135
    DSN_BUF *why = state->why;
 
136
    const char *dsn_action = "relayed";
135
137
    int     status;
136
138
 
137
139
    /*
 
140
     * Assume this was intermediate delivery when the server announced DSN
 
141
     * support, and don't send a DSN "SUCCESS" notification.
 
142
     */
 
143
    if (session->features & SMTP_FEATURE_DSN)
 
144
        rcpt->dsn_notify &= ~DSN_NOTIFY_SUCCESS;
 
145
 
 
146
    /*
 
147
     * Assume this was final delivery when the LMTP server announced no DSN
 
148
     * support. In backwards compatibility mode, send a "relayed" instead of
 
149
     * a "delivered" DSN "SUCCESS" notification. Do not attempt to "simplify"
 
150
     * the expression. The redundancy is for clarity. It is trivially
 
151
     * eliminated by the compiler. There is no need to sacrifice clarity for
 
152
     * the sake of "performance".
 
153
     */
 
154
    if ((session->features & SMTP_FEATURE_DSN) == 0
 
155
        && (state->misc_flags & SMTP_MISC_FLAG_USE_LMTP) != 0
 
156
        && var_lmtp_assume_final != 0)
 
157
        dsn_action = "delivered";
 
158
 
 
159
    /*
138
160
     * Report success and delete the recipient from the delivery request.
139
 
     * Defer if the success can't be reported. Don't send a DSN "SUCCESS"
140
 
     * notification if the receiving site announced DSN support.
 
161
     * Defer if the success can't be reported.
141
162
     * 
142
163
     * Note: the DSN action is ignored in case of address probes.
143
164
     */
144
 
    if (session->features & SMTP_FEATURE_DSN)
145
 
        rcpt->dsn_notify &= ~DSN_NOTIFY_SUCCESS;
146
 
 
147
 
    dsb_update(why, resp->dsn, "relayed", DSB_MTYPE_DNS, session->host,
 
165
    dsb_update(why, resp->dsn, dsn_action, DSB_MTYPE_DNS, session->host,
148
166
               DSB_DTYPE_SMTP, resp->str, "%s", resp->str);
149
167
 
150
168
    status = sent(DEL_REQ_TRACE_FLAGS(request->flags),