#include <imap/imap.h>
#include "pop.h"
-#ifdef USE_NNTP
-#include "nntp.h"
-#endif
static mx_t const *mxfmts[] = {
&mbox_mx,
&maildir_mx,
&imap_mx,
&pop_mx,
-#ifdef USE_NNTP
- &nntp_mx,
-#endif
&compress_mx,
};
static int dotlock_file(const char *path, int retry)
{
- char lockfile[PATH_MAX];
+ char lockfile[_POSIX_PATH_MAX];
snprintf(lockfile, sizeof(lockfile), "%s.lock", path);
if (lockfile_create(lockfile, retry ? 1 : 0, 0)) {
static int undotlock_file (const char *path)
{
- char lockfile[PATH_MAX];
+ char lockfile[_POSIX_PATH_MAX];
snprintf(lockfile, sizeof(lockfile), "%s.lock", path);
- lockfile_remove(lockfile);
+ return lockfile_remove(lockfile);
}
/* looks up index of type for path in mxfmts */
ctx->closing = 1;
-#ifdef USE_NNTP
- if (ctx->magic == M_NNTP) {
- int ret;
-
- ret = nntp_close_mailbox (ctx);
- mx_fastclose_mailbox (ctx);
- return ret;
- }
-#endif
if (ctx->readonly || ctx->dontwrite) {
/* mailbox is readonly or we don't want to write */
mx_fastclose_mailbox (ctx);
break;
}
-#ifdef USE_NNTP
- case M_NNTP:
- {
- if (nntp_fetch_message (msg, ctx, msgno) != 0)
- p_delete(&msg);
- break;
- }
-#endif /* USE_NNTP */
-
default:
p_delete(&msg);
break;
int r = 0;
if ((*msg)->magic == M_MH || (*msg)->magic == M_MAILDIR
- || (*msg)->magic == M_IMAP
- || (*msg)->magic == M_POP
-#ifdef USE_NNTP
- || (*msg)->magic == M_NNTP
-#endif
- ) {
+ || (*msg)->magic == M_IMAP || (*msg)->magic == M_POP)
+ {
r = m_fclose(&(*msg)->fp);
}
else