always build POP support, we do a /mail/ client, right ?
authorPierre Habouzit <madcoder@debian.org>
Sat, 4 Nov 2006 23:48:34 +0000 (00:48 +0100)
committerPierre Habouzit <madcoder@debian.org>
Sat, 4 Nov 2006 23:48:34 +0000 (00:48 +0100)
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
17 files changed:
Makefile.am
account.c
browser.c
compose.c
configure.ac
curs_main.c
doconfig.sh
globals.h
hcache.c
init.h
main.c
mutt.h
muttlib.c
mx.c
mx.h
protos.h
recvattach.c

index 4567094..9322a59 100644 (file)
@@ -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)
 
index d87c3e3..3cc3a22 100644 (file)
--- 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);
index 233a7c1..0e30000 100644 (file)
--- 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);
index aed420b..553e9b2 100644 (file)
--- 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
index 370486f..f2f835a 100644 (file)
@@ -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. ])
index 80872d0..9905ed5 100644 (file)
@@ -19,6 +19,8 @@
 #include <lib-lib/macros.h>
 #include <lib-lib/mapping.h>
 
+#include <pop/pop.h>
+
 #include "mutt.h"
 #include "mutt_curses.h"
 #include "mx.h"
 #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:
 
index 2d0d469..3b390cd 100755 (executable)
@@ -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
index 0542e87..486c361 100644 (file)
--- 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;
index 140df18..308ac68 100644 (file)
--- 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 (file)
--- 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 (file)
--- 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 (file)
--- 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 */
 
index 0bf733c..7592681 100644 (file)
--- 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 (file)
--- a/mx.c
+++ b/mx.c
 #include "imap/mx_imap.h"
 #endif
 
-#ifdef USE_POP
-#include "pop/pop.h"
-#include "pop/mx_pop.h"
-#endif
+#include <pop/pop.h>
+#include <pop/mx_pop.h>
 
 #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 (file)
--- a/mx.h
+++ b/mx.h
@@ -19,6 +19,9 @@
 
 #include <sys/stat.h>
 #include <utime.h>
+#include <stdio.h>
+
+#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
index 24e5c0d..8178944 100644 (file)
--- 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
index fcad491..ea535ef 100644 (file)
@@ -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) {