1/*	$NetBSD$	*/
2
3#ifndef _DSN_MASK_H_INCLUDED_
4#define _DSN_MASK_H_INCLUDED_
5
6/*++
7/* NAME
8/*	dsn_mask 3h
9/* SUMMARY
10/*	DSN embedding in SMTP
11/* SYNOPSIS
12/*	#include "dsn_mask.h"
13/* DESCRIPTION
14/* .nf
15
16 /*
17  * Support for MAIL FROM ... RET=mumble.
18  */
19#define DSN_RET_FULL	(1<<0)
20#define DSN_RET_HDRS	(1<<1)
21#define DSN_RET_BITS	(2)
22
23 /*
24  * Use this to filter bad content in queue files.
25  */
26#define DSN_RET_OK(v)	((v) == DSN_RET_FULL || (v) == DSN_RET_HDRS)
27
28 /*
29  * Only when RET is specified by the sender is the SMTP client allowed to
30  * specify RET=mumble while delivering mail (RFC 3461 section 5.2.1).
31  * However, if RET is not requested, then the MTA is allowed to interpret
32  * this as RET=FULL or RET=HDRS (RFC 3461 section 4.3). Postfix chooses the
33  * former.
34  */
35
36 /*
37  * Conversion routines: string to mask and reverse.
38  */
39extern int dsn_ret_code(const char *);
40extern const char *dsn_ret_str(int);
41
42 /*
43  * Support for RCPT TO ... NOTIFY=mumble is in the form of bit masks.
44  */
45#define DSN_NOTIFY_NEVER	(1<<0)	/* must not */
46#define DSN_NOTIFY_SUCCESS	(1<<1)	/* must */
47#define DSN_NOTIFY_FAILURE	(1<<2)	/* must */
48#define DSN_NOTIFY_DELAY	(1<<3)	/* may */
49#define DSN_NOTIFY_BITS		(4)
50
51 /*
52  * Any form of sender-requested notification.
53  */
54#define DSN_NOTIFY_ANY \
55    (DSN_NOTIFY_SUCCESS | DSN_NOTIFY_FAILURE | DSN_NOTIFY_DELAY)
56
57 /*
58  * Override the sender-specified notification restriction.
59  */
60#define DSN_NOTIFY_OVERRIDE	(DSN_NOTIFY_ANY | DSN_NOTIFY_NEVER)
61
62 /*
63  * Use this to filter bad content in queue files.
64  */
65#define DSN_NOTIFY_OK(v) \
66    ((v) == DSN_NOTIFY_NEVER || (v) == ((v) & DSN_NOTIFY_ANY))
67
68 /*
69  * Only when NOTIFY=something was requested by the sender is the SMTP client
70  * allowed to specify NOTIFY=mumble while delivering mail (RFC 3461 section
71  * 5.2.1). However, if NOTIFY is not requested, then the MTA is allowed to
72  * interpret this as NOTIFY=FAILURE or NOTIFY=FAILURE,DELAY (RFC 3461
73  * section 4.1). Postfix chooses the latter.
74  */
75
76 /*
77  * Conversion routines: string to mask and reverse.
78  */
79extern int dsn_notify_mask(const char *);
80extern const char *dsn_notify_str(int);
81
82/* LICENSE
83/* .ad
84/* .fi
85/*	The Secure Mailer license must be distributed with this software.
86/* AUTHOR(S)
87/*	Wietse Venema
88/*	IBM T.J. Watson Research
89/*	P.O. Box 704
90/*	Yorktown Heights, NY 10598, USA
91/*--*/
92
93#endif
94