~ubuntu-branches/ubuntu/natty/postfix/natty-security

« back to all changes in this revision

Viewing changes to src/cleanup/cleanup_addr.c

  • Committer: Bazaar Package Importer
  • Author(s): LaMont Jones
  • Date: 2011-02-22 05:26:41 UTC
  • mfrom: (1.1.27 upstream)
  • Revision ID: james.westby@ubuntu.com-20110222052641-l05d2bsz2kka0yca
Tags: 2.8.0-1~build1
natty version

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
/*      CLEANUP_STATE *state;
15
15
/*      const char *addr;
16
16
/*
 
17
/*      void    cleanup_addr_bcc_dsn(state, addr, dsn_orcpt, dsn_notify)
 
18
/*      CLEANUP_STATE *state;
 
19
/*      const char *addr;
 
20
/*      const char *dsn_orcpt;
 
21
/*      int     dsn_notify;
 
22
/*
17
23
/*      void    cleanup_addr_bcc(state, addr)
18
24
/*      CLEANUP_STATE *state;
19
25
/*      const char *addr;
28
34
/*      cleanup_addr_recipient() processes recipient envelope information
29
35
/*      and updates state->recip.
30
36
/*
31
 
/*      cleanup_addr_bcc() processes recipient envelope information. This
 
37
/*      cleanup_addr_bcc_dsn() processes recipient envelope information. This
32
38
/*      is a separate function to avoid invoking cleanup_addr_recipient()
33
39
/*      recursively.
34
40
/*
 
41
/*      cleanup_addr_bcc() is a backwards-compatibility wrapper for
 
42
/*      cleanup_addr_bcc_dsn() that requests no delivery status
 
43
/*      notification for the recipient.
 
44
/*
35
45
/*      Arguments:
36
46
/* .IP state
37
47
/*      Queue file and message processing state. This state is updated
38
48
/*      as records are processed and as errors happen.
39
49
/* .IP buf
40
50
/*      Record content.
 
51
/* .IP dsn_orcpt
 
52
/*      The DSN original recipient (or NO_DSN_ORCPT to specify none).
 
53
/* .IP dsn_notify
 
54
/*      DSN notification options. Specify NO_DSN_NOTIFY to disable
 
55
/*      notification, and DEF_DSN_NOTIFY for default notification.
41
56
/* LICENSE
42
57
/* .ad
43
58
/* .fi
179
194
    vstring_free(clean_addr);
180
195
}
181
196
 
182
 
/* cleanup_addr_bcc - process automatic BCC recipient */
 
197
/* cleanup_addr_bcc_dsn - process automatic BCC recipient */
183
198
 
184
 
void    cleanup_addr_bcc(CLEANUP_STATE *state, const char *bcc)
 
199
void    cleanup_addr_bcc_dsn(CLEANUP_STATE *state, const char *bcc,
 
200
                                 const char *dsn_orcpt, int dsn_notify)
185
201
{
186
202
    VSTRING *clean_addr = vstring_alloc(100);
187
203
 
189
205
     * Note: BCC addresses are supplied locally, and must be rewritten in the
190
206
     * local address rewriting context.
191
207
     */
192
 
#define NO_DSN_ORCPT    ((char *) 0)
193
 
 
194
208
    cleanup_rewrite_internal(MAIL_ATTR_RWR_LOCAL, clean_addr, bcc);
195
209
    if (state->flags & CLEANUP_FLAG_MAP_OK) {
196
210
        if (cleanup_rcpt_canon_maps
205
219
            && (cleanup_masq_flags & CLEANUP_MASQ_FLAG_ENV_RCPT))
206
220
            cleanup_masquerade_internal(clean_addr, cleanup_masq_domains);
207
221
    }
208
 
    cleanup_out_recipient(state, NO_DSN_ORCPT, DSN_NOTIFY_NEVER,
 
222
    cleanup_out_recipient(state, dsn_orcpt, dsn_notify,
209
223
                          STR(clean_addr), STR(clean_addr));
210
224
    vstring_free(clean_addr);
211
225
}