AUTOMAKE_OPTIONS = foreign
EXTRA_PROGRAMS = muttng_dotlock pgpringng pgpewrapng makedoc
-if BUILD_IMAP
-IMAP_SUBDIR = imap
-IMAP_INCLUDES = -I$(top_srcdir)/imap
-endif
-
if BUILD_NNTP
NNTP_SUBDIR = nntp
NNTP_INCLUDES = -I$(top_srcdir)/nntp
endif
-SUBDIRS = intl m4 po lib-lib lib-mime lib-hash doc contrib lib pop $(IMAP_SUBDIR) $(NNTP_SUBDIR)
+SUBDIRS = intl m4 po doc contrib \
+ lib-lib lib-mime lib-hash lib \
+ pop imap $(NNTP_SUBDIR)
bin_SCRIPTS = muttngbug fleang
crypt-mod-pgp-classic.c smime.c crypt-mod-smime-classic.c
-muttng_LDADD = @MUTT_LIB_OBJECTS@ @LIBOBJS@ $(LIBIMAP) -Lpop -lpop $(LIBNNTP) \
- -Llib-lib -llib -Llib-mime -lmime -Llib-hash -lhash -Llib -lsane $(MUTTLIBS) $(INTLLIBS) $(LIBICONV)
+muttng_LDADD = @MUTT_LIB_OBJECTS@ @LIBOBJS@ \
+ -Limap -limap -Lpop -lpop $(LIBNNTP) \
+ -Llib-lib -llib -Llib-mime -lmime -Llib-hash -lhash \
+ -Llib -lsane $(MUTTLIBS) $(INTLLIBS) $(LIBICONV)
muttng_DEPENDENCIES = @MUTT_LIB_OBJECTS@ @LIBOBJS@ \
$(top_builddir)/lib-lib/liblib.a \
$(top_builddir)/lib-mime/libmime.a \
$(top_builddir)/lib-hash/libhash.a \
$(top_builddir)/lib/libsane.a \
+ \
$(top_builddir)/pop/libpop.a \
- $(LIBIMAPDEPS) $(LIBNNTPDEPS) $(INTLDEPS)
+ $(top_builddir)/imap/libimap.a \
+ $(LIBNNTPDEPS) $(INTLDEPS)
makedoc_SOURCES = makedoc.c
makedoc_LDADD = -Llib-lib -llib
int mutt_account_match (const ACCOUNT * a1, const ACCOUNT * a2)
{
const char* user = NONULL (Username);
-#ifdef USE_IMAP
const char* login = NONULL (Username);
-#endif
if (a1->type != a2->type)
return 0;
if (a1->port != a2->port)
return 0;
-#ifdef USE_IMAP
if (a1->type == M_ACCT_TYPE_IMAP) {
if (ImapUser && (ImapUser[0] != '\0'))
user = ImapUser;
if (ImapLogin && (ImapLogin[0] != '\0'))
login = ImapLogin;
}
-#endif
if (a1->type == M_ACCT_TYPE_POP && PopUser)
user = PopUser;
url->pass = NULL;
url->port = 0;
-#ifdef USE_IMAP
if (account->type == M_ACCT_TYPE_IMAP) {
if (account->flags & M_ACCT_SSL)
url->scheme = U_IMAPS;
else
url->scheme = U_IMAP;
}
-#endif
if (account->type == M_ACCT_TYPE_POP) {
if (account->flags & M_ACCT_SSL)
/* already set */
if (account->flags & M_ACCT_USER)
return 0;
-#ifdef USE_IMAP
else if ((account->type == M_ACCT_TYPE_IMAP) && !m_strisempty(ImapUser))
m_strcpy(account->user, sizeof(account->user), ImapUser);
-#endif
else if ((account->type == M_ACCT_TYPE_POP) && !m_strisempty(PopUser))
m_strcpy(account->user, sizeof(account->user), PopUser);
#ifdef USE_NNTP
/* already set */
if (account->flags & M_ACCT_LOGIN)
return 0;
-#ifdef USE_IMAP
else if (account->type == M_ACCT_TYPE_IMAP)
{
if (!m_strisempty(ImapLogin)) {
account->flags |= M_ACCT_LOGIN;
}
}
-#endif
if (!(account->flags & M_ACCT_LOGIN)) {
mutt_account_getuser (account);
if (account->flags & M_ACCT_PASS)
return 0;
-#ifdef USE_IMAP
else if ((account->type == M_ACCT_TYPE_IMAP) && !m_strisempty(ImapPass))
m_strcpy(account->pass, sizeof(account->pass), ImapPass);
-#endif
else if ((account->type == M_ACCT_TYPE_POP) && !m_strisempty(PopPass))
m_strcpy(account->pass, sizeof(account->pass), PopPass);
#ifdef USE_NNTP
#include "browser.h"
#include "attach.h"
-#ifdef USE_IMAP
-#include "imap.h"
-#include "imap/mx_imap.h"
-#endif
+#include <imap/imap.h>
+#include <imap/mx_imap.h>
#ifdef USE_NNTP
#include "nntp.h"
#endif
p_delete(&((state->entry)[c].desc));
p_delete(&((state->entry)[c].st));
}
-#ifdef USE_IMAP
p_delete(&state->folder);
-#endif
p_delete(&state->entry);
}
{
const char *s;
-#ifdef USE_IMAP
if (folder->ff->imap)
s = NONULL (folder->ff->desc);
else
-#endif
s = NONULL (folder->ff->name);
snprintf (fn, sizeof (fn), "%s%s", s,
0 ? 'x' : '-');
mutt_format_s (dest, destlen, fmt, permission);
}
-#ifdef USE_IMAP
else if (folder->ff->imap) {
/* mark folders with subfolders AND mail */
snprintf (permission, sizeof (permission), "IMAP %c",
&& folder->ff->selectable) ? '+' : ' ');
mutt_format_s (dest, destlen, fmt, permission);
}
-#endif
else
mutt_format_s (dest, destlen, fmt, "");
break;
break;
case 'N':
-#ifdef USE_IMAP
if (imap_is_magic (folder->ff->desc, NULL) == M_IMAP) {
if (!optional) {
snprintf (tmp, sizeof (tmp), "%%%sd", fmt);
optional = 0;
break;
}
-#endif
snprintf (tmp, sizeof (tmp), "%%%sc", fmt);
snprintf (dest, destlen, tmp, folder->ff->new ? 'N' : ' ');
break;
(state->entry)[state->entrylen].new = new;
(state->entry)[state->entrylen].name = m_strdup(name);
(state->entry)[state->entrylen].desc = m_strdup(name);
-#ifdef USE_IMAP
(state->entry)[state->entrylen].imap = 0;
-#endif
#ifdef USE_NNTP
if (option (OPTNEWS))
(state->entry)[state->entrylen].nd = (NNTP_DATA *) data;
state->entrylen = 0;
state->entrymax = 256;
state->entry = p_new(struct folder_file, state->entrymax);
-#ifdef USE_IMAP
state->imap_browse = 0;
-#endif
if (menu)
menu->data = state->entry;
}
for (i = 0; i < Incoming->length; i++) {
tmp = (BUFFY*) Incoming->data[i];
tmp->magic = mx_get_magic (tmp->path);
-#ifdef USE_IMAP
if (tmp->magic == M_IMAP) {
#ifdef USE_NNTP
add_folder (menu, state, tmp->path, NULL, NULL, tmp->new);
#endif
continue;
}
-#endif
if (tmp->magic == M_POP) {
#ifdef USE_NNTP
add_folder (menu, state, tmp->path, NULL, NULL, tmp->new);
else {
m_strcpy(path, sizeof(path), LastDir);
mutt_pretty_mailbox (path);
-#ifdef USE_IMAP
if (state->imap_browse && option (OPTIMAPLSUB))
snprintf (title, titlelen, _("Subscribed [%s], File mask: %s"),
path, NONULL (Mask.pattern));
else
-#endif
snprintf (title, titlelen, _("Directory [%s], File mask: %s"),
path, NONULL (Mask.pattern));
}
#endif
if (*f) {
mutt_expand_path (f, flen);
-#ifdef USE_IMAP
if (imap_is_magic (f, NULL) == M_IMAP) {
init_state (&state, NULL);
state.imap_browse = 1;
m_strcpy(LastDir, sizeof(LastDir), state.folder);
}
else {
-#endif
for (i = m_strlen(f) - 1; i > 0 && f[i] != '/'; i--);
if (i > 0) {
if (f[0] == '/') {
else
m_strcpy(prefix, sizeof(prefix), f + i + 1);
killPrefix = 1;
-#ifdef USE_IMAP
}
-#endif
}
else {
if (!folder)
else if (!LastDir[0])
m_strcpy(LastDir, sizeof(LastDir), NONULL(Maildir));
-#ifdef USE_IMAP
if (!buffy && imap_is_magic (LastDir, NULL) == M_IMAP) {
init_state (&state, NULL);
state.imap_browse = 1;
imap_browse (LastDir, &state);
browser_sort (&state);
}
-#endif
}
*f = 0;
goto bail;
}
else
-#ifdef USE_IMAP
if (!state.imap_browse)
-#endif
if (examine_directory (NULL, &state, LastDir, prefix) == -1)
goto bail;
if (S_ISDIR (state.entry[menu->current].mode) ||
(S_ISLNK (state.entry[menu->current].mode) &&
link_is_dir (LastDir, state.entry[menu->current].name))
-#ifdef USE_IMAP
|| state.entry[menu->current].inferiors
-#endif
) {
/* make sure this isn't a MH or maildir mailbox */
if (buffy) {
m_strcpy(buf, sizeof(buf), state.entry[menu->current].name);
mutt_expand_path (buf, sizeof (buf));
}
-#ifdef USE_IMAP
else if (state.imap_browse) {
m_strcpy(buf, sizeof(buf), state.entry[menu->current].name);
}
-#endif
else
mutt_concat_path(buf, sizeof(buf), LastDir,
state.entry[menu->current].name);
if ((mx_get_magic (buf) <= 0)
-#ifdef USE_IMAP
- || state.entry[menu->current].inferiors
-#endif
- ) {
+ || state.entry[menu->current].inferiors)
+ {
char OldLastDir[_POSIX_PATH_MAX];
/* save the old directory */
state.entry[menu->current].name);
mutt_expand_path (LastDir, sizeof (LastDir));
}
-#ifdef USE_IMAP
else if (state.imap_browse) {
int n;
ciss_url_t url;
LastDir[n - 1] = state.entry[menu->current].delim;
}
}
-#endif
else {
char tmp[_POSIX_PATH_MAX];
killPrefix = 0;
}
buffy = 0;
-#ifdef USE_IMAP
if (state.imap_browse) {
init_state (&state, NULL);
state.imap_browse = 1;
menu->data = state.entry;
}
else
-#endif
if (examine_directory (menu, &state, LastDir, prefix) == -1) {
/* try to restore the old values */
m_strcpy(LastDir, sizeof(LastDir), OldLastDir);
m_strcpy(f, flen, state.entry[menu->current].name);
mutt_expand_path (f, flen);
}
-#ifdef USE_IMAP
else if (state.imap_browse)
m_strcpy(f, flen, state.entry[menu->current].name);
-#endif
else
mutt_concat_path(f, flen, LastDir, state.entry[menu->current].name);
mutt_message ("%s", state.entry[menu->current].name);
break;
-#ifdef USE_IMAP
case OP_BROWSER_TOGGLE_LSUB:
if (option (OPTIMAPLSUB)) {
unset_option (OPTIMAPLSUB);
p_delete(&mx.mbox);
}
break;
-#endif
case OP_CHANGE_DIRECTORY:
#endif
m_strcpy(buf, sizeof(buf), LastDir);
-#ifdef USE_IMAP
if (!state.imap_browse)
-#endif
{
/* add '/' at the end of the directory name if not already there */
size_t len = m_strlen(LastDir);
buf[0]) {
buffy = 0;
mutt_expand_path (buf, sizeof (buf));
-#ifdef USE_IMAP
if (imap_is_magic (buf, NULL) == M_IMAP) {
m_strcpy(LastDir, sizeof(LastDir), buf);
destroy_state (&state);
init_menu (&state, menu, title, sizeof (title), buffy);
}
else
-#endif
if (stat (buf, &st) == 0) {
if (S_ISDIR (st.st_mode)) {
destroy_state (&state);
Mask.not = not;
destroy_state (&state);
-#ifdef USE_IMAP
if (state.imap_browse) {
init_state (&state, NULL);
state.imap_browse = 1;
init_menu (&state, menu, title, sizeof (title), buffy);
}
else
-#endif
if (examine_directory (menu, &state, LastDir, NULL) == 0)
init_menu (&state, menu, title, sizeof (title), buffy);
else {
if (examine_mailboxes (menu, &state) == -1)
goto bail;
}
-#ifdef USE_IMAP
else if (imap_is_magic (LastDir, NULL) == M_IMAP) {
init_state (&state, NULL);
state.imap_browse = 1;
browser_sort (&state);
menu->data = state.entry;
}
-#endif
else if (examine_directory (menu, &state, LastDir, prefix) == -1)
goto bail;
init_menu (&state, menu, title, sizeof (title), buffy);
break;
}
-#ifdef USE_IMAP
if (state.entry[menu->current].selectable) {
m_strcpy(f, flen, state.entry[menu->current].name);
destroy_state (&state);
goto bail;
}
else
-#endif
if (S_ISDIR (state.entry[menu->current].mode) ||
(S_ISLNK (state.entry[menu->current].mode) &&
link_is_dir (LastDir, state.entry[menu->current].name))) {
break;
#endif /* USE_NNTP */
-#if defined USE_IMAP || defined USE_NNTP
case OP_BROWSER_SUBSCRIBE:
case OP_BROWSER_UNSUBSCRIBE:
-#endif
#ifdef USE_NNTP
case OP_SUBSCRIBE_PATTERN:
case OP_UNSUBSCRIBE_PATTERN:
regfree (rx);
p_delete(&rx);
}
-#ifdef USE_IMAP
else
-#endif /* USE_IMAP && USE_NNTP */
#endif /* USE_NNTP */
-#ifdef USE_IMAP
{
if (i == OP_BROWSER_SUBSCRIBE)
imap_subscribe (state.entry[menu->current].name, 1);
else
imap_subscribe (state.entry[menu->current].name, 0);
}
-#endif /* USE_IMAP */
}
}
char *desc;
unsigned short new;
-#ifdef USE_IMAP
char delim;
unsigned imap:1;
unsigned selectable:1;
unsigned inferiors:1;
-#endif
#ifdef USE_NNTP
NNTP_DATA *nd;
#endif
struct folder_file *entry;
unsigned int entrylen; /* number of real entries */
unsigned int entrymax; /* max entry */
-#ifdef USE_IMAP
short imap_browse;
char *folder;
unsigned noselect:1;
unsigned marked:1;
unsigned unmarked:1;
-#endif
};
#endif /* _BROWSER_H */
#include <lib-lib/buffer.h>
#include <lib-lib/macros.h>
+#include <imap/imap.h>
+
#include "mutt.h"
#include "buffy.h"
#include "mx.h"
#include "mutt_curses.h"
-#ifdef USE_IMAP
-#include "imap.h"
-#endif
-
-
#include <string.h>
#include <sys/stat.h>
#include <dirent.h>
static time_t BuffyTime = 0; /* last time we started checking for mail */
-#ifdef USE_IMAP
static time_t ImapBuffyTime = 0; /* last time we started checking for mail */
-#endif
static short BuffyCount = 0; /* how many boxes with new mail */
static short BuffyNotify = 0; /* # of unnotified new boxes */
CONTEXT *ctx;
unsigned int i = 0;
int local = 0, count = 0;
-#ifdef USE_IMAP
time_t last2;
/* update postponed count as well, on force */
if (force == 1)
mutt_update_num_postponed ();
-#endif
/* fastest return if there are no mailboxes */
if (list_empty(Incoming))
return 0;
now = time (NULL);
if (force == 0 && (now - BuffyTime < BuffyTimeout)
-#ifdef USE_IMAP
&& (now - ImapBuffyTime < ImapBuffyTimeout))
-#else
- )
-#endif
return BuffyCount;
last1 = BuffyTime;
if (force == 1 || now - BuffyTime >= BuffyTimeout)
BuffyTime = now;
-#ifdef USE_IMAP
last2 = ImapBuffyTime;
if (force == 1 || now - ImapBuffyTime >= ImapBuffyTimeout)
ImapBuffyTime = now;
-#endif
BuffyCount = 0;
BuffyNotify = 0;
BuffyCount++;
break;
-#ifdef USE_IMAP
case M_IMAP:
/* only check on force or $imap_mail_check reached */
if (force == 1 || (now - last2 >= ImapBuffyTimeout)) {
/* keep current stats if !force and !$imap_mail_check reached */
BuffyCount++;
break;
-#endif
}
}
#include <sys/stat.h>
#include <fcntl.h>
-#ifdef USE_IMAP
-#include "imap.h"
-#endif
+#include <imap/imap.h>
#ifdef BUFFY_SIZE
#include "buffy.h"
mutt_message (_("Copying to %s..."), buf);
-#ifdef USE_IMAP
if (Context->magic == M_IMAP && !(decode || decrypt) && mx_get_magic (buf) == M_IMAP) {
switch (imap_copy_messages (Context, h, buf, delete)) {
/* success */
return -1;
}
}
-#endif
if (mx_open_mailbox (buf, M_APPEND, &ctx) != NULL) {
if (h) {
#endif
#include "mutt.h"
-#ifdef USE_IMAP
#include "mx.h"
-#include "imap.h"
-#endif
+#include <imap/imap.h>
#ifdef USE_NNTP
#include "nntp.h"
#endif
char dirpart[_POSIX_PATH_MAX], exp_dirpart[_POSIX_PATH_MAX];
char filepart[_POSIX_PATH_MAX];
-#ifdef USE_IMAP
char imap_path[LONG_STRING];
-#endif
debug_print (2, ("completing %s\n", s));
}
#endif
-#ifdef USE_IMAP
/* we can use '/' as a delimiter, imap_complete rewrites it */
if (*s == '=' || *s == '+' || *s == '!') {
const char *q = NONULL(*s == '!' ? Spoolfile : Maildir);
if (mx_get_magic (imap_path) == M_IMAP)
return imap_complete (s, slen, imap_path);
-#endif
if (*s == '=' || *s == '+' || *s == '!') {
dirpart[0] = *s;
else
#endif
mutt_expand_path (fname, sizeof (fname));
-#ifdef USE_IMAP
if (mx_get_magic (fname) != M_IMAP)
-#endif
if (mx_get_magic (fname) != M_POP)
#ifdef USE_NNTP
if (mx_get_magic (fname) != M_NNTP && !option (OPTNEWS))
dnl -- socket dependencies --
-AC_ARG_ENABLE(imap, AC_HELP_STRING([--enable-imap], [Enable IMAP support]),
-[ if test x$enableval = xyes ; then
- AC_DEFINE(USE_IMAP,1,[ Define if you want support for the IMAP protocol. ])
- LIBIMAP="-Limap -limap"
- LIBIMAPDEPS="\$(top_srcdir)/imap/imap.h imap/libimap.a"
- need_imap="yes"
- need_md5="yes"
- fi
-])
-AM_CONDITIONAL(BUILD_IMAP, test x$need_imap = xyes)
-
AC_ARG_ENABLE(nntp, [ --enable-nntp Enable NNTP support],
[ if test x$enableval = xyes ; then
AC_DEFINE(USE_NNTP,1,[ Compiling with newsreading support with NNTP ])
gss_prefix="$withval", gss_prefix="no")
if test "$gss_prefix" != "no"
then
- if test "$need_imap" = "yes"
- then
MUTT_AM_PATH_GSSAPI(gss_prefix)
AC_MSG_CHECKING(GSSAPI implementation)
AC_MSG_RESULT($GSSAPI_IMPL)
MUTTLIBS="$MUTTLIBS $GSSAPI_LIBS"
AC_DEFINE(USE_GSS,1,[ Define if you have GSSAPI libraries available ])
need_gss="yes"
- else
- AC_MSG_WARN([GSS was requested but IMAP is not enabled])
- fi
fi
AM_CONDITIONAL(USE_GSS, test x$need_gss = xyes)
AM_CONDITIONAL(USE_SSL, test x$need_ssl = xyes)
-AC_ARG_WITH(sasl2, AC_HELP_STRING([--with-sasl2[=PFX]], [Use Cyrus SASL library version 2 for POP/IMAP authentication]),
+AC_ARG_WITH(sasl2, AC_HELP_STRING([--with-sasl2[=PFX]],
+ [Use Cyrus SASL library version 2 for POP/IMAP authentication]),
[
- if test "$with_sasl2" != "no" -a "$need_imap" != "yes" -a "$need_pop" != "yes"
- then
- AC_MSG_ERROR([SASL2 support is only useful with POP or IMAP support])
- fi
-
if test "$with_sasl2" != "no"
then
if test "$with_sasl2" != "yes"
AC_SUBST(MUTTLIBS)
AC_SUBST(MUTT_LIB_OBJECTS)
-AC_SUBST(LIBIMAP)
-AC_SUBST(LIBIMAPDEPS)
-AC_SUBST(LIBPOP)
-AC_SUBST(LIBPOPDEPS)
AC_SUBST(LIBNNTP)
AC_SUBST(LIBNNTPDEPS)
#include "thread.h"
#include "xterm.h"
-#ifdef USE_IMAP
-#include "imap_private.h"
-#endif
+#include <imap/imap_private.h>
#include "mutt_crypt.h"
* modified underneath us.)
*/
-#ifdef USE_IMAP
imap_allow_reopen (Context);
-#endif
index_hint = (Context->vcount && menu->current >= 0
&& menu->current < Context->vcount) ? CURHDR->index : 0;
}
}
-#ifdef USE_IMAP
imap_keepalive ();
imap_disallow_reopen (Context);
-#endif
if (!attach_msg) {
/* check for new mail in the incoming folders */
* The following operations can be performed inside of the pager.
*/
-#ifdef USE_IMAP
case OP_MAIN_IMAP_FETCH:
if (Context->magic == M_IMAP)
imap_check_mailbox (Context, &index_hint, 1);
break;
-#endif
case OP_MAIN_SYNC_FOLDER:
CHECK_MSGCOUNT;
CHECK_VISIBLE;
mutt_pipe_message (tag ? NULL : CURHDR);
-#ifdef USE_IMAP
/* in an IMAP folder index with imap_peek=no, piping could change
* * new or old messages status to read. Redraw what's needed.
*/
if (Context->magic == M_IMAP && !option (OPTIMAPPEEK)) {
menu->redraw = (tag ? REDRAW_INDEX : REDRAW_CURRENT) | REDRAW_STATUS;
}
-#endif
MAYBE_REDRAW (menu->redraw);
break;
CHECK_MSGCOUNT;
CHECK_VISIBLE;
mutt_print_message (tag ? NULL : CURHDR);
-#ifdef USE_IMAP
/* in an IMAP folder index with imap_peek=no, piping could change
* * new or old messages status to read. Redraw what's needed.
*/
if (Context->magic == M_IMAP && !option (OPTIMAPPEEK)) {
menu->redraw = (tag ? REDRAW_INDEX : REDRAW_CURRENT) | REDRAW_STATUS;
}
-#endif
break;
case OP_MAIN_READ_THREAD:
}
if (!attach_msg) {
-#ifdef USE_IMAP
/* Close all open IMAP connections */
imap_logout_all ();
-#endif
#ifdef USE_NNTP
/* Close all open NNTP connections */
nntp_logout_all ();
./autogen.sh
-./configure --prefix=/usr --sysconfdir=/etc --mandir=/usr/share/man --with-sharedir=/usr/share/mutt-ng --with-docdir=/usr/share/doc/mutt-ng --with-mailpath=/var/mail --enable-fcntl --enable-imap --with-mixmaster --with-sasl2 --with-idn --with-curses --enable-nntp --enable-debug --with-gnutls --enable-gpgme
+./configure --prefix=/usr --sysconfdir=/etc --mandir=/usr/share/man --with-sharedir=/usr/share/mutt-ng --with-docdir=/usr/share/doc/mutt-ng --with-mailpath=/var/mail --enable-fcntl --with-mixmaster --with-sasl2 --with-idn --with-curses --enable-nntp --enable-debug --with-gnutls --enable-gpgme
#include "mx.h"
#include "sidebar.h"
-#ifdef USE_IMAP
-#include "imap_private.h"
-#endif
+#include <imap/imap_private.h>
void _mutt_set_flag (CONTEXT * ctx, HEADER * h, int flag, int bf, int upd_ctx)
h->deleted = 1;
if (upd_ctx)
ctx->deleted++;
-#ifdef USE_IMAP
/* deleted messages aren't treated as changed elsewhere so that the
* purge-on-sync option works correctly. This isn't applicable here */
if (ctx && ctx->magic == M_IMAP) {
if (upd_ctx)
ctx->changed = 1;
}
-#endif
}
}
else if (h->deleted) {
ctx->appended--;
}
h->appended = 0; /* when undeleting, also reset the appended flag */
-#ifdef USE_IMAP
/* see my comment above */
if (ctx->magic == M_IMAP) {
h->changed = 1;
if (upd_ctx)
ctx->changed = 1;
}
-#endif
/*
* If the user undeletes a message which is marked as
* "trash" in the maildir folder on disk, the folder has
WHERE char *Homedir;
WHERE char *Hostname;
-#ifdef USE_IMAP
WHERE char *ImapAuthenticators INITVAL (NULL);
WHERE char *ImapDelimChars INITVAL (NULL);
WHERE char *ImapHeaders;
WHERE char *ImapLogin INITVAL (NULL);
WHERE char *ImapPass INITVAL (NULL);
WHERE char *ImapUser INITVAL (NULL);
-#endif
WHERE char *Inbox;
WHERE char *Ispell;
WHERE char *Locale;
WHERE short DrawFullLine INITVAL (0);
WHERE short SidebarWidth;
-#ifdef USE_IMAP
WHERE short ImapKeepalive;
WHERE short ImapBuffyTimeout;
-#endif
/* flags for received signals */
WHERE SIG_ATOMIC_VOLATILE_T SigAlrm INITVAL (0);
#include <lib-mime/mime.h>
#include "mutt.h"
-#ifdef USE_IMAP
-#include "message.h"
-#endif
+#include <imap/message.h>
#include "mx.h"
#include "lib.h"
(MUTTNG_HCACHE_ID "sithglan@stud.uni-erlangen.de[sithglan]|hcache.c|20041108231548|29613"));
#if HAVE_LANGINFO_CODESET
- crc = crc32 (crc, (unsigned char const *) Charset, m_strlen(Charset));
- crc = crc32 (crc, (unsigned char const *) "HAVE_LANGINFO_CODESET",
- m_strlen("HAVE_LANGINFO_CODESET"));
+ crc = crc32(crc, (unsigned char const *) Charset, m_strlen(Charset));
+ crc = crc32(crc, (unsigned char const *) "HAVE_LANGINFO_CODESET",
+ m_strlen("HAVE_LANGINFO_CODESET"));
#endif
crc = crc32(crc, (unsigned char const *) "USE_POP", m_strlen("USE_POP"));
#ifdef MIXMASTER
- crc =
- crc32 (crc, (unsigned char const *) "MIXMASTER",
- m_strlen("MIXMASTER"));
+ crc = crc32(crc, (unsigned char const *) "MIXMASTER",
+ m_strlen("MIXMASTER"));
#endif
-#ifdef USE_IMAP
- crc =
- crc32 (crc, (unsigned char const *) "USE_IMAP", m_strlen("USE_IMAP"));
-#endif
+ crc = crc32(crc, (unsigned char const *) "USE_IMAP", m_strlen("USE_IMAP"));
#ifdef USE_NNTP
- crc =
- crc32 (crc, (unsigned char const *) "USE_NNTP", m_strlen("USE_NNTP"));
+ crc = crc32(crc, (unsigned char const *) "USE_NNTP", m_strlen("USE_NNTP"));
#endif
return crc;
}
/* build complete documentation */
#ifdef _MAKEDOC
-# ifndef USE_IMAP
-# define USE_IMAP
-# endif
# ifndef MIXMASTER
# define MIXMASTER "mixmaster"
# endif
** Remember: This option works only for mailing lists which are explicitly set in your muttngrc
** configuration file.
*/
-#ifdef USE_IMAP
{"imap_authenticators", DT_STR, R_NONE, UL &ImapAuthenticators, "" },
/*
- ** .pp
- ** Availability: IMAP
- **
** .pp
** This is a colon-delimited list of authentication methods Mutt-ng may
** attempt to use to log in to an IMAP server, in the order Mutt-ng should
** your server on connection, and add them to the set of mailboxes
** it polls for new mail. See also the ``$mailboxes'' command.
*/
-
{"imap_delim_chars", DT_STR, R_NONE, UL &ImapDelimChars, "/."},
/*
- ** .pp
- ** Availability: IMAP
- **
** .pp
** This contains the list of characters which you would like to treat
** as folder separators for displaying IMAP paths. In particular it
*/
{"imap_headers", DT_STR, R_INDEX, UL &ImapHeaders, "" },
/*
- ** .pp
- ** Availability: IMAP
- **
** .pp
** Mutt-ng requests these header fields in addition to the default headers
** (``DATE FROM SUBJECT TO CC MESSAGE-ID REFERENCES CONTENT-TYPE
*/
{"imap_home_namespace", DT_STR, R_NONE, UL &ImapHomeNamespace, "" },
/*
- ** .pp
- ** Availability: IMAP
- **
** .pp
** You normally want to see your personal folders alongside
** your \fTINBOX\fP in the IMAP browser. If you see something else, you may set
*/
{"imap_keepalive", DT_NUM, R_NONE, UL &ImapKeepalive, "900" },
/*
- ** .pp
- ** Availability: IMAP
- **
** .pp
** This variable specifies the maximum amount of time in seconds that Mutt-ng
** will wait before polling open IMAP connections, to prevent the server
*/
{"imap_login", DT_STR, R_NONE, UL &ImapLogin, "" },
/*
- ** .pp
- ** Availability: IMAP
- **
** .pp
** Your login name on the IMAP server.
** .pp
*/
{"imap_list_subscribed", DT_BOOL, R_NONE, OPTIMAPLSUB, "no" },
/*
- ** .pp
- ** Availability: IMAP
- **
** .pp
** This variable configures whether IMAP folder browsing will look for
** only subscribed folders or all folders. This can be toggled in the
*/
{"imap_pass", DT_STR, R_NONE, UL &ImapPass, "" },
/*
- ** .pp
- ** Availability: IMAP
- **
** .pp
** Specifies the password for your IMAP account. If \fIunset\fP, Mutt-ng will
** prompt you for your password when you invoke the fetch-mail function.
*/
{"imap_passive", DT_BOOL, R_NONE, OPTIMAPPASSIVE, "yes" },
/*
- ** .pp
- ** Availability: IMAP
- **
** .pp
** When \fIset\fP, Mutt-ng will not open new IMAP connections to check for new
** mail. Mutt-ng will only check for new mail over existing IMAP
*/
{"imap_peek", DT_BOOL, R_NONE, OPTIMAPPEEK, "yes" },
/*
- ** .pp
- ** Availability: IMAP
- **
** .pp
** If \fIset\fP, Mutt-ng will avoid implicitly marking your mail as read whenever
** you fetch a message from the server. This is generally a good thing,
*/
{"imap_reconnect", DT_QUAD, R_NONE, OPT_IMAPRECONNECT, "ask-yes" },
/*
- ** .pp
- ** Availability: IMAP
- **
** .pp
** Controls whether or not Mutt-ng will try to reconnect to IMAP server when
** the connection is lost.
*/
{"imap_servernoise", DT_BOOL, R_NONE, OPTIMAPSERVERNOISE, "yes" },
/*
- ** .pp
- ** Availability: IMAP
- **
** .pp
** When \fIset\fP, Mutt-ng will display warning messages from the IMAP
** server as error messages. Since these messages are often
*/
{"imap_user", DT_STR, R_NONE, UL &ImapUser, "" },
/*
- ** .pp
- ** Availability: IMAP
- **
** .pp
** The name of the user whose mail you intend to access on the IMAP
** server.
** .pp
** This variable defaults to your user name on the local machine.
*/
-#endif
{"implicit_autoview", DT_BOOL, R_NONE, OPTIMPLICITAUTOVIEW, "no" },
/*
** .pp
#ifdef USE_NNTP
"nntp",
#endif
-#ifdef USE_IMAP
- "imap",
-#endif
#ifdef USE_SSL
"ssl",
#endif
#else
"-USE_NNTP "
#endif
-#ifdef USE_IMAP
- "+USE_IMAP "
-#else
- "-USE_IMAP "
-#endif
#ifdef USE_GSS
"+USE_GSS "
#else
m_strcpy(fpath, sizeof(fpath), Maildir);
mutt_expand_path (fpath, sizeof (fpath));
-#ifdef USE_IMAP
/* we're not connected yet - skip mail folder creation */
if (mx_get_magic (fpath) != M_IMAP)
-#endif
if (stat (fpath, &sb) == -1 && errno == ENOENT) {
snprintf (msg, sizeof (msg), _("%s does not exist. Create it?"),
Maildir);
#include "mbyte.h"
#include "sidebar.h"
-#ifdef USE_IMAP
-#include "imap.h"
-#endif
-
+#include <imap/imap.h>
#include <string.h>
#include <stdlib.h>
mutt_curs_set (0);
-
-#ifdef USE_IMAP
imap_keepalive ();
-#endif
if (menu_redraw (menu) == OP_REDRAW)
return OP_REDRAW;
OPT_DELETE,
OPT_FORWEDIT,
OPT_INCLUDE,
-#ifdef USE_IMAP
OPT_IMAPRECONNECT,
-#endif
OPT_MFUPTO,
OPT_MIMEFWD,
OPT_MIMEFWDREST,
OPTHIDETOPLIMITED,
OPTHIDETOPMISSING,
OPTIGNORELISTREPLYTO,
-#ifdef USE_IMAP
OPTIMAPCHECKSUBSCRIBED,
OPTIMAPLSUB,
OPTIMAPPASSIVE,
OPTIMAPPEEK,
OPTIMAPSERVERNOISE,
-#endif
#if defined(USE_SSL) || defined(USE_GNUTLS)
# ifndef USE_GNUTLS
OPTSSLSYSTEMCERTS,
#include "version.h"
-#ifdef USE_IMAP
-#include "imap.h"
-#include "imap/mx_imap.h"
-#endif
+#include <imap/imap.h>
+#include <imap/mx_imap.h>
#include "mutt_crypt.h"
case '=':
case '+':
{
-#ifdef USE_IMAP
/* if folder = imap[s]://host/: don't append slash */
if (imap_is_magic (NONULL (Maildir), NULL) == M_IMAP &&
Maildir[m_strlen(Maildir) - 1] == '/')
m_strcpy(p, sizeof(p), NONULL(Maildir));
else
-#endif
snprintf (p, sizeof (p), "%s/", NONULL (Maildir));
tail = s + 1;
scheme = url_check_scheme (s);
-#ifdef USE_IMAP
if (scheme == U_IMAP || scheme == U_IMAPS) {
imap_pretty_mailbox (s);
return;
}
-#endif
/* if s is an url, only collapse path component */
if (scheme != U_UNKNOWN) {
}
}
else {
-#ifdef USE_IMAP
if (magic != M_IMAP)
-#endif /* execute the block unconditionally if we don't use imap */
{
st->st_mtime = 0;
st->st_atime = 0;
#include "sidebar.h"
#include "compress.h"
-#ifdef USE_IMAP
-#include "imap/imap.h"
-#include "imap/mx_imap.h"
-#endif
+#include <imap/imap.h>
+#include <imap/mx_imap.h>
#include <pop/pop.h>
#include <pop/mx_pop.h>
ctx->append = 1;
-#ifdef USE_IMAP
-
if (mx_get_magic (ctx->path) == M_IMAP)
return imap_open_mailbox_append (ctx);
-#endif
-
if (stat (ctx->path, &sb) == 0) {
ctx->magic = mx_get_magic (ctx->path);
}
}
-#ifdef USE_IMAP
/* IMAP servers manage the OLD flag themselves */
if (ctx->magic != M_IMAP)
-#endif
if (option (OPTMARKOLD)) {
for (i = 0; i < ctx->msgcount; i++) {
if (!ctx->hdrs[i]->deleted && !ctx->hdrs[i]->old)
if (move_messages) {
mutt_message (_("Moving read messages to %s..."), mbox);
-#ifdef USE_IMAP
/* try to use server-side copy first */
i = 1;
return -1;
}
else /* use regular append-copy mode */
-#endif
{
if (mx_open_mailbox (mbox, M_APPEND, &f) == NULL) {
ctx->closing = 0;
return -1;
}
-#ifdef USE_IMAP
/* allow IMAP to preserve the deleted flag across sessions */
if (ctx->magic == M_IMAP) {
if ((check = imap_sync_mailbox (ctx, purge, index_hint)) != 0) {
}
}
else
-#endif
{
if (!purge) {
for (i = 0; i < ctx->msgcount; i++)
else if (purge == M_NO) {
if (!ctx->changed)
return 0; /* nothing to do! */
-#ifdef USE_IMAP
/* let IMAP servers hold on to D flags */
if (ctx->magic != M_IMAP)
-#endif
{
for (i = 0; i < ctx->msgcount; i++)
ctx->hdrs[i]->deleted = 0;
return -1;
}
-#ifdef USE_IMAP
if (ctx->magic == M_IMAP)
rc = imap_sync_mailbox (ctx, purge, index_hint);
else
-#endif
rc = sync_mailbox (ctx, index_hint);
if (rc == 0) {
-#ifdef USE_IMAP
if (ctx->magic == M_IMAP && !purge)
mutt_message (_("Mailbox checkpointed."));
else
-#endif
mutt_message (_("%d kept, %d deleted."), msgcount - deleted, deleted);
mutt_sleep (0);
* at least with the new threading code.
*/
if (purge || (ctx->magic != M_MAILDIR && ctx->magic != M_MH)) {
-#ifdef USE_IMAP
/* IMAP does this automatically after handling EXPUNGE */
if (ctx->magic != M_IMAP)
-#endif
{
mx_update_tables (ctx, 1);
mutt_sort_headers (ctx, 1); /* rethread from scratch */
}
break;
-#ifdef USE_IMAP
case M_IMAP:
{
if (imap_fetch_message (msg, ctx, msgno) != 0)
p_delete(&msg);
break;
}
-#endif /* USE_IMAP */
case M_POP:
{
int r = 0;
if ((*msg)->magic == M_MH || (*msg)->magic == M_MAILDIR
-#ifdef USE_IMAP
|| (*msg)->magic == M_IMAP
-#endif
|| (*msg)->magic == M_POP
#ifdef USE_NNTP
|| (*msg)->magic == M_NNTP
list_push_back (&MailboxFormats, (void*) mmdf_reg_mx ());
list_push_back (&MailboxFormats, (void*) mh_reg_mx ());
list_push_back (&MailboxFormats, (void*) maildir_reg_mx ());
-#ifdef USE_IMAP
list_push_back (&MailboxFormats, (void*) imap_reg_mx ());
-#endif
list_push_back (&MailboxFormats, (void*) pop_reg_mx ());
#ifdef USE_NNTP
list_push_back (&MailboxFormats, (void*) nntp_reg_mx ());
for (i = 0; i < Incoming->length; i++) {
b = (BUFFY*) Incoming->data[i];
magic = mx_get_magic (b->path);
- if (magic != M_MAILDIR && magic != M_MH
-#ifdef USE_IMAP
- && magic != M_IMAP
-#endif
- )
+ if (magic != M_MAILDIR && magic != M_MH && magic != M_IMAP)
continue;
sidebar_set_current (b->path);
sidebar_draw (CurrentMenu);
M_MMDF,
M_MH,
M_MAILDIR,
-#ifdef USE_IMAP
M_IMAP,
-#endif
M_POP,
#ifdef USE_NNTP
M_NNTP,
#include "mx.h"
-#ifdef USE_IMAP
-#include "imap_private.h"
-#endif
+#include <imap/imap_private.h>
#include "mutt_crypt.h"
while (ch != -1) {
mutt_curs_set (0);
-
-#ifdef USE_IMAP
imap_keepalive ();
-#endif
if (redraw & REDRAW_FULL) {
SETCOLOR (MT_COLOR_NORMAL);
#include "keymap.h"
#include "copy.h"
-
-#ifdef USE_IMAP
-#include "mx.h"
-#include "imap/imap.h"
-#endif
+#include <imap/imap.h>
#include <string.h>
#include <stdlib.h>
case M_BODY:
case M_HEADER:
case M_WHOLE_MSG:
-#ifdef USE_IMAP
/* IMAP search sets h->matched at search compile time */
if (ctx->magic == M_IMAP && pat->stringmatch)
return (h->matched);
-#endif
return (pat->not ^ msg_search (ctx, pat, h->msgno));
case M_SENDER:
return (pat->not ^ match_adrlist (pat, flags & M_MATCH_FULL_ADDRESS,
return (-1);
}
-#ifdef USE_IMAP
if (Context->magic == M_IMAP && imap_search (Context, pat) < 0)
return -1;
-#endif
mutt_message _("Executing command on matching messages...");
if (option (OPTSEARCHINVALID)) {
for (i = 0; i < Context->msgcount; i++)
Context->hdrs[i]->searched = 0;
-#ifdef USE_IMAP
if (Context->magic == M_IMAP && imap_search (Context, SearchPattern) < 0)
return -1;
-#endif
unset_option (OPTSEARCHINVALID);
}
#include "sort.h"
#include "thread.h"
#include "mx.h"
-#ifdef USE_IMAP
-#include "imap.h"
-#include "imap/mx_imap.h"
-#endif
#include "mutt_crypt.h"
+#include <imap/imap.h>
+#include <imap/mx_imap.h>
+
#include "lib/debug.h"
#include <ctype.h>
if (!Postponed)
return 0;
-#ifdef USE_IMAP
/* LastModify is useless for IMAP */
if (imap_is_magic (Postponed, NULL) == M_IMAP) {
if (force) {
}
return PostCount;
}
-#endif
if (stat (Postponed, &st) == -1) {
PostCount = 0;
* I'd like to think a bit more about this before including it.
*/
-#ifdef USE_IMAP
if ((flags & SENDBATCH) && fcc[0] && mx_get_magic (fcc) == M_IMAP)
fcc[0] = '\0';
-#endif
if (*fcc && m_strcmp("/dev/null", fcc) != 0) {
BODY *tmpbody = msg->content;
{
int shortened = 0, lencnt = 0;
char no[SHORT_STRING], entry[SHORT_STRING];
-#if USE_IMAP
int l = m_strlen(ImapHomeNamespace);
-#endif
int l_m = m_strlen(Maildir);
if (SidebarWidth > COLS)
lencnt = m_strlen(no);
memset(&entry, ' ', sizeof(entry));
-#if USE_IMAP
if (l > 0 && m_strncmp(box, ImapHomeNamespace, l) == 0 &&
m_strlen(box) > l)
box += l + 1; /* we're trimming the ImapHomeNamespace, the "+ 1" is for the separator */
else
-#endif
if (l_m > 0 && m_strncmp(box, Maildir, l_m) == 0 &&
m_strlen(box) > l_m) {
box += l_m;
int i = 0;
if (Context) {
- i = option (OPTATTACHMSG) ? 3 : ((Context->readonly ||
- Context->dontwrite) ? 2 : (Context->
- changed
- || (
-#ifdef USE_IMAP
- /* deleted doesn't necessarily mean changed in IMAP */
- Context->
- magic
- !=
- M_IMAP
- &&
-#endif
- Context->
- deleted))
- ? 1 : 0);
+ /* XXX: deleted doesn't necessarily mean changed in IMAP */
+ i = option (OPTATTACHMSG) ? 3
+ : ((Context->readonly || Context->dontwrite) ? 2
+ : (Context->changed || (Context-> magic != M_IMAP && Context->
+ deleted)) ? 1 : 0);
}
if (!StChars)
#endif
#include "mutt.h"
-#ifdef USE_IMAP
-# include "imap.h"
-# include <errno.h>
-#endif
+#include <imap/imap.h>
+#include <errno.h>
#include <stdlib.h>
#include <signal.h>
#include <string.h>
_exit (127); /* execl error */
}
else if (thepid != -1) {
-#ifndef USE_IMAP
- /* wait for the (first) child process to finish */
- waitpid (thepid, &rc, 0);
-#else
rc = imap_wait_keepalive (thepid);
-#endif
}
sigaction (SIGCONT, &oldcont, NULL);
#ifndef _URL_H
# define _URL_H
+#include <lib-mime/mime.h>
+
typedef enum url_scheme {
U_FILE,
U_POP,