aboutsummaryrefslogtreecommitdiff
path: root/mail/fetchmail
diff options
context:
space:
mode:
authorSimon Barner <barner@FreeBSD.org>2005-12-06 21:08:15 +0000
committerSimon Barner <barner@FreeBSD.org>2005-12-06 21:08:15 +0000
commite92788bd72d28a8cebf5c6639c6b379c5098c81c (patch)
treee0b2b509f52f02ecb718d6cb300a3cc4921555d4 /mail/fetchmail
parent7044c8e489100c96494e014e0889d875cded4e3c (diff)
downloadports-e92788bd72d28a8cebf5c6639c6b379c5098c81c.tar.gz
ports-e92788bd72d28a8cebf5c6639c6b379c5098c81c.zip
Notes
Diffstat (limited to 'mail/fetchmail')
-rw-r--r--mail/fetchmail/Makefile69
-rw-r--r--mail/fetchmail/distinfo12
-rw-r--r--mail/fetchmail/files/fetchmailconf2
-rw-r--r--mail/fetchmail/files/patch-Makefile.in38
-rw-r--r--mail/fetchmail/files/patch-aclocal.m412
-rw-r--r--mail/fetchmail/files/patch-ah20
-rw-r--r--mail/fetchmail/files/patch-ai12
-rw-r--r--mail/fetchmail/files/patch-aj9
-rw-r--r--mail/fetchmail/files/patch-al13
-rw-r--r--mail/fetchmail/files/patch-configure80
-rw-r--r--mail/fetchmail/files/patch-fetchmail.man20
-rw-r--r--mail/fetchmail/files/patch-imap.c148
-rw-r--r--mail/fetchmail/files/patch-pop2.c13
-rw-r--r--mail/fetchmail/pkg-plist10
14 files changed, 106 insertions, 352 deletions
diff --git a/mail/fetchmail/Makefile b/mail/fetchmail/Makefile
index 2b16a7150a15..8b23a31a05f9 100644
--- a/mail/fetchmail/Makefile
+++ b/mail/fetchmail/Makefile
@@ -10,42 +10,17 @@
# want fetchmailconf to work, define WITH_X11
PORTNAME= fetchmail
-PORTVERSION= 6.2.5.2
-PORTREVISION= 4
+PORTVERSION= 6.3.0
CATEGORIES= mail ipv6
-MASTER_SITES= http://download.berlios.de/%SUBDIR%/:fetchmail_site,fetchmailconf_site \
- http://www.catb.org/~esr/%SUBDIR%/:fetchmail_site \
- ftp://ftp.ayamura.org/pub/%SUBDIR%/:fetchmail_site \
- ftp://ftp.win.jp/pub/%SUBDIR%/:fetchmail \
- ftp://ftp.dti.ad.jp/pub/net/mail/%SUBDIR%/:fetchmail_site \
- http://home.leo.org/~barner/freebsd/distfiles/:fetchmail_site,fetchmailconf_site
-MASTER_SITE_SUBDIR= fetchmail/:fetchmail_site,fetchmailconf_site
-DISTNAME= ${PORTNAME}-6.2.5
-DISTFILES= ${DISTNAME}${EXTRACT_SUFX}:fetchmail_site \
- fetchmailconf-${FETCHMAILCONF_VER}.gz:fetchmailconf_site
-EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX}
-
-PATCH_SITES= http://download.berlios.de/%SUBDIR%/ \
+MASTER_SITES= http://download.berlios.de/%SUBDIR%/ \
+ http://home.pages.de/~mandree/%SUBDIR%/ \
http://home.leo.org/~barner/freebsd/distfiles/
-PATCH_SITE_SUBDIR= fetchmail
-PATCHFILES= ${PORTNAME}-patch-${PORTVERSION}.gz
-PATCH_DIST_STRIP=-p1
+MASTER_SITE_SUBDIR= fetchmail
MAINTAINER= barner@FreeBSD.org
COMMENT= Batch mail retrieval utility for IMAP/POP2/POP3/APOP/KPOP/ETRN/ODMR
-FETCHMAILCONF_VER=1.43.2
-
-.if defined(WITH_X11)
-RUN_DEPENDS= ${LOCALBASE}/lib/${PYTHON_VERSION}/site-packages/_tkinter.so:${PORTSDIR}/x11-toolkits/py-tkinter
-.endif
-
-.if !defined(WITHOUT_NLS)
-USE_GETTEXT= yes
-.endif
-.if defined(WITH_X11)
-USE_PYTHON= yes
-.endif
+USE_BZIP2= yes
USE_REINPLACE= yes
USE_GMAKE= yes
GNU_CONFIGURE= yes
@@ -59,21 +34,26 @@ MAKE_ENV+= ${CONFIGURE_ENV}
MAN1= fetchmail.1
MLINKS= fetchmail.1 fetchmailconf.1
+.if defined(WITH_X11)
+USE_PYTHON= yes
+RUN_DEPENDS+= ${LOCALBASE}/lib/${PYTHON_VERSION}/site-packages/_tkinter.so:${PORTSDIR}/x11-toolkits/py-tkinter
+.endif
+
+.include <bsd.port.pre.mk>
+
FDOC= ${PREFIX}/share/doc/fetchmail
DOCS= FAQ FEATURES NEWS NOTES README \
design-notes.html fetchmail-FAQ.html fetchmail-features.html
-WRKSRC= ${WRKDIR}/${PORTNAME}-6.2.5
.if !defined(WITHOUT_NLS)
CONFIGURE_ARGS+= --enable-nls
-PLIST_SUB= NLS=""
+PLIST_SUB+= NLS=""
+USE_GETTEXT= yes
.else
CONFIGURE_ARGS+= --disable-nls
-PLIST_SUB= NLS="@comment "
+PLIST_SUB+= NLS="@comment "
.endif
-.include <bsd.port.pre.mk>
-
.if ${OSVERSION} >= 400014
CONFIGURE_ARGS+=--enable-inet6
.endif
@@ -110,24 +90,17 @@ PLIST_SUB+= NTLMDOCS="%%PORTDOCS%%@comment "
.endif
pre-patch:
- @${CP} -f /usr/include/md5.h ${WRKSRC}
-# Use fetchmailconf-1.43.2 to avoid a password exposure
-# caused by insecure file creation
- @${GZCAT} ${DISTDIR}/fetchmailconf-${FETCHMAILCONF_VER}.gz | \
- ${SED} -e "s,^#!/.*/python,#!${LOCALBASE}/bin/python,g" \
- > ${WRKDIR}/fetchmailconf.temp
- @${MV} -f ${WRKDIR}/fetchmailconf.temp ${WRKSRC}/fetchmailconf
- @${SED} -e "s,@LOCALBASE@,${LOCALBASE},g" \
- ${FILESDIR}/fetchmailconf > ${WRKDIR}/fetchmailconf
- @${REINPLACE_CMD} -e "s,@l@,,;s,@GT_NO@,," \
- ${WRKSRC}/intl/Makefile.in
-
+ @${REINPLACE_CMD} -e "s,^#!/usr/bin/env python,#!${LOCALBASE}/bin/python,g" \
+ ${WRKSRC}/fetchmailconf.py
+ @${CP} ${FILESDIR}/fetchmailconf ${WRKDIR}/fetchmailconf
+ @${REINPLACE_CMD} -e "s,@LOCALBASE@,${LOCALBASE},g" \
+ ${WRKDIR}/fetchmailconf
post-install:
.if !defined(NOPORTDOCS)
${INSTALL} -d -m 555 -o ${DOCOWN} -g ${DOCGRP} ${FDOC}
cd ${WRKSRC} && ${INSTALL_DATA} ${DOCS} ${FDOC}
.endif
- ${MV} ${PREFIX}/bin/fetchmailconf ${PREFIX}/libexec/fetchmailconf.bin
+
${INSTALL_SCRIPT} ${WRKDIR}/fetchmailconf ${PREFIX}/bin
.include <bsd.port.post.mk>
diff --git a/mail/fetchmail/distinfo b/mail/fetchmail/distinfo
index 8d8cbd61978b..a5e52d27fdeb 100644
--- a/mail/fetchmail/distinfo
+++ b/mail/fetchmail/distinfo
@@ -1,9 +1,3 @@
-MD5 (fetchmail-6.2.5.tar.gz) = 9956b30139edaa4f5f77c4d0dbd80225
-SHA256 (fetchmail-6.2.5.tar.gz) = c18e6f23315e0a3526229bd0ba5cf8ce0d747cb5e5ba7cb952ad08c85a1cafac
-SIZE (fetchmail-6.2.5.tar.gz) = 1257376
-MD5 (fetchmailconf-1.43.2.gz) = 804bcae14431941c8b2c5e8f0011da7b
-SHA256 (fetchmailconf-1.43.2.gz) = edba49ee2c84fb1f4abb6fd37ed89f2d458c73acc4cbd26a850f671fbeb60cce
-SIZE (fetchmailconf-1.43.2.gz) = 24010
-MD5 (fetchmail-patch-6.2.5.2.gz) = be18f89b94e937a22560aa452e524c4b
-SHA256 (fetchmail-patch-6.2.5.2.gz) = 565d9078d5240e2e1474cd821c3feb5eb3d7018ec435228effa54bc1dce5d4b6
-SIZE (fetchmail-patch-6.2.5.2.gz) = 2000
+MD5 (fetchmail-6.3.0.tar.bz2) = b547b59f352af956911ce812773b3976
+SHA256 (fetchmail-6.3.0.tar.bz2) = abe34809e1a6a4eb27c8c91efe763e7c9762d50bfee31d3174703f022982b76e
+SIZE (fetchmail-6.3.0.tar.bz2) = 1155334
diff --git a/mail/fetchmail/files/fetchmailconf b/mail/fetchmail/files/fetchmailconf
index 70e8f79e1e4c..d3285d80fda6 100644
--- a/mail/fetchmail/files/fetchmailconf
+++ b/mail/fetchmail/files/fetchmailconf
@@ -10,7 +10,7 @@ LOCALBASE=@LOCALBASE@
if [ -x $LOCALBASE/bin/python ] ; then
PYTHON_VERSION=python$(${LOCALBASE}/bin/python -c 'import sys; print sys.version[:3]' 2>/dev/null)
if [ -e ${LOCALBASE}/lib/${PYTHON_VERSION}/site-packages/_tkinter.so ]; then
- exec ${LOCALBASE}/libexec/fetchmailconf.bin "$@"
+ exec ${LOCALBASE}/libexec/fetchmailconf.py "$@"
fi
fi
cat <<EOF
diff --git a/mail/fetchmail/files/patch-Makefile.in b/mail/fetchmail/files/patch-Makefile.in
new file mode 100644
index 000000000000..601acf6e3e46
--- /dev/null
+++ b/mail/fetchmail/files/patch-Makefile.in
@@ -0,0 +1,38 @@
+--- Makefile.in.orig Sat Sep 17 15:19:44 2005
++++ Makefile.in Tue Sep 20 15:11:33 2005
+@@ -29,7 +29,7 @@
+ INSTALL = @INSTALL@
+ install_sh_DATA = $(install_sh) -c -m 644
+ install_sh_PROGRAM = $(install_sh) -c
+-install_sh_SCRIPT = $(install_sh) -c
++install_sh_SCRIPT = $(install_sh) -c -m 555
+ INSTALL_HEADER = $(INSTALL_DATA)
+ transform = $(program_transform_name)
+ NORMAL_INSTALL = :
+@@ -837,23 +837,16 @@
+ uninstall-info-am:
+ install-pythonPYTHON: $(python_PYTHON)
+ @$(NORMAL_INSTALL)
+- test -z "$(pythondir)" || $(mkdir_p) "$(DESTDIR)$(pythondir)"
++ $(mkdir_p) "$(libexecdir)"
+ @list='$(python_PYTHON)'; dlist=''; for p in $$list; do\
+ if test -f "$$p"; then b=; else b="$(srcdir)/"; fi; \
+ if test -f $$b$$p; then \
+ f=$(am__strip_dir) \
+ dlist="$$dlist $$f"; \
+- echo " $(pythonPYTHON_INSTALL) '$$b$$p' '$(DESTDIR)$(pythondir)/$$f'"; \
+- $(pythonPYTHON_INSTALL) "$$b$$p" "$(DESTDIR)$(pythondir)/$$f"; \
++ echo " $(install_sh_SCRIPT) '$$b$$p' '$(libexecdir)/$$f'"; \
++ $(install_sh_SCRIPT) "$$b$$p" "$(libexecdir)/$$f"; \
+ else :; fi; \
+ done; \
+- if test -n "$$dlist"; then \
+- if test -z "$(DESTDIR)"; then \
+- PYTHON=$(PYTHON) $(py_compile) --basedir "$(pythondir)" $$dlist; \
+- else \
+- PYTHON=$(PYTHON) $(py_compile) --destdir "$(DESTDIR)" --basedir "$(pythondir)" $$dlist; \
+- fi; \
+- else :; fi
+
+ uninstall-pythonPYTHON:
+ @$(NORMAL_UNINSTALL)
diff --git a/mail/fetchmail/files/patch-aclocal.m4 b/mail/fetchmail/files/patch-aclocal.m4
deleted file mode 100644
index 665b8020ea90..000000000000
--- a/mail/fetchmail/files/patch-aclocal.m4
+++ /dev/null
@@ -1,12 +0,0 @@
---- aclocal.m4.orig Sat Mar 9 04:27:20 2002
-+++ aclocal.m4 Wed May 22 21:11:00 2002
-@@ -273,6 +273,9 @@
-
- CATOBJEXT=.gmo
- fi
-+ if test "$gt_cv_func_gettext_libintl" = "yes"; then
-+ INTLLIBS='-lintl'
-+ fi
- ])
-
- if test "$gt_use_preinstalled_gnugettext" = "yes" \
diff --git a/mail/fetchmail/files/patch-ah b/mail/fetchmail/files/patch-ah
deleted file mode 100644
index d4c2e837c3c8..000000000000
--- a/mail/fetchmail/files/patch-ah
+++ /dev/null
@@ -1,20 +0,0 @@
---- ./Makefile.in Wed Oct 18 00:50:22 2000
-+++ ./Makefile.in Sat Oct 28 14:54:23 2000
-@@ -72,6 +72,8 @@
- INSTALL_PROGRAM = @INSTALL_PROGRAM@
- # Program to install the man page.
- INSTALL_DATA = @INSTALL_DATA@
-+# Program to install scripts
-+INSTALL_SCRIPT = @INSTALL_SCRIPT@
- # Generic install program.
- INSTALL = @INSTALL@
-
-@@ -154,7 +156,7 @@
- @echo "Installing fetchmail binary..."
- $(INSTALL_PROGRAM) ./fetchmail $(DESTDIR)$(bindir)/fetchmail
- @echo "Installing fetchmail configurator..."
-- $(INSTALL_PROGRAM) ${srcdir}/fetchmailconf $(DESTDIR)$(bindir)/fetchmailconf
-+ $(INSTALL_SCRIPT) ${srcdir}/fetchmailconf $(DESTDIR)$(bindir)/fetchmailconf
- @echo "Installing manual page..."
- $(INSTALL_DATA) $(srcdir)/fetchmail.man $(DESTDIR)$(mandir)/fetchmail.$(manext)
- rm -f $(DESTDIR)$(mandir)/fetchmailconf.$(manext)
diff --git a/mail/fetchmail/files/patch-ai b/mail/fetchmail/files/patch-ai
deleted file mode 100644
index 5651cb62a83c..000000000000
--- a/mail/fetchmail/files/patch-ai
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -ru ../fetchmail-5.3.8.old/conf.c ./conf.c
---- ../fetchmail-5.3.8.old/conf.c Mon Mar 6 07:20:17 2000
-+++ ./conf.c Tue May 9 02:19:32 2000
-@@ -252,7 +252,7 @@
- #ifndef INET6_ENABLE
- numdump("port", ctl->server.port);
- #else
-- stringdump("port", ctl->server.service);
-+ stringdump("service", ctl->server.service);
- #endif
- numdump("timeout", ctl->server.timeout);
- numdump("interval", ctl->server.interval);
diff --git a/mail/fetchmail/files/patch-aj b/mail/fetchmail/files/patch-aj
deleted file mode 100644
index d6e615c2645e..000000000000
--- a/mail/fetchmail/files/patch-aj
+++ /dev/null
@@ -1,9 +0,0 @@
-diff -ruN ../fetchmail-5.3.0.OLD/md5.h ./md5.h
---- ../fetchmail-5.3.0.OLD/md5.h Sun Dec 19 15:18:14 1999
-+++ ./md5.h Wed Feb 23 23:46:56 2000
-@@ -1,4 +1,5 @@
- #ifndef _MD5_H_
- #define _MD5_H_
-+#include <sys/types.h>
- #include <sys/md5.h>
- #endif /* _MD5_H_ */
diff --git a/mail/fetchmail/files/patch-al b/mail/fetchmail/files/patch-al
deleted file mode 100644
index 2e891603d8b2..000000000000
--- a/mail/fetchmail/files/patch-al
+++ /dev/null
@@ -1,13 +0,0 @@
---- po/Makefile.in.in~ Mon Nov 23 06:42:00 1998
-+++ po/Makefile.in.in Sun May 21 23:17:50 2000
-@@ -19,8 +19,8 @@
- prefix = @prefix@
- exec_prefix = @exec_prefix@
- datadir = $(prefix)/@DATADIRNAME@
--localedir = $(datadir)/locale
--gnulocaledir = $(prefix)/share/locale
-+localedir = $(prefix)/share/locale
-+gnulocaledir = ${localedir}
- gettextsrcdir = $(prefix)/share/gettext/po
- subdir = po
-
diff --git a/mail/fetchmail/files/patch-configure b/mail/fetchmail/files/patch-configure
index d2e543ff1463..8ff0ae95dd59 100644
--- a/mail/fetchmail/files/patch-configure
+++ b/mail/fetchmail/files/patch-configure
@@ -1,77 +1,11 @@
---- configure.orig Fri Oct 10 09:39:54 2003
-+++ configure Tue Jul 26 12:39:04 2005
-@@ -12929,16 +12929,16 @@
- echo "$as_me:$LINENO: result: $ac_cv_lib_des_des_string_to_key" >&5
- echo "${ECHO_T}$ac_cv_lib_des_des_string_to_key" >&6
- if test $ac_cv_lib_des_des_string_to_key = yes; then
-- libk5crypto=-ldes
-+ libk5crypto=-lcrypto
- else
-
--echo "$as_me:$LINENO: checking for MD5_Init in -lssl" >&5
--echo $ECHO_N "checking for MD5_Init in -lssl... $ECHO_C" >&6
-+echo "$as_me:$LINENO: checking for MD5_Init in -lcrypto" >&5
-+echo $ECHO_N "checking for MD5_Init in -lcrypto... $ECHO_C" >&6
- if test "${ac_cv_lib_ssl_MD5_Init+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
- else
- ac_check_lib_save_LIBS=$LIBS
--LIBS="-lssl ${LDEFLAGS} ${ac_krblibs} $LIBS"
-+LIBS="-lcrypto ${LDEFLAGS} ${ac_krblibs} $LIBS"
- cat >conftest.$ac_ext <<_ACEOF
- #line $LINENO "configure"
- /* confdefs.h. */
-@@ -12991,7 +12991,7 @@
- #define HAVE_LIBSSL 1
- _ACEOF
-
-- LIBS="-lssl $LIBS"
-+ LIBS="-lcrypto $LIBS"
-
- else
- { { echo "$as_me:$LINENO: error: DES libraries not found. Try adding --with-ssl to enable OpenSSL support" >&5
-@@ -13238,7 +13238,7 @@
- _ACEOF
-
- CEFLAGS="$CEFLAGS -I/usr/include/kerberosIV"
-- LIBS="$LIBS -lkrb -ldes"
-+ LIBS="$LIBS -lkrb -lcrypto"
- else
- #we need to detect when we're building under a kerberosV compatibility
- #layer, btw...
-@@ -13381,7 +13381,7 @@
- fi
- rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
- if test "$ac_cv_search_des_string_to_key" = no; then
-- for ac_lib in des425 des; do
-+ for ac_lib in crypto des425 des; do
- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
- cat >conftest.$ac_ext <<_ACEOF
- #line $LINENO "configure"
-@@ -13401,7 +13401,7 @@
- int
- main ()
- {
--des_string_to_key ();
-+_ossl_old_des_string_to_key ();
- ;
- return 0;
- }
-@@ -13639,7 +13639,7 @@
- test "$with_ssl" != "/usr" && CEFLAGS="$CEFLAGS -I$with_ssl/include"
+--- configure.orig Mon Sep 26 00:29:14 2005
++++ configure Mon Sep 26 08:59:07 2005
+@@ -12374,7 +12374,7 @@
+ { (exit 1); exit 1; }; }
fi
LDEFLAGS="$LDEFLAGS -L$with_ssl/lib"
- LIBS="$LIBS -lssl -lcrypto"
+ LIBS="$LIBS -lssl -lcrypto $RSAGLUE"
- cat >>confdefs.h <<\_ACEOF
- #define SSL_ENABLE 1
- _ACEOF
-@@ -13959,7 +13959,7 @@
-
- if test -f "$with_gssapi/include/roken.h"
- then
-- LIBS="$LIBS -lkrb5 -lasn1 -ldes -lroken -ldb -ldl"
-+ LIBS="$LIBS -lkrb5 -lasn1 -lcrypto -lroken -ldb -ldl"
- echo "$as_me:$LINENO: checking for gss_init_sec_context in -lgssapi" >&5
- echo $ECHO_N "checking for gss_init_sec_context in -lgssapi... $ECHO_C" >&6
- if test "${ac_cv_lib_gssapi_gss_init_sec_context+set}" = set; then
+ echo "$as_me:$LINENO: checking for additional library dependencies of SSL" >&5
+ echo $ECHO_N "checking for additional library dependencies of SSL... $ECHO_C" >&6
+ found=0
diff --git a/mail/fetchmail/files/patch-fetchmail.man b/mail/fetchmail/files/patch-fetchmail.man
new file mode 100644
index 000000000000..b81f1c0f79c4
--- /dev/null
+++ b/mail/fetchmail/files/patch-fetchmail.man
@@ -0,0 +1,20 @@
+--- fetchmail.man.orig Tue Dec 6 21:49:31 2005
++++ fetchmail.man Tue Dec 6 21:49:50 2005
+@@ -798,7 +798,7 @@
+ but a string matching the user host name is likely.
+ By using the option 'envelope Delivered\-To:' you can make fetchmail reliably
+ identify the original envelope recipient, but you have to strip the
+-'mbox\-userstr\-' prefix to deliver to the correct user.
++\'mbox\-userstr\-' prefix to deliver to the correct user.
+ This is what this option is for.
+ .TP
+ .B \-\-configdump
+@@ -2188,7 +2188,7 @@
+ some SMTP listeners and/or mail servers insert a header
+ in each message containing a copy of the envelope addresses. This
+ header (when it exists) is often 'X\-Original\-To', 'Delivered\-To' or
+-'X\-Envelope\-To'. Fetchmail's assumption about this can be changed with
++\'X\-Envelope\-To'. Fetchmail's assumption about this can be changed with
+ the \-E or 'envelope' option. Note that writing an envelope header of
+ this kind exposes the names of recipients (including blind-copy
+ recipients) to all receivers of the messages, so the upstream must store
diff --git a/mail/fetchmail/files/patch-imap.c b/mail/fetchmail/files/patch-imap.c
deleted file mode 100644
index d23575443e9f..000000000000
--- a/mail/fetchmail/files/patch-imap.c
+++ /dev/null
@@ -1,148 +0,0 @@
-Index: imap.c
-===================================================================
---- imap.c (revision 4423)
-+++ imap.c (working copy)
-@@ -57,72 +57,85 @@
- *cp = toupper(*cp);
-
- /* interpret untagged status responses */
-- if (strstr(buf, "* CAPABILITY"))
-- {
-- strncpy(capabilities, buf + 12, sizeof(capabilities));
-- capabilities[sizeof(capabilities)-1] = '\0';
-- }
-- else if (strstr(buf, "EXISTS"))
-- {
-- count = atoi(buf+2);
-- /*
-- * Don't trust the message count passed by the server.
-- * Without this check, it might be possible to do a
-- * DNS-spoofing attack that would pass back a ridiculous
-- * count, and allocate a malloc area that would overlap
-- * a portion of the stack.
-- */
-- if (count > INT_MAX/sizeof(int))
-+ if (buf[0] == '*' && buf[1] == ' ') {
-+ if (strstr(buf, " CAPABILITY"))
- {
-- report(stderr, "bogus message count!");
-- return(PS_PROTOCOL);
-+ strncpy(capabilities, buf + 12, sizeof(capabilities));
-+ capabilities[sizeof(capabilities)-1] = '\0';
- }
--
-- /*
-- * Nasty kluge to handle RFC2177 IDLE. If we know we're idling
-- * we can't wait for the tag matching the IDLE; we have to tell the
-- * server the IDLE is finished by shipping back a DONE when we
-- * see an EXISTS. Only after that will a tagged response be
-- * shipped. The idling flag also gets cleared on a timeout.
-- */
-- if (stage == STAGE_IDLE)
-+ else if (strstr(buf, " EXISTS"))
- {
-- /* If IDLE isn't supported, we were only sending NOOPs anyway. */
-- if (has_idle)
-+ count = atoi(buf+2);
-+ /*
-+ * Don't trust the message count passed by the server.
-+ * Without this check, it might be possible to do a
-+ * DNS-spoofing attack that would pass back a ridiculous
-+ * count, and allocate a malloc area that would overlap
-+ * a portion of the stack.
-+ */
-+ if (count > INT_MAX/sizeof(int))
- {
-- /* we do our own write and report here to disable tagging */
-- SockWrite(sock, "DONE\r\n", 6);
-- if (outlevel >= O_MONITOR)
-- report(stdout, "IMAP> DONE\n");
-+ report(stderr, "bogus message count!");
-+ return(PS_PROTOCOL);
- }
-
-- mytimeout = saved_timeout;
-- stage = STAGE_FETCH;
-+ /*
-+ * Nasty kluge to handle RFC2177 IDLE. If we know we're idling
-+ * we can't wait for the tag matching the IDLE; we have to tell the
-+ * server the IDLE is finished by shipping back a DONE when we
-+ * see an EXISTS. Only after that will a tagged response be
-+ * shipped. The idling flag also gets cleared on a timeout.
-+ */
-+ if (stage == STAGE_IDLE)
-+ {
-+ /* If IDLE isn't supported, we were only sending NOOPs anyway. */
-+ if (has_idle)
-+ {
-+ /* we do our own write and report here to disable tagging */
-+ SockWrite(sock, "DONE\r\n", 6);
-+ if (outlevel >= O_MONITOR)
-+ report(stdout, "IMAP> DONE\n");
-+ }
-+
-+ mytimeout = saved_timeout;
-+ stage = STAGE_FETCH;
-+ }
- }
-+ /* a space is required to avoid confusion with the \Recent flag */
-+ else if (strstr(buf, " RECENT"))
-+ {
-+ recentcount = atoi(buf+2);
-+ }
-+ /* servers are not required to update the EXISTS counts,
-+ * so count down by ourselves */
-+ else if (strstr(buf, " EXPUNGE"))
-+ {
-+ if (atoi(buf+2) > 0) {
-+ if (count > 0)
-+ count --;
-+ }
-+ }
-+ else if (strstr(buf, " PREAUTH")) {
-+ preauth = TRUE;
-+ }
-+ /*
-+ * The server may decide to make the mailbox read-only,
-+ * which causes fetchmail to go into a endless loop
-+ * fetching the same message over and over again.
-+ *
-+ * However, for check_only, we use EXAMINE which will
-+ * mark the mailbox read-only as per the RFC.
-+ *
-+ * This checks for the condition and aborts if
-+ * the mailbox is read-only.
-+ *
-+ * See RFC 2060 section 6.3.1 (SELECT).
-+ * See RFC 2060 section 6.3.2 (EXAMINE).
-+ */
-+ else if (!check_only && strstr(buf, "[READ-ONLY]")) {
-+ return(PS_LOCKBUSY);
-+ }
- }
-- /* a space is required to avoid confusion with the \Recent flag */
-- else if (strstr(buf, " RECENT"))
-- {
-- recentcount = atoi(buf+2);
-- }
-- else if (strstr(buf, "PREAUTH"))
-- preauth = TRUE;
-- /*
-- * The server may decide to make the mailbox read-only,
-- * which causes fetchmail to go into a endless loop
-- * fetching the same message over and over again.
-- *
-- * However, for check_only, we use EXAMINE which will
-- * mark the mailbox read-only as per the RFC.
-- *
-- * This checks for the condition and aborts if
-- * the mailbox is read-only.
-- *
-- * See RFC 2060 section 6.3.1 (SELECT).
-- * See RFC 2060 section 6.3.2 (EXAMINE).
-- */
-- else if (!check_only && strstr(buf, "[READ-ONLY]"))
-- return(PS_LOCKBUSY);
- } while
- (tag[0] != '\0' && strncmp(buf, tag, strlen(tag)));
-
diff --git a/mail/fetchmail/files/patch-pop2.c b/mail/fetchmail/files/patch-pop2.c
new file mode 100644
index 000000000000..b99fd716ba67
--- /dev/null
+++ b/mail/fetchmail/files/patch-pop2.c
@@ -0,0 +1,13 @@
+--- pop2.c
++++ pop2.c
+@@ -132,8 +132,8 @@
+ static const struct method pop2 =
+ {
+ "POP2", /* Post Office Protocol v2 */
+- 109, /* standard POP2 port */
+- 109, /* ssl POP2 port - not */
++ "pop2", /* standard POP2 port */
++ "pop2", /* ssl POP2 port - not */
+ FALSE, /* this is not a tagged protocol */
+ FALSE, /* does not use message delimiter */
+ pop2_ok, /* parse command response */
diff --git a/mail/fetchmail/pkg-plist b/mail/fetchmail/pkg-plist
index a47265264866..7c98b9aeca9e 100644
--- a/mail/fetchmail/pkg-plist
+++ b/mail/fetchmail/pkg-plist
@@ -1,7 +1,7 @@
@comment $FreeBSD$
bin/fetchmail
bin/fetchmailconf
-libexec/fetchmailconf.bin
+libexec/fetchmailconf.py
%%PORTDOCS%%%%DOCSDIR%%/FAQ
%%PORTDOCS%%%%DOCSDIR%%/FEATURES
%%PORTDOCS%%%%DOCSDIR%%/NEWS
@@ -15,14 +15,10 @@ libexec/fetchmailconf.bin
%%PORTDOCS%%@dirrm %%DOCSDIR%%
%%NLS%%share/locale/ca/LC_MESSAGES/fetchmail.mo
%%NLS%%share/locale/cs/LC_MESSAGES/fetchmail.mo
-%%NLS%%share/locale/da/LC_MESSAGES/fetchmail.mo
%%NLS%%share/locale/de/LC_MESSAGES/fetchmail.mo
-%%NLS%%share/locale/el/LC_MESSAGES/fetchmail.mo
%%NLS%%share/locale/es/LC_MESSAGES/fetchmail.mo
%%NLS%%share/locale/fr/LC_MESSAGES/fetchmail.mo
-%%NLS%%share/locale/gl/LC_MESSAGES/fetchmail.mo
%%NLS%%share/locale/ja/LC_MESSAGES/fetchmail.mo
%%NLS%%share/locale/pl/LC_MESSAGES/fetchmail.mo
-%%NLS%%share/locale/pt_BR/LC_MESSAGES/fetchmail.mo
-%%NLS%%share/locale/sk/LC_MESSAGES/fetchmail.mo
-%%NLS%%share/locale/tr/LC_MESSAGES/fetchmail.mo
+%%NLS%%share/locale/ru/LC_MESSAGES/fetchmail.mo
+%%NLS%%share/locale/sq/LC_MESSAGES/fetchmail.mo