From: Pierre Habouzit Date: Sat, 4 Nov 2006 23:48:34 +0000 (+0100) Subject: always build POP support, we do a /mail/ client, right ? X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=commitdiff_plain;h=0ac011f8eb41bab7808881ebf9802b4eb252fe3b always build POP support, we do a /mail/ client, right ? Signed-off-by: Pierre Habouzit --- diff --git a/Makefile.am b/Makefile.am index 4567094..9322a59 100644 --- a/Makefile.am +++ b/Makefile.am @@ -9,17 +9,12 @@ IMAP_SUBDIR = imap IMAP_INCLUDES = -I$(top_srcdir)/imap endif -if BUILD_POP -POP_SUBDIR = pop -POP_INCLUDES = -I$(top_srcdir)/pop -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 $(IMAP_SUBDIR) $(POP_SUBDIR) $(NNTP_SUBDIR) +SUBDIRS = intl m4 po lib-lib lib-mime lib-hash doc contrib lib pop $(IMAP_SUBDIR) $(NNTP_SUBDIR) bin_SCRIPTS = muttngbug fleang @@ -44,7 +39,7 @@ muttng_SOURCES = $(BUILT_SOURCES) \ crypt-mod-pgp-classic.c smime.c crypt-mod-smime-classic.c -muttng_LDADD = @MUTT_LIB_OBJECTS@ @LIBOBJS@ $(LIBIMAP) $(LIBPOP) $(LIBNNTP) \ +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_DEPENDENCIES = @MUTT_LIB_OBJECTS@ @LIBOBJS@ \ @@ -52,7 +47,8 @@ muttng_DEPENDENCIES = @MUTT_LIB_OBJECTS@ @LIBOBJS@ \ $(top_builddir)/lib-mime/libmime.a \ $(top_builddir)/lib-hash/libhash.a \ $(top_builddir)/lib/libsane.a \ - $(LIBIMAPDEPS) $(LIBPOPDEPS) $(LIBNNTPDEPS) $(INTLDEPS) + $(top_builddir)/pop/libpop.a \ + $(LIBIMAPDEPS) $(LIBNNTPDEPS) $(INTLDEPS) makedoc_SOURCES = makedoc.c makedoc_LDADD = -Llib-lib -llib @@ -64,7 +60,7 @@ DEFS=-DPKGDATADIR=\"$(pkgdatadir)\" -DSYSCONFDIR=\"$(sysconfdir)\" \ -DBINDIR=\"$(bindir)\" -DMUTTLOCALEDIR=\"$(datadir)/locale\" \ -DHAVE_CONFIG_H=1 -DPKGDOCDIR=\"$(docdir)\" -INCLUDES=-I. -I$(top_srcdir) $(IMAP_INCLUDES) $(POP_INCLUDES) $(NNTP_INCLUDES) $(LIBGPGME_CFLAGS) -Iintl +INCLUDES=-I. -I$(top_srcdir) $(IMAP_INCLUDES) $(NNTP_INCLUDES) $(LIBGPGME_CFLAGS) -Iintl CPPFLAGS=@CPPFLAGS@ -I$(includedir) diff --git a/account.c b/account.c index d87c3e3..3cc3a22 100644 --- a/account.c +++ b/account.c @@ -48,10 +48,8 @@ int mutt_account_match (const ACCOUNT * a1, const ACCOUNT * a2) } #endif -#ifdef USE_POP if (a1->type == M_ACCT_TYPE_POP && PopUser) user = PopUser; -#endif #ifdef USE_NNTP if (a1->type == M_ACCT_TYPE_NNTP && NntpUser) @@ -112,14 +110,12 @@ void mutt_account_tourl (ACCOUNT * account, ciss_url_t * url) } #endif -#ifdef USE_POP if (account->type == M_ACCT_TYPE_POP) { if (account->flags & M_ACCT_SSL) url->scheme = U_POPS; else url->scheme = U_POP; } -#endif #ifdef USE_NNTP if (account->type == M_ACCT_TYPE_NNTP) { @@ -151,10 +147,8 @@ int mutt_account_getuser (ACCOUNT * account) else if ((account->type == M_ACCT_TYPE_IMAP) && !m_strisempty(ImapUser)) m_strcpy(account->user, sizeof(account->user), ImapUser); #endif -#ifdef USE_POP else if ((account->type == M_ACCT_TYPE_POP) && !m_strisempty(PopUser)) m_strcpy(account->user, sizeof(account->user), PopUser); -#endif #ifdef USE_NNTP else if ((account->type == M_ACCT_TYPE_NNTP) && !m_strisempty(NntpUser)) m_strcpy(account->user, sizeof(account->user), NntpUser); @@ -209,10 +203,8 @@ int mutt_account_getpass (ACCOUNT * account) else if ((account->type == M_ACCT_TYPE_IMAP) && !m_strisempty(ImapPass)) m_strcpy(account->pass, sizeof(account->pass), ImapPass); #endif -#ifdef USE_POP else if ((account->type == M_ACCT_TYPE_POP) && !m_strisempty(PopPass)) m_strcpy(account->pass, sizeof(account->pass), PopPass); -#endif #ifdef USE_NNTP else if ((account->type == M_ACCT_TYPE_NNTP) && !m_strisempty(NntpPass)) m_strcpy(account->pass, sizeof(account->pass), NntpPass); diff --git a/browser.c b/browser.c index 233a7c1..0e30000 100644 --- a/browser.c +++ b/browser.c @@ -622,7 +622,6 @@ static int examine_mailboxes (MUTTMENU * menu, struct browser_state *state) continue; } #endif -#ifdef USE_POP if (tmp->magic == M_POP) { #ifdef USE_NNTP add_folder (menu, state, tmp->path, NULL, NULL, tmp->new); @@ -631,7 +630,6 @@ static int examine_mailboxes (MUTTMENU * menu, struct browser_state *state) #endif continue; } -#endif #ifdef USE_NNTP if (tmp->magic == M_NNTP) { add_folder (menu, state, tmp->path, NULL, NULL, tmp->new); diff --git a/compose.c b/compose.c index aed420b..553e9b2 100644 --- a/compose.c +++ b/compose.c @@ -856,9 +856,7 @@ int mutt_compose_menu (HEADER * msg, /* structure for new message */ #ifdef USE_IMAP if (mx_get_magic (fname) != M_IMAP) #endif -#ifdef USE_POP if (mx_get_magic (fname) != M_POP) -#endif #ifdef USE_NNTP if (mx_get_magic (fname) != M_NNTP && !option (OPTNEWS)) #endif diff --git a/configure.ac b/configure.ac index 370486f..f2f835a 100644 --- a/configure.ac +++ b/configure.ac @@ -415,17 +415,6 @@ AC_SUBST(DOTLOCK_PERMISSION) dnl -- socket dependencies -- -AC_ARG_ENABLE(pop, AC_HELP_STRING([--enable-pop], [Enable POP3 support]), -[ if test x$enableval = xyes ; then - AC_DEFINE(USE_POP,1,[ Define if you want support for the POP3 protocol. ]) - LIBPOP="-Lpop -lpop" - LIBPOPDEPS="\$(top_srcdir)/pop/pop.h pop/libpop.a" - need_pop="yes" - need_md5="yes" - fi -]) -AM_CONDITIONAL(BUILD_POP, test x$need_pop = xyes) - 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. ]) diff --git a/curs_main.c b/curs_main.c index 80872d0..9905ed5 100644 --- a/curs_main.c +++ b/curs_main.c @@ -19,6 +19,8 @@ #include #include +#include + #include "mutt.h" #include "mutt_curses.h" #include "mx.h" @@ -31,10 +33,6 @@ #include "thread.h" #include "xterm.h" -#ifdef USE_POP -#include "pop.h" -#endif - #ifdef USE_IMAP #include "imap_private.h" #endif @@ -913,14 +911,12 @@ int mutt_index_menu (void) menu->redraw = REDRAW_INDEX | REDRAW_STATUS; break; -#ifdef USE_POP case OP_MAIN_FETCH_MAIL: CHECK_ATTACH; pop_fetch_mail (); menu->redraw = REDRAW_FULL; break; -#endif /* USE_POP */ case OP_HELP: diff --git a/doconfig.sh b/doconfig.sh index 2d0d469..3b390cd 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-pop --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 --enable-imap --with-mixmaster --with-sasl2 --with-idn --with-curses --enable-nntp --enable-debug --with-gnutls --enable-gpgme diff --git a/globals.h b/globals.h index 0542e87..486c361 100644 --- a/globals.h +++ b/globals.h @@ -118,13 +118,12 @@ WHERE char *Pager; WHERE char *PagerFmt; WHERE char *PipeSep; -#ifdef USE_POP WHERE char *PopAuthenticators INITVAL (NULL); WHERE short PopCheckTimeout; WHERE char *PopHost; WHERE char *PopPass INITVAL (NULL); WHERE char *PopUser INITVAL (NULL); -#endif + WHERE char *PostIndentString; WHERE char *Postponed; WHERE char *Prefix; diff --git a/hcache.c b/hcache.c index 140df18..308ac68 100644 --- a/hcache.c +++ b/hcache.c @@ -457,15 +457,11 @@ static int generate_crc32 () #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 *) "HAVE_LANGINFO_CODESET", + m_strlen("HAVE_LANGINFO_CODESET")); #endif -#ifdef USE_POP - crc = - crc32 (crc, (unsigned char const *) "USE_POP", m_strlen("USE_POP")); -#endif + crc = crc32(crc, (unsigned char const *) "USE_POP", m_strlen("USE_POP")); #ifdef MIXMASTER crc = diff --git a/init.h b/init.h index 480212a..9580202 100644 --- a/init.h +++ b/init.h @@ -87,9 +87,6 @@ struct option_t { # ifndef MIXMASTER # define MIXMASTER "mixmaster" # endif -# ifndef USE_POP -# define USE_POP -# endif # ifndef USE_SSL # define USE_SSL # endif @@ -2742,12 +2739,8 @@ struct option_t MuttVars[] = { ** The separator to add between messages when piping a list of tagged ** messages to an external Unix command. */ -#ifdef USE_POP {"pop_authenticators", DT_STR, R_NONE, UL &PopAuthenticators, "" }, /* - ** .pp - ** Availability: POP - ** ** .pp ** This is a colon-delimited list of authentication methods Mutt-ng may ** attempt to use to log in to an POP server, in the order Mutt-ng should @@ -2762,9 +2755,6 @@ struct option_t MuttVars[] = { */ {"pop_auth_try_all", DT_BOOL, R_NONE, OPTPOPAUTHTRYALL, "yes" }, /* - ** .pp - ** Availability: POP - ** ** .pp ** If \fIset\fP, Mutt-ng will try all available methods. When \fIunset\fP, Mutt-ng will ** only fall back to other authentication methods if the previous @@ -2774,18 +2764,12 @@ struct option_t MuttVars[] = { {"pop_checkinterval", DT_SYN, R_NONE, UL "pop_mail_check", 0}, {"pop_mail_check", DT_NUM, R_NONE, UL &PopCheckTimeout, "60" }, /* - ** .pp - ** Availability: POP - ** ** .pp ** This variable configures how often (in seconds) Mutt-ng should look for ** new mail. */ {"pop_delete", DT_QUAD, R_NONE, OPT_POPDELETE, "ask-no" }, /* - ** .pp - ** Availability: POP - ** ** .pp ** If \fIset\fP, Mutt-ng will delete successfully downloaded messages from the POP ** server when using the ``fetch-mail'' function. When \fIunset\fP, Mutt-ng will @@ -2793,9 +2777,6 @@ struct option_t MuttVars[] = { */ {"pop_host", DT_STR, R_NONE, UL &PopHost, ""}, /* - ** .pp - ** Availability: POP - ** ** .pp ** The name of your POP server for the ``fetch-mail'' function. You ** can also specify an alternative port, username and password, i.e.: @@ -2808,9 +2789,6 @@ struct option_t MuttVars[] = { */ {"pop_last", DT_BOOL, R_NONE, OPTPOPLAST, "no" }, /* - ** .pp - ** Availability: POP - ** ** .pp ** If this variable is \fIset\fP, Mutt-ng will try to use the ``\fTLAST\fP'' POP command ** for retrieving only unread messages from the POP server when using @@ -2818,18 +2796,12 @@ struct option_t MuttVars[] = { */ {"pop_reconnect", DT_QUAD, R_NONE, OPT_POPRECONNECT, "ask-yes" }, /* - ** .pp - ** Availability: POP - ** ** .pp ** Controls whether or not Mutt-ng will try to reconnect to a POP server if the ** connection is lost. */ {"pop_user", DT_STR, R_NONE, UL &PopUser, "" }, /* - ** .pp - ** Availability: POP - ** ** .pp ** Your login name on the POP server. ** .pp @@ -2837,9 +2809,6 @@ struct option_t MuttVars[] = { */ {"pop_pass", DT_STR, R_NONE, UL &PopPass, ""}, /* - ** .pp - ** Availability: POP - ** ** .pp ** Specifies the password for your POP account. If \fIunset\fP, Mutt-ng will ** prompt you for your password when you open POP mailbox. @@ -2848,7 +2817,6 @@ struct option_t MuttVars[] = { ** presents a security risk since the superuser of your machine may read it ** regardless of the file's permissions. */ -#endif /* USE_POP */ {"post_indent_string", DT_STR, R_NONE, UL &PostIndentString, ""}, /* ** .pp @@ -3861,9 +3829,6 @@ static const char* Features[] = { #ifdef USE_DOTLOCK "dotlock", #endif -#ifdef USE_POP - "pop", -#endif #ifdef USE_NNTP "nntp", #endif diff --git a/main.c b/main.c index 06a8a6f..14e0812 100644 --- a/main.c +++ b/main.c @@ -301,11 +301,6 @@ static void show_version (void) #endif ); puts ( -#ifdef USE_POP - " +USE_POP " -#else - " -USE_POP " -#endif #ifdef USE_NNTP "+USE_NNTP " #else diff --git a/mutt.h b/mutt.h index 41005f2..f0cf711 100644 --- a/mutt.h +++ b/mutt.h @@ -235,10 +235,8 @@ enum { OPT_MIMEFWDREST, OPT_MOVE, OPT_PGPMIMEAUTO, /* ask to revert to PGP/MIME when inline fails */ -#ifdef USE_POP OPT_POPDELETE, OPT_POPRECONNECT, -#endif OPT_POSTPONE, OPT_PRINT, OPT_QUIT, @@ -372,10 +370,8 @@ enum { OPTPAGERSTOP, OPTPIPEDECODE, OPTPIPESPLIT, -#ifdef USE_POP OPTPOPAUTHTRYALL, OPTPOPLAST, -#endif OPTPRINTDECODE, OPTPRINTSPLIT, OPTPROMPTAFTER, @@ -695,13 +691,8 @@ typedef struct header { LIST *chain; #endif -#ifdef USE_POP int refno; /* message number on server */ -#endif - -#if defined USE_POP || defined USE_IMAP || defined USE_NNTP void *data; /* driver-specific data */ -#endif char *maildir_flags; /* unknown maildir flags */ } HEADER; @@ -770,9 +761,7 @@ typedef struct { int appended; /* how many saved messages? */ int flagged; /* how many flagged messages */ int msgnotreadyet; /* which msg "new" in pager, -1 if none */ -#if defined USE_POP || defined USE_IMAP || defined USE_NNTP void *data; /* driver specific data */ -#endif /* USE_IMAP */ short magic; /* mailbox type */ diff --git a/muttlib.c b/muttlib.c index 0bf733c..7592681 100644 --- a/muttlib.c +++ b/muttlib.c @@ -244,9 +244,7 @@ void mutt_free_header (HEADER ** h) #ifdef MIXMASTER mutt_free_list (&(*h)->chain); #endif -#if defined USE_POP || defined USE_IMAP || defined USE_NNTP p_delete(&(*h)->data); -#endif p_delete(h); } @@ -1178,13 +1176,11 @@ int mutt_save_confirm (const char *s, struct stat *st) magic = mx_get_magic (s); -#ifdef USE_POP if (magic == M_POP) { mutt_error _("Can't save message to POP mailbox."); return 1; } -#endif #ifdef USE_NNTP if (magic == M_NNTP) { diff --git a/mx.c b/mx.c index 760b1dc..e38f696 100644 --- a/mx.c +++ b/mx.c @@ -38,10 +38,8 @@ #include "imap/mx_imap.h" #endif -#ifdef USE_POP -#include "pop/pop.h" -#include "pop/mx_pop.h" -#endif +#include +#include #ifdef USE_NNTP #include "nntp/nntp.h" @@ -1207,14 +1205,12 @@ MESSAGE *mx_open_message (CONTEXT * ctx, int msgno) } #endif /* USE_IMAP */ -#ifdef USE_POP case M_POP: { if (pop_fetch_message (msg, ctx, msgno) != 0) p_delete(&msg); break; } -#endif /* USE_POP */ #ifdef USE_NNTP case M_NNTP: @@ -1254,9 +1250,7 @@ int mx_close_message (MESSAGE ** msg) #ifdef USE_IMAP || (*msg)->magic == M_IMAP #endif -#ifdef USE_POP || (*msg)->magic == M_POP -#endif #ifdef USE_NNTP || (*msg)->magic == M_NNTP #endif @@ -1402,9 +1396,7 @@ void mx_init (void) { #ifdef USE_IMAP list_push_back (&MailboxFormats, (void*) imap_reg_mx ()); #endif -#ifdef USE_POP list_push_back (&MailboxFormats, (void*) pop_reg_mx ()); -#endif #ifdef USE_NNTP list_push_back (&MailboxFormats, (void*) nntp_reg_mx ()); #endif diff --git a/mx.h b/mx.h index b5fdd6b..bb15783 100644 --- a/mx.h +++ b/mx.h @@ -19,6 +19,9 @@ #include #include +#include + +#include "mutt.h" /* * supported mailbox formats @@ -32,9 +35,7 @@ enum { #ifdef USE_IMAP M_IMAP, #endif -#ifdef USE_POP M_POP, -#endif #ifdef USE_NNTP M_NNTP, #endif diff --git a/protos.h b/protos.h index 24e5c0d..8178944 100644 --- a/protos.h +++ b/protos.h @@ -345,11 +345,6 @@ int getdnsdomainname (char *, size_t); #define SCO #endif -/* SCO Unix uses chsize() instead of ftruncate() */ -#ifndef HAVE_FTRUNCATE -#define ftruncate chsize -#endif - #ifndef HAVE_SNPRINTF extern int snprintf (char *, size_t, const char *, ...); #endif diff --git a/recvattach.c b/recvattach.c index fcad491..ea535ef 100644 --- a/recvattach.c +++ b/recvattach.c @@ -1078,14 +1078,12 @@ void mutt_view_attachments (HEADER * hdr) case OP_DELETE: CHECK_READONLY; -#ifdef USE_POP if (Context->magic == M_POP) { mutt_flushinp (); mutt_error _("Can't delete attachment from POP server."); break; } -#endif #ifdef USE_NNTP if (Context->magic == M_NNTP) {