Upstream has implemented, but not released adding a new option to ignore 
timestamps that would resolve this bug.  I've extracted the change from their 
svn, turned it into a patch.  Looking at it, it seams reasonable and it 
builds, but I don't use mailfilter, so I can't test it.

If someone can verify this works, I'll upload it as an NMU if one of the 
maintainers can't.  Please test.

diff -Nru mailfilter-0.8.2/debian/changelog mailfilter-0.8.2/debian/changelog
--- mailfilter-0.8.2/debian/changelog	2012-04-22 20:32:40.000000000 -0400
+++ mailfilter-0.8.2/debian/changelog	2012-07-05 00:23:59.000000000 -0400
@@ -1,3 +1,11 @@
+mailfilter (0.8.2-3.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Cherry pick from upstream svn rev 20 to add option to ignore timestamps
+    (Closes: #661261)
+
+ -- Scott Kitterman <sc...@kitterman.com>  Thu, 05 Jul 2012 00:22:58 -0400
+
 mailfilter (0.8.2-3) unstable; urgency=low
 
   * Switch to dpkg-source 3.0 (quilt) format (and remove dpatch)
diff -Nru mailfilter-0.8.2/debian/patches/series mailfilter-0.8.2/debian/patches/series
--- mailfilter-0.8.2/debian/patches/series	2012-04-22 20:32:40.000000000 -0400
+++ mailfilter-0.8.2/debian/patches/series	2012-07-05 00:24:45.000000000 -0400
@@ -1,3 +1,4 @@
 01_remove_workaround_fixed_FTBFS.patch
 02_fix_build_newer_g++.patch
 03_fix_invalid_conversion.patch
+timestamp_ignore.diff
diff -Nru mailfilter-0.8.2/debian/patches/timestamp_ignore.diff mailfilter-0.8.2/debian/patches/timestamp_ignore.diff
--- mailfilter-0.8.2/debian/patches/timestamp_ignore.diff	1969-12-31 19:00:00.000000000 -0500
+++ mailfilter-0.8.2/debian/patches/timestamp_ignore.diff	2012-07-05 00:27:19.000000000 -0400
@@ -0,0 +1,246 @@
+Description: Add -i option to ignore timestamps
+ mailfilter (0.8.2-3.1) unstable; urgency=low
+ .
+   * Non-maintainer upload.
+   * Cherry pick from upstream svn rev 20 to add option to ignore timestamps
+     (Closes: #661261)
+Author: Scott Kitterman <sc...@kitterman.com>
+Origin: upstream
+Bug: http://sourceforge.net/tracker/?func=detail&aid=2865702&group_id=14762&atid=114762
+Bug-Debian: http://bugs.debian.org/661261
+Forwarded: not-needed
+Last-Update: <2012-07-04>
+
+--- mailfilter-0.8.2.orig/ChangeLog
++++ mailfilter-0.8.2/ChangeLog
+@@ -1,6 +1,33 @@
+ Mailfilter ChangeLog
+ -=-=-=-=-=-=-=-=-=-=
+ 
++Sat Mar  3 17:40:14 EST 2012 baueran
++
++ Index: src/socket.cc
++ Index: src/header.cc
++
++  Ignore time stamps.
++
++ Index: src/preferences.cc
++ Index: src/preferences.hh
++
++  Add preferences to ignore time stamps.
++
++ Index: src/mailfilter.cc
++ Index: src/mailfilter.hh
++
++  Add Options.
++
++ Index: configure.ac
++
++  Change version number.
++
++ Index: man/mailfilterrc.5
++ Index: man/mailfilter.1
++ Index: man/mailfilterex.5
++
++  Update man pages.
++
+ Sun Jun  7 11:51:11 EST 2009 baueran
+ 
+ - src/header.hh: new custom exception, add_entry throws it
+--- mailfilter-0.8.2.orig/NEWS
++++ mailfilter-0.8.2/NEWS
+@@ -20,6 +20,9 @@ mailfilter 0.8.1 (Sat Sep 15 17:14:49 ES
+     checked; 0 is only returned if the *entire* mailfilter session
+     was successful (Thanks to Mike Clarke for pointing this out)
+ 
++  - Due to popular demand: Added option -i to ignore invalid
++    Message-ID time stamps.  (Using this option is a potential
++    security risk, so do not use unless you know better!)
+ 
+ mailfilter 0.8 (Mon Jan  1 16:09:52 CET 2007) [stable version]
+ 
+--- mailfilter-0.8.2.orig/configure.ac
++++ mailfilter-0.8.2/configure.ac
+@@ -26,13 +26,13 @@
+ # Process this file with autoconf to produce a configure script.
+ 
+ AC_PREREQ(2.54)
+-AC_INIT(mailfilter, 0.8.2, [mailfilter-...@lists.sourceforge.net])
++AC_INIT(mailfilter, 0.8.2, [baue...@gmail.com])
+ AC_REVISION($Revision: 1.1.2.4.2.12 $)
+ AC_SUBST(PACKAGE_COPYRIGHT)
+ AC_DEFINE(PACKAGE_COPYRIGHT,
+-	   "Copyright (c) 2000 - 2009  Andreas Bauer <baue...@gmail.com>", 
++	   "Copyright (c) 2000 - 2012  Andreas Bauer <baue...@gmail.com>", 
+     	   [Copyright information.])
+-AC_COPYRIGHT(Copyright (c) 2000 - 2009  Andreas Bauer <baue...@gmail.com>)
++AC_COPYRIGHT(Copyright (c) 2000 - 2012  Andreas Bauer <baue...@gmail.com>)
+ 
+ AC_CONFIG_SRCDIR([src/mailfilter.cc])
+ AC_CONFIG_HEADERS(config.h)
+--- mailfilter-0.8.2.orig/man/mailfilterrc.5
++++ mailfilter-0.8.2/man/mailfilterrc.5
+@@ -324,7 +324,7 @@ configuration files.
+ .BR mailfilterex (5),
+ .BR regex (7)
+ .SH COPYRIGHT
+-Copyright \(co 2000-2009 Andreas Bauer <baue...@gmail.com>
++Copyright \(co 2000-2012 Andreas Bauer <baue...@gmail.com>
+ .PP
+ This is free software; see the source for copying conditions.  There is NO
+ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+--- mailfilter-0.8.2.orig/man/mailfilter.1
++++ mailfilter-0.8.2/man/mailfilter.1
+@@ -58,6 +58,9 @@ Enable additional return values
+ \fB\-t\fR, \fB\-\-test\fR
+ Simulate deletes
+ .TP
++\fB\-i\fR, \fB\-\-ignore-time-stamps\fR
++Ignore invalid Message-ID time stamps (Do not use unless you know better!)
++.TP
+ \fB\-v\fR, \fB\-\-verbose\fR=\fILEVEL\fR
+ Specify level of verbosity
+ .TP
+@@ -69,7 +72,7 @@ Display version information
+ .BR procmail (1),
+ .BR regex (7)
+ .SH COPYRIGHT
+-Copyright \(co 2000-2009 Andreas Bauer <baue...@gmail.com>
++Copyright \(co 2000-2012 Andreas Bauer <baue...@gmail.com>
+ .PP
+ This is free software; see the source for copying conditions.  There is NO
+ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+--- mailfilter-0.8.2.orig/man/mailfilterex.5
++++ mailfilter-0.8.2/man/mailfilterex.5
+@@ -235,7 +235,7 @@ them.
+ .BR procmailex (5),
+ .BR regex (7)
+ .SH COPYRIGHT
+-Copyright \(co 2000-2009 Andreas Bauer <baue...@gmail.com>
++Copyright \(co 2000-2012 Andreas Bauer <baue...@gmail.com>
+ .PP
+ This is free software; see the source for copying conditions.  There is NO
+ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+--- mailfilter-0.8.2.orig/src/preferences.hh
++++ mailfilter-0.8.2/src/preferences.hh
+@@ -48,6 +48,7 @@ protected:
+   bool             show_headers;
+   bool             del_duplicates;
+   bool             ret_status;
++  bool             _ignore_time_stamp;
+   int              high_score;
+   unsigned         time_out_val;
+   int              max_size;
+@@ -122,6 +123,8 @@ public:
+   void             set_test_mode     (const char*);
+   int              maxlength         (void);
+   void             set_maxlength     (int);
++  bool             ignore_time_stamp ();
++  void             set_ignore_time_stamp (bool = true);
+   bool             return_status     (void);
+   void             set_return_status (bool);
+   vector<Account>* accounts          (void);
+--- mailfilter-0.8.2.orig/src/header.cc
++++ mailfilter-0.8.2/src/header.cc
+@@ -94,7 +94,8 @@ void Header :: add_entry (const char* ta
+ 
+   if (cmp_no_case (tag, "Message-Id") == 0)
+     {
+-      if (rfc822_valid_msgid (body) < 0)
++      if (!Preferences :: Instance ().ignore_time_stamp() 
++	  && rfc822_valid_msgid (body) < 0)
+ 	{
+ 	  Feedback* logger = Feedback :: Instance ();
+ 	  logger->print_err ("POP timestamp in message-ID invalid.");
+--- mailfilter-0.8.2.orig/src/mailfilter.cc
++++ mailfilter-0.8.2/src/mailfilter.cc
+@@ -1,5 +1,5 @@
+ // mailfilter.cc - source file for the mailfilter program
+-// Copyright (c) 2000 - 2009  Andreas Bauer <baue...@gmail.com>
++// Copyright (c) 2000 - 2012  Andreas Bauer <baue...@gmail.com>
+ //
+ // This program is free software; you can redistribute it and/or modify
+ // it under the terms of the GNU General Public License as published by
+@@ -53,6 +53,7 @@ static struct option long_options[] =
+     {"verbose", 1, NULL, VALUE_VERBOSE},
+     {"mailfilterrc", 1, NULL, VALUE_MAILFILTERRC},
+     {"logfile", 1, NULL, VALUE_LOGFILE},
++    {"ignore-time-stamps", 0, NULL, VALUE_TIMESTAMP},
+     {"version", 0, NULL, VALUE_VERSION},
+     {"test", 0, NULL, VALUE_TEST},
+     {"return-value", 0, NULL, VALUE_RETURN},
+@@ -219,7 +220,7 @@ void get_opts (int argc, char* argv[])
+   int option = 0;
+   int option_index = 0;
+ 
+-  while ((option = getopt_long (argc, argv, "hL:M:Vv:tr",
++  while ((option = getopt_long (argc, argv, "hL:M:Vv:tir",
+ 				long_options, &option_index)) != -1)
+     {
+       switch (option)
+@@ -247,6 +248,8 @@ void get_opts (int argc, char* argv[])
+ 	  cout << "Enable additional return values" << endl;
+ 	  cout << "  -t, --test                 ";
+ 	  cout << "Simulate deletes" << endl;
++	  cout << "  -i, --ignore-time-stamps   ";
++	  cout << "Ignore invalid Message-ID time stamps (Do not use unless you know better!)" << endl;
+ 	  cout << "  -v, --verbose=LEVEL        ";
+ 	  cout << "Specify level of verbosity" << endl;
+ 	  cout << "  -V, --version              ";
+@@ -280,6 +283,10 @@ void get_opts (int argc, char* argv[])
+ 	case VALUE_TEST:
+ 	  Preferences :: Instance ().set_test_mode ("yes");
+ 	  break;
++	case 'i':
++	case VALUE_TIMESTAMP:
++	  Preferences :: Instance().ignore_time_stamp();
++	  break;
+ 	case 'r':
+ 	case VALUE_RETURN:
+ 	  Preferences :: Instance ().set_return_status (true);
+--- mailfilter-0.8.2.orig/src/mailfilter.hh
++++ mailfilter-0.8.2/src/mailfilter.hh
+@@ -1,5 +1,5 @@
+ // mailfilter.hh - source file for the mailfilter program
+-// Copyright (c) 2000 - 2009  Andreas Bauer <baue...@gmail.com>
++// Copyright (c) 2000 - 2012  Andreas Bauer <baue...@gmail.com>
+ //
+ // This program is free software; you can redistribute it and/or modify
+ // it under the terms of the GNU General Public License as published by
+@@ -36,6 +36,7 @@ using namespace std;
+ #define VALUE_VERSION                   5
+ #define VALUE_TEST                      6
+ #define VALUE_RETURN                    7
++#define VALUE_TIMESTAMP                 8
+ 
+ #define ERROR_MSG(msg)  \
+   cerr << PACKAGE_NAME  \
+--- mailfilter-0.8.2.orig/src/preferences.cc
++++ mailfilter-0.8.2/src/preferences.cc
+@@ -58,6 +58,7 @@ Preferences :: Preferences ()
+   show_headers      = false;
+   del_duplicates    = false;
+   ret_status        = false;
++  _ignore_time_stamp= false;
+   high_score        = 100;
+   time_out_val      = 30;
+   negative_allows   = 0;
+@@ -92,7 +93,17 @@ void Preferences :: kill (void)
+   while (die_account != (Preferences :: accnts).end ())
+     { die_account->clear (); die_account++; }
+ }
+-  
++
++void Preferences :: set_ignore_time_stamp(bool new_ts)
++{
++  _ignore_time_stamp = new_ts;
++}
++
++bool Preferences :: ignore_time_stamp()
++{
++  return _ignore_time_stamp;
++}
++
+ // This function tries to locate a preferences file and, upon success,
+ // stores the file path in prefs_file.  However, no data is loaded by
+ // the open() function.

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to