1 |
michael |
3389 |
/* Internal mail system declarations. |
2 |
|
|
* |
3 |
|
|
* IRC Services is copyright (c) 1996-2009 Andrew Church. |
4 |
|
|
* E-mail: <achurch@achurch.org> |
5 |
|
|
* Parts written by Andrew Kempe and others. |
6 |
|
|
* This program is free but copyrighted software; see the file GPL.txt for |
7 |
|
|
* details. |
8 |
|
|
*/ |
9 |
|
|
|
10 |
|
|
#ifndef MAIL_LOCAL_H |
11 |
|
|
#define MAIL_LOCAL_H |
12 |
|
|
|
13 |
|
|
#ifndef TIMEOUT_H |
14 |
|
|
# include "timeout.h" |
15 |
|
|
#endif |
16 |
|
|
|
17 |
|
|
/*************************************************************************/ |
18 |
|
|
|
19 |
|
|
/* Structure describing a message to be sent. */ |
20 |
|
|
|
21 |
|
|
typedef struct mailmessage_struct MailMessage; |
22 |
|
|
struct mailmessage_struct { |
23 |
|
|
MailMessage *next, *prev; |
24 |
|
|
char *from; |
25 |
|
|
char *fromname; |
26 |
|
|
char *to; |
27 |
|
|
char *subject; |
28 |
|
|
char *body; |
29 |
|
|
char *charset; |
30 |
|
|
MailCallback completion_callback; |
31 |
|
|
void *callback_data; |
32 |
|
|
Timeout *timeout; |
33 |
|
|
}; |
34 |
|
|
|
35 |
|
|
/*************************************************************************/ |
36 |
|
|
|
37 |
|
|
/* Pointer to low-level send routine. Low-level modules should set this |
38 |
|
|
* to point to their own send routine. This routine should initiate mail |
39 |
|
|
* sending, then call send_finished() with an appropriate status code when |
40 |
|
|
* the sending completes (successfully or otherwise). |
41 |
|
|
* |
42 |
|
|
* The routine can assume that the `from', `to', `subject', and `body' |
43 |
|
|
* fields of the message will be non-NULL. |
44 |
|
|
* |
45 |
|
|
* The routine can do as it likes with the message data stored in the |
46 |
|
|
* message structure (`from', `fromname', `to', `subject', and `body'), |
47 |
|
|
* but the (pointer) values of the fields themselves should not be changed. |
48 |
|
|
*/ |
49 |
|
|
extern void (*low_send)(MailMessage *msg); |
50 |
|
|
|
51 |
|
|
/* Pointer to low-level abort routine. Low-level modules should set this |
52 |
|
|
* to point to their own abort routine. This routine will be called when |
53 |
|
|
* the high-level code needs to abort a message (for example, on a send |
54 |
|
|
* timeout); the routine MUST abort sending of the given message. |
55 |
|
|
* send_finished() should not be called, as the high-level code will take |
56 |
|
|
* care of that. |
57 |
|
|
* |
58 |
|
|
* For modules which always complete processing before returning from |
59 |
|
|
* low_send(), this will never be called, so it may be an empty routine; |
60 |
|
|
* however, the `low_abort' pointer must be set or sendmail() will report |
61 |
|
|
* that no low-level sending module is installed. |
62 |
|
|
*/ |
63 |
|
|
extern void (*low_abort)(MailMessage *msg); |
64 |
|
|
|
65 |
|
|
/* Routine to be called by low_send() when the given message has been sent |
66 |
|
|
* (or sending has failed). The message structure must not be accessed |
67 |
|
|
* after calling this routine! |
68 |
|
|
*/ |
69 |
|
|
extern void send_finished(MailMessage *msg, int status); |
70 |
|
|
|
71 |
|
|
/*************************************************************************/ |
72 |
|
|
|
73 |
|
|
#endif /* MAIL_H */ |
74 |
|
|
|
75 |
|
|
/* |
76 |
|
|
* Local variables: |
77 |
|
|
* c-file-style: "stroustrup" |
78 |
|
|
* c-file-offsets: ((case-label . *) (statement-case-intro . *)) |
79 |
|
|
* indent-tabs-mode: nil |
80 |
|
|
* End: |
81 |
|
|
* |
82 |
|
|
* vim: expandtab shiftwidth=4: |
83 |
|
|
*/ |