~ubuntu-branches/ubuntu/raring/postfix/raring

« back to all changes in this revision

Viewing changes to src/cleanup/cleanup_envelope.c

Tags: upstream-2.2.6
ImportĀ upstreamĀ versionĀ 2.2.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
66
66
#include <qmgr_user.h>
67
67
#include <mail_params.h>
68
68
#include <verp_sender.h>
 
69
#include <mail_proto.h>
69
70
 
70
71
/* Application-specific. */
71
72
 
72
73
#include "cleanup.h"
73
74
 
74
75
#define STR     vstring_str
 
76
#define STREQ(x,y) (strcmp((x), (y)) == 0)
75
77
 
76
78
static void cleanup_envelope_process(CLEANUP_STATE *, int, const char *, int);
77
79
 
278
280
            myfree(sbuf);
279
281
            return;
280
282
        }
 
283
        /* Zero-length values are place holders for unavailable values. */
 
284
        if (*attr_value == 0) {
 
285
            msg_warn("%s: spurious null attribute value for \"%s\" -- ignored",
 
286
                     state->queue_id, attr_name);
 
287
            myfree(sbuf);
 
288
            return;
 
289
        }
 
290
        if (strcmp(attr_name, MAIL_ATTR_RWR_CONTEXT) == 0) {
 
291
            /* Choose header rewriting context. See also cleanup_addr.c. */
 
292
            if (STREQ(attr_value, MAIL_ATTR_RWR_LOCAL)) {
 
293
                state->hdr_rewrite_context = MAIL_ATTR_RWR_LOCAL;
 
294
            } else if (STREQ(attr_value, MAIL_ATTR_RWR_REMOTE)) {
 
295
                state->hdr_rewrite_context =
 
296
                    (*var_remote_rwr_domain ? MAIL_ATTR_RWR_REMOTE : 0);
 
297
            } else {
 
298
                msg_warn("%s: message rejected: bad rewriting context: %.100s",
 
299
                         state->queue_id, attr_value);
 
300
                state->errs |= CLEANUP_STAT_BAD;
 
301
                return;
 
302
            }
 
303
        }
281
304
        nvtable_update(state->attr, attr_name, attr_value);
282
305
        myfree(sbuf);
283
306
        cleanup_out(state, type, buf, len);