Commit 2e878c30 2e878c30999411781ca304afab2cfa1b49505a06 by Alain Magloire

Added the new docs

1 parent 3d4474e7
......@@ -26,7 +26,9 @@ EXTRA_DIST = \
## Sam, the examples dir is not part of the distribution so this will not work
## but we should probably have a "addrmsg" program and reenable this.
## Alain.
#ex-address.texi: ${top_srcdir}/examples/addr.c
#ex-address.texi: ${top_srcdir}/doc/examples/addr.c
# sed -es/{/@{/g -e s/}/@}/g < $< > $@
#sfrom.texi: ${top_srcdir}/doc/examples/sfrom.c
# sed -es/{/@{/g -e s/}/@}/g < $< > $@
#mailutils.info: mailutils.texi version.texi ex-address.texi
......
@example
@code{/* Prefix @emph{address_} is reserve */}
@code{#include <mailutils/address.h>}
@end example
The internet address format is defined in RFC 822. RFC 822 has been
updated, and is now superceeded by RFC 2822, which
makes some corrections and clarifications. References to RFC 822
......
@example
@code{/* Prefix @emph{attribute_} is reserve */}
@code{#include <mailutils/attribute.h>}
@end example
@deftypefun int attribute_create (attribute_t *@var{pattribute})
@end deftypefun
......
@example
@code{/* Prefix @emph{auth_} is reserve */}
@code{#include <mailutils/auth.h>}
@end example
There are many ways to authenticate to a server, to be flexible the
authentication process is provided by two objects @code{auth_t} and
@code{ticket_t}. The @code{auth_t} can implement different protocol like
......
@example
@code{/* Prefix @emph{body_} is reserve */}
@code{#include <mailutils/body.h>}
@end example
@deftypefun int body_create (body_t *@var{body}, void *@var{owner})
Initialize an object @var{bdy}.
@end deftypefun
......
@menu
* POP3:: POP3
* IMAP4:: IMAP4
* Mbox:: Mbox
* Mh:: Mh
* Maildir:: Maildir
* SMTP:: SMTP
* Sendmail:: Sendmail
* NNTP:: NNTP
* Parse822:: Parse822
@end menu
@node POP3
@comment node-name, next, previous, up
@section POP3
@cindex POP3
@include pop3.texi
@node IMAP4
@comment node-name, next, previous, up
@section IMAP4
@cindex IMAP4
@include imap4.texi
@node Mbox
@comment node-name, next, previous, up
@section Mbox
@cindex Mbox
@include mbox.texi
@node Mh
@comment node-name, next, previous, up
@section Mh
@cindex Mh
@include mh.texi
@node Maildir
@comment node-name, next, previous, up
@section Maildir
@cindex Maildir
@include maildir.texi
@node SMTP
@comment node-name, next, previous, up
@section SMTP
@cindex SMTP
@include smtp.texi
@node Sendmail
@comment node-name, next, previous, up
@section Sendmail
@cindex Sendmail
@include sendmail.texi
@node NNTP
@comment node-name, next, previous, up
@section NNTP
@cindex NNTP
@include nntp.texi
@node Parse822
@comment node-name, next, previous, up
@section Parse822
@cindex Parse822
@include parse822.texi
@example
@code{/* Prefix @emph{envelope_} is reserve */}
@code{#include <mailutils/envelope.h>}
@end example
@deftypefun int envelope_create (envelope_t *, void *);
@end deftypefun
@deftypefun void envelope_destroy (envelope_t *, void *);
@end deftypefun
@deftypefun int envelope_get_message (envelope_t, message_t *);
@end deftypefun
@deftypefun int envelope_set_sender (envelope_t, int (*_sender) __P ((envelope_t, char *, size_t, size_t*)), void *);
@end deftypefun
@deftypefun int envelope_sender (envelope_t, char *, size_t, size_t *);
@end deftypefun
@deftypefun int envelope_set_date (envelope_t, int (*_date) __P ((envelope_t, char *, size_t, size_t *)), void *);
@end deftypefun
@deftypefun int envelope_date (envelope_t, char *, size_t, size_t *);
@end deftypefun
@example
@code{/* Prefix @emph{folder_} is reserve */}
@code{#include <mailutils/folder.h>}
@end example
@example
@group
folder_t url_t
-/var/mail- +---//---->/-----------------\ +-->/-----------\
( alain *-)-+ | | url_t *-|----+ | port |
----------- | | |-----------------+ | hostname |
( jakob *-)-+--+ | observer_t *-| | file |
----------- | |-----------------+ | ... |
( jeff *-)-+ | stream_t | \-----------/
----------- | |-----------------|
( sean *-)-+ | auth_t |
---------- |-----------------|
| mailbox_t(1) |
|-----------------|
| mailbox_t(2) |
| ...... |
| mailbox_t(n) |
\-----------------/
@end group
@end example
@deftypefun int folder_create (folder_t *, const char *@var{url})
@end deftypefun
@deftypefun void folder_destroy (folder_t *)
@end deftypefun
@deftypefun int folder_open (folder_t, int @var{flag})
@end deftypefun
@deftypefun int folder_close (folder_t)
@end deftypefun
@deftypefun int folder_delete (folder_t, const char *@var{mailbox})
@end deftypefun
@deftypefun int folder_rename (folder_t, const char *, const char *@var{mailbox})
@end deftypefun
@deftypefun int folder_subscribe (folder_t, const char *@var{mailbox})
@end deftypefun
@deftypefun int folder_unsubscribe (folder_t, const char *@var{mailbox})
@end deftypefun
@deftypefun int folder_list (folder_t, const char *@var{ref}, const char *@var{wcard}, iterator_t *)
@end deftypefun
@deftypefun int folder_lsub (folder_t, const char *@var{ref}, const char *@var{wcar}, iterator_t *)
@end deftypefun
@deftypefun int folder_get_stream (folder_t, stream_t *)
@end deftypefun
@deftypefun int folder_set_stream (folder_t, stream_t)
@end deftypefun
@deftypefun int folder_get_observable (folder_t, observable_t *)
@end deftypefun
@deftypefun int folder_get_debug (folder_t, debug_t *)
@end deftypefun
@deftypefun int folder_set_debug (folder_t, debug_t)
@end deftypefun
@deftypefun int folder_get_authority (folder_t, authority_t *)
@end deftypefun
@deftypefun int folder_set_authority (folder_t, authority_t)
@end deftypefun
@deftypefun int folder_get_url (folder_t, url_t *)
@end deftypefun
@deftypefun int folder_set_url (folder_t, url_t)
@end deftypefun
@menu
* Folder:: Folder.
* Mailbox:: Mailbox.
* Mailer:: Protocol Used to Send Mail.
* Message:: Message.
* Envelope:: Envelope.
* Headers:: Headers.
* Body:: Body.
* Attribute:: Attribute.
* Stream:: Stream.
* Iterator:: Iterator.
* Authenticator:: Authenticator.
* Address:: Address.
* Locker:: Locker.
* URL:: Unified Ressource Locator.
@end menu
Where ever the mail is and whatever format it is store in, the same operations
to manipulate emails are common. To unified the C API, GNU mailutils offers
an heteroclite set of objects that work in aggregation to do operations on
emails. Each object do a specific task and delegate non related tasks to
others. The object comes alive by specifying a @emph{URL} parameter when
created, it will indicate the storage format or protocol
(POP3, IMAP4, MH, MAILDIR, etc ..).
@example
@group
folder_t url_t
-/var/mail- +- .. ->+-----------------+ +-->+------------+
( alain *-)-+ | | url_t *-|---+ | port |
----------- | | |-----------------| | hostname |
( jakob *-)-+--+ | auth_t *-|---+ | file |
----------- | |-----------------| | | ... |
( jeff *-)-+ | stream_t | | +------------+
----------- | |-----------------| |
( shaleh*-)-+ | ..... | | auth_t
---------- |-----------------| +-->+------------+
+---|-* mailbox_t[] | | ticket_t |
mailbox_t | +-----------------+ +------------+
+----------------+<-+
| locker_t *--|-------------+
|----------------| |
| url_t | | locker_t
|----------------| +-------->+---------+
| stream_t | | lock |
|----------------| | unlock |
| message_t[] *-|-------+ +---------+
+----------------+ | envelope_t
| +-------->+-----------+
message_t | | | date |
+----------------+<------+ | | from |
| envelope_t *-|------------------+ | to |
|----------------| header_t +-----------+
| header_t *-|------------>+--------------+
|----------------| | stream_t |
| body_t *-|----+ +--------------+
+----------------+ | body_t
+-->+--------------+
| stream_t |
+--------------+
@end group
@end example
For example writing a simple @code{from} command that will list the
@emph{From} and @emph{Subject} headers of every mail in a mailbox.
@example
@include sfrom.c.texi
@end example
@example
@cartouche
% MAIL=pop://alain@@localhost ./sfrom
Passwd: xxxx
Jim Meyering <meyering@@foo.org> fetish(shellutils) beta
Fran@,{c}ois Pinard <pinard@@bar.org> recode new alpha
@dots{}
@end cartouche
@end example
@node Folder
@comment node-name, next, previous, up
@section Folder
@cindex Folder
@include folder.texi
@node Mailbox
@comment node-name, next, previous, up
@section Mailbox
@cindex Mailbox
@include mailbox.texi
@node Mailer
@comment node-name, next, previous, up
@section Mailer
@cindex Mailer
@include mailer.texi
@node Message
@comment node-name, next, previous, up
@section Message
@cindex Message
@include message.texi
@node Envelope
@comment node-name, next, previous, up
@section Envelope
@cindex Envelope
@include envelope.texi
@node Headers
@comment node-name, next, previous, up
@section Headers
@cindex Headers
@include headers.texi
@node Body
@comment node-name, next, previous, up
@section Body
@cindex Body
@include body.texi
@node Attribute
@comment node-name, next, previous, up
@section Attribute
@cindex Attribute
@include attribute.texi
@node Stream
@comment node-name, next, previous, up
@section Stream
@cindex Stream
@include stream.texi
@node Iterator
@comment node-name, next, previous, up
@section Iterator
@cindex Iterator
@include iterator.texi
@node Authenticator
@comment node-name, next, previous, up
@section Authenticator
@cindex Authenticator
@include auth.texi
@node Address
@comment node-name, next, previous, up
@section Address
@cindex Address
@include address.texi
@node Locker
@comment node-name, next, previous, up
@section Locker
@cindex Locker
@include locker.texi
@node URL
@comment node-name, next, previous, up
@section URL
@cindex URL
@include url.texi
@example
@code{/* Prefix @emph{header_} is reserve */}
@code{#include <mailutils/header.h>}
@end example
So far we plan support for RFC822 and plan for RFC1522. with RFC1522 non ASCII
characters will be encoded.
......
@example
@code{/* Prefix @emph{imap4_} is reserve */}
@code{#include <mailutils/imap4.h>}
@end example
Internet Message Access Protocol - Version (4rev1). Not implemented.
@subsection Commands
@subsubsection Initialisation
@cindex IMAP4 Inintialisation
@deftypefun int imap4_create (imap4_t *)
@end deftypefun
@deftypefun int imap4_open (imap4_t, const char *@var{hostname}, unsigned int @var{port}, int @var{flags})
@end deftypefun
@deftypefun int imap4d_set_timeout (imap4_t, unsigned int @var{seconds})
@end deftypefun
@subsubsection Append
@cindex IMAP4 Append
@deftypefun int imap4_append (imap4_t)
@end deftypefun
@subsubsection Capability
@cindex IMAP4 Capability
@deftypefun int imap4_capability (imap4_t)
@end deftypefun
@subsubsection Create
@cindex IMAP4 Create
@deftypefun int imap4_create_mailbox (imap4_t, const char *@var{mbox})
@end deftypefun
@subsubsection Check
@cindex IMAP4 Check
@deftypefun int imap4_check (imap4_t)
@end deftypefun
@subsubsection Close
@cindex IMAP4 Close
@deftypefun int imap4_close (imap4_t)
@end deftypefun
@subsubsection Copy
@cindex IMAP4 Copy
@deftypefun int imap4_copy (imap4_t)
@end deftypefun
@subsubsection UID Copy
@cindex IMAP4 UID Copy
@deftypefun int imap4_uid_copy (imap4_t)
@end deftypefun
@subsubsection Delete
@cindex IMAP4 Delete
@deftypefun int imap4_delete (imap4_t)
@end deftypefun
@subsubsection Fetch
@cindex IMAP4 Fetch
@deftypefun int imap4_fetch (imap4_t)
@end deftypefun
@subsubsection UID Fetch
@cindex IMAP4 UID Fetch
@deftypefun int imap4_uid_fetch (imap4_t)
@end deftypefun
@subsubsection Examine
@cindex IMAP4 Examine
@deftypefun int imap4_examine (imap4_t)
@end deftypefun
@subsubsection Expunge
@cindex IMAP4 Expunge
@deftypefun int imap4_expunge (imap4_t)
@end deftypefun
@subsubsection List
@cindex IMAP4 List
@deftypefun int imap4_list (imap4_t)
@end deftypefun
@subsubsection Lsub
@cindex IMAP4 Lsub
@deftypefun int imap4_lsub (imap4_t)
@end deftypefun
@subsubsection Namespace
@cindex IMAP4 Namespace
@deftypefun int imap4_namespace (imap4_t)
@end deftypefun
@subsubsection Rename
@cindex IMAP4 Rename
@deftypefun int imap4_rename (imap4_t)
@end deftypefun
@subsubsection Search
@cindex IMAP4 Search
@deftypefun int imap4_search (imap4_t)
@end deftypefun
@subsubsection UID Search
@cindex IMAP4 UID Search
@deftypefun int imap4_uid_search (imap4_t)
@end deftypefun
@subsubsection Select
@cindex IMAP4 Select
@deftypefun int imap4_select (imap4_t)
@end deftypefun
@subsubsection Status
@cindex IMAP4 Status
@deftypefun int imap4_status (imap4_t)
@end deftypefun
@subsubsection Store
@cindex IMAP4 Store
@deftypefun int imap4_store (imap4_t)
@end deftypefun
@subsubsection UID Store
@cindex IMAP4 UID Store
@deftypefun int imap4_uid_store (imap4_t)
@end deftypefun
@subsubsection Subscribe
@cindex IMAP4 Subscribe
@deftypefun int imap4_subscribe (imap4_t)
@end deftypefun
@subsubsection Unsubscribe
@cindex IMAP4 Unsubscribe
@deftypefun int imap4_unsubscribe (imap4_t)
@end deftypefun
@example
@code{/* Prefix @emph{iterator_} is reserve */}
@code{#include <mailutils/iterator.h>}
@end example
@deftypefun int iterator_create (iterator_t *)
@end deftypefun
@deftypefun void iterator_destroy (iterator_t *)
@end deftypefun
@deftypefun int iterator_first (iterator_t)
@end deftypefun
@deftypefun int iterator_next (iterator_t)
@end deftypefun
@deftypefun int iterator_current (iterator_t, void **pitem)
@end deftypefun
@deftypefun int iterator_is_done (iterator_t)
@end deftypefun
@example
@code{/* Prefix @emph{locker_} is reserve */}
@code{#include <mailutils/locker.h>}
@end example
@deftypefun int locker_create (locker_t * @var{plocker}, char *@var{filename}, size_t @var{len}, int @var{flags})
@end deftypefun
......
@example
@code{/* Prefix @emph{mailbox_} is reserve */}
@code{#include <mailutils/mailbox.h>}
@end example
@deftp {Data Type} mailbox_t
The @code{mailbox_t} object is used to hold information and it is an opaque
data structure to the user. Functions are provided to retrieve the information.
......@@ -9,15 +14,15 @@ data structure to the user. Functions are provided to retrieve the information.
-/var/mail- +---//---->/-----------------\ +-->/-----------\
( alain ) | | url_t *-|----+ | port |
----------- | |-----------------+ | hostname |
( jakob *-)----+ | auth_t *-|----+ | file |
----------- |-----------------+ | | ... |
( jeff ) | stream_t | | \-----------/
----------- |-----------------| |
( sean ) | locker_t | | auth_t
---------- |-----------------| +-->/----------\
| message_t(1) | | user |
|-----------------| | passwd |
| message_t(2) | \----------/
( jakob *-)----+ | observer_t *-| | file |
----------- |-----------------+ | ... |
( jeff ) | stream_t | \-----------/
----------- |-----------------|
( sean ) | locker_t |
---------- |-----------------|
| message_t(1) |
|-----------------|
| message_t(2) |
| ...... |
| message_t(n) |
\-----------------/
......@@ -29,7 +34,7 @@ The @var{message} is appended to the mailbox @var{mbox}.
The return value is @code{0} on success and a code number on error conditions:
@table @code
@item EINVAL
@item MU_ERROR_INVALID_PARAMETER
@var{mbox} is null or @var{message} is invalid.
@end table
@end deftypefun
......@@ -39,7 +44,7 @@ The stream attach to @var{mbox} is closed.
The return value is @code{0} on success and a code number on error conditions:
@table @code
@item EINVAL
@item MU_ERROR_INVALID_PARAMETER
@var{mbox} is null.
@end table
@end deftypefun
......@@ -50,7 +55,7 @@ The concrete mailbox type instanciate is based on the scheme of the url @var{nam
The return value is @code{0} on success and a code number on error conditions:
@table @code
@item EINVAL
@item MU_ERROR_INVALID_PARAMETER
The url @var{name} supplied is invalid or not supported.
@var{pmbox} is NULL.
@item ENOMEM
......@@ -58,7 +63,7 @@ Not enough memory to allocate resources.
@end table
@end deftypefun
@deftypefun int mailbox_create_default (mailbox_t *@var{pmbox}, const char *@var{user})
@deftypefun int mailbox_create_default (mailbox_t *@var{pmbox}, const char *@var{name})
The environment variable @emph{$MAIL} or the string formed by
@emph{_PATH_MAILDIR}/@var{user}" or @emph{$LOGNAME} if @var{user} is null,
for a default mailbox and calls @code{mailbox_create}.
......@@ -73,17 +78,17 @@ All messages marked for deletion are removed.
The return value is @code{0} on success and a code number on error conditions:
@table @code
@item EINVAL
@item MU_ERROR_INVALID_PARAMETER
@var{mbox} is null.
@end table
@end deftypefun
@deftypefun int mailbox_get_auth (mailbox_t @var{mbox}, auth_t *@var{pauth})
Retrieve the @var{*pauth} of the @var{mbox}.
@deftypefun int mailbox_get_folder (mailbox_t @var{mbox}, folder_t *@var{folder})
Get the @var{folder}.
The return value is @code{0} on success and a code number on error conditions:
@table @code
@item EINVAL
@item MU_ERROR_INVALID_PARAMETER
@var{mbox} is null.
@end table
@end deftypefun
......@@ -92,7 +97,7 @@ The return value is @code{0} on success and a code number on error conditions:
Get a debug object.
The return value is @code{0} on success and a code number on error conditions:
@table @code
@item EINVAL
@item MU_ERROR_INVALID_PARAMETER
@var{mbox} is null.
@item ENOMEM
@end table
......@@ -103,7 +108,7 @@ Return the @var{locker} object.
The return value is @code{0} on success and a code number on error conditions:
@table @code
@item EINVAL
@item MU_ERROR_INVALID_PARAMETER
@var{mbox} is null.
@end table
@end deftypefun
......@@ -114,7 +119,7 @@ initialized.
The return value is @code{0} on success and a code number on error conditions:
@table @code
@item EINVAL
@item MU_ERROR_INVALID_PARAMETER
@var{mbox} is null or @var{msgno} is invalid.
@item ENOMEM
Not enough memory.
......@@ -126,7 +131,7 @@ Get the observable object.
The return value is @code{0} on success and a code number on error conditions:
@table @code
@item EINVAL
@item MU_ERROR_INVALID_PARAMETER
@var{mbox} is null.
@item ENOMEM
Not enough memory.
......@@ -137,7 +142,7 @@ Not enough memory.
Get the property object.
The return value is @code{0} on success and a code number on error conditions:
@table @code
@item EINVAL
@item MU_ERROR_INVALID_PARAMETER
@var{mbox} is null.
@item ENOMEM
@end table
......@@ -148,7 +153,7 @@ Gives the @var{mbox} size.
The return value is @code{0} on success and a code number on error conditions:
@table @code
@item EINVAL
@item MU_ERROR_INVALID_PARAMETER
@var{mbox} is null.
@end table
@end deftypefun
......@@ -158,7 +163,7 @@ The mailbox stream is put in @var{pstream}.
The return value is @code{0} on success and a code number on error conditions:
@table @code
@item EINVAL
@item MU_ERROR_INVALID_PARAMETER
@var{mbox} is invalid or @var{pstream} is NULL.
@end table
@end deftypefun
......@@ -167,7 +172,7 @@ The return value is @code{0} on success and a code number on error conditions:
The return value is @code{0} on success and a code number on error conditions:
@table @code
@item EINVAL
@item MU_ERROR_INVALID_PARAMETER
@var{mbox} is null.
@end table
@end deftypefun
......@@ -177,17 +182,17 @@ Gives the constructed @var{url}.
The return value is @code{0} on success and a code number on error conditions:
@table @code
@item EINVAL
@item MU_ERROR_INVALID_PARAMETER
@var{mbox} is null.
@end table
@end deftypefun
@deftypefun int mailbox_is_updated (mailbox_t @var{mbox})
Check if the mailbox is up-to-date.
@deftypefun int mailbox_is_modified (mailbox_t @var{mbox})
Check if the mailbox been modified by an external source.
The return value is @code{0} on success and a code number on error conditions:
@table @code
@item EINVAL
@item MU_ERROR_INVALID_PARAMETER
@var{mbox} is null.
@end table
@end deftypefun
......@@ -197,7 +202,7 @@ Give the number of first unseen message in @var{mbox}.
The return value is @code{0} on success and a code number on error conditions:
@table @code
@item EINVAL
@item MU_ERROR_INVALID_PARAMETER
@var{mbox} is null.
@end table
@end deftypefun
......@@ -207,7 +212,7 @@ Give the number of messages in @var{mbox}.
The return value is @code{0} on success and a code number on error conditions:
@table @code
@item EINVAL
@item MU_ERROR_INVALID_PARAMETER
@var{mbox} is null.
@end table
@end deftypefun
......@@ -217,7 +222,7 @@ Give the number of recent messages in @var{mbox}.
The return value is @code{0} on success and a code number on error conditions:
@table @code
@item EINVAL
@item MU_ERROR_INVALID_PARAMETER
@var{mbox} is null.
@end table
@end deftypefun
......@@ -234,7 +239,7 @@ The return value is @code{0} on success and a code number on error conditions:
Operation in progress.
@item EBUSY
Resource busy.
@item EINVAL
@item MU_ERROR_INVALID_PARAMETER
@var{mbox} is null or flag is invalid.
@item ENOMEM
Not enough memory.
......@@ -246,29 +251,19 @@ Scan the mailbox for new messages starting at message @var{msgno}.
The return value is @code{0} on success and a code number on error conditions:
@table @code
@item EINVAL
@item MU_ERROR_INVALID_PARAMETER
@var{mbox} is null.
@item ENOMEM
Not enough memory.
@end table
@end deftypefun
@deftypefun int mailbox_set_auth (mailbox_t @var{mbox}, auth_t @var{auth})
Set the type of authentication for the mailbox.
The return value is @code{0} on success and a code number on error conditions:
@table @code
@item EINVAL
@var{mbox} is null.
@end table
@end deftypefun
@deftypefun int mailbox_set_locker (mailbox_t @var{mbox}, locker_t @var{locker})
Set the type of locking done by the @var{mbox}.
The return value is @code{0} on success and a code number on error conditions:
@table @code
@item EINVAL
@item MU_ERROR_INVALID_PARAMETER
@var{mbox} is null.
@end table
@end deftypefun
......@@ -278,7 +273,7 @@ Set the @var{stream} connection to use for the mailbox.
The return value is @code{0} on success and a code number on error conditions:
@table @code
@item EINVAL
@item MU_ERROR_INVALID_PARAMETER
@var{mbox} or @var{stream} is NULL.
@end table
@end deftypefun
......@@ -288,7 +283,7 @@ The @var{ticket} will be set on the @code{auth_t} object on creation.
The return value is @code{0} on success and a code number on error conditions:
@table @code
@item EINVAL
@item MU_ERROR_INVALID_PARAMETER
@var{mbox} is null.
@end table
@end deftypefun
......@@ -298,7 +293,7 @@ Give the next predicted uid for @var{mbox}.
The return value is @code{0} on success and a code number on error conditions:
@table @code
@item EINVAL
@item MU_ERROR_INVALID_PARAMETER
@var{mbox} is null.
@end table
@end deftypefun
......@@ -308,8 +303,7 @@ Give the uid validity of @var{mbox}.
The return value is @code{0} on success and a code number on error conditions:
@table @code
@item EINVAL
@item MU_ERROR_INVALID_PARAMETER
@var{mbox} is null.
@end table
@end deftypefun
......
@example
@code{/* Prefix @emph{maildir_} is reserve */}
@code{#include <mailutils/maildir.h>}
@end example
QMail mailbox format. Not implemented.
@example
@code{/* Prefix @emph{mailer_} is reserve */}
@code{#include <mailutils/mailer.h>}
@end example
The API is still shaky and undefined.
@deftypefun int mailer_create (mailer_t *, const char *)
@end deftypefun
@deftypefun void mailer_destroy (mailer_t *)
@end deftypefun
@deftypefun int mailer_open (mailer_t, int flags)
@end deftypefun
@deftypefun int mailer_close (mailer_t)
@end deftypefun
@deftypefun int mailer_send_message (mailer_t, message_t)
@end deftypefun
@deftypefun int mailer_get_property (mailer_t, property_t *)
@end deftypefun
@deftypefun int mailer_get_stream (mailer_t, stream_t *)
@end deftypefun
@deftypefun int mailer_set_stream (mailer_t, stream_t)
@end deftypefun
@deftypefun int mailer_get_debug (mailer_t, debug_t *)
@end deftypefun
@deftypefun int mailer_set_debug (mailer_t, debug_t)
@end deftypefun
@deftypefun int mailer_get_observable (mailer_t, observable_t *)
@end deftypefun
@deftypefun int mailer_get_url (mailer_t, url_t *)
@end deftypefun
......
......@@ -62,7 +62,7 @@ by the Foundation.
@setchapternewpage off
@titlepage
@title mailutils, library API.
@title mailutils, SDK.
@subtitle version @value{VERSION}, @value{UPDATED}
@author Alain Magloire et al.
......@@ -92,6 +92,8 @@ by the Foundation.
@end titlepage
@page
@summarycontents
@page
@node Top, Introduction, (dir), (dir)
@comment node-name, next, previous, up
......@@ -102,26 +104,17 @@ This document was produced for version @value{VERSION} of @sc{gnu}
@end ifinfo
@menu
* Introduction:: GNU @sc{mailutils}
* Mailbox:: Mailbox API.
* Mailer:: Protocol Used to Send Mail.
* Message:: Message API.
* Headers:: Headers API.
* Body:: Body API.
* Attribute:: Attribute.
* Stream:: Stream API.
* Authenticator:: Authenticator.
* Address:: Address.
* Locker:: Locker.
* Encoding:: Encoding API.
* URL:: Unified Ressource Locator.
* C API:: C API.
* Framework:: Framework.
* Programs:: Programs.
* Reporting Bugs:: Reporting Bugs.
* Acknowledgement:: Thanks and Credits.
* Concept Index ::
* Index:: All @sc{Mailutils} Functions.
* Concept Index:: All @sc{Mailutils} Functions.
* Index::
@end menu
@node Introduction, Mailbox, Top, Top
@node Introduction, C API, Top, Top
@comment node-name, next, previous, up
@chapter Introduction
@cindex Introduction
......@@ -130,127 +123,122 @@ This document was produced for version @value{VERSION} of @sc{gnu}
provide a rich set of functions for accessing different mailbox formats and
mailers.
@example
@group
mailbox_t url_t
-/var/mail- +---//---->+-----------------+ +-->+------------+
( alain ) | | url_t *-|----+ | port |
----------- | |-----------------| | hostname |
( jakob *-)----+ | auth_t *-|----+ | file |
----------- |-----------------| | | ... |
( jeff ) | locker_t *-|--+ | +------------+
----------- |-----------------| | |
( shaleh ) | stream_t | | | auth_t
---------- |-----------------| | +-->+------------+
+---|-* message_t[] | | | ticket_t |
message_t | +-----------------+ | +------------+
+----------------+<----+ |
| envelope_t | |
|----------------| header_t | locker_t
| header_t *-|------------>+--------------+ +---->+------+
|----------------| | stream_t | +------+
| body_t *-|----+ +--------------+
+----------------+ | body_t
+---+--------------+
| stream_t |
+--------------+
@end group
@end example
For example writing a simple @code{from} command that will list the
@emph{From} and @emph{Subject} headers of every mail in a folder.
@example
@include sfrom.c.texi
@end example
@node Mailbox, Mailer, Introduction, Top
@comment node-name, next, previous, up
@chapter Mailbox
@cindex Mailbox
@section References
@include mailbox.texi
For more information on,
@node Mailer, Message, Mailbox, Top
@comment node-name, next, previous, up
@chapter Mailer
@cindex Mailer
@itemize @bullet
@item
SMTP RFCs:
@include mailer.texi
@itemize @minus
@item
@cite{RFC 2821: Simple Mail Transfer Protocol}
@node Message, Headers , Mailer, Top
@comment node-name, next, previous, up
@chapter Message
@cindex Message
@item
@cite{RFC 2822: Internet Message Format}
@include message.texi
@item
@cite{RFC 2368: The mailto URL scheme}
@end itemize
@node Headers , Body, Message, Top
@comment node-name, next, previous, up
@chapter Headers
@cindex Headers
@item
on POP3
@include headers.texi
@itemize @minus
@item
@cite{RFC 1734: POP3 AUTHentication command}
@node Body, Attribute, Headers, Top
@comment node-name, next, previous, up
@chapter Body
@cindex Body
@item
@cite{RFC 1957: Some Observations on Implementations of the Post Office
Protocol (POP3)}
@include body.texi
@item
@cite{RFC 1939: Post Office Protocol - Version 3}
@node Attribute, Stream, Body, Top
@comment node-name, next, previous, up
@chapter Attribute
@cindex Attribute
@item
@cite{RFC 2449: POP3 Extension Mechanism}
@include attribute.texi
@item
@cite{RFC 2384: POP URL Scheme}
@end itemize
@node Stream, Authenticator, Attribute, Top
@comment node-name, next, previous, up
@chapter Stream
@cindex Stream
@item
On IMAP4
@include stream.texi
@itemize @minus
@item
@cite{RFC 2088: IMAP4 non-synchronizing literals}
@node Authenticator, Address, Stream, Top
@comment node-name, next, previous, up
@chapter Authenticator
@cindex Authenticator
@item
@cite{RFC 2193: IMAP4 Mailbox Referrals}
@include auth.texi
@item
@cite{RFC 2221: IMAP4 Login Referrals}
@node Address, Locker, Authenticator, Top
@comment node-name, next, previous, up
@chapter Address
@cindex Address
@item
@cite{RFC 2342: IMAP4 Namespace}
@include address.texi
@item
@cite{RFC 1738: Uniform Resource Locators (URL)}
@node Locker, Encoding, Address, Top
@comment node-name, next, previous, up
@chapter Locker
@cindex Locker
@item
@cite{RFC 2192: IMAP URL Scheme}
@end itemize
@item
On MIME
@include locker.texi
@itemize @minus
@item
@cite{RFC 2060: INTERNET MESSAGE ACCESS PROTOCOL - VERSION 4rev1}
@node Encoding, URL, Locker , Top
@item
@cite{RFC 2045: Multipurpose Internet Mail Extensions (MIME) Part One:
Format of Internet Message Bodies}
@item
@cite{RFC 2047: MIME (Multipurpose Internet Mail Extensions) Part Three:
Message Header Extensions for Non-ASCII Text}
@item
@cite{RFC 2049: Multipurpose Internet Mail Extensions (MIME) Part Five:
Conformance Criteria and Examples}
@item
@cite{RFC 2111: Content-ID and Message-ID Uniform Resource Locators}
@end itemize
@item
Misc
@cite{RFC 3028: Sieve: A Mail Filtering Language}
@item
@cite{Internet Email Protocols a Developer's Guide by Kevin Johnson}
@end itemize
@node C API, Framework, Introduction, Top
@comment node-name, next, previous, up
@chapter Encoding
@cindex Encoding
@chapter C API
@cindex C API
@include encoding.texi
@include c-api.texi
@node URL, Reporting Bugs, Encoding, Top
@node Framework, Programs, C API, Top
@comment node-name, next, previous, up
@chapter URL
@cindex URL
@chapter Framework
@cindex Framework
@include url.texi
@include framework.texi
@node Programs, Reporting Bugs, Framework, Top
@comment node-name, next, previous, up
@chapter Programs
@cindex Programs
@include programs.texi
@node Reporting Bugs, Acknowledgement, URL, Top
@node Reporting Bugs, Acknowledgement, Programs, Top
@comment node-name, next, previous, up
@chapter Reporting Bugs
@cindex Reporting Bugs
......@@ -266,14 +254,16 @@ Be sure to include the word ``mailutils'' somewhere in the ``Subject:'' field.
In no particular order,
Jakob Kaivo @email{jkaivo@@ndn.net},
Jeff Bailey @email{jbailey@@gnu.org},
Sean 'Shaleh' Perry @email{shaleh@@debian.org},
Sean Perry @email{shaleh@@debian.org},
Thomas Fletcher @email{thomasf@@qnx.com},
Dave Inglis @email{dinglis@@qnx.com},
Brian Edmond @email{briane@@qnx.com},
Sam Roberts @email{sroberts@@uniserve.com}.
Sam Roberts @email{sroberts@@uniserve.com},
Sergey Poznyakoff @email{gray@@Mirddin.farlep.net},
Fran@,{c}ois Pinard @email{pinard@@IRO.UMontreal.CA}.
@page
@node Concept Index , Index, Acknowledgement, Top
@node Concept Index, Index, Acknowledgement, Top
@comment node-name, next, previous, up
@unnumbered Concept Index
......@@ -282,7 +272,8 @@ This is a general index of all issues discussed in this manual
@printindex cp
@page
@node Index, , Concept Index , Top
@node Index, , Concept Index, Top
@comment node-name, next, previous, up
@unnumbered Index
This is an alphabetical list of all @sc{mailutils} functions.
......
@example
@code{/* Prefix @emph{mbox_} is reserve */}
@code{#include <mailutils/mbox.h>}
@end example
Standard Unix Mailbox. Not implemented.
@example
@code{#include <mailutils/message.h>}
@code{/* Prefix @emph{message_} is reserve */}
@end example
The @code{message_t} object is a convenient way to manipulate messages. It
encapsulates the @code{envelope_t}, the @code{header_t} and the @code{body_t}.
......
@example
@code{/* Prefix @emph{mh_} is reserve */}
@code{#include <mailutils/mh.h>}
@end example
Mail Handler mailbox format. Not implemented.
Mime stuff in the Body.
@example
@code{/* Prefix @emph{pop3_} is reserve */}
@code{#include <mailutils/pop3.h>}
@end example
Multipurpose Internet Mail Extensions (MIME).
@deftypefun int mime_create (mime_t *pmime, message_t msg, int flags)
@end deftypefun
@deftypefun void mime_destroy (mime_t *pmime)
@end deftypefun
@deftypefun int mime_is_multipart (mime_t mime)
@end deftypefun
@deftypefun int mime_get_num_parts (mime_t mime, size_t *nparts)
@end deftypefun
@deftypefun int mime_get_part (mime_t mime, size_t part, message_t *msg)
@end deftypefun
@deftypefun int mime_add_part (mime_t mime, message_t msg)
@end deftypefun
@deftypefun int mime_get_message (mime_t mime, message_t *msg)
@end deftypefun
......
@example
@code{/* Prefix @emph{nntp_} is reserve */}
@code{#include <mailutils/nntp.h>}
@end example
Network News Transfer Protocol. Not implemented.
@subsection Commands
@subsubsection Initialisation
@cindex NNTP Initialisation
@deftypefun int nntp_create (nnpt_t *)
@end deftypefun
@deftypefun int nntp_destroy (nnpt_t *)
@end deftypefun
@deftypefun int nntp_open (nnpt_t)
@end deftypefun
@subsubsection Article
@cindex NNTP Article
@deftypefun int nntp_article (nnpt_t)
@end deftypefun
@subsubsection Body
@cindex NNTP Body
@deftypefun int nntp_body (nntp_t)
@end deftypefun
@subsubsection Group
@cindex NNTP Group
@deftypefun int nntp_group (nntp_t)
@end deftypefun
@subsubsection Head
@cindex NNTP Head
@deftypefun int nntp_head (nntp_t)
@end deftypefun
@subsubsection Help
@cindex NNTP Help
@deftypefun int nntp_help (nntp_t)
@end deftypefun
@subsubsection IHave
@cindex NNTP IHave
@deftypefun int nntp_ihave (nntp_t)
@end deftypefun
@subsubsection Last
@cindex NNTP Last
@deftypefun int nntp_last (nntp_t)
@end deftypefun
@subsubsection List
@cindex NNTP List
@deftypefun int nntp_list (nntp_t)
@end deftypefun
@subsubsection NewGroups
@cindex NNTP NewGroups
@deftypefun int nntp_newgroups (nntp_t)
@end deftypefun
@subsubsection NewNews
@cindex NNTP NewNews
@deftypefun int nntp_newnews (nntp_t)
@end deftypefun
@subsubsection Next
@cindex NNTP Next
@deftypefun int nntp_next (nntp_t)
@end deftypefun
@subsubsection Post
@cindex NNTP Post
@deftypefun int nntp_post (nntp_t)
@end deftypefun
@subsubsection Quit
@cindex NNTP Quit
@deftypefun int nntp_quit (nntp_t)
@end deftypefun
@subsubsection Slave
@cindex NNTP Slave
@deftypefun int nntp_slave (nntp_t)
@end deftypefun
@subsubsection Stat
@cindex NNTP Stat
@deftypefun int nntp_stat (nntp_t)
@end deftypefun
@example
@code{/* Prefix @emph{parse822_} is reserve */}
@code{#include <mailutils/parse822.h>}
@end example
Internet Message Format, see Address node for the discusion.
@deftypefun int parse822_address_list (address_t* a, const char* s)
@end deftypefun
@deftypefun int parse822_mail_box (const char** p, const char* e, address_t* a)
@end deftypefun
@deftypefun int parse822_group (const char** p, const char* e, address_t* a)
@end deftypefun
@deftypefun int parse822_address (const char** p, const char* e, address_t* a)
@end deftypefun
@deftypefun int parse822_route_addr (const char** p, const char* e, address_t* a)
@end deftypefun
@deftypefun int parse822_route (const char** p, const char* e, char** route)
@end deftypefun
@deftypefun int parse822_addr_spec (const char** p, const char* e, address_t* a)
@end deftypefun
@deftypefun int parse822_unix_mbox (const char** p, const char* e, address_t* a)
@end deftypefun
@deftypefun int parse822_local_part (const char** p, const char* e, char** local_part)
@end deftypefun
@deftypefun int parse822_domain (const char** p, const char* e, char** domain)
@end deftypefun
@deftypefun int parse822_sub_domain (const char** p, const char* e, char** sub_domain)
@end deftypefun
@deftypefun int parse822_domain_ref (const char** p, const char* e, char** domain_ref)
@end deftypefun
@deftypefun int parse822_domain_literal (const char** p, const char* e, char** domain_literal)
@end deftypefun
@deftypefun int parse822_quote_string (char** quoted, const char* raw)
@end deftypefun
@deftypefun int parse822_quote_local_part (char** quoted, const char* raw)
@end deftypefun
@deftypefun int parse822_field_body (const char** p, const char *e, char** fieldbody)
@end deftypefun
@deftypefun int parse822_field_name (const char** p, const char *e, char** fieldname)
@end deftypefun
@section frm
List header from a mailbox.
@section imap4d
Imap4 daemon.
@section mail
Send and receive mail.
@section parse822
Parse RFC 822 fields.
@section pop3d
POP3 daemon.
@section readmsg
Extract messages from a folder.
@section sendmsg
Send a message.
@section sieve
Filter a mailbox.
@example
@code{/* Prefix @emph{sendmail_} is reserve */}
@code{#include <mailutils/sendmail.h>}
@end example
Spawning Sedmail daemon to deliver mail. Not implemented.
......@@ -74,13 +74,3 @@ main (int argc, const char **argv)
mailbox_destroy (&mbox);
return 0;
@}
@example
@cartouche
% MAIL=pop://alain@@localhost ./sfrom
Passwd: xxxx
Jim Meyering <meyering@@foo.org> fetish(shellutils) beta
Fran@,{c}ois Pinard <pinard@@bar.org> recode new alpha
@dots{}
@end cartouche
@end example
......
@example
@code{/* Prefix @emph{smtp_} is reserve */}
@code{#include <mailutils/smtp.h>}
@end example
Simple Mail Transfer Protocol. Not implemented.
@subsection Commands
@cindex smtp_t
@subsubsection Initialisation
@cindex SMTP Initialisation
@deftypefun int smtp_create (smtp_t *)
@end deftypefun
@deftypefun void smtp_destroy (smtp_t *)
@end deftypefun
@deftypefun int smtp_open (smtp_t, const char *@var{host}, unsigned int @var{port}, int @var{flags})
@end deftypefun
@subsubsection Data
@cindex SMTP Data
@deftypefun int smtp_data (smtp_t, stream_t @var{stream})
@end deftypefun
@subsubsection Helo
@cindex SMTP Helo
@deftypefun int smtp_helo (smtp_t, const char *@var{domain})
@end deftypefun
@deftypefun int smtp_ehlo (smtp_t, const char *@var{domain})
@end deftypefun
@subsubsection Expn
@cindex SMTP Expn
@deftypefun int smtp_expn (smtp_t, const char *@var{list}, iterator_t *)
@end deftypefun
@subsubsection Help
@cindex SMTP Help
@deftypefun int smtp_help (smtp_t, const char *@var{help}, iterator_t *)
@end deftypefun
@subsubsection Mail From
@cindex SMTP Mail From
@deftypefun int smtp_mail_from (smtp_t, const char *@var{address}, const char *@var{param})
@end deftypefun
@subsubsection Noop
@cindex SMTP Noop
@deftypefun int smtp_noop (smtp_t)
@end deftypefun
@subsubsection Quit
@cindex SMTP Quit
@deftypefun int smtp_quit (smtp_t)
@end deftypefun
@subsubsection Recpt To
@cindex SMTP Recpt To
@deftypefun int smtp_rcpt_to (smtp_t, const char *@var{address}, const char *@var{param})
@end deftypefun
@subsubsection Reset
@cindex SMTP Reset
@deftypefun int smtp_reset (smtp_t)
@end deftypefun
@subsubsection Verify
@cindex SMTP Verify
@deftypefun int smtp_verify (smtp_t, const char *@var{user})
@end deftypefun
@subsubsection Help functions
@cindex SMTP Help functions
@deftypefun extern int smtp_readline (smtp_t, char *@var{buffer}, size_t @var{len}, size_t *@var{len})
@end deftypefun
@deftypefun extern int smtp_response (smtp_t, char *@var{buffer}, size_t @var{len}, size_t *@var{len})
@end deftypefun
@deftypefun extern int smtp_writeline (smtp_t, const char *@var{format}, @var{...})
@end deftypefun
@deftypefun extern int smtp_sendline (smtp_t, const char *@var{line})
@end deftypefun
@deftypefun extern int smtp_send (smtp_t
@end deftypefun
......@@ -4,7 +4,7 @@ A mailbox and mailer can be described in a URL, the string will contain the
necessary information to initialize @code{mailbox_t}, or @code{mailer_t}
properly.
@section POP3
@subsection POP3
The POP URL scheme contains a pop server, optional port number
and the authentication mechanism. The general form is
......@@ -25,12 +25,12 @@ a default scheme base on the capability of the server.
For more complete information see @cite{rfc2368}.
@section IMAP
@subsection IMAP
imap://.....
Description of the fields and examples are needed.
@section File
@subsection File
Local folder should be handle by this URL. It is preferable to let
the mailbox recognize the type of mailbox and take the appropriate
......@@ -50,7 +50,7 @@ use @url{file://path} and let the library figure out which one.
@url{mh://path}
@end example
@section Mailto
@subsection Mailto
After setting a mailer, @url{mailto:} is used to tell the mailer where
and to whom the message is for.
......@@ -67,7 +67,7 @@ to mailing lists.
For more complete information see @cite{rfc2368}.
@section URL functions
@subsection URL functions
Helper functions are provided to retrieve and set the @emph{URL} fields.
......@@ -91,7 +91,7 @@ Initialize and parse the @var{url}
@end example
@end deftp
@section URL registration
@subsection URL registration
@deftypefun int url_list_type (struct url_type @var{list}[], size_t @var{len}, size_t *@var{n})
@end deftypefun
......@@ -105,7 +105,7 @@ Initialize and parse the @var{url}
@deftypefun int url_get_id (const url_t @var{url}, int *@var{id})
@end deftypefun
@section Helper functions
@subsection Helper functions
@example
#include <mailutils/url.h>
......