1#ifndef _MAIL_COPY_H_INCLUDED_
2#define _MAIL_COPY_H_INCLUDED_
3
4/*++
5/* NAME
6/*	mail_copy 3h
7/* SUMMARY
8/*	copy message with extreme prejudice
9/* SYNOPSIS
10/*	#include <mail_copy.h>
11/* DESCRIPTION
12/* .nf
13
14 /*
15  * Utility library.
16  */
17#include <vstream.h>
18#include <vstring.h>
19
20 /*
21  * Global library.
22  */
23#include <dsn_buf.h>
24
25 /*
26  * External interface.
27  */
28extern int mail_copy(const char *, const char *, const char *,
29		             VSTREAM *, VSTREAM *,
30		             int, const char *, DSN_BUF *);
31
32#define MAIL_COPY_QUOTE		(1<<0)	/* prepend > to From_ */
33#define MAIL_COPY_TOFILE	(1<<1)	/* fsync, ftruncate() */
34#define MAIL_COPY_FROM		(1<<2)	/* prepend From_ */
35#define MAIL_COPY_DELIVERED	(1<<3)	/* prepend Delivered-To: */
36#define MAIL_COPY_RETURN_PATH	(1<<4)	/* prepend Return-Path: */
37#define MAIL_COPY_DOT		(1<<5)	/* escape dots - needed for bsmtp */
38#define MAIL_COPY_BLANK		(1<<6)	/* append blank line */
39#define MAIL_COPY_ORIG_RCPT	(1<<7)	/* prepend X-Original-To: */
40#define MAIL_COPY_MBOX		(MAIL_COPY_FROM | MAIL_COPY_QUOTE | \
41				    MAIL_COPY_TOFILE | MAIL_COPY_DELIVERED | \
42				    MAIL_COPY_RETURN_PATH | MAIL_COPY_BLANK | \
43					MAIL_COPY_ORIG_RCPT)
44
45#define MAIL_COPY_NONE		0	/* all turned off */
46
47#define MAIL_COPY_STAT_OK	0
48#define MAIL_COPY_STAT_CORRUPT	(1<<0)
49#define MAIL_COPY_STAT_READ	(1<<1)
50#define MAIL_COPY_STAT_WRITE	(1<<2)
51
52/* LICENSE
53/* .ad
54/* .fi
55/*	The Secure Mailer license must be distributed with this software.
56/* AUTHOR(S)
57/*	Wietse Venema
58/*	IBM T.J. Watson Research
59/*	P.O. Box 704
60/*	Yorktown Heights, NY 10598, USA
61/*--*/
62
63#endif
64