Commit 9d01189d 9d01189d9c635a0d5ba920e7935afc2016f19fd9 by Alain Magloire

mailbox.c mailbox.h mailboxi.c mbx_imap.c mbx_imap.h mbx_pop.c

 	mbx_pop.h
Draft of the Mailbox API
1 parent c30118f3
/* GNU mailutils - a suite of utilities for electronic mail
Copyright (C) 1999 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Library Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <mbx_unix.h>
#include <mbx_pop.h>
#include <mbx_imap.h>
#include <stdlib.h>
#include <errno.h>
/* forward prototypes */
static int mbx_open (mailbox_t, int flag);
static int mbx_close (mailbox_t, int flag);
/* name */
static int mbx_get_name (mailbox_t, int *id, char *name, int offset, int n);
/* passwd */
static int mbx_get_passwd (mailbox_t, char * passwd, int offset, int len);
static int mbx_get_mpasswd (mailbox_t, char ** passwd, int *len);
static int mbx_set_passwd (mailbox_t, const char * passwd, int offset, int n);
/* deleting */
static int mbx_delete (mailbox_t, int);
static int mbx_undelete (mailbox_t, int);
static int mbx_expunge (mailbox_t);
static int mbx_is_deleted (mailbox_t, int);
/* appending */
static int mbx_new_msg (mailbox_t, int * id);
static int mbx_set_header (mailbox_t, int id, const char *h,
int offset, int n, int replace);
static int mbx_set_body (mailbox_t, int id, const char *b,
int offset, int n, int replace);
static int mbx_append (mailbox_t, int id);
static int mbx_destroy_msg (mailbox_t, int id);
/* reading */
static int mbx_get_body (mailbox_t, int id, char *b, int offset, int n);
static int mbx_get_header (mailbox_t, int id, char *h, int offset, int n);
/* locking */
static int mbx_lock (mailbox_t, int flag);
static int mbx_unlock (mailbox_t);
/* misc */
static int mbx_scan (mailbox_t, int *msgs);
static int mbx_is_updated (mailbox_t);
static int mbx_get_timeout (mailbox_t, int *timeout);
static int mbx_set_timeout (mailbox_t, int timeout);
static int mbx_get_refresh (mailbox_t, int *refresh);
static int mbx_set_refresh (mailbox_t, int refresh);
static int mbx_set_notification (mailbox_t, int (*notif) (mailbox_t));
static void mbx_check_struct (mailbox_t);
/*
Builtin mailbox types.
A circular list is use for the builtin.
Proper locking is not done when accessing the list.
FIXME: not thread-safe. */
static struct mailbox_builtin
{
const struct mailbox_type *mtype;
int is_malloc;
struct mailbox_builtin * next;
} mailbox_builtin [] = {
{ NULL, 0, &url_builtin[1] }, /* sentinel, head list */
{ &_mailbox_unix_type, 0, &mailbox_builtin[2] },
{ &_mailbox_pop_type, 0, &mailbox_builtin[3] },
{ &_mailbox_imap_type, 0, &mailbox_builtin[0] },
};
int
malibox_add_type (struct mailbox_type *mtype)
{
struct mailbox_builtin *current = malloc (sizeof (*current));
if (current == NULL)
return -1;
if (mtype->utype)
{
if (url_add_type (mtype->utype) < 0)
{
free (current);
return -1;
}
mtype->id = url_get_id (mtype->utype); /* same ID as the url_tupe */
}
else
{
mtype->id = (int)mtype; /* just need to be uniq */
}
current->mtype = mtype;
current->is_malloc = 1;
current->next = mailbox_builtin->next;
mailbox_builtin->next = current;
return 0;
}
int
mailbox_remove_type (const struct mailbox_type *mtype)
{
struct mailbox_builtin *current, *previous;
for (previous = mailbox_builtin, current = mailbox_builtin->next;
current != mailbox_builtin;
previous = current, current = current->next)
{
if (current->mtype == mtype)
{
previous->next = current->next;
if (current->is_malloc)
free (current);
return 0;;
}
}
return -1;
}
int
mailbox_list_type (struct mailbox_type *list, int n)
{
struct mailbox_builtin *current;
int i;
for (i = 0, current = mailbox_builtin->next; current != mailbox_builtin;
current = current->next, i++)
{
if (list)
if (i < n)
list[i] = *(current->mtype);
}
return i;
}
int
mailbox_list_mtype (struct url_type **mlist, int *n)
{
struct mailbox_type *mtype;
int i;
if ((i = mailbox_list_type (NULL, 0)) <= 0 || (mtype = malloc (i)) == NULL)
{
return -1;
}
*mlist = mtype;
return *n = mailbox_list_type (mtype, i);
}
int
mailbox_get_type (struct mailbox_type * const *mtype, int id)
{
struct mailbox_builtin *current;
for (current = mailbox_builtin->next; current != mailbox_builtin;
current = current->next)
{
if (current->mtype->type == type)
{
*mtype = current->mtype;
return 0;;
}
}
return -1;
}
int
mailbox_init (mailbox_t *mbox, const char *name, int id)
{
int status = -1; /* -1 means error */
/* 1st run: if they know what they want, shortcut */
if (id)
{
struct mailbox_type *mtype;
status = mailbox_get_type (&mtype, id);
if (status == 0)
{
status = mtype->_init (mbox, name);
if (status == 0)
mbx_check_struct (*mbox);
}
}
/* 2nd run: try heuristic URL discovery */
if (status != 0)
{
url_t url;
status = url_init (&url, name);
if (status == 0)
{
int id;
struct mailbox_type *mtype;
/* We've found a match get it */
if (url_get_id (url, &id) == 0
&& (status = mailbox_get_type (&mtype, id)) == 0)
{
status = mtype->_init (mbox, name);
if (status == 0)
mbx_check_struct (*mbox);
}
url_destroy (url);
}
}
/* 3nd run: nothing yet ?? try unixmbox/maildir directly as the last resort.
this should take care of the case where the filename is use */
if (status != 0 )
{
status = mailbox_unix_init (mbox, name);
if (status == 0)
mbx_check_struct (*mbox);
}
return status;
}
void
mailbox_destroy (mailbox_t * mbox)
{
return mbox->_destroy (mbox);
}
/* stub functions */
static void
mbx_check_struct (mailbox_t)
{
}
static int
mbx_open (mailbox_t, int flag)
{
return -1;
}
static int
mbx_close (mailbox_t, int flag)
{
return -1;
}
/* name */
static int
mbx_get_name (mailbox_t, int *id, char *name, int offset, int n)
{
return -1;
}
/* passwd */
static int
mbx_get_passwd (mailbox_t, char * passwd, int offset, int len)
{
return -1;
}
static int
mbx_get_mpasswd (mailbox_t, char ** passwd, int *len)
{
return -1;
}
static int
mbx_set_passwd (mailbox_t, const char * passwd, int offset, int n)
{
return -1;
}
/* deleting */
static int
mbx_delete (mailbox_t, int)
{
return -1;
}
static int
mbx_undelete (mailbox_t, int)
{
return -1;
}
static int
mbx_expunge (mailbox_t)
{
return -1;
}
static int
mbx_is_deleted (mailbox_t, int)
{
return -1;
}
/* appending */
static int
mbx_new_msg (mailbox_t, int * id)
{
return -1;
}
static int
mbx_set_header (mailbox_t, int id, const char *h,
int offset, int n, int replace)
{
return -1;
}
static int
mbx_set_body (mailbox_t, int id, const char *b,
int offset, int n, int replace)
{
return -1;
}
static int
mbx_append (mailbox_t, int id)
{
return -1;
}
static int
mbx_destroy_msg (mailbox_t, int id)
{
return -1;
}
/* reading */
static int
mbx_get_body (mailbox_t, int id, char *b, int offset, int n)
{
return -1;
}
static int
mbx_get_header (mailbox_t, int id, char *h, int offset, int n)
{
return -1;
}
/* locking */
static int
mbx_lock (mailbox_t, int flag)
{
return -1;
}
static int
mbx_unlock (mailbox_t)
{
return -1;
}
/* misc */
static int
mbx_scan (mailbox_t, int *msgs)
{
return -1;
}
static int
mbx_is_updated (mailbox_t)
{
return -1;
}
static int
mbx_get_timeout (mailbox_t, int *timeout)
{
return -1;
}
static int
mbx_set_timeout (mailbox_t, int timeout)
{
return -1;
}
static int
mbx_get_refresh (mailbox_t, int *refresh)
{
return -1;
}
static int
mbx_set_refresh (mailbox_t, int refresh)
{
return -1;
}
static int
mbx_set_notification (mailbox_t, int (*notif) (mailbox_t))
{
return -1;
}
/* GNU mailutils - a suite of utilities for electronic mail
Copyright (C) 1999 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Library General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#ifndef _MAILBOX_H
# define _MAILBOX_H
#include <url.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifndef __P
# ifdef __STDC__
# define __P(args) args
# else
# define __P(args) ()
# endif
#endif /*__P */
/* forward declaration */
struct _mailbox;
typedef struct _mailbox *mailbox_t;
/* Lock settings */
typedef enum { MB_ULOCK, MB_RLOCK, MB_WLOCK } mailbox_lock_t;
struct mailbox_type
{
char *name;
int id;
struct url_type *utype;
int (*_init) __P ((mailbox_t *, const char *name, int id));
int (*_destroy) __P ((mailbox_t *);
};
struct _mailbox
{
/* Data */
char *name;
int messages;
int num_deleted;
long size;
int timeout;
int refresh;
mailbox_lock_t lock;
int (*notif) __P ((mailbox_t));
void *data;
struct mailbox_type *mtype;
/* Functions */
void (*_destroy) __P ((maibox_t *));
int (*_open) __P ((mailbox_t, int flag));
int (*_close) __P ((mailbox_t, int flag));
/* type */
int (*_get_type) __P ((mailbox_t, int *type, char *desc,
int offset, int len));
int (*_get_mtype) __P ((mailbox_t, int *type, char **desc,
int *len));
/* passwd if needed */
int (*_get_passwd) __P ((mailbox_t, char * passwd, int offset, int n));
int (*_get_mpasswd) __P ((mailbox_t, char ** passwd, int *n));
int (*_set_passwd) __P ((mailbox_t, const char * passwd,
int offset, int n));
/* deleting mesgs */
int (*_delete) __P ((mailbox_t, int id));
int (*_undelete) __P ((mailbox_t, int id));
int (*_is_deleted) __P ((mailbox_t, int id));
int (*_expunge) __P ((mailbox_t));
/* appending messages */
int (*_new_msg) __P ((mailbox_t, int *id));
int (*_set_header) __P ((mailbox_t, int id, const char *h,
int offset, int n, int replace));
int (*_set_body) __P ((mailbox_t, int id, const char *b,
int offset, int n, int replace));
int (*_append) __P ((mailbox_t, int id));
int (*_destroy_msg) __P ((mailbox_t, int id));
/* locking */
int (*_lock) __P ((mailbox_t, int flag));
int (*_unlock) __P ((mailbox_t));
/* reading mesgs */
int (*_get_body) __P ((mailbox_t, int id, char *v,
int offset, int n));
int (*_get_mbody) __P ((mailbox_t, int id, char **v, int *n));
int (*_get_header) __P ((mailbox_t, int id, char *h,
int offset, int n));
int (*_get_mheader) __P ((mailbox_t, int id, char **h, int *n));
/* misc */
int (*_scan) __P ((mailbox_t, int *msgs));
int (*_is_updated) __P ((mailbox_t));
int (*_get_timeout) __P ((mailbox_t, int *timeout));
int (*_set_timeout) __P ((mailbox_t, int timeout));
int (*_get_size) __P ((mailbox_t, int id, long *size));
int (*_get_refresh) __P ((mailbox_t, int *refresh));
int (*_set_refresh) __P ((mailbox_t, int refresh));
int (*_set_notification) __P ((mailbox_t, int (*notif) __P ((mailbox_t))));
};
/* constructor/destructor and possible types */
extern int mailbox_init __P ((mailbox_t *, const char *name, int id));
extern void mailbox_destroy __P ((mailbox_t *));
/* mailbox registration */
extern int mailbox_list_type __P ((struct mailbox_type mtype[], int size));
extern int mailbox_list_mtype __P ((struct mailbox_type **mtype, int *size));
extern int mailbox_add_type __P ((struct mailbox_type *mlist));
extern int mailbox_remove_type __P ((const struct mailbox_type *mlist));
#ifndef INLINE
# ifdef __GNUC__
# define INLINE __inline__
# else
# define INLINE
# endif
#endif
extern INLINE int mailbox_open __P ((mailbox_t, int flag));
extern INLINE int mailbox_close __P ((mailbox_t, int flag));
/* type */
extern INLINE int mailbox_get_type __P ((mailbox_t, int *type, char *desc,
int offset, int len));
extern INLINE int mailbox_get_mtype __P ((mailbox_t, int *type, char **desc,
int *len));
/* passwd */
extern INLINE int mailbox_get_passwd __P ((mailbox_t, char * passwd,
int offset, int len));
extern INLINE int mailbox_get_mpasswd __P ((mailbox_t, char ** passwd,
int *len));
extern INLINE int mailbox_set_passwd __P ((mailbox_t, const char * passwd,
int offset, int len));
/* deleting */
extern INLINE int mailbox_delete __P ((mailbox_t, int));
extern INLINE int mailbox_undelete __P ((mailbox_t, int));
extern INLINE int mailbox_expunge __P ((mailbox_t));
extern INLINE int mailbox_is_deleted __P ((mailbox_t, int));
/* appending */
extern INLINE int mailbox_new_msg __P ((mailbox_t, int * id));
extern INLINE int mailbox_set_header __P ((mailbox_t, int id, const char *h,
int offset, int n, int replace));
extern INLINE int mailbox_set_body __P ((mailbox_t, int id, const char *b,
int offset, int n, int replace));
extern INLINE int mailbox_append __P ((mailbox_t, int id));
extern INLINE int mailbox_destroy_msg __P ((mailbox_t, int id));
/* reading */
extern INLINE int mailbox_get_body __P ((mailbox_t, int id, char *b,
int offset, int n));
extern INLINE int mailbox_get_header __P ((mailbox_t, int id, char *h,
int offset, int n));
/* locking */
extern INLINE int mailbox_lock __P ((mailbox_t, int flag));
extern INLINE int mailbox_unlock __P ((mailbox_t));
/* misc */
extern INLINE int mailbox_scan __P ((mailbox_t, int *msgs));
extern INLINE int mailbox_is_updated __P ((mailbox_t));
extern INLINE int mailbox_get_timeout __P ((mailbox_t, int *timeout));
extern INLINE int mailbox_set_timeout __P ((mailbox_t, int timeout));
extern INLINE int mailbox_get_refresh __P ((mailbox_t, int *refresh));
extern INLINE int mailbox_set_refresh __P ((mailbox_t, int refresh));
extern INLINE int mailbox_set_notification __P ((mailbox_t, int
(*notif) __P ((mailbox_t))));
#ifdef MU_USE_MACROS
#define mailbox_open(m, f) m->_open (m, f)
#define mailbox_close(m, f) m->_close (m, f)
/* type */
#define mailbox_get_type(m, t, d, o, n) m->_get_type (m, t, d, o, n)
#define mailbox_get_mtype(m, t, d, n) m->_get_mtype (m, t, d, n)
/* passwd */
#define mailbox_get_passwd(m, p, o, n) m->_get_passwd (m, p, o, n)
#define mailbox_get_mpasswd(m, p, n) m->_get_mpasswd (m, p, n)
#define mailbox_set_passwd(m, p, o, n) m->_set_passwd (m, p, o, n)
/* deleting */
#define mailbox_delete(m, id) m->_delete (m, id)
#define mailbox_undelete(m, id) m->_undelete (m, id)
#define mailbox_is_deleted(m, id) m->_is_deleted (m, id)
#define mailbox_expunge(m) m->_expunge (m)
/* appending */
#define mailbox_new_msg(m, id) m->_new_msg (m, id)
#define mailbox_set_header(m, id, h, o, n, r) m->_set_header(m, id, h, o, n, r)
#define mailbox_set_body(m, id, b, o, n, r) m->_set_body (m, id, b, o, n, r)
#define mailbox_append(m, id) m->_append (m, id)
#define mailbox_destroy_msg(m, id) m->_destroy_msg (m, id)
/* locking */
#define mailbox_lock(m, f) m->_lock (m, f)
#define mailbox_unlock(m) m->_unlock (m)
/* reading */
#define mailbox_get_header(m, id, h, o, n) m->_get_header (m, id, h, o, n)
#define mailbox_get_mheader(m, id, h, n) m->_get_header (m, id, h, n)
#define mailbox_get_body(m, id, b, o, n) m->_get_body (m, id, b, o, n)
#define mailbox_get_mbody(m, id, b, n) m->_get_body (m, id, b, n)
/* misc */
#define mailbox_scan(m, t) m->_scan (m, t)
#define mailbox_is_updated(m) m->_is_updated (m)
#define mailbox_get_timeout(m, t) m->_get_timeout (m, t)
#define mailbox_set_timeout(m, t) m->_set_timeout (m, t)
#define mailbox_get_refresh(m, r) m->_get_refresh (m, r)
#define mailbox_set_refresh(m, r) m->_set_refresh (m, r)
#define mailbox_set_notification(m, notif) m->_set_notification (m, notif)
#endif /* MU_USE_MACROS */
#ifdef __cplusplus
}
#endif
#endif /* _MAILBOX_H */
/* GNU mailutils - a suite of utilities for electronic mail
Copyright (C) 1999 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Library General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <mailbox.h>
int
mailbox_open (mailbox_t mbox, int flag)
{
return mbox->_open (mbox, flag);
}
int
mailbox_close (mailbox_t mbox, int flag)
{
return mbox->_close (mbox, flag);
}
/* type */
int
mailbox_get_type (mailbox_t mbox, int *type, char *desc, int offset, int len)
{
return mbox->_get_type (mbox, type, desc, offset, len);
}
int
mailbox_get_mtype (mailbox_t mbox, int *type, char **desc, int *len)
{
return mbox->_get_mtype (mbox, type, desc, offset, len);
}
/* passwd */
int
mailbox_get_passwd (mailbox_t mbox, char *passwd, int offset, int len)
{
return mbox->_get_passwd (mbox, passwd, offset, len);
}
int
mailbox_get_mpasswd (mailbox_t mbox, char **passwd, int *len)
{
return mbox->_get_mpasswd (mbox, passwd, len);
}
int
mailbox_set_passwd (mailbox_t mbox, const char *passwd, int offset, int len)
{
return mbox->_set_passwd (mbox, passwd, offset, len);
}
/* deleting */
int
mailbox_delete (mailbox_t mbox, int id)
{
return mbox->_delete (mbox, id);
}
int
mailbox_undelete (mailbox_t mbox, int id)
{
return mbox->_undelete (mbox, id);
}
int
mailbox_expunge (mailbox_t mbox)
{
return mbox->_expunge (mbox);
}
int
mailbox_is_deleted (mailbox_t mbox, int)
{
return mbox->_is_deleted (mbox, int);
}
/* appending */
int
mailbox_new_msg (mailbox_t mbox, int * id)
{
return mbox->_new_msg (mbox, id);
}
int
mailbox_set_header (mailbox_t mbox, int id, const char *h,
int offset, int n, int replace)
{
return mbox->_set_header (mbox, id, h, offset, n, replace);
}
int
mailbox_set_body (mailbox_t mbox, int id, const char *b,
int offset, int n, int replace)
{
return mbox->_set_body (mbox, id, b, offset, n, replace);
}
int
mailbox_append (mailbox_t mbox, int id)
{
return mbox->_append (mbox, id);
}
int
mailbox_destroy_msg (mailbox_t mbox, int id)
{
return mbox->_destroy_msg (mbox, id);
}
/* reading */
int
mailbox_get_body (mailbox_t mbox, int id, char *b, int offset, int n)
{
return mbox->_get_body (mbox, id, b, offset, n);
}
int
mailbox_get_mbody (mailbox_t mbox, int id, char **b, int *n)
{
return mbox->_get_body (mbox, id, b, n);
}
int
mailbox_get_header (mailbox_t mbox, int id, char *h, int offset, int n)
{
return mbox->_get_header (mbox, id, h, offset, n);
}
int
mailbox_get_mheader (mailbox_t mbox, int id, char **h, int *n)
{
return mbox->_get_header (mbox, id, h, n);
}
/* locking */
int
mailbox_lock (mailbox_t mbox, int flag)
{
return mbox->_lock (mbox, flag);
}
int
mailbox_unlock (mailbox_t mbox)
{
return mbox->_unlock (mbox);
}
/* misc */
int
mailbox_scan (mailbox_t mbox, int *msgs)
{
return mbox->_scan (mbox, msgs);
}
int
mailbox_is_updated (mailbox_t mbox)
{
return mbox->_is_updated (mbox);
}
int
mailbox_get_timeout (mailbox_t mbox, int *timeout)
{
return mbox->_get_timeout (mbox, timeout);
}
int
mailbox_set_timeout (mailbox_t mbox, int timeout)
{
return mbox->_set_timeout (mbox, timeout);
}
int
mailbox_get_refresh (mailbox_t mbox, int *refresh)
{
return mbox->_get_refresh (mbox, refresh);
}
int
mailbox_set_refresh (mailbox_t mbox, int refresh)
{
return mbox->_set_refresh (mbox, refresh);
}
int
mailbox_set_notification (mailbox_t mbox, int (*notif) __P ((mailbox_t mbox)))
{
return mbox->_set_notification (mbox, notif);
}
/* GNU mailutils - a suite of utilities for electronic mail
Copyright (C) 1999 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Library General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <mbx_imap.h>
struct mailbox_type _mailbox_imap_type =
{
"IMAP",
(int)&_url_imap_type, &_url_imap_type,
mailbox_imap_init, mailbox_imap_destroy
};
int
mailbox_imap_destroy (mailbox_t *mbox)
{
return;
}
int
mailbox_imap_init (mailbox_t *mbox, const char *name)
{
return -1;
}
/* GNU mailutils - a suite of utilities for electronic mail
Copyright (C) 1999 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Library General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#ifndef _MBX_IMAP_H
#define _MBX_IMAP_H 1
#include <mailbox.h>
extern int mailbox_imap_init __P ((mailbox_t *mbox, const char *name));
extern int mailbox_imap_destroy __P ((mailbox_t *mbox));
extern struct mailbox_type _mailbox_imap_type;
#endif /* _MBX_IMAP_H */
/* GNU mailutils - a suite of utilities for electronic mail
Copyright (C) 1999 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Library Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <mbx_pop.h>
struct mailbox_type _mailbox_pop_type =
{
"POP",
(int)&_url_pop_type, &_url_pop_type,
mailbox_pop_init, mailbox_pop_destroy
};
void
mailbox_pop_destroy (mailbox_t *mbox)
{
return;
}
int
mailbox_pop_init (mailbox_t *mbox)
{
return -1;
}
/* GNU mailutils - a suite of utilities for electronic mail
Copyright (C) 1999 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Library General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#ifndef _MBX_POP_H
#define _MBX_POP_H 1
#include <mailbox.h>
extern int mailbox_pop_init __P ((mailbox_t *mbox, const char *name));
extern int mailbox_pop_destroy __P ((mailbox_t *mbox));
extern struct mailbox_type _mailbox_pop_type;
#endif /* _MBX_POP_H */