From matthias.andree@gmx.de  Thu Nov  3 11:26:30 2005
Return-Path: <matthias.andree@gmx.de>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 859F616A420;
	Thu,  3 Nov 2005 11:26:30 +0000 (GMT)
	(envelope-from matthias.andree@gmx.de)
Received: from mail.dt.e-technik.uni-dortmund.de (krusty.dt.E-Technik.Uni-Dortmund.DE [129.217.163.1])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 5AB8643D45;
	Thu,  3 Nov 2005 11:26:29 +0000 (GMT)
	(envelope-from matthias.andree@gmx.de)
Received: from localhost (localhost [127.0.0.1])
	by mail.dt.e-technik.uni-dortmund.de (Postfix) with ESMTP id 18F1144561;
	Thu,  3 Nov 2005 12:26:28 +0100 (CET)
Received: from mail.dt.e-technik.uni-dortmund.de ([127.0.0.1])
 by localhost (krusty [127.0.0.1]) (amavisd-new, port 10024) with ESMTP
 id 31494-02; Thu,  3 Nov 2005 12:26:26 +0100 (CET)
Received: from m2a2.dyndns.org (p5091266E.dip0.t-ipconnect.de [80.145.38.110])
	by mail.dt.e-technik.uni-dortmund.de (Postfix) with ESMTP id AD80E44093;
	Thu,  3 Nov 2005 12:26:24 +0100 (CET)
Received: from localhost (localhost [127.0.0.1])
	by merlin.emma.line.org (Postfix) with ESMTP id 128962006D2;
	Thu,  3 Nov 2005 12:26:24 +0100 (CET)
