headers.texi mailbox.texi mailer.texi mailutils.texi
sfrom.c.texi url.texi updated.
Showing
6 changed files
with
194 additions
and
10 deletions
1 | So far we plan support for RFC822 and RFC1522; | 1 | So far we plan support for RFC822 and plan for RFC1522. with RFC1522 non ASCII |
2 | characters will be encoded. | ||
3 | |||
4 | @subsubsection Init/Destroy | ||
5 | The header should be initiliaze before any use. | ||
2 | 6 | ||
3 | @deftypefun int header_init (header_t *@var{hdr}, const char *@var{blurb}, size_t @var{len}, int @var{flag}) | 7 | @deftypefun int header_init (header_t *@var{hdr}, const char *@var{blurb}, size_t @var{len}, int @var{flag}) |
4 | Initialize a @var{hdr} to a supported type. If @var{blurb} is not NULL, it is | 8 | Initialize a @var{hdr} to a supported type. If @var{blurb} is not NULL, it is |
5 | parsed. @var{Flag} can be set to RFC8222 or RFC1522 so far onlyr rfc822 is | 9 | parsed. @var{Flag} can be set to RFC8222 or RFC1522 so far onlyr rfc822 is |
6 | supported. | 10 | supported. |
7 | @end deftypefun | 11 | @end deftypefun |
12 | |||
13 | @defmac MU_HDR_RFC822 | ||
14 | Supports rfc 822, header style. | ||
15 | @end defmac | ||
16 | |||
17 | @defmac MU_HDR_RFC1522 | ||
18 | Supports rfc 1522, encoding policy. | ||
19 | @end defmac | ||
20 | |||
8 | @deftypefun void header_destroy (header_t *@var{hdr}) | 21 | @deftypefun void header_destroy (header_t *@var{hdr}) |
9 | The ressources allocate for @var{hdr} or freed. | 22 | The ressources allocate for @var{hdr} or freed. |
10 | @end deftypefun | 23 | @end deftypefun |
... | @@ -15,6 +28,87 @@ Set the field-name @var{fn} to field-value @var{fv} of size @var{n} in | ... | @@ -15,6 +28,87 @@ Set the field-name @var{fn} to field-value @var{fv} of size @var{n} in |
15 | it is append. | 28 | it is append. |
16 | @end deftypefun | 29 | @end deftypefun |
17 | 30 | ||
31 | Some basic macros is already provided for rfc822. | ||
32 | |||
33 | @defmac MU_HDR_UNIX_FROM | ||
34 | "From " | ||
35 | @end defmac | ||
36 | @defmac MU_HDR_RETURN_PATH | ||
37 | "Return-Path" | ||
38 | @end defmac | ||
39 | @defmac MU_HDR_RECEIVED | ||
40 | "Received" | ||
41 | @end defmac | ||
42 | @defmac MU_HDR_DATE | ||
43 | "Date" | ||
44 | @end defmac | ||
45 | @defmac MU_HDR_FROM | ||
46 | "From" | ||
47 | @end defmac | ||
48 | @defmac MU_HDR_RESENT_FROM | ||
49 | "Resent-From" | ||
50 | @end defmac | ||
51 | @defmac MU_HDR_SUBJECT | ||
52 | "Subject" | ||
53 | @end defmac | ||
54 | @defmac MU_HDR_SENDER | ||
55 | "Sender" | ||
56 | @end defmac | ||
57 | @defmac MU_HDR_RESENT_SENDER | ||
58 | "Resent-SENDER" | ||
59 | @end defmac | ||
60 | @defmac MU_HDR_TOs | ||
61 | "To" | ||
62 | @end defmac | ||
63 | @defmac MU_HDR_RESENT_TO | ||
64 | "Resent-To" | ||
65 | @end defmac | ||
66 | @defmac MU_HDR_CC | ||
67 | "Cc" | ||
68 | @end defmac | ||
69 | @defmac MU_HDR_RESENT_CC | ||
70 | "Resent-Cc" | ||
71 | @end defmac | ||
72 | @defmac MU_HDR_BCC | ||
73 | "Bcc" | ||
74 | @end defmac | ||
75 | @defmac MU_HDR_RESENT_BCC | ||
76 | "Resent-Bcc" | ||
77 | @end defmac | ||
78 | @defmac MU_HDR_REPLY_TO | ||
79 | "Reply-To" | ||
80 | @end defmac | ||
81 | @defmac MU_HDR_RESENT_REPLY_TO | ||
82 | "Resent-Reply-To" | ||
83 | @end defmac | ||
84 | @defmac MU_HDR_MESSAGE_ID | ||
85 | "Message-ID" | ||
86 | @end defmac | ||
87 | @defmac MU_HDR_RESENT_MESSAGE_ID | ||
88 | "Resent-Message-ID" | ||
89 | @end defmac | ||
90 | @defmac MU_HDR_IN_REPLY_TO | ||
91 | "In-Reply-To" | ||
92 | @end defmac | ||
93 | @defmac MU_HDR_ENCRYPTED | ||
94 | "Encrypted" | ||
95 | @end defmac | ||
96 | @defmac MU_HDR_PRECEDENCE | ||
97 | "Precedence" | ||
98 | @end defmac | ||
99 | @defmac MU_HDR_STATUS | ||
100 | "Status" | ||
101 | @end defmac | ||
102 | @defmac MU_HDR_CONTENT_LENGTH | ||
103 | "Content-Length" | ||
104 | @end defmac | ||
105 | @defmac MU_HDR_CONTENT_TYPE | ||
106 | "Content-Type" | ||
107 | @end defmac | ||
108 | @defmac MU_HDR_MIME_VERSION | ||
109 | "MIME-Version" | ||
110 | @end defmac | ||
111 | |||
18 | @deftypefun int header_get_value (header_t @var{hdr}, const char *fn, char *fv, size_t len, size_t *n) | 112 | @deftypefun int header_get_value (header_t @var{hdr}, const char *fn, char *fv, size_t len, size_t *n) |
19 | Value of field-name @var{fn} is return in buffer @var{fv} of size @var{len}. | 113 | Value of field-name @var{fn} is return in buffer @var{fv} of size @var{len}. |
20 | The number of bytes written is put in @var{n}. | 114 | The number of bytes written is put in @var{n}. | ... | ... |
This diff is collapsed.
Click to expand it.
1 | 1 | ||
2 | Mail Delivery is done here. Nothing is implemented and the API is still shaky. | 2 | Mail Delivery is done here. Nothing is implemented and the API is still shaky. |
3 | 3 | ||
4 | @subsubsection Init/Destroy | ||
5 | |||
6 | Initialize the mailer object. | ||
7 | |||
4 | @deftypefun int mailer_init (mailer_t *@var{mailer}, const char *@var{name}, int @var{flag}) | 8 | @deftypefun int mailer_init (mailer_t *@var{mailer}, const char *@var{name}, int @var{flag}) |
5 | Not Implemented. | 9 | Not Implemented. |
6 | @end deftypefun | 10 | @end deftypefun |
7 | 11 | ||
12 | @defmac MU_ML_PROGRAM | ||
13 | Program like sendmail, mail, mailx to deliver the mail | ||
14 | @end defmac | ||
15 | |||
16 | @defmac MU_ML_SMTP | ||
17 | Contact the host directly with SMTP. | ||
18 | @end defmac | ||
19 | |||
20 | @defmac MU_ML_MPP | ||
21 | Use MPP protocol. | ||
22 | @end defmac | ||
23 | |||
8 | @deftypefun int mailer_destroy (mailer_r *@var{mailer}) | 24 | @deftypefun int mailer_destroy (mailer_r *@var{mailer}) |
9 | Not Implemented. | 25 | Not Implemented. |
10 | @end deftypefun | 26 | @end deftypefun |
11 | 27 | ||
28 | @subsubsection User/Passwd | ||
29 | |||
30 | On some mailer like MMP you need to identify. | ||
31 | |||
12 | @deftypefun int mailer_user (mailer_t @var{mailer}, const char *@var{user}) | 32 | @deftypefun int mailer_user (mailer_t @var{mailer}, const char *@var{user}) |
13 | Not Implemented. | 33 | Not Implemented. |
14 | @end deftypefun | 34 | @end deftypefun |
... | @@ -17,6 +37,9 @@ Not Implemented. | ... | @@ -17,6 +37,9 @@ Not Implemented. |
17 | Not Implemented. | 37 | Not Implemented. |
18 | @end deftypefun | 38 | @end deftypefun |
19 | 39 | ||
40 | @subsubsection Open/Close | ||
41 | The mailer is spawn, if it is a program, or the host is contacted. | ||
42 | |||
20 | @deftypefun int mailer_open (mailer_t @var{mailer}, int @var{flag}) | 43 | @deftypefun int mailer_open (mailer_t @var{mailer}, int @var{flag}) |
21 | Not Implemented. | 44 | Not Implemented. |
22 | @end deftypefun | 45 | @end deftypefun |
... | @@ -25,6 +48,14 @@ Not Implemented. | ... | @@ -25,6 +48,14 @@ Not Implemented. |
25 | Not Implemented. | 48 | Not Implemented. |
26 | @end deftypefun | 49 | @end deftypefun |
27 | 50 | ||
51 | @subsubsection Sending | ||
52 | |||
53 | Sending a message. | ||
54 | |||
55 | @deftypefun int mailer_create_envelope (mailer_t @var{mailer}, size_t *) | ||
56 | Not Implemented. | ||
57 | @end deftypefun | ||
58 | |||
28 | @deftypefun int mailer_set_body (mailer_t @var{mailer}, char *, size_t) | 59 | @deftypefun int mailer_set_body (mailer_t @var{mailer}, char *, size_t) |
29 | Not Implemented. | 60 | Not Implemented. |
30 | @end deftypefun | 61 | @end deftypefun |
... | @@ -33,22 +64,26 @@ Not Implemented. | ... | @@ -33,22 +64,26 @@ Not Implemented. |
33 | Not Implemented. | 64 | Not Implemented. |
34 | @end deftypefun | 65 | @end deftypefun |
35 | 66 | ||
36 | @deftypefun int mailer_set_timeout (mailer_t @var{mailer}, size_t) | 67 | @deftypefun int mailbox_add_attachment (mailer_t, size_t msgno, const char *boundary, const char *header, FILE *file, int encoding) |
68 | @end deftypefun | ||
69 | |||
70 | @deftypefun int mailer_send_envelope (mailer_t @var{mailer}, size_t) | ||
37 | Not Implemented. | 71 | Not Implemented. |
38 | @end deftypefun | 72 | @end deftypefun |
39 | 73 | ||
40 | @deftypefun int mailer_get_timeout (mailer_t @var{mailer}, size_t) | 74 | @subsubsection Timeout |
75 | @deftypefun int mailer_set_timeout (mailer_t @var{mailer}, size_t) | ||
41 | Not Implemented. | 76 | Not Implemented. |
42 | @end deftypefun | 77 | @end deftypefun |
43 | 78 | ||
44 | @deftypefun int mailer_send_envelope (mailer_t @var{mailer}, size_t) | 79 | @deftypefun int mailer_get_timeout (mailer_t @var{mailer}, size_t) |
45 | Not Implemented. | 80 | Not Implemented. |
46 | @end deftypefun | 81 | @end deftypefun |
47 | 82 | ||
48 | 83 | ||
49 | @subsection Mailto | 84 | @subsection Mailto |
50 | @cindex Mailto | 85 | @cindex Mailto |
51 | The URL mailto: is supported. | 86 | The URL mailto: should be supported. |
52 | 87 | ||
53 | TODO: example of mailto, and mailing lists, | 88 | TODO: example of mailto, and mailing lists, |
54 | 89 | ... | ... |
... | @@ -35,7 +35,7 @@ Published by the Free Software Foundation, | ... | @@ -35,7 +35,7 @@ Published by the Free Software Foundation, |
35 | 59 Temple Place - Suite 330 | 35 | 59 Temple Place - Suite 330 |
36 | Boston, MA 02111-1307, USA | 36 | Boston, MA 02111-1307, USA |
37 | 37 | ||
38 | Copyright 1999 Free Software Foundation, Inc. | 38 | Copyright 1999, 2000 Free Software Foundation, Inc. |
39 | 39 | ||
40 | Permission is granted to make and distribute verbatim copies of | 40 | Permission is granted to make and distribute verbatim copies of |
41 | this manual provided the copyright notice and this permission notice | 41 | this manual provided the copyright notice and this permission notice | ... | ... |
... | @@ -14,9 +14,10 @@ int main (int argc, char **argv) | ... | @@ -14,9 +14,10 @@ int main (int argc, char **argv) |
14 | char buffer[1024]; | 14 | char buffer[1024]; |
15 | char from[64]; | 15 | char from[64]; |
16 | char subject[64]; | 16 | char subject[64]; |
17 | char *header; | 17 | char *mail; |
18 | mailbox_t mbox; | 18 | mailbox_t mbox; |
19 | int status, id, msg_no; | 19 | int status |
20 | size_t msgno, msg_total, size; | ||
20 | 21 | ||
21 | if (argc == 2) | 22 | if (argc == 2) |
22 | @{ | 23 | @{ |
... | @@ -28,7 +29,7 @@ int main (int argc, char **argv) | ... | @@ -28,7 +29,7 @@ int main (int argc, char **argv) |
28 | if (mail == NULL) | 29 | if (mail == NULL) |
29 | @{ | 30 | @{ |
30 | char * user = getlogin (); | 31 | char * user = getlogin (); |
31 | int len = strlen (_PATH_MAILDIR) + strlen (user) + 1; | 32 | size_t len = strlen (_PATH_MAILDIR) + strlen (user) + 1; |
32 | mail = malloc (len); | 33 | mail = malloc (len); |
33 | if (mail == NULL) | 34 | if (mail == NULL) |
34 | @{ | 35 | @{ | ... | ... |
1 | 1 | ||
2 | See rfc2368, rfc2369, rfc2384 | 2 | @comment See rfc2368, rfc2369, rfc2384 |
3 | Instead of providing different functions to create a mailbox_t and mailer_t the | ||
4 | information is encoded in the form of a URL. | ||
5 | |||
6 | @itemize @bullet | ||
7 | @item | ||
8 | POP3 Post Office Protocol, Not Implemented. | ||
9 | @item | ||
10 | IMAP, not implemented | ||
11 | @item | ||
12 | QMAIL, not implemented | ||
13 | @item | ||
14 | Unix mbox | ||
15 | @item | ||
16 | MMDF, not implemented | ||
17 | @item | ||
18 | SMail, not implemented | ||
19 | @end itemize | ||
20 | |||
21 | The URL will contain the necessary information to initialize @code{mailbox_t} | ||
22 | properly. | ||
23 | @subsection POP3 | ||
24 | pop://<user>;AUTH=<auth>@@<hostname>:<port> | ||
25 | |||
26 | Description of the fields and examples are needed. | ||
27 | |||
28 | @subsection IMAP | ||
29 | imap://..... | ||
30 | |||
31 | Description of the fields and examples are needed. | ||
32 | |||
33 | @subsection File | ||
34 | file://path | ||
35 | |||
36 | Description of the fields and examples are needed. | ||
37 | |||
38 | @subsection MMDF | ||
39 | mmdf://path | ||
40 | |||
41 | Description of the fields and examples are needed. | ||
42 | |||
43 | @subsection MH | ||
44 | mh://path | ||
45 | |||
46 | Description of the fields and examples are needed. | ||
47 | |||
48 | @subsection Mailto | ||
49 | mailto:// | ||
50 | |||
51 | Description of the fields and examples are needed. | ||
52 | |||
53 | @subsection mmp | ||
54 | mmp:// | ||
55 | |||
56 | Description of the fields and examples are needed. | ||
3 | 57 | ... | ... |
-
Please register or sign in to post a comment