1 /*	$NetBSD: mail_queue.h,v 1.1.1.2 2010/06/17 18:06:50 tron Exp $	*/
2 
3 #ifndef _MAIL_QUEUE_H_INCLUDED_
4 #define _MAIL_QUEUE_H_INCLUDED_
5 
6 /*++
7 /* NAME
8 /*	mail_queue 3h
9 /* SUMMARY
10 /*	mail queue access
11 /* SYNOPSIS
12 /*	#include <mail_queue.h>
13 /* DESCRIPTION
14 /* .nf
15 
16  /*
17   * System library.
18   */
19 #include <sys/time.h>
20 
21  /*
22   * Utility library.
23   */
24 #include <vstring.h>
25 #include <vstream.h>
26 
27  /*
28   * Mail queue names.
29   */
30 #define MAIL_QUEUE_MAILDROP	"maildrop"
31 #define MAIL_QUEUE_HOLD		"hold"
32 #define MAIL_QUEUE_INCOMING	"incoming"
33 #define MAIL_QUEUE_ACTIVE	"active"
34 #define MAIL_QUEUE_DEFERRED	"deferred"
35 #define MAIL_QUEUE_TRACE	"trace"
36 #define MAIL_QUEUE_DEFER	"defer"
37 #define MAIL_QUEUE_BOUNCE	"bounce"
38 #define MAIL_QUEUE_CORRUPT	"corrupt"
39 #define MAIL_QUEUE_FLUSH	"flush"
40 #define MAIL_QUEUE_SAVED	"saved"
41 
42  /*
43   * Queue file modes.
44   *
45   * 4.4BSD-like systems don't allow (sticky AND executable) together, so we use
46   * group read permission bits instead. These are more portable, but they
47   * also are more likely to be turned on by accident. It would not be the end
48   * of the world.
49   */
50 #define MAIL_QUEUE_STAT_READY	(S_IRUSR | S_IWUSR | S_IXUSR)
51 #define MAIL_QUEUE_STAT_CORRUPT	(S_IRUSR)
52 #ifndef MAIL_QUEUE_STAT_UNTHROTTLE
53 #define MAIL_QUEUE_STAT_UNTHROTTLE (S_IRGRP)
54 #endif
55 
56 extern struct VSTREAM *mail_queue_enter(const char *, mode_t, struct timeval *);
57 extern struct VSTREAM *mail_queue_open(const char *, const char *, int, mode_t);
58 extern int mail_queue_rename(const char *, const char *, const char *);
59 extern int mail_queue_remove(const char *, const char *);
60 extern const char *mail_queue_dir(VSTRING *, const char *, const char *);
61 extern const char *mail_queue_path(VSTRING *, const char *, const char *);
62 extern int mail_queue_mkdirs(const char *);
63 extern int mail_queue_name_ok(const char *);
64 extern int mail_queue_id_ok(const char *);
65 
66 /* LICENSE
67 /* .ad
68 /* .fi
69 /*	The Secure Mailer license must be distributed with this software.
70 /* AUTHOR(S)
71 /*	Wietse Venema
72 /*	IBM T.J. Watson Research
73 /*	P.O. Box 704
74 /*	Yorktown Heights, NY 10598, USA
75 /*--*/
76 
77 #endif
78