bounce_service.h revision 1.1
1/*	$NetBSD: bounce_service.h,v 1.1 2009/06/23 10:08:42 tron Exp $	*/
2
3/*++
4/* NAME
5/*	bounce_service 3h
6/* SUMMARY
7/*	bounce message service
8/* SYNOPSIS
9/*	#include <bounce_service.h>
10/* DESCRIPTION
11/* .nf
12
13 /*
14  * Utility library.
15  */
16#include <vstring.h>
17
18 /*
19  * Global library.
20  */
21#include <bounce_log.h>
22
23 /*
24  * Application-specific.
25  */
26#include <bounce_template.h>
27
28 /*
29  * bounce_append_service.c
30  */
31extern int bounce_append_service(int, char *, char *, RECIPIENT *, DSN *);
32
33 /*
34  * bounce_notify_service.c
35  */
36extern int bounce_notify_service(int, char *, char *, char *, char *, char *, char *, int, BOUNCE_TEMPLATES *);
37
38 /*
39  * bounce_warn_service.c
40  */
41extern int bounce_warn_service(int, char *, char *, char *, char *, char *, char *, int, BOUNCE_TEMPLATES *);
42
43 /*
44  * bounce_trace_service.c
45  */
46extern int bounce_trace_service(int, char *, char *, char *, char *, char *, char *, int, BOUNCE_TEMPLATES *);
47
48 /*
49  * bounce_notify_verp.c
50  */
51extern int bounce_notify_verp(int, char *, char *, char *, char *, char *, char *, int, char *, BOUNCE_TEMPLATES *);
52
53 /*
54  * bounce_one_service.c
55  */
56extern int bounce_one_service(int, char *, char *, char *, char *, char *, int, RCPT_BUF *, DSN_BUF *, BOUNCE_TEMPLATES *);
57
58 /*
59  * bounce_cleanup.c
60  */
61extern VSTRING *bounce_cleanup_path;
62extern void bounce_cleanup_register(char *, char *);
63extern void bounce_cleanup_log(void);
64extern void bounce_cleanup_unregister(void);
65
66#define bounce_cleanup_registered() (bounce_cleanup_path != 0)
67
68 /*
69  * bounce_notify_util.c
70  */
71typedef struct {
72    const char *service;		/* bounce or defer */
73    const char *queue_name;		/* incoming, etc. */
74    const char *queue_id;		/* base name */
75    const char *mime_encoding;		/* null or encoding */
76    const char *dsn_envid;		/* DSN envelope ID */
77    const char *mime_boundary;		/* for MIME */
78    BOUNCE_TEMPLATE *template;		/* bounce message template */
79    VSTRING *buf;			/* scratch pad */
80    VSTRING *sender;			/* envelope sender */
81    VSTREAM *orig_fp;			/* open queue file */
82    long    orig_offs;			/* start of content */
83    time_t  arrival_time;		/* time of arrival */
84    long    message_size;		/* size of content */
85    RCPT_BUF *rcpt_buf;			/* recipient info */
86    DSN_BUF *dsn_buf;			/* delivery status info */
87    BOUNCE_LOG *log_handle;		/* open logfile */
88    char   *mail_name;			/* $mail_name, cooked */
89} BOUNCE_INFO;
90
91 /* */
92
93extern BOUNCE_INFO *bounce_mail_init(const char *, const char *, const char *, const char *, const char *, BOUNCE_TEMPLATE *);
94extern BOUNCE_INFO *bounce_mail_one_init(const char *, const char *, const char *, const char *, RCPT_BUF *, DSN_BUF *, BOUNCE_TEMPLATE *);
95extern void bounce_mail_free(BOUNCE_INFO *);
96extern int bounce_header(VSTREAM *, BOUNCE_INFO *, const char *, int);
97extern int bounce_boilerplate(VSTREAM *, BOUNCE_INFO *);
98extern int bounce_recipient_log(VSTREAM *, BOUNCE_INFO *);
99extern int bounce_diagnostic_log(VSTREAM *, BOUNCE_INFO *, int);
100extern int bounce_header_dsn(VSTREAM *, BOUNCE_INFO *);
101extern int bounce_recipient_dsn(VSTREAM *, BOUNCE_INFO *);
102extern int bounce_diagnostic_dsn(VSTREAM *, BOUNCE_INFO *, int);
103extern int bounce_original(VSTREAM *, BOUNCE_INFO *, int);
104extern void bounce_delrcpt(BOUNCE_INFO *);
105extern void bounce_delrcpt_one(BOUNCE_INFO *);
106
107/* LICENSE
108/* .ad
109/* .fi
110/*	The Secure Mailer license must be distributed with this software.
111/* AUTHOR(S)
112/*	Wietse Venema
113/*	IBM T.J. Watson Research
114/*	P.O. Box 704
115/*	Yorktown Heights, NY 10598, USA
116/*--*/
117