Expand PMF_FN_* macros.
[netbsd-mini2440.git] / external / ibm-public / postfix / dist / src / global / mail_flush.c
blobe7d1cad4919ef2d53d0e9ff24c8f7b12d40451e1
1 /* $NetBSD$ */
3 /*++
4 /* NAME
5 /* mail_flush 3
6 /* SUMMARY
7 /* flush backed up mail
8 /* SYNOPSIS
9 /* #include <mail_flush.h>
11 /* int mail_flush_deferred()
13 /* int mail_flush_maildrop()
14 /* DESCRIPTION
15 /* This module triggers delivery of backed up mail.
17 /* mail_flush_deferred() triggers delivery of all deferred
18 /* or incoming mail. This function tickles the queue manager.
20 /* mail_flush_maildrop() triggers delivery of all mail in
21 /* the maildrop directory. This function tickles the pickup
22 /* service.
23 /* DIAGNOSTICS
24 /* The result is 0 in case of success, -1 in case of failure.
25 /* LICENSE
26 /* .ad
27 /* .fi
28 /* The Secure Mailer license must be distributed with this software.
29 /* AUTHOR(S)
30 /* Wietse Venema
31 /* IBM T.J. Watson Research
32 /* P.O. Box 704
33 /* Yorktown Heights, NY 10598, USA
34 /*--*/
36 /* System library. */
38 #include "sys_defs.h"
40 /* Utility library. */
42 /* Global library. */
44 #include <mail_params.h>
45 #include <mail_proto.h>
46 #include <mail_flush.h>
48 /* mail_flush_deferred - flush deferred/incoming queue */
50 int mail_flush_deferred(void)
52 static char qmgr_trigger[] = {
53 QMGR_REQ_FLUSH_DEAD, /* all hosts, all transports */
54 QMGR_REQ_SCAN_ALL, /* all time stamps */
55 QMGR_REQ_SCAN_DEFERRED, /* scan deferred queue */
56 QMGR_REQ_SCAN_INCOMING, /* scan incoming queue */
60 * Trigger the flush queue service.
62 return (mail_trigger(MAIL_CLASS_PUBLIC, var_queue_service,
63 qmgr_trigger, sizeof(qmgr_trigger)));
66 /* mail_flush_maildrop - flush maildrop queue */
68 int mail_flush_maildrop(void)
70 static char wakeup[] = {TRIGGER_REQ_WAKEUP};
73 * Trigger the pickup service.
75 return (mail_trigger(MAIL_CLASS_PUBLIC, var_pickup_service,
76 wakeup, sizeof(wakeup)));