Patches for bincimap v1.3.4

Stephen Welker <[email protected]> Wed, 15 Jun 2005 19:36:41 +1000
Newsgroups gmane.mail.imap.binc.devel
Message-ID <[email protected]>
The following patch were applied to a NetBSD 1.6.2/i386 environment, 
gcc 2.95.3

The result of applying all 3 patches results in a stable system when 
used with Apple Mail (Mac OS X v10.3.9 & v10.4.1) as well as 
Thunderbird v1.0.2 (Mac OS X 10.4.1) - attachments now decode properly 
under all situations I have encountered. It was necessary to force a 
"rebuild" (mailbox) in Apple Mail to flush its internal caches.

The following are released to the public domain, with credit being 
documented in Changelog (for the 1st & 2nd).

Patch #1 - fixes attachment (decode) corruption.

---- begin patch ----
--- mime-printdoc.cc.orig       Wed Feb  9 07:30:20 2005
+++ mime-printdoc.cc    Wed Jun 15 19:22:58 2005
@@ -58,7 +58,7 @@
    }

    mimeSource->reset();
-  mimeSource->seek(headerstartoffsetcrlf);
+  mimeSource->seek(headerstartoffsetcrlf + startoffset);

    char c;
    for (unsigned int i = 0; i < length; ++i) {
---- end patch ----

Patch #2 - resolves a compile problem under gcc 2.95.3 (NetBSD 
1.6.2/i386).

---- begin patch ----
--- maildir-writecache.cc.orig  Wed Jun 15 05:45:43 2005
+++ maildir-writecache.cc       Wed Jun 15 14:37:24 2005
@@ -30,6 +30,7 @@
  #include <dirent.h>
  #include <fcntl.h>
  #include <unistd.h>
+#include <errno.h>

  #include "maildir.h"

---- end patch ----

Patch #3 - author suggested patch - the complete details.

---- begin patch ----
--- bincimapd.cc.orig   Wed Jun 15 14:45:52 2005
+++ bincimapd.cc        Wed Jun 15 14:47:23 2005
@@ -23,6 +23,9 @@
   *  Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, 
USA.
   *  
--------------------------------------------------------------------
   */
+
+#include <sys/stat.h>
+
  #include "imapserver.h"

  namespace Binc {
@@ -33,6 +36,7 @@

  int main(int argc, char *argv[])
  {
+  umask(022);
    Binc::IMAPServer imapServer(argc, argv);
    int initResult = imapServer.initialize();
    if (initResult != 0)
---- end patch ----

I hope these help.

-- 
regards,
Stephen Welker,
Nemostar Pty Ltd.
http://www.nemostar.com.au/