From b8c71f93b0296f815a6538182343ba67e88c0012 Mon Sep 17 00:00:00 2001 From: Pierre Habouzit Date: Sun, 5 Nov 2006 01:11:18 +0100 Subject: [PATCH] always build imap as well. Signed-off-by: Pierre Habouzit --- Makefile.am | 19 ++++++++-------- account.c | 12 ---------- browser.c | 64 ++++------------------------------------------------ browser.h | 4 ---- buffy.c | 19 ++-------------- commands.c | 6 +---- complete.c | 8 +------ compose.c | 2 -- configure.ac | 28 ++--------------------- curs_main.c | 16 +------------ doconfig.sh | 2 +- flags.c | 8 +------ globals.h | 4 ---- hcache.c | 23 +++++++------------ init.h | 48 --------------------------------------- main.c | 7 ------ menu.c | 8 +------ mutt.h | 4 ---- muttlib.c | 12 ++-------- mx.c | 36 +++-------------------------- mx.h | 2 -- pager.c | 7 +----- pattern.c | 12 +--------- postpone.c | 9 +++----- send.c | 2 -- sidebar.c | 4 ---- status.c | 20 ++++------------ system.c | 11 ++------- url.h | 2 ++ 29 files changed, 51 insertions(+), 348 deletions(-) diff --git a/Makefile.am b/Makefile.am index 9322a59..fbb9ded 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4,17 +4,14 @@ 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 @@ -39,16 +36,20 @@ muttng_SOURCES = $(BUILT_SOURCES) \ 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 diff --git a/account.c b/account.c index 3cc3a22..800fdd4 100644 --- a/account.c +++ b/account.c @@ -28,9 +28,7 @@ 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; @@ -39,14 +37,12 @@ int mutt_account_match (const ACCOUNT * a1, const ACCOUNT * a2) 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; @@ -101,14 +97,12 @@ void mutt_account_tourl (ACCOUNT * account, ciss_url_t * url) 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) @@ -143,10 +137,8 @@ int mutt_account_getuser (ACCOUNT * account) /* 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 @@ -172,7 +164,6 @@ int mutt_account_getlogin (ACCOUNT* account) /* 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)) { @@ -180,7 +171,6 @@ int mutt_account_getlogin (ACCOUNT* account) account->flags |= M_ACCT_LOGIN; } } -#endif if (!(account->flags & M_ACCT_LOGIN)) { mutt_account_getuser (account); @@ -199,10 +189,8 @@ int mutt_account_getpass (ACCOUNT * 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 diff --git a/browser.c b/browser.c index 0e30000..443283d 100644 --- a/browser.c +++ b/browser.c @@ -27,10 +27,8 @@ #include "browser.h" #include "attach.h" -#ifdef USE_IMAP -#include "imap.h" -#include "imap/mx_imap.h" -#endif +#include +#include #ifdef USE_NNTP #include "nntp.h" #endif @@ -85,9 +83,7 @@ static void destroy_state (struct browser_state *state) p_delete(&((state->entry)[c].desc)); p_delete(&((state->entry)[c].st)); } -#ifdef USE_IMAP p_delete(&state->folder); -#endif p_delete(&state->entry); } @@ -201,11 +197,9 @@ static const char *folder_format_str (char *dest, size_t destlen, char op, { 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, @@ -240,7 +234,6 @@ static const char *folder_format_str (char *dest, size_t destlen, char op, 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", @@ -248,7 +241,6 @@ static const char *folder_format_str (char *dest, size_t destlen, char op, && folder->ff->selectable) ? '+' : ' '); mutt_format_s (dest, destlen, fmt, permission); } -#endif else mutt_format_s (dest, destlen, fmt, ""); break; @@ -276,7 +268,6 @@ static const char *folder_format_str (char *dest, size_t destlen, char op, break; case 'N': -#ifdef USE_IMAP if (imap_is_magic (folder->ff->desc, NULL) == M_IMAP) { if (!optional) { snprintf (tmp, sizeof (tmp), "%%%sd", fmt); @@ -286,7 +277,6 @@ static const char *folder_format_str (char *dest, size_t destlen, char op, optional = 0; break; } -#endif snprintf (tmp, sizeof (tmp), "%%%sc", fmt); snprintf (dest, destlen, tmp, folder->ff->new ? 'N' : ' '); break; @@ -451,9 +441,7 @@ static void add_folder (MUTTMENU * m, struct browser_state *state, (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; @@ -466,9 +454,7 @@ static void init_state (struct browser_state *state, MUTTMENU * menu) 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; } @@ -612,7 +598,6 @@ static int examine_mailboxes (MUTTMENU * menu, struct browser_state *state) 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); @@ -621,7 +606,6 @@ static int examine_mailboxes (MUTTMENU * menu, struct browser_state *state) #endif continue; } -#endif if (tmp->magic == M_POP) { #ifdef USE_NNTP add_folder (menu, state, tmp->path, NULL, NULL, tmp->new); @@ -716,12 +700,10 @@ static void init_menu (struct browser_state *state, MUTTMENU * menu, 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)); } @@ -791,7 +773,6 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, #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; @@ -799,7 +780,6 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, 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] == '/') { @@ -824,9 +804,7 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, else m_strcpy(prefix, sizeof(prefix), f + i + 1); killPrefix = 1; -#ifdef USE_IMAP } -#endif } else { if (!folder) @@ -834,14 +812,12 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, 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; @@ -851,9 +827,7 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, goto bail; } else -#ifdef USE_IMAP if (!state.imap_browse) -#endif if (examine_directory (NULL, &state, LastDir, prefix) == -1) goto bail; @@ -887,29 +861,23 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, 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 */ @@ -936,7 +904,6 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, 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; @@ -955,7 +922,6 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, LastDir[n - 1] = state.entry[menu->current].delim; } } -#endif else { char tmp[_POSIX_PATH_MAX]; @@ -970,7 +936,6 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, killPrefix = 0; } buffy = 0; -#ifdef USE_IMAP if (state.imap_browse) { init_state (&state, NULL); state.imap_browse = 1; @@ -979,7 +944,6 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, 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); @@ -1004,10 +968,8 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, 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); @@ -1053,7 +1015,6 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, mutt_message ("%s", state.entry[menu->current].name); break; -#ifdef USE_IMAP case OP_BROWSER_TOGGLE_LSUB: if (option (OPTIMAPLSUB)) { unset_option (OPTIMAPLSUB); @@ -1138,7 +1099,6 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, p_delete(&mx.mbox); } break; -#endif case OP_CHANGE_DIRECTORY: @@ -1148,9 +1108,7 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, #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); @@ -1163,7 +1121,6 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, 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); @@ -1177,7 +1134,6 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, init_menu (&state, menu, title, sizeof (title), buffy); } else -#endif if (stat (buf, &st) == 0) { if (S_ISDIR (st.st_mode)) { destroy_state (&state); @@ -1236,7 +1192,6 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, Mask.not = not; destroy_state (&state); -#ifdef USE_IMAP if (state.imap_browse) { init_state (&state, NULL); state.imap_browse = 1; @@ -1246,7 +1201,6 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, 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 { @@ -1321,7 +1275,6 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, 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; @@ -1329,7 +1282,6 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, 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); @@ -1361,7 +1313,6 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, break; } -#ifdef USE_IMAP if (state.entry[menu->current].selectable) { m_strcpy(f, flen, state.entry[menu->current].name); destroy_state (&state); @@ -1369,7 +1320,6 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, 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))) { @@ -1452,10 +1402,8 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, 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: @@ -1550,18 +1498,14 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, 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 */ } } diff --git a/browser.h b/browser.h index 20aedc9..5edd06f 100644 --- a/browser.h +++ b/browser.h @@ -24,13 +24,11 @@ struct folder_file { 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 @@ -41,13 +39,11 @@ struct browser_state { 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 */ diff --git a/buffy.c b/buffy.c index f2d4887..105e809 100644 --- a/buffy.c +++ b/buffy.c @@ -18,6 +18,8 @@ #include #include +#include + #include "mutt.h" #include "buffy.h" #include "mx.h" @@ -26,11 +28,6 @@ #include "mutt_curses.h" -#ifdef USE_IMAP -#include "imap.h" -#endif - - #include #include #include @@ -42,9 +39,7 @@ 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 */ @@ -275,34 +270,26 @@ int buffy_check (int force) 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; @@ -460,7 +447,6 @@ int buffy_check (int force) BuffyCount++; break; -#ifdef USE_IMAP case M_IMAP: /* only check on force or $imap_mail_check reached */ if (force == 1 || (now - last2 >= ImapBuffyTimeout)) { @@ -478,7 +464,6 @@ int buffy_check (int force) /* keep current stats if !force and !$imap_mail_check reached */ BuffyCount++; break; -#endif } } diff --git a/commands.c b/commands.c index 58eaaa5..a9f3298 100644 --- a/commands.c +++ b/commands.c @@ -35,9 +35,7 @@ #include #include -#ifdef USE_IMAP -#include "imap.h" -#endif +#include #ifdef BUFFY_SIZE #include "buffy.h" @@ -754,7 +752,6 @@ int mutt_save_message (HEADER * h, int delete, 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 */ @@ -769,7 +766,6 @@ int mutt_save_message (HEADER * h, int delete, return -1; } } -#endif if (mx_open_mailbox (buf, M_APPEND, &ctx) != NULL) { if (h) { diff --git a/complete.c b/complete.c index bd2bb05..5e66da8 100644 --- a/complete.c +++ b/complete.c @@ -12,10 +12,8 @@ #endif #include "mutt.h" -#ifdef USE_IMAP #include "mx.h" -#include "imap.h" -#endif +#include #ifdef USE_NNTP #include "nntp.h" #endif @@ -45,9 +43,7 @@ int mutt_complete (char *s, size_t slen) 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)); @@ -101,7 +97,6 @@ int mutt_complete (char *s, size_t slen) } #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); @@ -112,7 +107,6 @@ int mutt_complete (char *s, size_t slen) if (mx_get_magic (imap_path) == M_IMAP) return imap_complete (s, slen, imap_path); -#endif if (*s == '=' || *s == '+' || *s == '!') { dirpart[0] = *s; diff --git a/compose.c b/compose.c index 553e9b2..f449b1e 100644 --- a/compose.c +++ b/compose.c @@ -853,9 +853,7 @@ int mutt_compose_menu (HEADER * msg, /* structure for new message */ 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)) diff --git a/configure.ac b/configure.ac index f2f835a..84b2142 100644 --- a/configure.ac +++ b/configure.ac @@ -415,17 +415,6 @@ AC_SUBST(DOTLOCK_PERMISSION) 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 ]) @@ -452,8 +441,6 @@ AC_ARG_WITH(gss, AC_HELP_STRING([--with-gss[=PFX]], [Compile in GSSAPI authentic 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) @@ -470,9 +457,6 @@ then 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) @@ -525,13 +509,9 @@ fi 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" @@ -733,10 +713,6 @@ dnl -- end cache -- 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) diff --git a/curs_main.c b/curs_main.c index 9905ed5..c241ff6 100644 --- a/curs_main.c +++ b/curs_main.c @@ -33,9 +33,7 @@ #include "thread.h" #include "xterm.h" -#ifdef USE_IMAP -#include "imap_private.h" -#endif +#include #include "mutt_crypt.h" @@ -470,9 +468,7 @@ int mutt_index_menu (void) * 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; @@ -513,10 +509,8 @@ int mutt_index_menu (void) } } -#ifdef USE_IMAP imap_keepalive (); imap_disallow_reopen (Context); -#endif if (!attach_msg) { /* check for new mail in the incoming folders */ @@ -1101,12 +1095,10 @@ int mutt_index_menu (void) * 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: @@ -2092,14 +2084,12 @@ int mutt_index_menu (void) 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; @@ -2108,14 +2098,12 @@ int mutt_index_menu (void) 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: @@ -2356,10 +2344,8 @@ int mutt_index_menu (void) } 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 (); diff --git a/doconfig.sh b/doconfig.sh index 3b390cd..abb7e5f 100755 --- a/doconfig.sh +++ b/doconfig.sh @@ -1,2 +1,2 @@ ./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 diff --git a/flags.c b/flags.c index 6bbe781..814b19a 100644 --- a/flags.c +++ b/flags.c @@ -20,9 +20,7 @@ #include "mx.h" #include "sidebar.h" -#ifdef USE_IMAP -#include "imap_private.h" -#endif +#include void _mutt_set_flag (CONTEXT * ctx, HEADER * h, int flag, int bf, int upd_ctx) @@ -46,7 +44,6 @@ 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) { @@ -54,7 +51,6 @@ void _mutt_set_flag (CONTEXT * ctx, HEADER * h, int flag, int bf, int upd_ctx) if (upd_ctx) ctx->changed = 1; } -#endif } } else if (h->deleted) { @@ -65,14 +61,12 @@ void _mutt_set_flag (CONTEXT * ctx, HEADER * h, int flag, int bf, int upd_ctx) 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 diff --git a/globals.h b/globals.h index 486c361..db96096 100644 --- a/globals.h +++ b/globals.h @@ -56,7 +56,6 @@ WHERE char *HdrFmt; WHERE char *Homedir; WHERE char *Hostname; -#ifdef USE_IMAP WHERE char *ImapAuthenticators INITVAL (NULL); WHERE char *ImapDelimChars INITVAL (NULL); WHERE char *ImapHeaders; @@ -64,7 +63,6 @@ WHERE char *ImapHomeNamespace INITVAL (NULL); 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; @@ -241,10 +239,8 @@ WHERE short ScoreThresholdFlag; 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); diff --git a/hcache.c b/hcache.c index 308ac68..681ec86 100644 --- a/hcache.c +++ b/hcache.c @@ -46,9 +46,7 @@ #include #include "mutt.h" -#ifdef USE_IMAP -#include "message.h" -#endif +#include #include "mx.h" #include "lib.h" @@ -456,27 +454,22 @@ static int generate_crc32 () (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; } diff --git a/init.h b/init.h index 9580202..3906a33 100644 --- a/init.h +++ b/init.h @@ -81,9 +81,6 @@ struct option_t { /* build complete documentation */ #ifdef _MAKEDOC -# ifndef USE_IMAP -# define USE_IMAP -# endif # ifndef MIXMASTER # define MIXMASTER "mixmaster" # endif @@ -1012,12 +1009,8 @@ struct option_t MuttVars[] = { ** 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 @@ -1042,12 +1035,8 @@ struct option_t MuttVars[] = { ** 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 @@ -1055,9 +1044,6 @@ struct option_t MuttVars[] = { */ {"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 @@ -1069,9 +1055,6 @@ struct option_t MuttVars[] = { */ {"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 @@ -1079,9 +1062,6 @@ struct option_t MuttVars[] = { */ {"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 @@ -1097,9 +1077,6 @@ struct option_t MuttVars[] = { */ {"imap_login", DT_STR, R_NONE, UL &ImapLogin, "" }, /* - ** .pp - ** Availability: IMAP - ** ** .pp ** Your login name on the IMAP server. ** .pp @@ -1107,9 +1084,6 @@ struct option_t MuttVars[] = { */ {"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 @@ -1124,9 +1098,6 @@ struct option_t MuttVars[] = { */ {"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. @@ -1137,9 +1108,6 @@ struct option_t MuttVars[] = { */ {"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 @@ -1149,9 +1117,6 @@ struct option_t MuttVars[] = { */ {"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, @@ -1160,18 +1125,12 @@ struct option_t MuttVars[] = { */ {"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 @@ -1181,16 +1140,12 @@ struct option_t MuttVars[] = { */ {"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 @@ -3832,9 +3787,6 @@ static const char* Features[] = { #ifdef USE_NNTP "nntp", #endif -#ifdef USE_IMAP - "imap", -#endif #ifdef USE_SSL "ssl", #endif diff --git a/main.c b/main.c index 14e0812..3596712 100644 --- a/main.c +++ b/main.c @@ -306,11 +306,6 @@ static void show_version (void) #else "-USE_NNTP " #endif -#ifdef USE_IMAP - "+USE_IMAP " -#else - "-USE_IMAP " -#endif #ifdef USE_GSS "+USE_GSS " #else @@ -774,10 +769,8 @@ int main (int argc, char **argv) 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); diff --git a/menu.c b/menu.c index 05b6b11..eb19d5a 100644 --- a/menu.c +++ b/menu.c @@ -22,10 +22,7 @@ #include "mbyte.h" #include "sidebar.h" -#ifdef USE_IMAP -#include "imap.h" -#endif - +#include #include #include @@ -808,10 +805,7 @@ int mutt_menuLoop (MUTTMENU * menu) mutt_curs_set (0); - -#ifdef USE_IMAP imap_keepalive (); -#endif if (menu_redraw (menu) == OP_REDRAW) return OP_REDRAW; diff --git a/mutt.h b/mutt.h index f0cf711..188205f 100644 --- a/mutt.h +++ b/mutt.h @@ -227,9 +227,7 @@ enum { OPT_DELETE, OPT_FORWEDIT, OPT_INCLUDE, -#ifdef USE_IMAP OPT_IMAPRECONNECT, -#endif OPT_MFUPTO, OPT_MIMEFWD, OPT_MIMEFWDREST, @@ -333,13 +331,11 @@ enum { OPTHIDETOPLIMITED, OPTHIDETOPMISSING, OPTIGNORELISTREPLYTO, -#ifdef USE_IMAP OPTIMAPCHECKSUBSCRIBED, OPTIMAPLSUB, OPTIMAPPASSIVE, OPTIMAPPEEK, OPTIMAPSERVERNOISE, -#endif #if defined(USE_SSL) || defined(USE_GNUTLS) # ifndef USE_GNUTLS OPTSSLSYSTEMCERTS, diff --git a/muttlib.c b/muttlib.c index 7592681..6892168 100644 --- a/muttlib.c +++ b/muttlib.c @@ -30,10 +30,8 @@ #include "version.h" -#ifdef USE_IMAP -#include "imap.h" -#include "imap/mx_imap.h" -#endif +#include +#include #include "mutt_crypt.h" @@ -337,13 +335,11 @@ char *_mutt_expand_path (char *s, size_t slen, int rx) 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; @@ -689,12 +685,10 @@ void mutt_pretty_mailbox (char *s) 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) { @@ -1209,9 +1203,7 @@ int mutt_save_confirm (const char *s, struct stat *st) } } 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; diff --git a/mx.c b/mx.c index e38f696..28ba348 100644 --- a/mx.c +++ b/mx.c @@ -33,10 +33,8 @@ #include "sidebar.h" #include "compress.h" -#ifdef USE_IMAP -#include "imap/imap.h" -#include "imap/mx_imap.h" -#endif +#include +#include #include #include @@ -387,13 +385,9 @@ static int mx_open_mailbox_append (CONTEXT * ctx, int flags) 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); @@ -758,10 +752,8 @@ static int _mx_close_mailbox (CONTEXT * ctx, int *index_hint) } } -#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) @@ -772,7 +764,6 @@ static int _mx_close_mailbox (CONTEXT * ctx, int *index_hint) if (move_messages) { mutt_message (_("Moving read messages to %s..."), mbox); -#ifdef USE_IMAP /* try to use server-side copy first */ i = 1; @@ -795,7 +786,6 @@ static int _mx_close_mailbox (CONTEXT * ctx, int *index_hint) return -1; } else /* use regular append-copy mode */ -#endif { if (mx_open_mailbox (mbox, M_APPEND, &f) == NULL) { ctx->closing = 0; @@ -836,7 +826,6 @@ static int _mx_close_mailbox (CONTEXT * ctx, int *index_hint) 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) { @@ -845,7 +834,6 @@ static int _mx_close_mailbox (CONTEXT * ctx, int *index_hint) } } else -#endif { if (!purge) { for (i = 0; i < ctx->msgcount; i++) @@ -1017,10 +1005,8 @@ static int _mx_sync_mailbox (CONTEXT * ctx, int *index_hint) 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; @@ -1041,19 +1027,15 @@ static int _mx_sync_mailbox (CONTEXT * ctx, int *index_hint) 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); @@ -1074,10 +1056,8 @@ static int _mx_sync_mailbox (CONTEXT * ctx, int *index_hint) * 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 */ @@ -1196,14 +1176,12 @@ MESSAGE *mx_open_message (CONTEXT * ctx, int msgno) } 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: { @@ -1247,9 +1225,7 @@ int mx_close_message (MESSAGE ** msg) 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 @@ -1393,9 +1369,7 @@ void mx_init (void) { 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 ()); @@ -1431,11 +1405,7 @@ int mx_rebuild_cache (void) { 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); diff --git a/mx.h b/mx.h index bb15783..ccbe239 100644 --- a/mx.h +++ b/mx.h @@ -32,9 +32,7 @@ enum { M_MMDF, M_MH, M_MAILDIR, -#ifdef USE_IMAP M_IMAP, -#endif M_POP, #ifdef USE_NNTP M_NNTP, diff --git a/pager.c b/pager.c index f429e77..ce473ed 100644 --- a/pager.c +++ b/pager.c @@ -35,9 +35,7 @@ #include "mx.h" -#ifdef USE_IMAP -#include "imap_private.h" -#endif +#include #include "mutt_crypt.h" @@ -1488,10 +1486,7 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t * extra) while (ch != -1) { mutt_curs_set (0); - -#ifdef USE_IMAP imap_keepalive (); -#endif if (redraw & REDRAW_FULL) { SETCOLOR (MT_COLOR_NORMAL); diff --git a/pattern.c b/pattern.c index 335337e..a61e7e9 100644 --- a/pattern.c +++ b/pattern.c @@ -28,11 +28,7 @@ #include "keymap.h" #include "copy.h" - -#ifdef USE_IMAP -#include "mx.h" -#include "imap/imap.h" -#endif +#include #include #include @@ -1000,11 +996,9 @@ mutt_pattern_exec (struct pattern_t *pat, pattern_exec_flag flags, 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, @@ -1212,10 +1206,8 @@ int mutt_pattern_func (int op, char *prompt) 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..."); @@ -1343,10 +1335,8 @@ int mutt_search_command (int cur, int op) 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); } diff --git a/postpone.c b/postpone.c index afcc9b1..4d34734 100644 --- a/postpone.c +++ b/postpone.c @@ -29,12 +29,11 @@ #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 +#include + #include "lib/debug.h" #include @@ -82,7 +81,6 @@ int mutt_num_postponed (int force) if (!Postponed) return 0; -#ifdef USE_IMAP /* LastModify is useless for IMAP */ if (imap_is_magic (Postponed, NULL) == M_IMAP) { if (force) { @@ -98,7 +96,6 @@ int mutt_num_postponed (int force) } return PostCount; } -#endif if (stat (Postponed, &st) == -1) { PostCount = 0; diff --git a/send.c b/send.c index 8ba9c3c..3609f77 100644 --- a/send.c +++ b/send.c @@ -1678,10 +1678,8 @@ int ci_send_message (int flags, /* send mode */ * 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; diff --git a/sidebar.c b/sidebar.c index 5ce1922..deecda6 100644 --- a/sidebar.c +++ b/sidebar.c @@ -190,9 +190,7 @@ int make_sidebar_entry (char* box, int idx, size_t len) { 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) @@ -210,12 +208,10 @@ int make_sidebar_entry (char* box, int idx, size_t len) 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; diff --git a/status.c b/status.c index 47abf57..6c613eb 100644 --- a/status.c +++ b/status.c @@ -222,21 +222,11 @@ static const char *status_format_str (char *buf, size_t buflen, char op, 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) diff --git a/system.c b/system.c index af915de..2d96430 100644 --- a/system.c +++ b/system.c @@ -12,11 +12,9 @@ #endif #include "mutt.h" -#ifdef USE_IMAP -# include "imap.h" -# include -#endif +#include +#include #include #include #include @@ -104,12 +102,7 @@ int _mutt_system (const char *cmd, int flags) _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); diff --git a/url.h b/url.h index b6dbc38..fda4e64 100644 --- a/url.h +++ b/url.h @@ -10,6 +10,8 @@ #ifndef _URL_H # define _URL_H +#include + typedef enum url_scheme { U_FILE, U_POP, -- 2.20.1