[SCM] davmail packaging branch, master, updated. 02c2b101f323ee4dc652f941a0d9441a59cfa0da

Alexandre Rossi alexandre.rossi at gmail.com
Mon Oct 1 09:07:49 UTC 2012


The following commit has been merged in the master branch:
commit 2059fdf4ab6fe0a8a12ba721683bd159bb659ad2
Author: Alexandre Rossi <alexandre.rossi at gmail.com>
Date:   Mon Oct 1 10:36:29 2012 +0200

    re-add debian dir removed by git-import-orig

diff --git a/debian/ant.properties b/debian/ant.properties
new file mode 100644
index 0000000..163300d
--- /dev/null
+++ b/debian/ant.properties
@@ -0,0 +1,15 @@
+# Build flags
+windows-dist = false
+installdir   = /usr/share/java
+
+# Deps
+commons-codec      = /usr/share/java/commons-codec.jar
+servlet-api        = /usr/share/java/servlet-api.jar
+commons-httpclient = /usr/share/java/commons-httpclient.jar
+htmlcleaner        = /usr/share/java/htmlcleaner.jar
+gnumail            = /usr/share/java/gnumail.jar
+jcifs              = /usr/share/java/jcifs.jar
+jackrabbit-webdav  = /usr/share/java/jackrabbit-webdav.jar
+woodstox-core      = /usr/share/java/woodstox-core-lgpl.jar
+stax2-api          = /usr/share/java/stax2-api.jar
+swt                = /usr/share/java/swt.jar
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..bf11f07
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,5 @@
+davmail (3.9.9-1976-1~pre+1) unstable; urgency=low
+
+  * Initial release (Closes: #569668).
+
+ -- Alexandre Rossi <alexandre.rossi at gmail.com>  Thu, 26 May 2011 15:33:26 +0200
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..7f8f011
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+7
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..2c457c7
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,38 @@
+Source: davmail
+Section: net
+Priority: extra
+Maintainer: Alexandre Rossi <alexandre.rossi at gmail.com>
+Build-Depends: debhelper (>= 7.0.50~), default-jdk, ant, ant-optional,
+               javahelper (>=0.20),
+               libcommons-codec-java, libservlet2.4-java,
+               libcommons-httpclient-java, libhtmlcleaner-java,
+               libgnumail-java, libjcifs-java, libjackrabbit-java,
+               liblog4j1.2-java, libwoodstox-java, libstax2-api-java,
+			   libswt-gtk-3-java
+Standards-Version: 3.9.2
+Homepage: http://davmail.sourceforge.net/
+#Vcs-Git: git://git.debian.org/collab-maint/davmail-src-3.9.1.git
+#Vcs-Browser: http://git.debian.org/?p=collab-maint/davmail-src-3.9.1.git;a=summary
+
+Package: davmail
+Architecture: all
+Depends: lsb-base (>= 3.0-6), logrotate, adduser,
+         ${shlibs:Depends}, ${misc:Depends}, ${java:Depends}
+Suggests: libswt-gtk-3.6-java | libswt-gtk-3.5-java | libswt-gtk-3.4-java
+Description: POP/IMAP/SMTP/CalDav/LDAP to Microsoft Exchange gateway
+ Ever wanted to get rid of Outlook? DavMail is a POP/IMAP/SMTP/Caldav/LDAP
+ exchange gateway allowing users to use any mail/calendar client (e.g.
+ Thunderbird with Lightning or Apple iCal) with an Exchange server, even from
+ the internet or behind a firewall through Outlook Web Access. DavMail now
+ includes an LDAP gateway to Exchange global address book to allow recipient
+ address completion in mail compoze window and full calendar support with
+ attendees free/busy display.
+ .
+ The main goal of DavMail is to provide standard compliant protocols in front
+ of proprietary Exchange.  This means LDAP for address book, SMTP to send
+ messages, IMAP to browse messages on the server in any folder, POP to retrieve
+ inbox messages only and Caldav for calendar support. Thus any standard
+ compliant client can be used with Microsoft Exchange.
+ .
+ DavMail gateway is implemented in java and should run on any platform.
+ Releases are tested on Windows, Linux (Ubuntu) and Mac OSX.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..be9a401
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,189 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: Davmail
+Upstream-Contact: Mickaël Guessant <mguessan at free.fr>
+Source: http://davmail.sourceforge.net/download.html
+
+Files: *
+Copyright: 2009-2012, Mickael Guessant
+License: GPL-2+
+ 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 the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later
+ version.
+ .
+ This program is distributed in the hope that it will be
+ useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ PURPOSE.  See the GNU General Public License for more
+ details.
+ .
+ You should have received a copy of the GNU General Public
+ License along with this package; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ Boston, MA  02110-1301 USA
+ .
+ On Debian systems, the full text of the GNU General Public
+ License version 2 can be found in the file
+ `/usr/share/common-licenses/GPL-2'.
+
+Files: ./jsmooth-0.9.9-7-patch/skeletons/*
+Copyright: 2003-2007, Rodrigo Reyes <reyes at charabia.net>
+License: LGPL-2+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+ .
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ Library General Public License for more details.
+ .
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ .
+ On Debian systems, the full text of the GNU Library General Public
+ License version 2 can be found in the file
+ `/usr/share/common-licenses/LGPL-2'.
+
+Files: ./jsmooth-0.9.9-7-patch/src/net/*
+Copyright: 2003, Rodrigo Reyes <reyes at charabia.net>
+License: GPL-2+
+ 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 the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later
+ version.
+ .
+ This program is distributed in the hope that it will be
+ useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ PURPOSE.  See the GNU General Public License for more
+ details.
+ .
+ You should have received a copy of the GNU General Public
+ License along with this package; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ Boston, MA  02110-1301 USA
+ .
+ On Debian systems, the full text of the GNU General Public
+ License version 2 can be found in the file
+ `/usr/share/common-licenses/GPL-2'.
+
+Files: ./libgrowl/*
+Copyright: 2008, Michael Stringer
+License: BSD (3 clause)
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ 1. Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in the
+    documentation and/or other materials provided with the distribution.
+ 3. Neither the name of the University nor the names of its contributors
+    may be used to endorse or promote products derived from this software
+    without specific prior written permission.
+ .
+ THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
+
+Files: src/java/com/ctc/wstx/sr/StreamScanner.java
+Copyright: 2004 Tatu Saloranta <tatu.saloranta at iki.fi>
+License: GPL-2
+ 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 the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later
+ version.
+ .
+ This program is distributed in the hope that it will be
+ useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ PURPOSE.  See the GNU General Public License for more
+ details.
+ .
+ You should have received a copy of the GNU General Public
+ License along with this package; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ Boston, MA  02110-1301 USA
+ .
+ On Debian systems, the full text of the GNU General Public
+ License version 2 can be found in the file
+ `/usr/share/common-licenses/GPL-2'.
+
+Files: debian/*
+Copyright: 2012 Alexandre Rossi <alexandre.rossi at gmail.com>
+License: GPL-2+
+ 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 the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later
+ version.
+ .
+ This program is distributed in the hope that it will be
+ useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ PURPOSE.  See the GNU General Public License for more
+ details.
+ .
+ You should have received a copy of the GNU General Public
+ License along with this package; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ Boston, MA  02110-1301 USA
+ .
+ On Debian systems, the full text of the GNU General Public
+ License version 2 can be found in the file
+ `/usr/share/common-licenses/GPL-2'.
+
+Files: ./nsis/processwork.dll
+Files: ./lib/libgrowl-0.2.jar
+Files: ./lib/slf4j-log4j12-1.3.1.jar
+Files: ./lib/jdom-1.0.jar
+Files: ./lib/redline-1.1.9.jar
+Files: ./lib/xercesImpl-2.8.1.jar
+Files: ./lib/jcharset-1.3.jar
+Files: ./lib/activation-1.1.1.jar
+Files: ./lib/swt-3.7-gtk-linux-x86.jar
+Files: ./lib/htmlcleaner-2.1.jar
+Files: ./lib/jcifs-1.3.14.jar
+Files: ./lib/stax-api-1.0.1.jar
+Files: ./lib/commons-httpclient-3.1.jar
+Files: ./lib/log4j-1.2.16.jar
+Files: ./lib/stax2-api-3.1.1.jar
+Files: ./lib/junit-3.8.1.jar
+Files: ./lib/woodstox-core-asl-4.1.2.jar
+Files: ./lib/nsisant-1.2.jar
+Files: ./lib/slf4j-api-1.3.1.jar
+Files: ./lib/commons-logging-1.0.4.jar
+Files: ./lib/libgrowl.jnilib
+Files: ./lib/commons-codec-1.3.jar
+Files: ./lib/swt-3.7-win32-x86_64.jar
+Files: ./lib/mail-1.4.3.jar
+Files: ./lib/jsmoothgen-ant-0.9.9-7-mgu2.jar
+Files: ./lib/jarbundler-2.1.0.jar
+Files: ./lib/servlet-api.jar
+Files: ./lib/swt-3.7-win32-x86.jar
+Files: ./lib/winrun4j-0.4.4.jar
+Files: ./lib/commons-collections-3.1.jar
+Files: ./lib/swt-3.7-gtk-linux-x86_64.jar
+Files: ./lib/ant-deb-0.0.1.jar
+Files: ./lib/jackrabbit-webdav-1.4.jar
+Files: ./svnant/svnkit-javahl16-1.7.0-beta1.jar
+Files: ./svnant/sequence-library-1.0.0.jar
+Files: ./svnant/antlr-runtime-3.4.jar
+Files: ./svnant/svnkit-1.7.0-beta1.jar
+Files: ./svnant/sqljet-1.1.0-SNAPSHOT_r1190_v20120116_2007.jar
+Files: ./svnant/svnClientAdapter.jar
+Files: ./svnant/svnant.jar
diff --git a/debian/davmail.1 b/debian/davmail.1
new file mode 100644
index 0000000..07f726f
--- /dev/null
+++ b/debian/davmail.1
@@ -0,0 +1,45 @@
+.\"                                      Hey, EMACS: -*- nroff -*-
+.\" (C) Copyright 2012 Alexandre Rossi <alexandre.rossi at gmail.com>
+.\"
+.TH DAVMAIL 1 "September 2012"
+.\" Please adjust this date whenever revising the manpage.
+.\"
+.\" Some roff macros, for reference:
+.\" .nh        disable hyphenation
+.\" .hy        enable hyphenation
+.\" .ad l      left justify
+.\" .ad b      justify to both left and right margins
+.\" .nf        disable filling
+.\" .fi        enable filling
+.\" .br        insert line break
+.\" .sp <n>    insert n+1 empty lines
+.\" for manpage-specific macros, see man(7)
+.SH NAME
+davmail \- POP/IMAP/SMTP/Caldav/Carddav/LDAP Exchange Gateway
+.SH SYNOPSIS
+.B davmail
+.RI [ config-file-path ]
+.br
+.SH DESCRIPTION
+This manual page documents briefly the
+.B davmail
+command.
+.PP
+\fBdavmail\fP creates a gateway making the Microsoft Exchange mail, contacts
+and calendar protocol available in standard protocols such as POP, IMAP, CalDAV,
+SMTP and LDAP.
+.SH OPTIONS
+\fBdavmail\fP takes a single command line argument, the configuration file
+path. The configuration file syntax is described deeply on the \fBdavmail\fP
+website.
+.SH FILES
+.I /etc/davmail.conf
+.RS
+The system wide configuration file.
+.I /etc/default/davmail
+.RS
+System wide initscript behaviour handling.
+.SH SEE ALSO
+.BR http://davmail.sourceforge.net/serversetup.html
+.BR http://davmail.sourceforge.net/advanced.html
+.BR http://davmail.sourceforge.net/sslsetup.html
diff --git a/debian/davmail.conf b/debian/davmail.conf
new file mode 100644
index 0000000..6cbe280
--- /dev/null
+++ b/debian/davmail.conf
@@ -0,0 +1,51 @@
+davmail.url=https://owa.example.com/owa/
+davmail.enableEws=false
+davmail.ldapPort=1389
+davmail.caldavPort=1080
+davmail.smtpPort=1025
+davmail.popPort=1110
+davmail.imapPort=1143
+davmail.proxyPort=
+davmail.disableUpdateCheck=true
+davmail.bindAddress=127.0.0.1
+davmail.logFilePath=/var/log/davmail.log
+davmail.server=true
+davmail.server.certificate.hash=
+davmail.caldavPastDelay=90
+davmail.sentKeepDelay=90
+davmail.keepDelay=30
+davmail.allowRemote=false
+
+davmail.enableProxy=false
+davmail.proxyHost=
+davmail.proxyPassword=
+davmail.proxyUser=
+
+log4j.logger.davmail=WARN
+log4j.logger.httpclient.wire=WARN
+log4j.logger.org.apache.commons.httpclient=WARN
+log4j.rootLogger=WARN
+
+# SSL configuration. From http://davmail.sourceforge.net/sslsetup.html :
+#
+# SSL is not necessary when DavMail is used in workstation mode, as
+# communication between clients and DavMail remain local. However, in server
+# (shared) mode e.g. with a smartphone connecting to DavMail over the internet,
+# you should make sure encryption is enabled.
+#
+# The simplest way to secure communication between mail/calendar clients and
+# DavMail is to create a self signed certificate:
+#
+#   keytool -genkey -keyalg rsa -keysize 2048 -storepass password\
+#     -keystore davmail.p12 -storetype pkcs12 -validity 3650\
+#     -dname cn=davmailhostname.company.com,ou=davmail,o=sf,o=net
+#
+# Note to iPhone users: iOS does not support the default DSA algorithm, make
+# sure you use an RSA key pair.
+# Another note : do not use blank passwords, both keystore and key passwords
+# must be set.
+#
+#davmail.ssl.keystoreType=PKCS12
+#davmail.ssl.keyPass=password
+#davmail.ssl.keystoreFile=/etc/davmail.p12
+#davmail.ssl.keystorePass=password
diff --git a/debian/davmail.desktop b/debian/davmail.desktop
new file mode 100644
index 0000000..dd139f0
--- /dev/null
+++ b/debian/davmail.desktop
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Version=1.0
+Encoding=UTF-8
+Name=DavMail
+Type=Application
+Terminal=false
+Exec=/usr/bin/davmail
+Comment=DavMail Exchange Gateway
+Icon=/usr/share/icons/davmail.png
diff --git a/debian/davmail.menu b/debian/davmail.menu
new file mode 100644
index 0000000..93c1e82
--- /dev/null
+++ b/debian/davmail.menu
@@ -0,0 +1,3 @@
+?package(davmail):needs="X11" section="Applications/Network/Communication" \
+  title="DavMail Exchange Gateway" command="/usr/bin/davmail" \
+  icon="/usr/share/pixmaps/davmail.xpm"
diff --git a/debian/davmail.xpm b/debian/davmail.xpm
new file mode 100644
index 0000000..ffae546
--- /dev/null
+++ b/debian/davmail.xpm
@@ -0,0 +1,519 @@
+/* XPM */
+static char * davmail_xpm[] = {
+"32 32 484 2",
+"  	c None",
+". 	c #C95900",
+"+ 	c #D77F00",
+"@ 	c #E3A200",
+"# 	c #EABB00",
+"$ 	c #EEC900",
+"% 	c #EEC800",
+"& 	c #EAC200",
+"* 	c #DFA100",
+"= 	c #D88000",
+"- 	c #B34900",
+"; 	c #C16500",
+"> 	c #E3A100",
+", 	c #FBEF00",
+"' 	c #FFFF05",
+") 	c #FFFF17",
+"! 	c #FEFF21",
+"~ 	c #FEFF28",
+"{ 	c #FEFF24",
+"] 	c #FFFF19",
+"^ 	c #FFFF06",
+"/ 	c #FDF700",
+"( 	c #DEA200",
+"_ 	c #AF5D00",
+": 	c #CB5F00",
+"< 	c #E7B100",
+"[ 	c #FBF300",
+"} 	c #FFFF09",
+"| 	c #FEFA74",
+"1 	c #FDFDB7",
+"2 	c #FFFFCE",
+"3 	c #FFFFD8",
+"4 	c #FFFFE4",
+"5 	c #FFFFDF",
+"6 	c #FFFFDE",
+"7 	c #FFFFBA",
+"8 	c #FFFE7F",
+"9 	c #FFFF14",
+"0 	c #FBF400",
+"a 	c #E0B100",
+"b 	c #AB4A00",
+"c 	c #CF6D00",
+"d 	c #F0D500",
+"e 	c #FFFF0A",
+"f 	c #FEFE65",
+"g 	c #FEFEDF",
+"h 	c #FEFEE0",
+"i 	c #FDFDDB",
+"j 	c #E9DCD8",
+"k 	c #EEE5DC",
+"l 	c #ECE2DB",
+"m 	c #EBE2DA",
+"n 	c #EBE2DB",
+"o 	c #EEE6DB",
+"p 	c #EDE3E0",
+"q 	c #EEE5DE",
+"r 	c #FEFE73",
+"s 	c #FFFF0D",
+"t 	c #F3DE00",
+"u 	c #C66800",
+"v 	c #D47300",
+"w 	c #F7E700",
+"x 	c #FEFF19",
+"y 	c #FDFDAD",
+"z 	c #FEFED1",
+"A 	c #FEFECD",
+"B 	c #FEFFCD",
+"C 	c #ECE3CD",
+"D 	c #F8F3DA",
+"E 	c #FEFFDE",
+"F 	c #FEFEE2",
+"G 	c #FEFEDE",
+"H 	c #FEFEE1",
+"I 	c #FDFDDD",
+"J 	c #E9DED2",
+"K 	c #F8F6CD",
+"L 	c #FAF9D0",
+"M 	c #FEFEB2",
+"N 	c #FEFF27",
+"O 	c #F7E900",
+"P 	c #C36D00",
+"Q 	c #BE5D00",
+"R 	c #F8E700",
+"S 	c #FEFE22",
+"T 	c #FEFEC4",
+"U 	c #FEFEC5",
+"V 	c #FEFEC2",
+"W 	c #FDFCC6",
+"X 	c #E5D6C2",
+"Y 	c #FEFEDC",
+"Z 	c #FDFDDC",
+"` 	c #F6F2D7",
+" .	c #EEE5C3",
+"..	c #FFFFC4",
+"+.	c #FDFDC5",
+"@.	c #FEFEC9",
+"#.	c #FEFF2A",
+"$.	c #FAF100",
+"%.	c #B85B00",
+"&.	c #EFCA00",
+"*.	c #FEFF17",
+"=.	c #FDFDAB",
+"-.	c #FEFDBC",
+";.	c #FEFEB6",
+">.	c #FEFEBB",
+",.	c #F9F7BC",
+"'.	c #ECE1C7",
+").	c #FEFEDD",
+"!.	c #FEFED5",
+"~.	c #FDFEDD",
+"{.	c #FEFDDB",
+"].	c #E0CEBD",
+"^.	c #FCFBBA",
+"/.	c #FDFDBD",
+"(.	c #FEFEBC",
+"_.	c #FEFEB3",
+":.	c #FDFDB2",
+"<.	c #773700",
+"[.	c #D98300",
+"}.	c #FDFD00",
+"|.	c #FEFE8C",
+"1.	c #FDFEB2",
+"2.	c #FEFEB0",
+"3.	c #FEFEB1",
+"4.	c #F4EEB0",
+"5.	c #F3EBD0",
+"6.	c #E4D3C1",
+"7.	c #F3ECB0",
+"8.	c #FEFD9C",
+"9.	c #FEFE00",
+"0.	c #D28400",
+"a.	c #C65100",
+"b.	c #F6E300",
+"c.	c #FEFF4C",
+"d.	c #FEFEA5",
+"e.	c #FEFEA6",
+"f.	c #FFFFA8",
+"g.	c #E9DAAB",
+"h.	c #F9F5D8",
+"i.	c #F5EFD2",
+"j.	c #E9D9A9",
+"k.	c #FFFFA7",
+"l.	c #FEFFA6",
+"m.	c #FDFCA5",
+"n.	c #FDFDA7",
+"o.	c #FDFDA6",
+"p.	c #FEFEAA",
+"q.	c #FEFC5F",
+"r.	c #FEF500",
+"s.	c #A34000",
+"t.	c #DB8E00",
+"u.	c #FFFF08",
+"v.	c #FEFE92",
+"w.	c #FEFD99",
+"x.	c #FEFEA4",
+"y.	c #FEFD97",
+"z.	c #FEFEA1",
+"A.	c #FDFDA0",
+"B.	c #FFFF99",
+"C.	c #DCC3A4",
+"D.	c #FDFCDD",
+"E.	c #FFFFE0",
+"F.	c #DFCAB9",
+"G.	c #E8D8A1",
+"H.	c #ECDEA2",
+"I.	c #ECDDA1",
+"J.	c #F6F09B",
+"K.	c #FEFE9A",
+"L.	c #FEFD9A",
+"M.	c #FAF89E",
+"N.	c #FDFD8D",
+"O.	c #FFFF0E",
+"P.	c #C48700",
+"Q.	c #EFBE00",
+"R.	c #FEFE24",
+"S.	c #FDFB92",
+"T.	c #FEFC92",
+"U.	c #FEFC94",
+"V.	c #FEFC93",
+"W.	c #F5EE92",
+"X.	c #DEC8B9",
+"Y.	c #FEFFE3",
+"Z.	c #FEFEE3",
+"`.	c #F9F5DB",
+" +	c #F6F2DA",
+".+	c #F7F3DB",
+"++	c #E6D2C0",
+"@+	c #E5D291",
+"#+	c #FEFD94",
+"$+	c #FDFC92",
+"%+	c #FEFB92",
+"&+	c #FEFD2C",
+"*+	c #EACC00",
+"=+	c #FEFA50",
+"-+	c #FDFA8B",
+";+	c #FDFA89",
+">+	c #FEFC89",
+",+	c #E0C37C",
+"'+	c #ECE2D8",
+")+	c #F8F3DD",
+"!+	c #F8F3DC",
+"~+	c #FAF7DF",
+"{+	c #FEFEE5",
+"]+	c #FEFEEB",
+"^+	c #FEFDE4",
+"/+	c #FDFDEB",
+"(+	c #FAF7DD",
+"_+	c #D7B694",
+":+	c #FFFF84",
+"<+	c #FEFB5C",
+"[+	c #F8E200",
+"}+	c #733800",
+"|+	c #975200",
+"1+	c #FAE700",
+"2+	c #FFF46C",
+"3+	c #FEF885",
+"4+	c #FEF67C",
+"5+	c #FEF67E",
+"6+	c #FEF780",
+"7+	c #FFF77D",
+"8+	c #F4E67D",
+"9+	c #E6CE88",
+"0+	c #E7CF89",
+"a+	c #E6D08B",
+"b+	c #E1C5B0",
+"c+	c #FFFFEE",
+"d+	c #FDFEEB",
+"e+	c #FFFFF6",
+"f+	c #E3CCB3",
+"g+	c #F5E57C",
+"h+	c #FEF985",
+"i+	c #FEF67D",
+"j+	c #FEFD7B",
+"k+	c #FBEB00",
+"l+	c #9C5300",
+"m+	c #CC7000",
+"n+	c #FFF262",
+"o+	c #FEF57A",
+"p+	c #FEF372",
+"q+	c #FEF473",
+"r+	c #FFF67A",
+"s+	c #FFF778",
+"t+	c #FFFA78",
+"u+	c #E8CD7D",
+"v+	c #F5EAE4",
+"w+	c #FEFDF7",
+"x+	c #FEFDF6",
+"y+	c #F2E8DB",
+"z+	c #DAB571",
+"A+	c #FAEE7A",
+"B+	c #FEF57B",
+"C+	c #FEF26D",
+"D+	c #FCE900",
+"E+	c #B56400",
+"F+	c #CD7300",
+"G+	c #FAE800",
+"H+	c #FEE508",
+"I+	c #FDEB57",
+"J+	c #FDF271",
+"K+	c #FEF16E",
+"L+	c #FDF16E",
+"M+	c #FDF473",
+"N+	c #FEF16D",
+"O+	c #FCEE6D",
+"P+	c #D6AE97",
+"Q+	c #FEFEFA",
+"R+	c #FDFDFC",
+"S+	c #FEFDFC",
+"T+	c #FAF8F5",
+"U+	c #D8B185",
+"V+	c #FFF76D",
+"W+	c #FFF76E",
+"X+	c #FDF170",
+"Y+	c #FFF260",
+"Z+	c #F8E609",
+"`+	c #FCEA00",
+" @	c #B96500",
+".@	c #C96D00",
+"+@	c #FDDC00",
+"@@	c #FDE300",
+"#@	c #FEE200",
+"$@	c #FEEA40",
+"%@	c #FDEC5F",
+"&@	c #FEF065",
+"*@	c #FDED64",
+"=@	c #FEED63",
+"-@	c #FEF069",
+";@	c #D9AA61",
+">@	c #F6EFEC",
+",@	c #FEFEFD",
+"'@	c #F6EDE7",
+")@	c #D7AC88",
+"!@	c #D8AE89",
+"~@	c #D19E6E",
+"{@	c #FFF264",
+"]@	c #FDEC64",
+"^@	c #FDED62",
+"/@	c #FEEF64",
+"(@	c #FEEE61",
+"_@	c #FEE100",
+":@	c #FDE200",
+"<@	c #B86300",
+"[@	c #984F00",
+"}@	c #FBDB00",
+"|@	c #FEDB00",
+"1@	c #FEE30B",
+"2@	c #FDE53D",
+"3@	c #FDEB5E",
+"4@	c #FEEB5C",
+"5@	c #FDEB5C",
+"6@	c #F7DD56",
+"7@	c #E2C2A7",
+"8@	c #FFFFFF",
+"9@	c #F9F3F0",
+"0@	c #DCAE69",
+"a@	c #FFED5A",
+"b@	c #FDE656",
+"c@	c #FDEA60",
+"d@	c #FEE840",
+"e@	c #FDDE0D",
+"f@	c #FDDB00",
+"g@	c #FEE400",
+"h@	c #FEDC00",
+"i@	c #FCD800",
+"j@	c #9D5400",
+"k@	c #F7C900",
+"l@	c #FDD900",
+"m@	c #FEDA00",
+"n@	c #FED900",
+"o@	c #FEDB0B",
+"p@	c #FEE134",
+"q@	c #FEE543",
+"r@	c #EEC84F",
+"s@	c #E7C3A3",
+"t@	c #EACEB4",
+"u@	c #F9F3EE",
+"v@	c #DCAD7E",
+"w@	c #F9DD4B",
+"x@	c #FDE446",
+"y@	c #FEE73B",
+"z@	c #FEDB0A",
+"A@	c #FACF00",
+"B@	c #763A00",
+"C@	c #EBB300",
+"D@	c #FED400",
+"E@	c #FED500",
+"F@	c #FED300",
+"G@	c #FDD503",
+"H@	c #FDD40A",
+"I@	c #F7CA0A",
+"J@	c #E3A720",
+"K@	c #F3E3D9",
+"L@	c #D59C7D",
+"M@	c #EEB80B",
+"N@	c #FED60A",
+"O@	c #FED503",
+"P@	c #FDD500",
+"Q@	c #F1B900",
+"R@	c #D58500",
+"S@	c #FFD800",
+"T@	c #FDD200",
+"U@	c #FED200",
+"V@	c #FFD500",
+"W@	c #D78F1C",
+"X@	c #F9F1ED",
+"Y@	c #FEFFFE",
+"Z@	c #EFD9C7",
+"`@	c #DD9404",
+" #	c #FFD700",
+".#	c #CC8000",
+"+#	c #BA5200",
+"@#	c #FCC800",
+"##	c #FECC00",
+"$#	c #FECD00",
+"%#	c #FDCD00",
+"&#	c #FFCE00",
+"*#	c #D18342",
+"=#	c #FEFEFE",
+"-#	c #FBFCFF",
+";#	c #D2770F",
+">#	c #FDCC00",
+",#	c #FECB00",
+"'#	c #FFD000",
+")#	c #AB4900",
+"!#	c #4E1F00",
+"~#	c #DE8201",
+"{#	c #FECA00",
+"]#	c #FDCA00",
+"^#	c #FEC400",
+"/#	c #FEC900",
+"(#	c #FEC800",
+"_#	c #EFAC00",
+":#	c #E5B28F",
+"<#	c #FEFFFF",
+"[#	c #FDFCFA",
+"}#	c #D88841",
+"|#	c #F7BD00",
+"1#	c #DA8300",
+"2#	c #572200",
+"3#	c #F2B200",
+"4#	c #FEC300",
+"5#	c #FEC200",
+"6#	c #E18100",
+"7#	c #FAEFE6",
+"8#	c #EDC59D",
+"9#	c #F1A300",
+"0#	c #FEC600",
+"a#	c #FDC400",
+"b#	c #F5B600",
+"c#	c #723500",
+"d#	c #B75C01",
+"e#	c #FEBA00",
+"f#	c #FEB900",
+"g#	c #FEC000",
+"h#	c #FEBF00",
+"i#	c #E3871B",
+"j#	c #F8E5D6",
+"k#	c #E37F00",
+"l#	c #FFBC00",
+"m#	c #FEBC00",
+"n#	c #FEC100",
+"o#	c #FDBB00",
+"p#	c #B35D00",
+"q#	c #C46800",
+"r#	c #FDB400",
+"s#	c #FEB600",
+"t#	c #FEBB00",
+"u#	c #FAB100",
+"v#	c #ECB272",
+"w#	c #FDFAF8",
+"x#	c #E18925",
+"y#	c #D26F00",
+"z#	c #2C1100",
+"A#	c #C66600",
+"B#	c #FBAF00",
+"C#	c #FEB400",
+"D#	c #FDB300",
+"E#	c #F6A300",
+"F#	c #F6DBC2",
+"G#	c #EAAA6A",
+"H#	c #FAAB00",
+"I#	c #FEB300",
+"J#	c #FEB500",
+"K#	c #FBAE00",
+"L#	c #C46C00",
+"M#	c #371600",
+"N#	c #9A4C00",
+"O#	c #F19600",
+"P#	c #FFB200",
+"Q#	c #FFAF00",
+"R#	c #EC9715",
+"S#	c #E8AC7B",
+"T#	c #ED8F00",
+"U#	c #FEAD00",
+"V#	c #FEAF00",
+"W#	c #F19B00",
+"X#	c #A54F00",
+"Y#	c #1F0B00",
+"Z#	c #823200",
+"`#	c #BE6700",
+" $	c #F39B00",
+".$	c #ED8D01",
+"+$	c #E58400",
+"@$	c #FEAC00",
+"#$	c #FDAB00",
+"$$	c #FCA800",
+"%$	c #F29A00",
+"&$	c #BC6200",
+"*$	c #6D2A00",
+"=$	c #592800",
+"-$	c #A14E00",
+";$	c #D37000",
+">$	c #EC8900",
+",$	c #F39500",
+"'$	c #F99E00",
+")$	c #F89D00",
+"!$	c #F29400",
+"~$	c #ED8A00",
+"{$	c #D27000",
+"]$	c #A24F00",
+"^$	c #5E2800",
+"/$	c #562200",
+"($	c #773100",
+"_$	c #823400",
+"                                                                ",
+"                    . + @ # $ % & * = -                         ",
+"                ; > , ' ) ! ~ ~ { ] ^ / ( _                     ",
+"            : < [ } | 1 2 3 4 5 6 2 7 8 9 0 a b                 ",
+"          c d e f g h i j k k l m n o p q r s t u               ",
+"        v w x y z A B C D E F G H F I J K L M N O P             ",
+"      Q R S T U T V W X 6 I Y I Z Y `  ...V +. at .#.$.%.          ",
+"      &.*.=.-.;.;.>.,.'.6 ).I !.~.{.].^./.>.(._.:.x d <.        ",
+"    [.}.|.1.2.2.2.3.4.5.).).Y I ).6.7.2.2.2.3.2.3.8.9.0.        ",
+"  a.b.c.=.d.e.e.e.f.g.h.Z Y ).).i.j.k.l.m.m.n.e.o.p.q.r.s.      ",
+"  t.u.v.w.x.y.z.A.B.C.D.).F ).E.F.G.H.I.J.K.L.M.K.K.N.O.P.      ",
+"  Q.R.S.T.U.T.U.V.W.X.Y.F F Z.Z.`. +.+++ at +#+$+U.$+V.%+&+*+      ",
+"  b.=+-+;+;+;+;+>+,+'+)+!+~+{+]+^+/+(+_+:+;+;+;+;+;+-+<+[+}+    ",
+"|+1+2+3+4+3+5+6+7+8+9+0+a+b+c+]+d+e+f+g+h+i+7+i+i+i+i+j+k+l+    ",
+"m+k+n+o+o+p+o+q+o+r+s+t+u+v+w+x+x+y+z+r+p+r+A+o+o+o+B+C+D+E+    ",
+"F+G+H+I+J+K+L+M+L+L+N+O+P+Q+R+S+T+U+V+W+L+L+K+L+L+X+Y+Z+`+ @    ",
+". at +@@@#@$@%@&@*@=@=@-@;@>@,@,@,@'@)@!@~@{@]@^@/@(@$@@@_@:@<@    ",
+"[@}@|@#@|@1 at 2@3 at 4@5 at 6@7 at 8@,@,@, at S+S+9@0 at a@b at c@d at e@f at g@h at i@j@    ",
+"  k at l@m at m@m at n@o at p@q at r@s at t@u@,@,@, at 8@v at w@x at y@z at m@|@n at m@|@A at B@    ",
+"  C at D@E at E@E at D@E at F@G at H@I at J@K@,@, at 8@L at M@N at O@F at E@E at E@D at E@P at Q@      ",
+"  R at S@T at U@U at F@U at U@U at U@V at W@X at R+Y@Z@`@ #T at F@F at U@U at F@U at T@S at .#      ",
+"  +#@#######$#######%#&#*#=#, at -#;#@#>#,#$#$#,#,#$#,#,#'#)#      ",
+"  !#~#{#]#{#^#^#/#(#,#_#:#<#[#}#|#,#^#,#^#^#/#/#^#]#,#1#2#      ",
+"      3#^#4#^#^#5#5#4#6#7#8 at 8#9#0#a#^#^#^#^#4#4#^#^#b#c#        ",
+"      d#e#4#f#g#g#f#h#i#8 at j#k#l#m#m#m#m#e#f#n#g#m#o#p#          ",
+"        q#r#o#s#t#s#u#v#w#x#f#e#s#t#t#t#s#s#s#o#r#y#z#          ",
+"          A#B#C#D#C#E#F#G#H#D#I#C#I#I#I#J#r#f#K#L#M#            ",
+"            N#O#P#Q#R#S#T#U#V#V#U#U#U#I#U#P#W#X#Y#              ",
+"              Z#`# $.$+$Q#@$@$#$#$U#@$$$%$&$*$                  ",
+"                  =$-$;$>$,$'$)$!$~${$]$^$                      ",
+"                      Y#/$($_$_$($/$Y#                          ",
+"                                                                "};
diff --git a/debian/default b/debian/default
new file mode 100644
index 0000000..dbfda55
--- /dev/null
+++ b/debian/default
@@ -0,0 +1,4 @@
+# Defaults for davmail initscript
+
+# Whether to run the daemon using the supplied initscript
+ENABLE_DAEMON="false"
diff --git a/debian/gbp.conf b/debian/gbp.conf
new file mode 100644
index 0000000..65ce0be
--- /dev/null
+++ b/debian/gbp.conf
@@ -0,0 +1,2 @@
+[git-import-orig]
+filter = [ 'lib', 'libgrowl', 'nsis', 'svnant', ]
diff --git a/debian/init b/debian/init
new file mode 100755
index 0000000..d0248dd
--- /dev/null
+++ b/debian/init
@@ -0,0 +1,162 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides:          davmail
+# Required-Start:    $local_fs $remote_fs
+# Required-Stop:     $local_fs $remote_fs
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Launch Davmail Exchange gateway
+# Description:       Prepare environement and launch the Davmail Exchange
+#                    gateway daemon.
+### END INIT INFO
+
+# Author: Alexandre Rossi <alexandre.rossi at gmail.com>
+
+# Do NOT "set -e"
+
+# PATH should only include /usr/* if it runs after the mountnfs.sh script
+PATH=/sbin:/usr/sbin:/bin:/usr/bin
+DESC="Davmail Exchange gateway"
+NAME=davmail
+DAEMON=/usr/bin/$NAME
+DAEMON_USER=$NAME
+HOME=/var/lib/$DAEMON_USER
+PIDFILE=/var/run/$NAME.pid
+LOGFILE=/var/log/$NAME.log
+SCRIPTNAME=/etc/init.d/$NAME
+
+
+# Exit if the package is not installed
+[ -x "$DAEMON" ] || exit 0
+
+# Read configuration variable file if it is present
+[ -r /etc/default/$NAME ] && . /etc/default/$NAME
+
+# Exit if daemon run by initscript is disabled
+[ "$ENABLE_DAEMON" = "true" ] || exit 0
+
+DAEMON_ARGS="/etc/davmail.conf"
+
+# Create logfiles if they do not exist
+if [ ! -r "$LOGFILE" ]
+then
+    touch $LOGFILE
+    chown $NAME:adm $LOGFILE
+fi
+
+# Load the VERBOSE setting and other rcS variables
+. /lib/init/vars.sh
+
+# Define LSB log_* functions.
+# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
+. /lib/lsb/init-functions
+
+do_start()
+{
+    # Return
+    #   0 if daemon has been started
+    #   2 if daemon could not be started
+    $ENABLE_DAEMON
+    is_alive && return 0
+    start-stop-daemon --start --pidfile $PIDFILE --chuid $DAEMON_USER\
+        --background --make-pidfile\
+        --exec $DAEMON -- $DAEMON_ARGS \
+        || return 2
+}
+
+do_stop()
+{
+    # Return
+    #   0 if daemon has been stopped
+    #   1 if daemon was already stopped
+    #   2 if daemon could not be stopped
+    #   other if a failure occurred
+    start-stop-daemon --user $DAEMON_USER --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
+    RETVAL="$?"
+    [ "$RETVAL" = 2 ] && return 2
+    start-stop-daemon --user $DAEMON_USER --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
+    [ "$?" = 2 ] && return 2
+    rm -f $PIDFILE
+    return "$RETVAL"
+}
+
+do_reload() {
+    #
+    # If the daemon can reload its configuration without
+    # restarting (for example, when it is sent a SIGHUP),
+    # then implement that here.
+    #
+    start-stop-daemon --user $DAEMON_USER --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
+    return 0
+}
+
+is_alive () {
+    ret=1
+    if [ -r $PIDFILE ] ; then
+        pid=`cat $PIDFILE`
+        if [ -e /proc/$pid ] ; then
+            procname=`/bin/ps h -p $pid -C $NAME`
+            [ -n "$procname" ] && ret=0
+        fi
+    fi
+    return $ret
+}
+
+
+case "$1" in
+    start)
+        [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
+        do_start
+        case "$?" in
+            0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+            2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
+        esac
+        ;;
+    stop)
+        [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
+        do_stop
+        case "$?" in
+            0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+            2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
+        esac
+        ;;
+    reload|force-reload)
+        log_daemon_msg "Reloading $DESC" "$NAME"
+        do_reload
+        log_end_msg $?
+        ;;
+    restart)
+        log_daemon_msg "Restarting $DESC" "$NAME"
+        do_stop
+        case "$?" in
+            0|1)
+            do_start
+            case "$?" in
+                0) log_end_msg 0 ;;
+                1) log_end_msg 1 ;; # Old process is still running
+                *) log_end_msg 1 ;; # Failed to start
+            esac
+            ;;
+        *)
+            # Failed to stop
+            log_end_msg 1
+            ;;
+        esac
+        ;;
+    status)
+        echo -n "Status of $DESC: "
+        if is_alive ; then
+            echo "alive."
+        else
+            echo "dead."
+            exit 1
+        fi
+        ;;
+    *)
+        echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload|status}" >&2
+        exit 3
+        ;;
+esac
+
+:
+# vim: ts=4 sw=4 expandtab
diff --git a/debian/install b/debian/install
new file mode 100644
index 0000000..55d6ef5
--- /dev/null
+++ b/debian/install
@@ -0,0 +1,4 @@
+debian/davmail.conf /etc
+debian/davmail.xpm /usr/share/pixmaps
+dist/davmail.png /usr/share/icons
+debian/davmail.desktop /usr/share/applications
diff --git a/debian/jlibs b/debian/jlibs
new file mode 100644
index 0000000..bde75da
--- /dev/null
+++ b/debian/jlibs
@@ -0,0 +1 @@
+dist/davmail.jar
diff --git a/debian/links b/debian/links
new file mode 100644
index 0000000..ba120b0
--- /dev/null
+++ b/debian/links
@@ -0,0 +1 @@
+usr/share/java/davmail.jar usr/bin/davmail
diff --git a/debian/logrotate b/debian/logrotate
new file mode 100644
index 0000000..2ae1891
--- /dev/null
+++ b/debian/logrotate
@@ -0,0 +1,14 @@
+/var/log/davmail.log /var/log/davmail.*.log {
+    rotate 4
+    weekly
+    compress
+    copytruncate
+    missingok
+    notifempty
+    sharedscripts
+    postrotate
+        if invoke-rc.d --quiet davmail status > /dev/null; then
+            invoke-rc.d --quiet davmail reload > /dev/null
+        fi
+    endscript
+}
diff --git a/debian/manifest b/debian/manifest
new file mode 100644
index 0000000..b6f54d9
--- /dev/null
+++ b/debian/manifest
@@ -0,0 +1,3 @@
+usr/share/java/davmail.jar:
+    Class-Path: /usr/share/java/commons-codec.jar /usr/share/java/servlet-api.jar /usr/share/java/commons-httpclient.jar /usr/share/java/htmlcleaner.jar /usr/share/java/gnumail.jar /usr/share/java/jcifs.jar /usr/share/java/jackrabbit-webdav.jar /usr/share/java/woodstox-core-lgpl.jar /usr/share/java/stax2-api.jar /usr/share/java/swt.jar /usr/share/java/log4j-1.2.jar /usr/share/java/slf4j-simple.jar /usr/share/java/slf4j-api.jar
+    Main-Class: davmail.DavGateway
diff --git a/debian/manpages b/debian/manpages
new file mode 100644
index 0000000..10ecf14
--- /dev/null
+++ b/debian/manpages
@@ -0,0 +1 @@
+debian/davmail.1
diff --git a/debian/patches/base64-enc-dec b/debian/patches/base64-enc-dec
new file mode 100644
index 0000000..5fbebbc
--- /dev/null
+++ b/debian/patches/base64-enc-dec
@@ -0,0 +1,474 @@
+Description: Add BASE64MailboxDecoder and BASE64MailboxEncoder
+
+Those are missing in libgnumail-java and needed to build davmail. The
+alternative would be to depend on javamail which is now DFSG-free
+(RFP #596469, http://bugs.debian.org/596469 )
+
+Origin: javamail source code, http://kenai.com/projects/javamail/downloads
+Forwarded: not-needed
+Author: Alexandre Rossi <alexandre.rossi at gmail.com>
+
+Index: davmail-src-3.9.9-1976/src/java/com/sun/mail/imap/protocol/BASE64MailboxDecoder.java
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ davmail-src-3.9.9-1976/src/java/com/sun/mail/imap/protocol/BASE64MailboxDecoder.java	2012-08-24 15:31:07.946121347 +0200
+@@ -0,0 +1,194 @@
++/*
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
++ *
++ * Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved.
++ *
++ * The contents of this file are subject to the terms of either the GNU
++ * General Public License Version 2 only ("GPL") or the Common Development
++ * and Distribution License("CDDL") (collectively, the "License").  You
++ * may not use this file except in compliance with the License.  You can
++ * obtain a copy of the License at
++ * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
++ * or packager/legal/LICENSE.txt.  See the License for the specific
++ * language governing permissions and limitations under the License.
++ *
++ * When distributing the software, include this License Header Notice in each
++ * file and include the License file at packager/legal/LICENSE.txt.
++ *
++ * GPL Classpath Exception:
++ * Oracle designates this particular file as subject to the "Classpath"
++ * exception as provided by Oracle in the GPL Version 2 section of the License
++ * file that accompanied this code.
++ *
++ * Modifications:
++ * If applicable, add the following below the License Header, with the fields
++ * enclosed by brackets [] replaced by your own identifying information:
++ * "Portions Copyright [year] [name of copyright owner]"
++ *
++ * Contributor(s):
++ * If you wish your version of this file to be governed by only the CDDL or
++ * only the GPL Version 2, indicate your decision by adding "[Contributor]
++ * elects to include this software in this distribution under the [CDDL or GPL
++ * Version 2] license."  If you don't indicate a single choice of license, a
++ * recipient has the option to distribute your version of this file under
++ * either the CDDL, the GPL Version 2 or to extend the choice of license to
++ * its licensees as provided above.  However, if you add GPL Version 2 code
++ * and therefore, elected the GPL Version 2 license, then the option applies
++ * only if the new code is made subject to such option by the copyright
++ * holder.
++ */
++
++package com.sun.mail.imap.protocol;
++
++import java.text.StringCharacterIterator;
++import java.text.CharacterIterator;
++
++/**
++ * See the BASE64MailboxEncoder for a description of the RFC2060 and how
++ * mailbox names should be encoded.  This class will do the correct decoding
++ * for mailbox names.
++ *
++ * @author	Christopher Cotton
++ */
++
++public class BASE64MailboxDecoder {
++
++    public static String decode(String original) {
++	if (original == null || original.length() == 0)
++	    return original;
++
++	boolean changedString = false;
++	int copyTo = 0;
++	// it will always be less than the original
++	char[] chars = new char[original.length()];
++	StringCharacterIterator iter = new StringCharacterIterator(original);
++
++	for(char c = iter.first(); c != CharacterIterator.DONE;
++	    c = iter.next()) {
++
++	    if (c == '&') {
++		changedString = true;
++		copyTo = base64decode(chars, copyTo, iter);
++	    } else {
++		chars[copyTo++] = c;
++	    }
++	}
++
++	// now create our string from the char array
++	if (changedString) {
++	    return new String(chars, 0, copyTo);
++	} else {
++	    return original;
++	}
++    }
++
++
++    protected static int base64decode(char[] buffer, int offset,
++				      CharacterIterator iter) {
++	boolean firsttime = true;
++	int leftover = -1;
++
++	while(true) {
++	    // get the first byte
++	    byte orig_0 = (byte) iter.next();
++	    if (orig_0 == -1) break; // no more chars
++	    if (orig_0 == '-') {
++		if (firsttime) {
++		    // means we got the string "&-" which is turned into a "&"
++		    buffer[offset++] = '&';
++		}
++		// we are done now
++		break;
++	    }
++	    firsttime = false;
++
++	    // next byte
++	    byte orig_1 = (byte) iter.next();
++	    if (orig_1 == -1 || orig_1 == '-')
++		break; // no more chars, invalid base64
++
++	    byte a, b, current;
++	    a = pem_convert_array[orig_0 & 0xff];
++	    b = pem_convert_array[orig_1 & 0xff];
++	    // The first decoded byte
++	    current = (byte)(((a << 2) & 0xfc) | ((b >>> 4) & 3));
++
++	    // use the leftover to create a Unicode Character (2 bytes)
++	    if (leftover != -1) {
++		buffer[offset++] = (char)(leftover << 8 | (current & 0xff));
++		leftover = -1;
++	    } else {
++		leftover = current & 0xff;
++	    }
++
++	    byte orig_2 = (byte) iter.next();
++	    if (orig_2 == '=') { // End of this BASE64 encoding
++		continue;
++	    } else if (orig_2 == -1 || orig_2 == '-') {
++	    	break; // no more chars
++	    }
++
++	    // second decoded byte
++	    a = b;
++	    b = pem_convert_array[orig_2 & 0xff];
++	    current = (byte)(((a << 4) & 0xf0) | ((b >>> 2) & 0xf));
++
++	    // use the leftover to create a Unicode Character (2 bytes)
++	    if (leftover != -1) {
++		buffer[offset++] = (char)(leftover << 8 | (current & 0xff));
++		leftover = -1;
++	    } else {
++		leftover = current & 0xff;
++	    }
++
++	    byte orig_3 = (byte) iter.next();
++	    if (orig_3 == '=') { // End of this BASE64 encoding
++		continue;
++	    } else if (orig_3 == -1 || orig_3 == '-') {
++	    	break;  // no more chars
++	    }
++
++	    // The third decoded byte
++	    a = b;
++	    b = pem_convert_array[orig_3 & 0xff];
++	    current = (byte)(((a << 6) & 0xc0) | (b & 0x3f));
++
++	    // use the leftover to create a Unicode Character (2 bytes)
++	    if (leftover != -1) {
++		buffer[offset++] = (char)(leftover << 8 | (current & 0xff));
++		leftover = -1;
++	    } else {
++		leftover = current & 0xff;
++	    }
++	}
++
++	return offset;
++    }
++
++    /**
++     * This character array provides the character to value map
++     * based on RFC1521, but with the modification from RFC2060
++     * which changes the '/' to a ','.
++     */
++
++    // shared with BASE64MailboxEncoder
++    static final char pem_array[] = {
++	'A','B','C','D','E','F','G','H', // 0
++	'I','J','K','L','M','N','O','P', // 1
++	'Q','R','S','T','U','V','W','X', // 2
++	'Y','Z','a','b','c','d','e','f', // 3
++	'g','h','i','j','k','l','m','n', // 4
++	'o','p','q','r','s','t','u','v', // 5
++	'w','x','y','z','0','1','2','3', // 6
++	'4','5','6','7','8','9','+',','  // 7
++    };
++
++    private static final byte pem_convert_array[] = new byte[256];
++
++    static {
++	for (int i = 0; i < 255; i++)
++	    pem_convert_array[i] = -1;
++	for(int i = 0; i < pem_array.length; i++)
++	    pem_convert_array[pem_array[i]] = (byte) i;
++    }
++}
+Index: davmail-src-3.9.9-1976/src/java/com/sun/mail/imap/protocol/BASE64MailboxEncoder.java
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ davmail-src-3.9.9-1976/src/java/com/sun/mail/imap/protocol/BASE64MailboxEncoder.java	2012-08-24 15:31:08.017876275 +0200
+@@ -0,0 +1,260 @@
++/*
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
++ *
++ * Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved.
++ *
++ * The contents of this file are subject to the terms of either the GNU
++ * General Public License Version 2 only ("GPL") or the Common Development
++ * and Distribution License("CDDL") (collectively, the "License").  You
++ * may not use this file except in compliance with the License.  You can
++ * obtain a copy of the License at
++ * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
++ * or packager/legal/LICENSE.txt.  See the License for the specific
++ * language governing permissions and limitations under the License.
++ *
++ * When distributing the software, include this License Header Notice in each
++ * file and include the License file at packager/legal/LICENSE.txt.
++ *
++ * GPL Classpath Exception:
++ * Oracle designates this particular file as subject to the "Classpath"
++ * exception as provided by Oracle in the GPL Version 2 section of the License
++ * file that accompanied this code.
++ *
++ * Modifications:
++ * If applicable, add the following below the License Header, with the fields
++ * enclosed by brackets [] replaced by your own identifying information:
++ * "Portions Copyright [year] [name of copyright owner]"
++ *
++ * Contributor(s):
++ * If you wish your version of this file to be governed by only the CDDL or
++ * only the GPL Version 2, indicate your decision by adding "[Contributor]
++ * elects to include this software in this distribution under the [CDDL or GPL
++ * Version 2] license."  If you don't indicate a single choice of license, a
++ * recipient has the option to distribute your version of this file under
++ * either the CDDL, the GPL Version 2 or to extend the choice of license to
++ * its licensees as provided above.  However, if you add GPL Version 2 code
++ * and therefore, elected the GPL Version 2 license, then the option applies
++ * only if the new code is made subject to such option by the copyright
++ * holder.
++ */
++
++package com.sun.mail.imap.protocol;
++
++import java.io.*;
++
++
++/**
++ *
++ *
++  from RFC2060
++
++5.1.3.  Mailbox International Naming Convention
++
++   By convention, international mailbox names are specified using a
++   modified version of the UTF-7 encoding described in [UTF-7].  The
++   purpose of these modifications is to correct the following problems
++   with UTF-7:
++
++      1) UTF-7 uses the "+" character for shifting; this conflicts with
++         the common use of "+" in mailbox names, in particular USENET
++         newsgroup names.
++
++      2) UTF-7's encoding is BASE64 which uses the "/" character; this
++         conflicts with the use of "/" as a popular hierarchy delimiter.
++
++      3) UTF-7 prohibits the unencoded usage of "\"; this conflicts with
++         the use of "\" as a popular hierarchy delimiter.
++
++      4) UTF-7 prohibits the unencoded usage of "~"; this conflicts with
++         the use of "~" in some servers as a home directory indicator.
++
++      5) UTF-7 permits multiple alternate forms to represent the same
++         string; in particular, printable US-ASCII chararacters can be
++         represented in encoded form.
++
++   In modified UTF-7, printable US-ASCII characters except for "&"
++   represent themselves; that is, characters with octet values 0x20-0x25
++   and 0x27-0x7e.  The character "&" (0x26) is represented by the two-
++   octet sequence "&-".
++
++   All other characters (octet values 0x00-0x1f, 0x7f-0xff, and all
++   Unicode 16-bit octets) are represented in modified BASE64, with a
++   further modification from [UTF-7] that "," is used instead of "/".
++   Modified BASE64 MUST NOT be used to represent any printing US-ASCII
++   character which can represent itself.
++
++   "&" is used to shift to modified BASE64 and "-" to shift back to US-
++   ASCII.  All names start in US-ASCII, and MUST end in US-ASCII (that
++   is, a name that ends with a Unicode 16-bit octet MUST end with a "-
++   ").
++
++
++
++
++
++Crispin                     Standards Track                    [Page 15]
++
++RFC 2060                       IMAP4rev1                   December 1996
++
++
++      For example, here is a mailbox name which mixes English, Japanese,
++      and Chinese text: ~peter/mail/&ZeVnLIqe-/&U,BTFw-
++
++
++ * This class will do the correct Encoding for the IMAP mailboxes
++ *
++ * @author	Christopher Cotton
++ */
++
++public class BASE64MailboxEncoder {
++    protected byte[] buffer = new byte[4];
++    protected int bufsize = 0;
++    protected boolean started = false;
++    protected Writer out = null;
++
++
++    public static String encode(String original) {
++	BASE64MailboxEncoder base64stream = null;
++	char origchars[] = original.toCharArray();
++	int length = origchars.length;
++	boolean changedString = false;
++	CharArrayWriter writer = new CharArrayWriter(length);
++
++	// loop over all the chars
++	for(int index = 0; index < length; index++) {
++	    char current = origchars[index];
++
++	    // octets in the range 0x20-0x25,0x27-0x7e are themselves
++	    // 0x26 "&" is represented as "&-"
++	    if (current >= 0x20 && current <= 0x7e) {
++		if (base64stream != null) {
++		    base64stream.flush();
++		}
++
++		if (current == '&') {
++		    changedString = true;
++		    writer.write('&');
++		    writer.write('-');
++		} else {
++		    writer.write(current);
++		}
++	    } else {
++
++		// use a B64MailboxEncoder to write out the other bytes
++		// as a modified BASE64.  The stream will write out
++		// the beginning '&' and the ending '-' which is part
++		// of every encoding.
++
++		if (base64stream == null) {
++		    base64stream = new BASE64MailboxEncoder(writer);
++		    changedString = true;
++		}
++
++		base64stream.write(current);
++	    }
++	}
++
++
++	if (base64stream != null) {
++	    base64stream.flush();
++	}
++
++	if (changedString) {
++	    return writer.toString();
++	} else {
++	    return original;
++	}
++    }
++
++
++    /**
++     * Create a BASE64 encoder
++     */
++    public BASE64MailboxEncoder(Writer what) {
++	out = what;
++    }
++
++    public void write(int c) {
++	try {
++	    // write out the initial character if this is the first time
++	    if (!started) {
++		started = true;
++		out.write('&');
++	    }
++
++	    // we write each character as a 2 byte unicode character
++	    buffer[bufsize++] = (byte) (c >> 8);
++	    buffer[bufsize++] = (byte) (c & 0xff);
++
++	    if (bufsize >= 3) {
++		encode();
++		bufsize -= 3;
++	    }
++	} catch (IOException e) {
++	    //e.printStackTrace();
++	}
++    }
++
++
++    public void flush() {
++	try {
++	    // flush any bytes we have
++	    if (bufsize > 0) {
++		encode();
++		bufsize = 0;
++	    }
++
++	    // write the terminating character of the encoding
++	    if (started) {
++		out.write('-');
++		started = false;
++	    }
++	} catch (IOException e) {
++	    //e.printStackTrace();
++	}
++    }
++
++
++    protected void encode() throws IOException {
++	byte a, b, c;
++	if (bufsize == 1) {
++	    a = buffer[0];
++	    b = 0;
++	    c = 0;
++	    out.write(pem_array[(a >>> 2) & 0x3F]);
++	    out.write(pem_array[((a << 4) & 0x30) + ((b >>> 4) & 0xf)]);
++		// no padding characters are written
++	} else if (bufsize == 2) {
++	    a = buffer[0];
++	    b = buffer[1];
++	    c = 0;
++	    out.write(pem_array[(a >>> 2) & 0x3F]);
++	    out.write(pem_array[((a << 4) & 0x30) + ((b >>> 4) & 0xf)]);
++	    out.write(pem_array[((b << 2) & 0x3c) + ((c >>> 6) & 0x3)]);
++		// no padding characters are written
++	} else {
++	    a = buffer[0];
++	    b = buffer[1];
++	    c = buffer[2];
++	    out.write(pem_array[(a >>> 2) & 0x3F]);
++	    out.write(pem_array[((a << 4) & 0x30) + ((b >>> 4) & 0xf)]);
++	    out.write(pem_array[((b << 2) & 0x3c) + ((c >>> 6) & 0x3)]);
++	    out.write(pem_array[c & 0x3F]);
++
++	    // copy back the extra byte
++	    if (bufsize == 4)
++		buffer[0] = buffer[3];
++        }
++    }
++
++    private final static char pem_array[] = {
++	'A','B','C','D','E','F','G','H', // 0
++	'I','J','K','L','M','N','O','P', // 1
++	'Q','R','S','T','U','V','W','X', // 2
++	'Y','Z','a','b','c','d','e','f', // 3
++	'g','h','i','j','k','l','m','n', // 4
++	'o','p','q','r','s','t','u','v', // 5
++	'w','x','y','z','0','1','2','3', // 6
++	'4','5','6','7','8','9','+',','  // 7
++    };
++}
diff --git a/debian/patches/fix-build b/debian/patches/fix-build
new file mode 100644
index 0000000..d2fb4a9
--- /dev/null
+++ b/debian/patches/fix-build
@@ -0,0 +1,99 @@
+Description: Use system libraries in the build system and disable windows dist
+Forwarded: no
+Author: Alexandre Rossi <alexandre.rossi at gmail.com>
+
+Index: davmail-src-3.9.9-1976/build.xml
+===================================================================
+--- davmail-src-3.9.9-1976.orig/build.xml	2012-07-10 23:13:26.000000000 +0200
++++ davmail-src-3.9.9-1976/build.xml	2012-08-23 17:57:56.353182085 +0200
+@@ -3,12 +3,22 @@
+     <property name="version" value="3.9.9"/>
+ 
+     <path id="classpath">
+-        <pathelement location="classes"/>
+-        <fileset dir="lib">
+-            <include name="*.jar"/>
+-        </fileset>
++        <pathelement location="${commons-codec}" />
++        <pathelement location="${servlet-api}" />
++        <pathelement location="${commons-httpclient}" />
++        <pathelement location="${htmlcleaner}" />
++        <pathelement location="${gnumail}" />
++        <pathelement location="${jcifs}" />
++        <pathelement location="${jackrabbit-webdav}" />
++        <pathelement location="${woodstox-core}" />
++        <pathelement location="${stax2-api}" />
++        <pathelement location="${swt}" />
+     </path>
+ 
++    <condition property="windows-dist-run">
++        <equals arg1="${windows-dist}" arg2="true" />
++    </condition>
++
+     <target name="clean">
+         <delete dir="target"/>
+         <delete dir="dist"/>
+@@ -230,8 +240,20 @@
+ 
+     </target>
+ 
++    <target name="windows-dist" depends="compile" if="windows-dist-run">
++
++        <taskdef name="jsmoothgen"
++                 classname="net.charabia.jsmoothgen.ant.JSmoothGen"
++                 classpathref="classpath"/>
++        <jsmoothgen project="davmail.jsmooth" skeletonroot="src/jsmooth/skeletons"/>
++        <jsmoothgen project="davmailconsole.jsmooth" skeletonroot="src/jsmooth/skeletons"/>
++        <!-- use WinRun4J to generate DavMail service -->
++        <copy file="src/winrun4j/davmailservice.exe" todir="dist"/>
++        <jsmoothgen project="davmail64.jsmooth" skeletonroot="src/jsmooth/skeletons"/>
+ 
+-    <target name="dist" depends="compile">
++    </target>
++
++    <target name="dist" depends="compile, windows-dist">
+         <property name="release-name" value="${release}-trunk"/>
+         <delete dir="dist"/>
+         <mkdir dir="dist"/>
+@@ -242,6 +264,7 @@
+                     <attribute name="Implementation-Title" value="DavMail Gateway"/>
+                     <attribute name="Implementation-Version" value="${release-name}"/>
+                     <attribute name="Implementation-Vendor" value="Mickael Guessant"/>
++                    <attribute name="Main-Class" value="davmail.DavGateway"/>
+                 </section>
+             </manifest>
+         </jar>
+@@ -259,14 +282,6 @@
+         </copy>
+         <copy file="src/java/tray48.png" tofile="dist/davmail.png"/>
+         <copy file="davmail.sh" todir="dist"/>
+-        <taskdef name="jsmoothgen"
+-                 classname="net.charabia.jsmoothgen.ant.JSmoothGen"
+-                 classpathref="classpath"/>
+-        <jsmoothgen project="davmail.jsmooth" skeletonroot="src/jsmooth/skeletons"/>
+-        <jsmoothgen project="davmailconsole.jsmooth" skeletonroot="src/jsmooth/skeletons"/>
+-        <!-- use WinRun4J to generate DavMail service -->
+-        <copy file="src/winrun4j/davmailservice.exe" todir="dist"/>
+-        <jsmoothgen project="davmail64.jsmooth" skeletonroot="src/jsmooth/skeletons"/>
+         <zip file="dist/davmail-${release-name}.zip">
+             <fileset dir="dist">
+                 <include name="lib/*.jar"/>
+Index: davmail-src-3.9.9-1976/build.properties
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ davmail-src-3.9.9-1976/build.properties	2012-08-23 18:01:27.492683383 +0200
+@@ -0,0 +1,14 @@
++# Build flags
++windows-dist = yes
++
++# Deps
++commons-codec      = lib/commons-codec-1.3.jar
++servlet-api        = lib/servlet-api.jar
++commons-httpclient = lib/commons-httpclient-3.1.jar
++htmlcleaner        = lib/htmlcleaner-2.1.jar
++gnumail            = lib/mail-1.4.3.jar
++jcifs              = lib/jcifs-1.3.14.jar
++jackrabbit-webdav  = lib/jackrabbit-webdav-1.4.jar
++woodstox-core      = lib/woodstox-core-asl-4.1.2.jar
++stax2-api          = lib/stax2-api-3.1.1.jar
++swt                = lib/swt-3.7-*.jar
diff --git a/debian/patches/htmlcleaner22 b/debian/patches/htmlcleaner22
new file mode 100644
index 0000000..b7b6c30
--- /dev/null
+++ b/debian/patches/htmlcleaner22
@@ -0,0 +1,42 @@
+Description: Port to HTMLCleaner 2.2 API
+Forwarded: no
+Author: Alexandre Rossi <alexandre.rossi at gmail.com>
+
+Index: davmail-src-3.9.9-1976/src/java/davmail/exchange/ExchangeSession.java
+===================================================================
+--- davmail-src-3.9.9-1976.orig/src/java/davmail/exchange/ExchangeSession.java	2012-07-07 00:55:55.000000000 +0200
++++ davmail-src-3.9.9-1976/src/java/davmail/exchange/ExchangeSession.java	2012-07-18 11:39:24.887318823 +0200
+@@ -33,8 +33,8 @@
+ import org.apache.commons.httpclient.params.HttpClientParams;
+ import org.apache.commons.httpclient.util.URIUtil;
+ import org.apache.log4j.Logger;
+-import org.htmlcleaner.CommentToken;
+-import org.htmlcleaner.ContentToken;
++import org.htmlcleaner.CommentNode;
++import org.htmlcleaner.ContentNode;
+ import org.htmlcleaner.HtmlCleaner;
+ import org.htmlcleaner.TagNode;
+ 
+@@ -440,8 +440,8 @@
+                     for (Object script : scriptList) {
+                         List contents = ((TagNode) script).getChildren();
+                         for (Object content : contents) {
+-                            if (content instanceof CommentToken) {
+-                                String scriptValue = ((CommentToken) content).getCommentedContent();
++                            if (content instanceof CommentNode) {
++                                String scriptValue = ((CommentNode) content).getCommentedContent();
+                                 String sUrl = StringUtil.getToken(scriptValue, "var a_sUrl = \"", "\"");
+                                 String sLgn = StringUtil.getToken(scriptValue, "var a_sLgnQS = \"", "\"");
+                                 if (sLgn == null) {
+@@ -454,9 +454,9 @@
+                                     logonMethod = buildLogonMethod(httpClient, newInitMethod);
+                                 }
+ 
+-                            } else if (content instanceof ContentToken) {
++                            } else if (content instanceof ContentNode) {
+                                 // Microsoft Forefront Unified Access Gateway redirect
+-                                String scriptValue = ((ContentToken) content).getContent();
++                                String scriptValue = ((ContentNode) content).getContent().toString();
+                                 String location = StringUtil.getToken(scriptValue, "window.location.replace(\"", "\"");
+                                 if (location != null) {
+                                     LOGGER.debug("Post logon redirect to: " + location);
diff --git a/debian/patches/jackrabbit2 b/debian/patches/jackrabbit2
new file mode 100644
index 0000000..08ec65b
--- /dev/null
+++ b/debian/patches/jackrabbit2
@@ -0,0 +1,151 @@
+Description: Port to jackrabbit 2 API
+Forwarded: no
+Author: Alexandre Rossi <alexandre.rossi at gmail.com>
+
+Index: davmail-src-3.9.9-1976/src/java/davmail/exchange/dav/DavExchangeSession.java
+===================================================================
+--- davmail-src-3.9.9-1976.orig/src/java/davmail/exchange/dav/DavExchangeSession.java	2012-07-07 00:55:54.000000000 +0200
++++ davmail-src-3.9.9-1976/src/java/davmail/exchange/dav/DavExchangeSession.java	2012-07-18 11:31:08.331318904 +0200
+@@ -41,6 +41,7 @@
+ import org.apache.jackrabbit.webdav.property.DavProperty;
+ import org.apache.jackrabbit.webdav.property.DavPropertyNameSet;
+ import org.apache.jackrabbit.webdav.property.DavPropertySet;
++import org.apache.jackrabbit.webdav.property.PropEntry;
+ import org.w3c.dom.Node;
+ 
+ import javax.mail.MessagingException;
+@@ -1685,7 +1686,7 @@
+                 // trigger activeSync push event, only if davmail.forceActiveSyncUpdate setting is true
+                 if ((status == HttpStatus.SC_OK || status == HttpStatus.SC_CREATED) &&
+                         (Settings.getBooleanProperty("davmail.forceActiveSyncUpdate"))) {
+-                    ArrayList<DavConstants> propertyList = new ArrayList<DavConstants>();
++                    ArrayList<PropEntry> propertyList = new ArrayList<PropEntry>();
+                     // Set contentclass to make ActiveSync happy
+                     propertyList.add(Field.createDavProperty("contentclass", contentClass));
+                     // ... but also set PR_INTERNET_CONTENT to preserve custom properties
+@@ -1884,7 +1885,7 @@
+             } else if (statusCode != HttpStatus.SC_CREATED) {
+                 throw DavGatewayHttpClientFacade.buildHttpException(method);
+             } else if (folderPath.equalsIgnoreCase("/users/" + getEmail() + "/calendar")) {
+-                // calendar renamed, need to reload well known folders 
++                // calendar renamed, need to reload well known folders
+                 getWellKnownFolders();
+             }
+         } finally {
+@@ -2317,7 +2318,7 @@
+     public void processItem(String folderPath, String itemName) throws IOException {
+         String eventPath = URIUtil.encodePath(getFolderPath(folderPath) + '/' + convertItemNameToEML(itemName));
+         // do not delete calendar messages, mark read and processed
+-        ArrayList<DavConstants> list = new ArrayList<DavConstants>();
++        ArrayList<PropEntry> list = new ArrayList<PropEntry>();
+         list.add(Field.createDavProperty("processed", "true"));
+         list.add(Field.createDavProperty("read", "1"));
+         PropPatchMethod patchMethod = new PropPatchMethod(eventPath, list);
+@@ -2359,7 +2360,7 @@
+             }
+             // failover for Exchange 2007, use PROPPATCH with forced timezone
+             if (fakeEventUrl == null) {
+-                ArrayList<DavConstants> propertyList = new ArrayList<DavConstants>();
++                ArrayList<PropEntry> propertyList = new ArrayList<PropEntry>();
+                 propertyList.add(Field.createDavProperty("contentclass", "urn:content-classes:appointment"));
+                 propertyList.add(Field.createDavProperty("outlookmessageclass", "IPM.Appointment"));
+                 propertyList.add(Field.createDavProperty("instancetype", "0"));
+@@ -2460,8 +2461,8 @@
+         return new Contact(getFolderPath(folderPath), itemName, properties, etag, noneMatch).createOrUpdate();
+     }
+ 
+-    protected List<DavConstants> buildProperties(Map<String, String> properties) {
+-        ArrayList<DavConstants> list = new ArrayList<DavConstants>();
++    protected List<PropEntry> buildProperties(Map<String, String> properties) {
++        ArrayList<PropEntry> list = new ArrayList<PropEntry>();
+         if (properties != null) {
+             for (Map.Entry<String, String> entry : properties.entrySet()) {
+                 if ("read".equals(entry.getKey())) {
+@@ -2506,7 +2507,7 @@
+     public void createMessage(String folderPath, String messageName, HashMap<String, String> properties, MimeMessage mimeMessage) throws IOException {
+         String messageUrl = URIUtil.encodePathQuery(getFolderPath(folderPath) + '/' + messageName);
+         PropPatchMethod patchMethod;
+-        List<DavConstants> davProperties = buildProperties(properties);
++        List<PropEntry> davProperties = buildProperties(properties);
+ 
+         if (properties != null && properties.containsKey("draft")) {
+             // note: draft is readonly after create, create the message first with requested messageFlags
+@@ -2549,7 +2550,7 @@
+             if (code == HttpStatus.SC_NOT_ACCEPTABLE) {
+                 LOGGER.warn("Draft message creation failed, failover to property update. Note: attachments are lost");
+ 
+-                ArrayList<DavConstants> propertyList = new ArrayList<DavConstants>();
++                ArrayList<PropEntry> propertyList = new ArrayList<PropEntry>();
+                 propertyList.add(Field.createDavProperty("to", mimeMessage.getHeader("to", ",")));
+                 propertyList.add(Field.createDavProperty("cc", mimeMessage.getHeader("cc", ",")));
+                 propertyList.add(Field.createDavProperty("message-id", mimeMessage.getHeader("message-id", ",")));
+@@ -2613,7 +2614,7 @@
+         try {
+             // need to update bcc after put
+             if (mimeMessage.getHeader("Bcc") != null) {
+-                davProperties = new ArrayList<DavConstants>();
++                davProperties = new ArrayList<PropEntry>();
+                 davProperties.add(Field.createDavProperty("bcc", mimeMessage.getHeader("Bcc", ",")));
+                 patchMethod = new PropPatchMethod(messageUrl, davProperties);
+                 try {
+@@ -2705,7 +2706,7 @@
+             createMessage(DRAFTS, itemName, properties, mimeMessage);
+             MoveMethod method = new MoveMethod(URIUtil.encodePath(getFolderPath(DRAFTS + '/' + itemName)),
+                     URIUtil.encodePath(getFolderPath(SENDMSG)), false);
+-            // set header if saveInSent is disabled 
++            // set header if saveInSent is disabled
+             if (!Settings.getBooleanProperty("davmail.smtpSaveInSent", true)) {
+                 method.setRequestHeader("Saveinsent", "f");
+             }
+Index: davmail-src-3.9.9-1976/src/java/davmail/exchange/dav/Field.java
+===================================================================
+--- davmail-src-3.9.9-1976.orig/src/java/davmail/exchange/dav/Field.java	2012-06-12 00:01:41.000000000 +0200
++++ davmail-src-3.9.9-1976/src/java/davmail/exchange/dav/Field.java	2012-07-18 11:25:07.520653273 +0200
+@@ -19,7 +19,7 @@
+ package davmail.exchange.dav;
+ 
+ import davmail.util.StringUtil;
+-import org.apache.jackrabbit.webdav.DavConstants;
++import org.apache.jackrabbit.webdav.property.PropEntry;
+ import org.apache.jackrabbit.webdav.property.DavPropertyName;
+ import org.apache.jackrabbit.webdav.property.DefaultDavProperty;
+ import org.apache.jackrabbit.webdav.xml.DomUtil;
+@@ -183,7 +183,7 @@
+         createField(URN_SCHEMAS_CALENDAR, "exdate"); // DistinguishedPropertySetType.PublicStrings/urn:schemas:calendar:exdate/PtypMultipleTime
+ 
+         createField(SCHEMAS_MAPI, "reminderset"); // PidLidReminderSet
+-        createField(SCHEMAS_MAPI, "reminderdelta"); // PidLidReminderDelta         
++        createField(SCHEMAS_MAPI, "reminderdelta"); // PidLidReminderDelta
+ 
+         // TODO
+         createField(SCHEMAS_MAPI, "allattendeesstring"); // PidLidAllAttendeesString
+@@ -197,7 +197,7 @@
+         createField(URN_SCHEMAS_CALENDAR, "busystatus"); // DistinguishedPropertySetType.PublicStrings/urn:schemas:calendar:busystatus/String
+         createField(URN_SCHEMAS_CALENDAR, "exrule"); // DistinguishedPropertySetType.PublicStrings/urn:schemas:calendar:exrule/PtypMultipleString
+         createField(URN_SCHEMAS_CALENDAR, "recurrenceidrange"); // DistinguishedPropertySetType.PublicStrings/urn:schemas:calendar:recurrenceidrange/String
+-        createField(URN_SCHEMAS_CALENDAR, "rdate"); // DistinguishedPropertySetType.PublicStrings/urn:schemas:calendar:rdate/PtypMultipleTime        
++        createField(URN_SCHEMAS_CALENDAR, "rdate"); // DistinguishedPropertySetType.PublicStrings/urn:schemas:calendar:rdate/PtypMultipleTime
+         createField(URN_SCHEMAS_CALENDAR, "reminderoffset"); // DistinguishedPropertySetType.PublicStrings/urn:schemas:calendar:reminderoffset/Integer
+         createField(URN_SCHEMAS_CALENDAR, "timezone"); // DistinguishedPropertySetType.PublicStrings/urn:schemas:calendar:timezone/String
+ 
+@@ -286,7 +286,7 @@
+         createField("description", URN_SCHEMAS_HTTPMAIL, "textdescription"); // PR_BODY 0x1000 String
+         createField("im", SCHEMAS_MAPI, "InstMsg"); // InstantMessagingAddress DistinguishedPropertySetType.Address/0x00008062/String
+         createField(URN_SCHEMAS_CONTACTS, "othermobile"); // PR_CAR_TELEPHONE_NUMBER 0x3A1E String
+-        createField(URN_SCHEMAS_CONTACTS, "internationalisdnnumber"); // PR_ISDN_NUMBER 0x3A2D String        
++        createField(URN_SCHEMAS_CONTACTS, "internationalisdnnumber"); // PR_ISDN_NUMBER 0x3A2D String
+ 
+         createField(URN_SCHEMAS_CONTACTS, "otherTelephone"); // PR_OTHER_TELEPHONE_NUMBER 0x3A21 String
+         createField(URN_SCHEMAS_CONTACTS, "homefax"); // PR_HOME_FAX_NUMBER 0x3A25 String
+@@ -527,9 +527,9 @@
+      *
+      * @param alias DavMail field alias
+      * @param value field value
+-     * @return DavProperty with value or DavPropertyName for null values
++     * @return PropEntry with value or DavPropertyName for null values
+      */
+-    public static DavConstants createDavProperty(String alias, String value) {
++    public static PropEntry createDavProperty(String alias, String value) {
+         Field field = Field.get(alias);
+         if (value == null) {
+             // return DavPropertyName to remove property
diff --git a/debian/patches/no-osx-tray b/debian/patches/no-osx-tray
new file mode 100644
index 0000000..3921c6e
--- /dev/null
+++ b/debian/patches/no-osx-tray
@@ -0,0 +1,259 @@
+Description: Remove OSX specific code.
+Forwarded: not-needed
+Author: Alexandre Rossi <alexandre.rossi at gmail.com>
+
+Index: davmail-src-3.9.9-1976/src/java/davmail/ui/tray/OSXAwtGatewayTray.java
+===================================================================
+--- davmail-src-3.9.9-1976.orig/src/java/davmail/ui/tray/OSXAwtGatewayTray.java	2011-04-06 22:01:14.000000000 +0200
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1,133 +0,0 @@
+-/*
+- * DavMail POP/IMAP/SMTP/CalDav/LDAP Exchange Gateway
+- * Copyright (C) 2009  Mickael Guessant
+- *
+- * 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 the Free Software Foundation; either version 2
+- * of the License, or (at your option) any later version.
+- *
+- * This program is distributed in the hope that it will be useful,
+- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+- * GNU General Public License for more details.
+- *
+- * You should have received a copy of the GNU General Public License
+- * along with this program; if not, write to the Free Software
+- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+- */
+-package davmail.ui.tray;
+-
+-import davmail.BundleMessage;
+-import davmail.DavGateway;
+-import davmail.ui.OSXAdapter;
+-import info.growl.Growl;
+-import info.growl.GrowlException;
+-import info.growl.GrowlUtils;
+-import org.apache.log4j.Level;
+-import org.apache.log4j.Logger;
+-
+-import javax.swing.*;
+-import java.awt.*;
+-import java.awt.image.BufferedImage;
+-import java.awt.image.RenderedImage;
+-
+-/**
+- * Extended Awt tray with OSX extensions.
+- */
+-public class OSXAwtGatewayTray extends AwtGatewayTray {
+-    protected static final String OSX_TRAY_ACTIVE_PNG = "osxtray2.png";
+-    protected static final String OSX_TRAY_PNG = "osxtray.png";
+-    protected static final String OSX_TRAY_INACTIVE_PNG = "osxtrayinactive.png";
+-
+-    private static final Logger LOGGER = Logger.getLogger(OSXAwtGatewayTray.class);
+-
+-    /**
+-     * Exit DavMail Gateway.
+-     *
+-     * @return true
+-     */
+-    @SuppressWarnings({"SameReturnValue", "UnusedDeclaration"})
+-    public boolean quit() {
+-        DavGateway.stop();
+-        // dispose frames
+-        settingsFrame.dispose();
+-        aboutFrame.dispose();
+-        if (logBrokerMonitor != null) {
+-            logBrokerMonitor.dispose();
+-        }
+-        return true;
+-    }
+-
+-    @Override
+-    protected void createAndShowGUI() {
+-        System.setProperty("apple.laf.useScreenMenuBar", "true");
+-        super.createAndShowGUI();
+-        trayIcon.removeActionListener(settingsListener);
+-        try {
+-            OSXAdapter.setAboutHandler(this, AwtGatewayTray.class.getDeclaredMethod("about", (Class[]) null));
+-            OSXAdapter.setPreferencesHandler(this, AwtGatewayTray.class.getDeclaredMethod("preferences", (Class[]) null));
+-            OSXAdapter.setQuitHandler(this, OSXAwtGatewayTray.class.getDeclaredMethod("quit", (Class[]) null));
+-        } catch (Exception e) {
+-            DavGatewayTray.error(new BundleMessage("LOG_ERROR_LOADING_OSXADAPTER"), e);
+-        }
+-    }
+-
+-    @Override
+-    protected String getTrayIconPath() {
+-        return OSXAwtGatewayTray.OSX_TRAY_PNG;
+-    }
+-
+-    @Override
+-    protected String getTrayIconActivePath() {
+-        return OSXAwtGatewayTray.OSX_TRAY_ACTIVE_PNG;
+-    }
+-
+-    @Override
+-    protected String getTrayIconInactivePath() {
+-        return OSXAwtGatewayTray.OSX_TRAY_INACTIVE_PNG;
+-    }
+-
+-    @Override
+-    public void displayMessage(final String message, final Level level) {
+-        if (!GrowlUtils.isGrowlLoaded()) {
+-            super.displayMessage(message, level);
+-        } else {
+-            SwingUtilities.invokeLater(new Runnable() {
+-                public void run() {
+-                    if (trayIcon != null) {
+-                        Icon icon = null;
+-                        if (level.equals(Level.INFO)) {
+-                            icon = UIManager.getIcon("OptionPane.informationIcon");
+-                        } else if (level.equals(Level.WARN)) {
+-                            icon = UIManager.getIcon("OptionPane.warningIcon");
+-                        } else if (level.equals(Level.ERROR)) {
+-                            icon = UIManager.getIcon("OptionPane.errorIcon");
+-                        }
+-
+-                        if (icon != null && message != null && message.length() > 0) {
+-                            try {
+-                                String title = BundleMessage.format("UI_DAVMAIL_GATEWAY");
+-                                Growl growl = GrowlUtils.getGrowlInstance("DavMail");
+-                                growl.addNotification(title, true);
+-                                growl.register();
+-                                growl.sendNotification(title, title, message, (RenderedImage) getImageForIcon(icon));
+-                            } catch (GrowlException growlException) {
+-                                LOGGER.error(growlException);
+-                            }
+-                        }
+-                        trayIcon.setToolTip(BundleMessage.format("UI_DAVMAIL_GATEWAY") + '\n' + message);
+-                    }
+-                }
+-            });
+-        }
+-    }
+-
+-    protected Image getImageForIcon(Icon icon) {
+-        BufferedImage bufferedimage = new BufferedImage(icon.getIconWidth(), icon.getIconHeight(), BufferedImage.TYPE_INT_ARGB);
+-        Graphics g = bufferedimage.getGraphics();
+-        icon.paintIcon(null, g, 0, 0);
+-        g.dispose();
+-        return bufferedimage;
+-    }
+-}
+Index: davmail-src-3.9.9-1976/src/java/davmail/ui/tray/OSXFrameGatewayTray.java
+===================================================================
+--- davmail-src-3.9.9-1976.orig/src/java/davmail/ui/tray/OSXFrameGatewayTray.java	2011-07-31 21:26:52.000000000 +0200
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1,81 +0,0 @@
+-/*
+- * DavMail POP/IMAP/SMTP/CalDav/LDAP Exchange Gateway
+- * Copyright (C) 2009  Mickael Guessant
+- *
+- * 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 the Free Software Foundation; either version 2
+- * of the License, or (at your option) any later version.
+- *
+- * This program is distributed in the hope that it will be useful,
+- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+- * GNU General Public License for more details.
+- *
+- * You should have received a copy of the GNU General Public License
+- * along with this program; if not, write to the Free Software
+- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+- */
+-package davmail.ui.tray;
+-
+-import davmail.BundleMessage;
+-import davmail.DavGateway;
+-import davmail.ui.OSXAdapter;
+-
+-import javax.swing.*;
+-import java.awt.event.ActionEvent;
+-import java.awt.event.ActionListener;
+-
+-/**
+- * MacOSX specific frame to handle menu
+- */
+-public class OSXFrameGatewayTray extends FrameGatewayTray {
+-
+-    /**
+-     * Exit DavMail Gateway.
+-     *
+-     * @return true
+-     */
+-    @SuppressWarnings({"SameReturnValue", "UnusedDeclaration"})
+-    public boolean quit() {
+-        DavGateway.stop();
+-        // dispose frames
+-        settingsFrame.dispose();
+-        aboutFrame.dispose();
+-        if (logBrokerMonitor != null) {
+-            logBrokerMonitor.dispose();
+-        }
+-        return true;
+-    }
+-
+-    @Override
+-    protected void buildMenu() {
+-        // create a popup menu
+-        JMenu menu = new JMenu(BundleMessage.format("UI_LOGS"));
+-        JMenuBar menuBar = new JMenuBar();
+-        menuBar.add(menu);
+-        mainFrame.setJMenuBar(menuBar);
+-
+-        JMenuItem logItem = new JMenuItem(BundleMessage.format("UI_SHOW_LOGS"));
+-        logItem.addActionListener(new ActionListener() {
+-            public void actionPerformed(ActionEvent e) {
+-                showLogs();
+-            }
+-        });
+-        menu.add(logItem);
+-    }
+-
+-
+-    @Override
+-    protected void createAndShowGUI() {
+-        System.setProperty("apple.laf.useScreenMenuBar", "true");
+-        super.createAndShowGUI();
+-        try {
+-            OSXAdapter.setAboutHandler(this, FrameGatewayTray.class.getDeclaredMethod("about", (Class[]) null));
+-            OSXAdapter.setPreferencesHandler(this, FrameGatewayTray.class.getDeclaredMethod("preferences", (Class[]) null));
+-            OSXAdapter.setQuitHandler(this, OSXFrameGatewayTray.class.getDeclaredMethod("quit", (Class[]) null));
+-        } catch (Exception e) {
+-            DavGatewayTray.error(new BundleMessage("LOG_ERROR_LOADING_OSXADAPTER"), e);
+-        }
+-    }
+-}
+Index: davmail-src-3.9.9-1976/src/java/davmail/ui/tray/DavGatewayTray.java
+===================================================================
+--- davmail-src-3.9.9-1976.orig/src/java/davmail/ui/tray/DavGatewayTray.java	2011-10-29 23:29:19.000000000 +0200
++++ davmail-src-3.9.9-1976/src/java/davmail/ui/tray/DavGatewayTray.java	2012-07-18 10:36:06.439321059 +0200
+@@ -240,11 +240,7 @@
+             if (davGatewayTray == null) {
+                 try {
+                     if (SystemTray.isSupported()) {
+-                        if (isOSX()) {
+-                            davGatewayTray = new OSXAwtGatewayTray();
+-                        } else {
+-                            davGatewayTray = new AwtGatewayTray();
+-                        }
++                        davGatewayTray = new AwtGatewayTray();
+                         davGatewayTray.init();
+                     }
+                 } catch (NoClassDefFoundError e) {
+@@ -252,12 +248,7 @@
+                 }
+             }
+             if (davGatewayTray == null) {
+-                if (isOSX()) {
+-                    // MacOS
+-                    davGatewayTray = new OSXFrameGatewayTray();
+-                } else {
+-                    davGatewayTray = new FrameGatewayTray();
+-                }
++                davGatewayTray = new FrameGatewayTray();
+                 davGatewayTray.init();
+             }
+         }
diff --git a/debian/patches/no-windows-service b/debian/patches/no-windows-service
new file mode 100644
index 0000000..58cf84a
--- /dev/null
+++ b/debian/patches/no-windows-service
@@ -0,0 +1,16 @@
+Description: Avoid winrun4j build dependency
+Forwarded: not-needed
+Author: Alexandre Rossi <alexandre.rossi at gmail.com>
+
+Index: davmail-src-3.9.9-1976/build.xml
+===================================================================
+--- davmail-src-3.9.9-1976.orig/build.xml	2012-09-05 10:26:05.632581656 +0200
++++ davmail-src-3.9.9-1976/build.xml	2012-09-05 10:26:47.276583673 +0200
+@@ -58,6 +58,7 @@
+     <target name="compile" depends="init">
+         <mkdir dir="target/classes"/>
+         <javac srcdir="src/java" destdir="target/classes" source="1.5" target="1.5" debug="on" encoding="UTF-8"
++               excludes="davmail/service/DavService.java"
+                includeantruntime="false">
+             <classpath>
+                 <path refid="classpath"/>
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..fb35001
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,6 @@
+htmlcleaner22
+no-windows-service
+no-osx-tray
+base64-enc-dec
+jackrabbit2
+fix-build
diff --git a/debian/postinst b/debian/postinst
new file mode 100644
index 0000000..3e725ec
--- /dev/null
+++ b/debian/postinst
@@ -0,0 +1,15 @@
+#!/bin/sh -e
+USER=davmail
+
+if ! getent passwd $USER >/dev/null; then
+    adduser --quiet --system --no-create-home --home /var/lib/$USER $USER
+fi
+
+for i in /var/log/$USER.log /var/lib/$USER;
+do
+    if ! dpkg-statoverride --list --quiet "$i" >/dev/null; then
+        dpkg-statoverride --force --quiet --update --add davmail adm 0755 "$i"
+    fi
+done
+
+#DEBHELPER#
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..586b7eb
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,14 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+#
+# Uncomment this to turn on verbose mode.
+export DH_VERBOSE=1
+
+# This has to be exported to make some magic below work.
+export DH_OPTIONS
+
+%:
+	dh $@ --with javahelper
+
+override_dh_auto_build:
+	ant -propertyfile debian/ant.properties
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/debian/watch b/debian/watch
new file mode 100644
index 0000000..5bf235d
--- /dev/null
+++ b/debian/watch
@@ -0,0 +1,3 @@
+version=3
+
+http://sf.net/davmail/davmail-src-(.+)\.tgz

-- 
davmail packaging



More information about the pkg-java-commits mailing list