Received: from m2a2.dyndns.org ([127.0.0.1])
 by localhost (m2a2.dyndns.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 08906-07; Thu,  3 Nov 2005 12:26:23 +0100 (CET)
Received: from libertas.emma.line.org (libertas.emma.line.org [192.168.1.2])
	by merlin.emma.line.org (Postfix) with ESMTP id 11DE920067F;
	Thu,  3 Nov 2005 12:26:23 +0100 (CET)
Received: from emma by libertas.emma.line.org with local (Exim 4.54 (FreeBSD))
	id 1EXdHd-000NhX-4a; Thu, 03 Nov 2005 12:29:29 +0100
Message-Id: <E1EXdHd-000NhX-4a@libertas.emma.line.org>
Date: Thu, 03 Nov 2005 12:29:29 +0100
From: Matthias Andree <matthias.andree@gmx.de>
Sender: Matthias Andree <matthias.andree@gmx.de>
To: FreeBSD-gnats-submit@freebsd.org
Cc: barner@FreeBSD.org
Subject: [PATCH] mail/fetchmail: fix IMAP timeout and fetchmailconf wrapper
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         88444
>Category:       ports
>Synopsis:       [PATCH] mail/fetchmail: fix IMAP timeout and fetchmailconf wrapper
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    barner
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Nov 03 11:30:14 GMT 2005
>Closed-Date:    Thu Nov 10 10:31:30 GMT 2005
>Last-Modified:  Thu Nov 10 10:31:30 GMT 2005
>Originator:     Matthias Andree
>Release:        FreeBSD 4.11-RELEASE-p13 i386
>Organization:
>Environment:
System: FreeBSD libertas.emma.line.org 4.11-RELEASE-p13 FreeBSD 4.11-RELEASE-p13 #2: Mon Oct 24 12:35:08 CEST 2005
>Description:
- fix IMAP client timeout bug with upstream servers that do not send updated
  EXISTS counts after acknowledging EXPUNGE see <http://bugs.debian.org/314509>

- add fetchmailconf wrapper check for _tkinter.so (if python was installed but
  not Tkinter, the wrapper would still try to run fetchmailconf.bin, which
  gives a less clear error message to the user than was intended)

- let fetchmailconf wrapper pass command line arguments to fetchmailconf.bin
  (it supports -d and -f FILE)

- replace PREFIX with LOCALBASE where appropriate

- bump PORTREVISION

Added file(s):
- files/patch-imap-timeout

Port maintainer (barner@FreeBSD.org) is cc'd.

Generated with FreeBSD Port Tools 0.63
>How-To-Repeat:
>Fix:

--- fetchmail-6.2.5.2_2.patch begins here ---
diff -ruN --exclude=CVS /usr/ports/mail/fetchmail/Makefile /usr/home/emma/ports/mail/fetchmail/Makefile
--- /usr/ports/mail/fetchmail/Makefile	Tue Nov  1 22:16:45 2005
+++ /usr/home/emma/ports/mail/fetchmail/Makefile	Thu Nov  3 11:52:13 2005
@@ -11,7 +11,7 @@
 
 PORTNAME=	fetchmail
 PORTVERSION=	6.2.5.2
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	mail ipv6
 MASTER_SITES=	http://download.berlios.de/%SUBDIR%/:fetchmail_site,fetchmailconf_site \
 		http://www.catb.org/~esr/%SUBDIR%/:fetchmail_site \
@@ -112,10 +112,10 @@
 # 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,#!${PREFIX}/bin/python,g" \
+		${SED} -e "s,^#!/.*/python,#!${LOCALBASE}/bin/python,g" \
 		> ${WRKDIR}/fetchmailconf.temp
 	@${MV} -f ${WRKDIR}/fetchmailconf.temp ${WRKSRC}/fetchmailconf
-	@${SED} -e "s,@PREFIX@,${PREFIX},g" \
+	@${SED} -e "s,@LOCALBASE@,${LOCALBASE},g" \
 		${FILESDIR}/fetchmailconf > ${WRKDIR}/fetchmailconf
 	@${REINPLACE_CMD} -e "s,@l@,,;s,@GT_NO@,," \
 		${WRKSRC}/intl/Makefile.in
diff -ruN --exclude=CVS /usr/ports/mail/fetchmail/files/fetchmailconf /usr/home/emma/ports/mail/fetchmail/files/fetchmailconf
--- /usr/ports/mail/fetchmail/files/fetchmailconf	Wed Jul 27 11:43:22 2005
+++ /usr/home/emma/ports/mail/fetchmail/files/fetchmailconf	Thu Nov  3 11:59:27 2005
@@ -1,19 +1,22 @@
 #!/bin/sh
 #
-# Wrapper for the real fetchmailconf.  Checks whether Python is installed,
-# and runs the real fetchmailconf or alerts the user, as appropriate.
+# Wrapper for the real fetchmailconf.  Checks whether Python and Tkinter are
+# installed, and runs the real fetchmailconf or alerts the user, as appropriate.
 #
 # $FreeBSD: ports/mail/fetchmail/files/fetchmailconf,v 1.5 2005/07/21 10:25:32 barner Exp $
 
-PREFIX=@PREFIX@
+LOCALBASE=@LOCALBASE@
 
-if [ -e $PREFIX/bin/python ]; then
-	exec $PREFIX/libexec/fetchmailconf.bin
-else
-	cat <<EOF
-The fetchmailconf program requires Python with Tkinter, which does not
-appear to be installed on this system.  Python/Tkinter can be found in
-the FreeBSD Ports Collection under x11-toolkits/py-tkinter.
-EOF
-	exit 1
+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 "$@"
+	fi
 fi
+cat <<EOF
+The fetchmailconf program requires Python with Tkinter, which does
+not appear to be installed on this system.  Python can be found in
+the FreeBSD Ports Collection in lang/python, and Tkinter for Python
+can be found in x11-toolkits/py-tkinter.
+EOF
+exit 1
diff -ruN --exclude=CVS /usr/ports/mail/fetchmail/files/patch-imap-timeout /usr/home/emma/ports/mail/fetchmail/files/patch-imap-timeout
--- /usr/ports/mail/fetchmail/files/patch-imap-timeout	Thu Jan  1 01:00:00 1970
+++ /usr/home/emma/ports/mail/fetchmail/files/patch-imap-timeout	Thu Nov  3 12:08:51 2005
@@ -0,0 +1,18 @@
+--- ./imap.c.orig	2003-10-15 21:17:41.000000000 +0200
++++ ./imap.c	2005-10-29 15:19:58.000000000 +0200
+@@ -105,6 +105,15 @@
+ 	{
+ 	    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;
+ 	/*
--- fetchmail-6.2.5.2_2.patch ends here ---

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->barner 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Thu Nov 3 11:36:19 GMT 2005 
Responsible-Changed-Why:  
Over to maintainer 

http://www.freebsd.org/cgi/query-pr.cgi?pr=88444 
State-Changed-From-To: open->closed 
State-Changed-By: barner 
State-Changed-When: Thu Nov 10 10:31:29 GMT 2005 
State-Changed-Why:  
Committed. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=88444 
>Unformatted:
