]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/commitdiff
Geändert:
authorms <ms@ea5c0bd1-69bd-2848-81d8-4f18e57aeed8>
Thu, 22 Jun 2006 11:54:33 +0000 (11:54 +0000)
committerms <ms@ea5c0bd1-69bd-2848-81d8-4f18e57aeed8>
Thu, 22 Jun 2006 11:54:33 +0000 (11:54 +0000)
  * Cyrus-IMAP downgrade auf 2.2.12 mit einer Menge Patches,
    doch die Probleme bleiben bestehen...
  * SSH-Schönheitsfehler im Webinterface behoben.

git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@181 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8

30 files changed:
config/cfgroot/ssh-settings [new file with mode: 0644]
config/cyrusimap/cyrus.conf
config/cyrusimap/imapd.conf
config/postfix/master.cf
doc/ChangeLog
doc/packages-list.txt
lfs/configroot
lfs/cyrusimap
src/paks/cyrusimap/ROOTFILES
src/patches/allow_auth_plain_proxying.patch [new file with mode: 0644]
src/patches/authid_normalize.patch [new file with mode: 0644]
src/patches/cyrus-imapd-2.1.16-getrlimit.patch [new file with mode: 0644]
src/patches/cyrus-imapd-2.1.3-flock.patch [new file with mode: 0644]
src/patches/cyrus-imapd-2.2.10-groupcache.patch [new file with mode: 0644]
src/patches/cyrus-imapd-2.2.12-64bit_quota-p1.patch [new file with mode: 0644]
src/patches/cyrus-imapd-2.2.12-64bit_quota-p2.patch [new file with mode: 0644]
src/patches/cyrus-imapd-2.2.12-autocreate-0.9.4.diff [new file with mode: 0644]
src/patches/cyrus-imapd-2.2.12-autosievefolder-0.6.diff [new file with mode: 0644]
src/patches/cyrus-imapd-2.2.12-gcc4.patch [new file with mode: 0644]
src/patches/cyrus-imapd-2.2.12-munge8bit.patch [new file with mode: 0644]
src/patches/cyrus-imapd-2.2.12-mupdate-thread-safe.patch [new file with mode: 0644]
src/patches/cyrus-imapd-2.2.12-no_transfig.patch [new file with mode: 0644]
src/patches/cyrus-imapd-2.2.12-notify_sms.patch [new file with mode: 0644]
src/patches/cyrus-imapd-2.2.12-rmquota+deletemailbox-0.2-1.diff [new file with mode: 0644]
src/patches/cyrus-imapd-2.2.12-seenstate.patch [new file with mode: 0644]
src/patches/cyrus-imapd-2.2.12-singleinstancestore.patch [new file with mode: 0644]
src/patches/cyrus-imapd-2.2.12-spool.patch [new file with mode: 0644]
src/patches/cyrus-imapd-2.3.3-deleteacl_invalid_identifier_fix.patch [new file with mode: 0644]
src/patches/cyrus-imapd-acceptinvalidfrom.patch [new file with mode: 0644]
src/patches/timsieved_reset_sasl_conn.patch [new file with mode: 0644]

diff --git a/config/cfgroot/ssh-settings b/config/cfgroot/ssh-settings
new file mode 100644 (file)
index 0000000..a96c9f7
--- /dev/null
@@ -0,0 +1,6 @@
+ENABLE_SSH_KEYS=on
+ENABLE_SSH_PROTOCOL1=off
+ENABLE_SSH_PASSWORDS=on
+ENABLE_SSH_PORTFW=off
+ENABLE_SSH=on
+__CGI__=CGI=HASH(0x840b7a0)
index 96dc414e7e63739816b410533fc29f51ee38795b..d9adbd9d03ad663ab038039bb0bcceaf6578d440 100644 (file)
@@ -13,10 +13,10 @@ SERVICES {
   imaps         cmd="imapd -s" listen="imaps" prefork=0
   pop3          cmd="pop3d" listen="pop3" prefork=0
   pop3s         cmd="pop3d -s" listen="pop3s" prefork=0
-  sieve         cmd="timsieved" listen="sieve" prefork=0
+  sieve         cmd="timsieved" listen="127.0.0.1:2000" prefork=0
 
   # at least one LMTP is required for delivery
-#  lmtp         cmd="lmtpd" listen="lmtp" prefork=0
+  lmtp         cmd="lmtpd" listen="127.0.0.1:24" prefork=0
   lmtpunix      cmd="lmtpd" listen="/var/imap/socket/lmtp" prefork=0
 
   # this is only necessary if using notifications
index 767a9891a3c8bfc17c6c72417c5168521a73aabe..0bf2a28c661e847bbfd2deac2e1ef8fe7eaa46b2 100644 (file)
@@ -5,7 +5,7 @@ admins: cyrus
 allowanonymouslogin: no
 allowplaintext: yes
 sasl_mech_list: PLAIN
-servername: servername
+servername: localhost
 autocreatequota: 10000
 reject8bit: no
 quotawarn: 90
@@ -18,7 +18,9 @@ sievedir: /usr/sieve
 sendmail: /usr/sbin/sendmail
 sieve_maxscriptsize: 32
 sieve_maxscripts: 5
+lmtpsocket: /var/imap/socket/lmtp
 #unixhierarchysep: yes
-echo tls_ca_file: /var/imap/server.pem
-echo tls_cert_file: /var/imap/server.pem
-echo tls_key_file: /var/imap/server.pem
+#echo tls_ca_file: /var/imap/server.pem
+#echo tls_cert_file: /var/imap/server.pem
+#echo tls_key_file: /var/imap/server.pem
+#hashimapspool: yes
index a2c5f3024c476dd2e867bfc3243010fc82cde063..6397e441094d671f7942f242c25db8265bb824c3 100644 (file)
@@ -78,4 +78,4 @@ ifmail    unix  -       n       n       -       -       pipe
 bsmtp     unix  -       n       n       -       -       pipe
   flags=Fq. user=foo argv=/usr/local/sbin/bsmtp -f $sender $nexthop $recipient
 procmail  unix  -       n       n       -       20      pipe
-flags=R user=cyrus argv=/usr/bin/procmail -r SENDER=${sender} -t -m USER=${user} EXTENSION=${extension} /etc/procmailrc
+  flags=R user=cyrus argv=/usr/bin/procmail -r SENDER=${sender} -t -m USER=${user} EXTENSION=${extension} /etc/procmailrc
index c57661b7c6a267d6bc4a401d6927240c9f40f17e..cd42a673d3d423566ef1976a194747f10cd8da8c 100644 (file)
 ------------------------------------------------------------------------
-r164 | ms | 2006-06-06 21:12:22 +0200 (Tue, 06 Jun 2006) | 10 lines
+r180 | ms | 2006-06-20 20:31:22 +0200 (Di, 20 Jun 2006) | 7 lines
 
-Hinzugefügt:
+Hinzugefügt:
+  * Consolenprogramme erscheinen nun in Farbe statt in S/W.
+  * MC in die ISO gepackt.
+  * Pakete für amavisd, nmap, nfs, mailx und spamassassin erstellt.
+Geändert:
+  * IMAP-Ordnerstrukturen des Cyrus-IMAPd angelegt mit richtigen Rechten.
+
+------------------------------------------------------------------------
+r179 | ms | 2006-06-15 19:43:14 +0200 (Do, 15 Jun 2006) | 5 lines
+
+Geändert:
+  * Postfix - PostgreSQL-Unterstützung herausgenommen.
+  * HDDTemp-Bezeichnung gekürzt - Dank an masa oder wer das nochmal war :D
+  * Konfigurationen der Mailer in die Pakete gepackt.
+
+------------------------------------------------------------------------
+r178 | ms | 2006-06-14 23:19:05 +0200 (Mi, 14 Jun 2006) | 3 lines
+
+Hinzugefügt:
+  * In Mailserverkonfiguration fortgeschritten...
+
+------------------------------------------------------------------------
+r177 | ms | 2006-06-14 19:35:12 +0200 (Mi, 14 Jun 2006) | 7 lines
+
+Hinzugefügt:
+  * Asterisk-Konfigurationsdateien fürs Webinterface.
+  * Funktionierender Packager.
+  * CUPS-Paket
+Geändert:
+  * Postfix ohne PostgreSQL
+
+------------------------------------------------------------------------
+r176 | ms | 2006-06-14 12:10:01 +0200 (Mi, 14 Jun 2006) | 5 lines
+
+Hinzugefügt:
+  * qos.cgi - Geht noch so gut wie nix.
+Geändert:
+  * hddshutdown funktioniert nun.
+
+------------------------------------------------------------------------
+r175 | ms | 2006-06-13 23:05:40 +0200 (Di, 13 Jun 2006) | 4 lines
+
+Geändert:
+  * Packager neu erstellt.
+  XAMPP Paket noch nicht drin. ERRORS! :(
+
+------------------------------------------------------------------------
+r174 | casemaster | 2006-06-13 21:46:57 +0200 (Di, 13 Jun 2006) | 4 lines
+
+Installer:
+Tastatur "DE" als default
+Timezone "Europe/Berlin" als default.
+
+------------------------------------------------------------------------
+r173 | ms | 2006-06-13 16:15:51 +0200 (Di, 13 Jun 2006) | 8 lines
+
+Geändert:
+  * (experimentelle) httpd.conf
+  * Portproblem gefixt
+  * snort wieder zurückgesetzt auf die alte Version, da für die neue keine freien Regeln da sind.
+  * Rechtschreibfehler im Installer behoben.
+  * mpg123 wieder hinzugefügt.
+  * fwhits-Graphs - Kleinigkeit vergessen.
+
+------------------------------------------------------------------------
+r172 | ms | 2006-06-12 20:41:26 +0200 (Mo, 12 Jun 2006) | 4 lines
+
+Geändert:
+  * Graphs gefixt http://bugtracker.ipfire.eu/view.php?id=8
+  * src/paks/*/CONFFILES gelöscht
+
+------------------------------------------------------------------------
+r171 | ms | 2006-06-12 17:00:19 +0200 (Mo, 12 Jun 2006) | 8 lines
+
+Hinzugefügt:
+  * IPTables ins Webinterface - Muss der Benne nochmal drüberkucken!
+Geändert:
+  * Blinde Datei oh323 gelöscht.
+  * Kein sudo-Paket mehr, da bereits in ISO.
+  * makegraphs gefixt wegen hddtemp
+  * Menü im Webinterface wieder einmal bearbeitet.
+
+------------------------------------------------------------------------
+r170 | casemaster | 2006-06-11 00:38:23 +0200 (So, 11 Jun 2006) | 3 lines
+
+Sprachen in den Installer auf DE und EN begrenzt.
+Deutsch als default.
+Abfrage für "alte Konfiguration laden" entfernt.
+------------------------------------------------------------------------
+r169 | casemaster | 2006-06-10 23:17:42 +0200 (Sa, 10 Jun 2006) | 2 lines
+
+Sprachen in den Installer auf DE und EN begrenzt.
+Deutsch als default.
+------------------------------------------------------------------------
+r168 | ms | 2006-06-10 21:21:32 +0200 (Sa, 10 Jun 2006) | 10 lines
+
+Hinzugefuegt:
+  * SquidGuard - mit Patch damit es mit der DB 4.4.20 funktioniert.
+  * wput - wget nur andersrum.
+  * hddtemp/hddgraph
+  * etherwake
+  * Saemtliche Bootscripts vom BLFS
+  * vpn-restart-script... muss noch bearbeitet werden.
+Geaendert:
+  * Karsten Rechenbachs Emailadresse in die Credits gebaut.
+
+------------------------------------------------------------------------
+r167 | ms | 2006-06-08 15:17:52 +0200 (Do, 08 Jun 2006) | 9 lines
+
+Hinzugefügt:
+  * Morningreconnect - Danke an Benedikt
+Geändert:
+  * Stop-Bug im OpenVPN behoben - wieder Danke an Benedikt
+  * CA nach IPFire umbenannt.
+  * Sprachdateien bearbeitet
+  * Snort aktualisiert.
+
+
+------------------------------------------------------------------------
+r166 | ms | 2006-06-07 22:31:04 +0200 (Mi, 07 Jun 2006) | 6 lines
+
+Hinzugefuegt:
+  * CM zu den Credits
+  * NTOP
+  * Lynx
+  * iftop
+
+------------------------------------------------------------------------
+r165 | ms | 2006-06-06 21:31:47 +0200 (Di, 06 Jun 2006) | 5 lines
+
+Geändert:
+  * Bearbeitetes Startscript für AJ
+  * Changelog aktualisiert.
+  * Nur noch Deutsch/Englisch für das Webinterface.
+
+------------------------------------------------------------------------
+r164 | ms | 2006-06-06 21:12:22 +0200 (Di, 06 Jun 2006) | 10 lines
+
+Hinzugefügt:
   * Morningreconnect Script
-Geändert:
+Geändert:
   * Neue Spamassassin Version. 3.1.3
   * Interface umfangreich bearbeitet in Layout und angezeigten Texten.
   * DHCP-Leases-Error gefixt
   * lq-Graph pingt nun nach www.heise.de
-  * IP-Anzeige für PPPoE/DSL gefixt.
-  * Connectionstate vom IPCop übernommen.
+  * IP-Anzeige für PPPoE/DSL gefixt.
+  * Connectionstate vom IPCop übernommen.
 
 ------------------------------------------------------------------------
-r163 | ms | 2006-06-06 14:38:52 +0200 (Tue, 06 Jun 2006) | 10 lines
+r163 | ms | 2006-06-06 14:38:52 +0200 (Di, 06 Jun 2006) | 10 lines
 
-Hinzugefügt:
-  * Locale-Codes - Perl-Modul für die country.cgi
-Geändert:
+Hinzugefügt:
+  * Locale-Codes - Perl-Modul für die country.cgi
+Geändert:
   * Samba OHNE PAM
-  * Permissions der Flags von GeoIP geändert.
+  * Permissions der Flags von GeoIP geändert.
   * Samba Paket erstellt.
   * Wget in die ISO gepackt.
-  * Startscripte bearbeitet. (IPCop-Überreste)
+  * Startscripte bearbeitet. (IPCop-Überreste)
   * Sysconfdir von xinetd und Samba verschoben.
 
 ------------------------------------------------------------------------
-r162 | ms | 2006-06-05 19:35:00 +0200 (Mon, 05 Jun 2006) | 6 lines
+r162 | ms | 2006-06-05 19:35:00 +0200 (Mo, 05 Jun 2006) | 6 lines
 
-Hinzugefügt:
-  * HDDGraphs für mehrere Festplatten
-  * Höhere Baudrate in pppsetup.cgi
-Geändert:
+Hinzugefügt:
+  * HDDGraphs für mehrere Festplatten
+  * Höhere Baudrate in pppsetup.cgi
+Geändert:
   * Sprachen auf DE und EN reduziert.
 
 ------------------------------------------------------------------------
-r161 | ms | 2006-06-05 13:51:06 +0200 (Mon, 05 Jun 2006) | 3 lines
+r161 | ms | 2006-06-05 13:51:06 +0200 (Mo, 05 Jun 2006) | 3 lines
 
-Geändert:
-  * HDDTemp wieder aktiviert. Bisher nur das Binary. CGI folgt später.
+Geändert:
+  * HDDTemp wieder aktiviert. Bisher nur das Binary. CGI folgt später.
 
 ------------------------------------------------------------------------
-r160 | ms | 2006-06-05 13:30:07 +0200 (Mon, 05 Jun 2006) | 11 lines
+r160 | ms | 2006-06-05 13:30:07 +0200 (Mo, 05 Jun 2006) | 11 lines
 
-Hinzugefügt:
-  * Kleiner Tux im Webinterface für den eXciter und den Benne :)
-Geändert:
-  * time.cgi überarbeitet und Funktion verbessert.
-  * index.cgi - noch ein Paar Fehler behoben oder was hinzugefügt.
-  * FLASH-Eintrag aus der crontab gelöscht.
-  * Online-Hilfe-Rettungsringe (die hässlichen) aus den CGIs entfernt.
+Hinzugefügt:
+  * Kleiner Tux im Webinterface für den eXciter und den Benne :)
+Geändert:
+  * time.cgi überarbeitet und Funktion verbessert.
+  * index.cgi - noch ein Paar Fehler behoben oder was hinzugefügt.
+  * FLASH-Eintrag aus der crontab gelöscht.
+  * Online-Hilfe-Rettungsringe (die hässlichen) aus den CGIs entfernt.
   * Logger von ipcop nach ipfire umgestellt.
-Gelöscht:
-  * Nicht benötigte Reste vom IPCop entfernt.
+Gelöscht:
+  * Nicht benötigte Reste vom IPCop entfernt.
 
 ------------------------------------------------------------------------
-r159 | ms | 2006-06-05 01:24:58 +0200 (Mon, 05 Jun 2006) | 4 lines
+r159 | ms | 2006-06-05 01:24:58 +0200 (Mo, 05 Jun 2006) | 4 lines
 
-Hinzugefügt:
+Hinzugefügt:
   * OpenVPN in Statusseite.
   * cftp - FTP-Client grafisch?!
 
 ------------------------------------------------------------------------
-r158 | ms | 2006-06-05 00:55:40 +0200 (Mon, 05 Jun 2006) | 4 lines
+r158 | ms | 2006-06-05 00:55:40 +0200 (Mo, 05 Jun 2006) | 4 lines
 
-Geändert:
-  * Webinterfacemenü vervollständigt.
-  * Pfad im AdvProxy geändert.
+Geändert:
+  * Webinterfacemenü vervollständigt.
+  * Pfad im AdvProxy geändert.
 
 ------------------------------------------------------------------------
-r157 | ms | 2006-06-05 00:29:23 +0200 (Mon, 05 Jun 2006) | 7 lines
+r157 | ms | 2006-06-05 00:29:23 +0200 (Mo, 05 Jun 2006) | 7 lines
 
-Hinzugefügt:
+Hinzugefügt:
   * Link Quality Graphs
-Geändert:
+Geändert:
   * index.cgi nochmals bearbeitet.
   * Benedikt is jetzt ganz aus den Credits raus... Bekommt dann wohl ne Extra-Sonderseite mit Bild und so^^
   * OpenVPN in ISO gepackt.
 
 ------------------------------------------------------------------------
-r156 | ms | 2006-06-04 18:40:59 +0200 (Sun, 04 Jun 2006) | 5 lines
+r156 | ms | 2006-06-04 18:40:59 +0200 (So, 04 Jun 2006) | 5 lines
 
-Hinzugefügt:
+Hinzugefügt:
   * fcclassic (auch SMP)
-Geändert:
+Geändert:
   * Benedikt aus den Credits rausgenommen. Willer nich. :(
 
 ------------------------------------------------------------------------
-r155 | ms | 2006-06-03 22:16:53 +0200 (Sat, 03 Jun 2006) | 9 lines
+r155 | ms | 2006-06-03 22:16:53 +0200 (Sa, 03 Jun 2006) | 9 lines
 
 Update:
   * Squid 2.5STABLE14 eingepflegt.
-Geändert: 
+Geändert: 
   * xinetd Konfiguration verschoben.
   * OpenVPN Errors behoben. Funktioniert immernoch nicht korrekt. :(
   * Pakfire bearbeitet.
-  * Credits erweitert und GPL hinzugefügt.
-  * index.cgi, völlig neuer Look.
+  * Credits erweitert und GPL hinzugefügt.
+  * index.cgi, völlig neuer Look.
 
 ------------------------------------------------------------------------
-r154 | ms | 2006-06-03 14:22:38 +0200 (Sat, 03 Jun 2006) | 5 lines
+r154 | ms | 2006-06-03 14:22:38 +0200 (Sa, 03 Jun 2006) | 5 lines
 
-Geändert:
-  * Webinterface Menü bearbeitet.
+Geändert:
+  * Webinterface Menü bearbeitet.
   * Squid-Error gefixt.
-  * Pakfire gefixt, aber noch nicht funktionsfähig!
+  * Pakfire gefixt, aber noch nicht funktionsfähig!
 
 ------------------------------------------------------------------------
-r153 | ms | 2006-06-02 21:03:53 +0200 (Fri, 02 Jun 2006) | 5 lines
+r153 | ms | 2006-06-02 21:03:53 +0200 (Fr, 02 Jun 2006) | 5 lines
 
-Hinzugefügt:
-  * AdvancedProxy Fähigkeiten
-Geändert:
+Hinzugefügt:
+  * AdvancedProxy Fähigkeiten
+Geändert:
   * Kleiner Fehler im OpenVPN GUI verblieben und daher behoben.
 
 ------------------------------------------------------------------------
-r152 | ms | 2006-06-02 17:59:39 +0200 (Fri, 02 Jun 2006) | 5 lines
+r152 | ms | 2006-06-02 17:59:39 +0200 (Fr, 02 Jun 2006) | 5 lines
 
-Hinzugefügt:
+Hinzugefügt:
   * OpenVPN GUI Alpha7
-Geändert:
+Geändert:
   * XAMPP von 1.5.3 --> 1.5.3a
 
 ------------------------------------------------------------------------
-r151 | ms | 2006-06-02 14:48:29 +0200 (Fri, 02 Jun 2006) | 5 lines
+r151 | ms | 2006-06-02 14:48:29 +0200 (Fr, 02 Jun 2006) | 5 lines
 
-Geändert:
+Geändert:
   * Postfix Version 2.2.10 eingepflegt
   * Cyrus-Paket umbenannt
   * JAVA-Paket erstellt
 
 ------------------------------------------------------------------------
-r150 | ms | 2006-05-31 22:46:41 +0200 (Wed, 31 May 2006) | 4 lines
+r150 | ms | 2006-05-31 22:46:41 +0200 (Mi, 31 Mai 2006) | 4 lines
 
 Quellenupdate:
   * popt
   * sane
 
 ------------------------------------------------------------------------
-r149 | ms | 2006-05-31 18:29:08 +0200 (Wed, 31 May 2006) | 6 lines
+r149 | ms | 2006-05-31 18:29:08 +0200 (Mi, 31 Mai 2006) | 6 lines
 
-Hinzugefügt:
-  * ./make.sh pub lädt die ISO auf den mirror.ipfire.org
-Geändert:
-  * ./make.sh paks verändert. Pakete werden nur noch gebaut, wenn sie noch nicht da sind.
-  Zum neu bauen einfach das File löschen und beim nächsten durchlauf wird es wieder mitgebaut.
+Hinzugefügt:
+  * ./make.sh pub lädt die ISO auf den mirror.ipfire.org
+Geändert:
+  * ./make.sh paks verändert. Pakete werden nur noch gebaut, wenn sie noch nicht da sind.
+  Zum neu bauen einfach das File löschen und beim nächsten durchlauf wird es wieder mitgebaut.
 
 ------------------------------------------------------------------------
-r148 | ms | 2006-05-31 12:09:27 +0200 (Wed, 31 May 2006) | 8 lines
+r148 | ms | 2006-05-31 12:09:27 +0200 (Mi, 31 Mai 2006) | 8 lines
 
-Großes Update:
-Hinzugefügt:
+Großes Update:
+Hinzugefügt:
   * L7-Protokolle
-Geändert:
+Geändert:
   * XAMPP 1.5.1 --> 1.5.3
-  * Sämtliche "IPCops" durch "IPFire" im Webinterface ersetzt
+  * Sämtliche "IPCops" durch "IPFire" im Webinterface ersetzt
   * Einige Fixes, wegen Errors im Webinterface. (Im Forum zu finden.)
 
 ------------------------------------------------------------------------
-r147 | ms | 2006-05-28 19:57:38 +0200 (Sun, 28 May 2006) | 4 lines
+r147 | ms | 2006-05-28 19:57:38 +0200 (So, 28 Mai 2006) | 4 lines
 
 BUILDFIXES:
-  * ROOTFILES überarbeitet. (Ne Menge vergessen.^^)
+  * ROOTFILES überarbeitet. (Ne Menge vergessen.^^)
   * Packages werden nichtmehr im "build" gepackt, sondern mit dem Parameter "paks".
 
 ------------------------------------------------------------------------
-r146 | ms | 2006-05-27 12:38:03 +0200 (Sat, 27 May 2006) | 7 lines
+r146 | ms | 2006-05-27 12:38:03 +0200 (Sa, 27 Mai 2006) | 7 lines
 
-Hinzugefügt:
+Hinzugefügt:
   * XAMPP mit Python
-Geändert:
+Geändert:
   * Installationsprozess von PHPAJ
   * shutdown.cgi auf ipfire angepasst
   * Make-Packages.sh behebt jetzt doppelte Dateien in den Pak-Archiven.
 
 ------------------------------------------------------------------------
-r145 | ms | 2006-05-26 14:19:48 +0200 (Fri, 26 May 2006) | 6 lines
+r145 | ms | 2006-05-26 14:19:48 +0200 (Fr, 26 Mai 2006) | 6 lines
 
-Geändert:
+Geändert:
   * IPCop -> IPFire bei den misc-progs
   * Startscripte verschoben und Symlink nach /usr/local/bin/rc*
-Gelöscht:
+Gelöscht:
   * Restartshaping in den Misc-Progs, weil es durch QoS ersetzt wird.
 
 ------------------------------------------------------------------------
-r144 | ms | 2006-05-26 12:51:14 +0200 (Fri, 26 May 2006) | 7 lines
+r144 | ms | 2006-05-26 12:51:14 +0200 (Fr, 26 Mai 2006) | 7 lines
 
-Hinzugefügt:
+Hinzugefügt:
   * Screen
   * Applejuice - mit Startscript
-Geändert:
+Geändert:
   * Xampp-Paket verkleinert.
   * Lame eingepackt.
 
 ------------------------------------------------------------------------
-r143 | ms | 2006-05-25 23:49:28 +0200 (Thu, 25 May 2006) | 3 lines
+r143 | ms | 2006-05-25 23:49:28 +0200 (Do, 25 Mai 2006) | 3 lines
 
-Hinzugefügt:
+Hinzugefügt:
   * Java von SUN
 
 ------------------------------------------------------------------------
-r142 | ms | 2006-05-25 23:10:48 +0200 (Thu, 25 May 2006) | 3 lines
+r142 | ms | 2006-05-25 23:10:48 +0200 (Do, 25 Mai 2006) | 3 lines
 
-Hinzugefügt:
+Hinzugefügt:
   * Firewallhits
 
 ------------------------------------------------------------------------
-r141 | ms | 2006-05-25 22:23:12 +0200 (Thu, 25 May 2006) | 3 lines
+r141 | ms | 2006-05-25 22:23:12 +0200 (Do, 25 Mai 2006) | 3 lines
 
-Hinzugefügt:
+Hinzugefügt:
   * HTOP - http://htop.sourceforge.net
 
 ------------------------------------------------------------------------
-r140 | ms | 2006-05-25 21:49:10 +0200 (Thu, 25 May 2006) | 3 lines
+r140 | ms | 2006-05-25 21:49:10 +0200 (Do, 25 Mai 2006) | 3 lines
 
-Hinzugefügt:
+Hinzugefügt:
   * GeoIP
 
 ------------------------------------------------------------------------
-r139 | ms | 2006-05-25 12:52:42 +0200 (Thu, 25 May 2006) | 6 lines
+r139 | ms | 2006-05-25 12:52:42 +0200 (Do, 25 Mai 2006) | 6 lines
 
-Hinzugefügt:
+Hinzugefügt:
   * ethereal
   * mailx
-Geändert:
+Geändert:
   * /var/ipcop --> /var/ipfire
 
 ------------------------------------------------------------------------
-r138 | ms | 2006-05-24 22:21:07 +0200 (Wed, 24 May 2006) | 2 lines
+r138 | ms | 2006-05-24 22:21:07 +0200 (Mi, 24 Mai 2006) | 2 lines
 
-Sourceforge-Mirror wieder geändert.
+Sourceforge-Mirror wieder geändert.
 
 ------------------------------------------------------------------------
-r137 | ms | 2006-05-24 21:47:34 +0200 (Wed, 24 May 2006) | 6 lines
+r137 | ms | 2006-05-24 21:47:34 +0200 (Mi, 24 Mai 2006) | 6 lines
 
-Hinzugefügt:
+Hinzugefügt:
   * NCFTP - Ein CLI-FTP-Client.
-Geändert:
+Geändert:
   * Versucht das XAMPP-Paket zu verkleinern.
   * ./make.sh sync erweitert.
 
 ------------------------------------------------------------------------
-r136 | ms | 2006-05-24 20:04:26 +0200 (Wed, 24 May 2006) | 3 lines
+r136 | ms | 2006-05-24 20:04:26 +0200 (Mi, 24 Mai 2006) | 3 lines
 
-Hinzugefügt:
+Hinzugefügt:
   * Amavis-Perl-Module in der ISO.
 
 ------------------------------------------------------------------------
-r135 | ms | 2006-05-24 19:42:02 +0200 (Wed, 24 May 2006) | 4 lines
+r135 | ms | 2006-05-24 19:42:02 +0200 (Mi, 24 Mai 2006) | 4 lines
 
-Hinzugefügt:
+Hinzugefügt:
   * Erste Version von CONFIRE.
-  * ./make.sh sync lädt nun alle neuen Dateien auf den FTP-Server.
+  * ./make.sh sync lädt nun alle neuen Dateien auf den FTP-Server.
 
 ------------------------------------------------------------------------
-r134 | ms | 2006-05-23 22:15:26 +0200 (Tue, 23 May 2006) | 4 lines
+r134 | ms | 2006-05-23 22:15:26 +0200 (Di, 23 Mai 2006) | 4 lines
 
-Geändert:
+Geändert:
   * CONFIG_ROOT in den Scripts angepasst auf /var/ipfire
-  * Zwei führende "/" in den ROOTFILES entfernt.
+  * Zwei führende "/" in den ROOTFILES entfernt.
 
 ------------------------------------------------------------------------
-r133 | ms | 2006-05-23 21:31:40 +0200 (Tue, 23 May 2006) | 6 lines
+r133 | ms | 2006-05-23 21:31:40 +0200 (Di, 23 Mai 2006) | 6 lines
 
-Hinzugefügt:
+Hinzugefügt:
   * NMAP - Netzwerk-Scanner
-Geändert:
+Geändert:
   * Postfix-Quelle
   * CAPIINFO war an der falschen Stelle in der Makefile.
 
 ------------------------------------------------------------------------
-r132 | ms | 2006-05-22 14:47:00 +0200 (Mon, 22 May 2006) | 3 lines
+r132 | ms | 2006-05-22 14:47:00 +0200 (Mo, 22 Mai 2006) | 3 lines
 
 Zweiter Teil des dicken Quellenupdates. Diesmal: C bis D.
 Status: 49/230 fertiggestellt.
 
 ------------------------------------------------------------------------
-r131 | ms | 2006-05-22 14:14:56 +0200 (Mon, 22 May 2006) | 6 lines
+r131 | ms | 2006-05-22 14:14:56 +0200 (Mo, 22 Mai 2006) | 6 lines
 
 
 Wir beginnen nun ein Migration der Quellcodepakete auf einen unserer
@@ -284,352 +422,352 @@ A bis B einschliesslich. Ich hoffe da macht jemand anderes weiter.
 Hinzu sind die Pakete, deren Mirrors ausgefallen sind, schon umgezogen.
 
 ------------------------------------------------------------------------
-r130 | ms | 2006-05-22 12:43:28 +0200 (Mon, 22 May 2006) | 8 lines
+r130 | ms | 2006-05-22 12:43:28 +0200 (Mo, 22 Mai 2006) | 8 lines
 
-Hinzugefügt:
+Hinzugefügt:
   * Zaptel Kernelmodule werden gleich komprimiert.
-Geändert:
-  * Konfigurationspfade sämtlicher Programme von /etc nach /var/ipfire verschoben.
-  * Einige Schönheitsfehler IPCop --> IPFire korrigiert.
-Gelöscht:
+Geändert:
+  * Konfigurationspfade sämtlicher Programme von /etc nach /var/ipfire verschoben.
+  * Einige Schönheitsfehler IPCop --> IPFire korrigiert.
+Gelöscht:
   * wireless herausgenommen. (Bleibt abzuwarten, wann es in IPCop 1.4.11 ist.)
 
 ------------------------------------------------------------------------
-r129 | ms | 2006-05-21 22:54:29 +0200 (Sun, 21 May 2006) | 11 lines
+r129 | ms | 2006-05-21 22:54:29 +0200 (So, 21 Mai 2006) | 11 lines
 
-Hinzugefügt:
+Hinzugefügt:
   * Nochmal ein neues Shutdown-Bild.
   * Schnelle Profilauswahl in der index.cgi
   * Nettraffic.
   * Capiinfo.
-Geändert:
-  * Menü komplett neu sortiert.
+Geändert:
+  * Menü komplett neu sortiert.
   * Javascript-Option aus gui.cgi entfernt.
   * Pakfire-Fehler beseitigt.
-  * Sämtliche /var/ipcop durch /var/ipfire ersetzt.
+  * Sämtliche /var/ipcop durch /var/ipfire ersetzt.
 
 ------------------------------------------------------------------------
-r128 | ms | 2006-05-20 13:34:29 +0200 (Sat, 20 May 2006) | 8 lines
+r128 | ms | 2006-05-20 13:34:29 +0200 (Sa, 20 Mai 2006) | 8 lines
 
-Hinzugefügt:
+Hinzugefügt:
   * Pakfire in die ISO gepackt. (Welche nocheinmal kleiner geworden ist.)
   * Neues Shutdown-Bild
-Geändert:
-  * Zahlreiche Schönheitsfehler im Pakfire korrigiert. ^^
-Gelöscht:
-  * Ein kleines Überbleibsel vom IPCop entfernt.
+Geändert:
+  * Zahlreiche Schönheitsfehler im Pakfire korrigiert. ^^
+Gelöscht:
+  * Ein kleines Überbleibsel vom IPCop entfernt.
 
 ------------------------------------------------------------------------
-r127 | ms | 2006-05-20 11:34:19 +0200 (Sat, 20 May 2006) | 3 lines
+r127 | ms | 2006-05-20 11:34:19 +0200 (Sa, 20 Mai 2006) | 3 lines
 
-Hinzugefügt:
+Hinzugefügt:
   * Erste Version des Pakfire von Peter
 
 ------------------------------------------------------------------------
-r126 | ms | 2006-05-19 16:29:15 +0200 (Fri, 19 May 2006) | 3 lines
+r126 | ms | 2006-05-19 16:29:15 +0200 (Fr, 19 Mai 2006) | 3 lines
 
-Geändert:
-  * Überflüssige Programme aus der ISO genommen... Postfix, Stund usw...
+Geändert:
+  * Überflüssige Programme aus der ISO genommen... Postfix, Stund usw...
 
 ------------------------------------------------------------------------
-r125 | ms | 2006-05-18 19:33:39 +0200 (Thu, 18 May 2006) | 5 lines
+r125 | ms | 2006-05-18 19:33:39 +0200 (Do, 18 Mai 2006) | 5 lines
 
-Hinzugefügt:
+Hinzugefügt:
   * Fritz!PCI Treiber (auch SMP)
-Geändert:
-  * Postfix Konfiguration gekürzt
+Geändert:
+  * Postfix Konfiguration gekürzt
 
 ------------------------------------------------------------------------
-r124 | ms | 2006-05-18 13:39:26 +0200 (Thu, 18 May 2006) | 3 lines
+r124 | ms | 2006-05-18 13:39:26 +0200 (Do, 18 Mai 2006) | 3 lines
 
-Geändert:
+Geändert:
   * Erste Postfix-Standard-Konfiguration
 
 ------------------------------------------------------------------------
-r123 | ms | 2006-05-18 13:14:03 +0200 (Thu, 18 May 2006) | 7 lines
+r123 | ms | 2006-05-18 13:14:03 +0200 (Do, 18 Mai 2006) | 7 lines
 
-Hinzugefügt:
+Hinzugefügt:
   * Amavisd-new
   * Spamassassin (geht nun)
-  * Sämtlich Perlmodule für Amavis
-Geändert:
+  * Sämtlich Perlmodule für Amavis
+Geändert:
   * ./make.sh make bearbeitet
 
 ------------------------------------------------------------------------
-r122 | ms | 2006-05-18 11:14:22 +0200 (Thu, 18 May 2006) | 10 lines
+r122 | ms | 2006-05-18 11:14:22 +0200 (Do, 18 Mai 2006) | 10 lines
 
-Hinzugefügt:
+Hinzugefügt:
   * Razor - Spamkiller
   * ./make.sh make - Holt erst die Pakete und kompiliert dann...
-Geändert:
+Geändert:
   * Asterisk - Compiler-Optionen
-  * Postfix - nur optische Änderungen
-  * ROOTFILES.i386 - Wegen saslauthd-Änderungen einige Dateien gestrichen
+  * Postfix - nur optische Änderungen
+  * ROOTFILES.i386 - Wegen saslauthd-Änderungen einige Dateien gestrichen
   * ./make.sh changelog bearbeitet
   * ChangeLog-Update
 
 ------------------------------------------------------------------------
-r121 | ms | 2006-05-17 19:04:11 +0200 (Wed, 17 May 2006) | 3 lines
+r121 | ms | 2006-05-17 19:04:11 +0200 (Mi, 17 Mai 2006) | 3 lines
 
-Hinzugefügt:
+Hinzugefügt:
   * Procmail
 
 ------------------------------------------------------------------------
-r120 | ms | 2006-05-17 14:44:06 +0200 (Wed, 17 May 2006) | 4 lines
+r120 | ms | 2006-05-17 14:44:06 +0200 (Mi, 17 Mai 2006) | 4 lines
 
-Geändert:
+Geändert:
   * CyrusIMAPd auf den neuesten Stand gebracht.
-  * Saslauthd überarbeitet.
+  * Saslauthd überarbeitet.
 
 ------------------------------------------------------------------------
-r119 | ms | 2006-05-17 13:25:29 +0200 (Wed, 17 May 2006) | 3 lines
+r119 | ms | 2006-05-17 13:25:29 +0200 (Mi, 17 Mai 2006) | 3 lines
 
-Geändert:
+Geändert:
   * Asterisk jetzt in der Version 1.2.7.1 mit Bristuff 0.3.0-PRE-1o und Florz-Patch
 
 ------------------------------------------------------------------------
-r118 | ms | 2006-05-16 13:12:49 +0200 (Tue, 16 May 2006) | 7 lines
+r118 | ms | 2006-05-16 13:12:49 +0200 (Di, 16 Mai 2006) | 7 lines
 
-Hinzugefügt:
+Hinzugefügt:
   * NFS
-  * Portmap - braucht man für NFS
-Geändert:
-  * IP_CONNTRACK-Patch erstellt damit die Verbindungsanzeige im Webinterface ohne Workaround funktioniert. (Noch nicht vollständig getestet!)
+  * Portmap - braucht man für NFS
+Geändert:
+  * IP_CONNTRACK-Patch erstellt damit die Verbindungsanzeige im Webinterface ohne Workaround funktioniert. (Noch nicht vollständig getestet!)
   * ./make.sh commit optimiert
 
 ------------------------------------------------------------------------
-r117 | ms | 2006-05-16 13:01:06 +0200 (Tue, 16 May 2006) | 3 lines
+r117 | ms | 2006-05-16 13:01:06 +0200 (Di, 16 Mai 2006) | 3 lines
 
 Quellenupdate u.a. wegen Serverausfall bei Sourceforge.net
 Wir haben die Absicht den Sourcecode auf eigenen Servern zu hosten!
 
 ------------------------------------------------------------------------
-r116 | ms | 2006-05-15 22:28:30 +0200 (Mon, 15 May 2006) | 5 lines
+r116 | ms | 2006-05-15 22:28:30 +0200 (Mo, 15 Mai 2006) | 5 lines
 
-Geändert:
+Geändert:
   * ./make.sh dist noch optimiert.
   * TCP Wrappers Patch vergessen :)
   * ChangeLog-Update hat auch nicht funktioniert.
 
 ------------------------------------------------------------------------
-r115 | ms | 2006-05-15 22:08:54 +0200 (Mon, 15 May 2006) | 7 lines
+r115 | ms | 2006-05-15 22:08:54 +0200 (Mo, 15 Mai 2006) | 7 lines
 
-Hinzugefügt:
-  * TCP Wrappers für NFS
+Hinzugefügt:
+  * TCP Wrappers für NFS
   * SpamAssassin - geht noch nicht!
-Geändert:
+Geändert:
   * Cups mit Samba verlinkt.
-  * Neue Prozedur in ./make.sh commit - Lädt alles ins SVN und aktualisiert vorher den ChangeLog.
+  * Neue Prozedur in ./make.sh commit - Lädt alles ins SVN und aktualisiert vorher den ChangeLog.
 
 ------------------------------------------------------------------------
-r114 | ms | 2006-05-13 19:54:40 +0200 (Sat, 13 May 2006) | 3 lines
+r114 | ms | 2006-05-13 19:54:40 +0200 (Sa, 13 Mai 2006) | 3 lines
 
-Geändert:
+Geändert:
   * ./make.sh dist erstellt von jetzt an einen Tarball mit den letzten Sources im SVN.
 
 ------------------------------------------------------------------------
-r113 | ms | 2006-05-13 18:59:56 +0200 (Sat, 13 May 2006) | 12 lines
+r113 | ms | 2006-05-13 18:59:56 +0200 (Sa, 13 Mai 2006) | 12 lines
 
-Hinzugefügt:
+Hinzugefügt:
   * Clamav - Antivirus
   * rsync - Backuptool
-Geändert:
+Geändert:
   * Einige neue Prozeduren in der make.sh
-  * Ein paar Backupdateien gelöscht/aufgeräumt
-  * Credits bearbeitet. Noch nicht vollständig.
+  * Ein paar Backupdateien gelöscht/aufgeräumt
+  * Credits bearbeitet. Noch nicht vollständig.
   * XAMPP jetzt nichtmehr in der ISO sondern als Paket.
   * ISO bedeutend kleiner: 144MB -> 61MB
   * GNUMP3D-Paket erstellt.
-  * Kernel schonmal angepasst für NFS, noch nicht getestet!!
+  * Kernel schonmal angepasst für NFS, noch nicht getestet!!
 
 ------------------------------------------------------------------------
-r112 | ms | 2006-05-04 12:50:41 +0200 (Thu, 04 May 2006) | 3 lines
+r112 | ms | 2006-05-04 12:50:41 +0200 (Do, 04 Mai 2006) | 3 lines
 
-Hauptsächlich Quellenupdate. Apache - Bind - hddtemp - hdparm - lame
+Hauptsächlich Quellenupdate. Apache - Bind - hddtemp - hdparm - lame
 Ghostscript und CUPS aktiviert. Samba jetzt mit libcups-Support.
 
 ------------------------------------------------------------------------
-r111 | ms | 2006-05-04 12:48:33 +0200 (Thu, 04 May 2006) | 5 lines
+r111 | ms | 2006-05-04 12:48:33 +0200 (Do, 04 Mai 2006) | 5 lines
 
-Hinzugefügt:
-  * Patch für MPG123
-Geändert:
+Hinzugefügt:
+  * Patch für MPG123
+Geändert:
   * CUPS
 
 ------------------------------------------------------------------------
-r110 | ms | 2006-05-02 22:19:59 +0200 (Tue, 02 May 2006) | 7 lines
+r110 | ms | 2006-05-02 22:19:59 +0200 (Di, 02 Mai 2006) | 7 lines
 
-Hinzugefügt:
-  * mpg123 - Für Wartemusik im Asterisk
+Hinzugefügt:
+  * mpg123 - Für Wartemusik im Asterisk
   * CUPS - Drucker-Daemon
   * Ghostscript - Braucht CUPS
   * GNUmp3d - MP3-Streamer
   * lame - Braucht GNUmp3d
 
 ------------------------------------------------------------------------
-r109 | ms | 2006-05-02 08:06:43 +0200 (Tue, 02 May 2006) | 4 lines
+r109 | ms | 2006-05-02 08:06:43 +0200 (Di, 02 Mai 2006) | 4 lines
 
-Geändert:
+Geändert:
   * Samba wird jetzt ohne Dokumentation installiert
   * Gettoolchain repariert
 
 ------------------------------------------------------------------------
-r108 | ms | 2006-05-01 21:47:04 +0200 (Mon, 01 May 2006) | 2 lines
+r108 | ms | 2006-05-01 21:47:04 +0200 (Mo, 01 Mai 2006) | 2 lines
 
 Quellenupdate! wireless, ntp, shadow, uClibc
 
 ------------------------------------------------------------------------
-r107 | ms | 2006-05-01 21:02:50 +0200 (Mon, 01 May 2006) | 2 lines
+r107 | ms | 2006-05-01 21:02:50 +0200 (Mo, 01 Mai 2006) | 2 lines
 
-EmbCop-Sources gelöscht!
+EmbCop-Sources gelöscht!
 
 ------------------------------------------------------------------------
-r106 | ms | 2006-04-28 16:57:32 +0200 (Fri, 28 Apr 2006) | 7 lines
+r106 | ms | 2006-04-28 16:57:32 +0200 (Fr, 28 Apr 2006) | 7 lines
 
-Hinzugefügt:
+Hinzugefügt:
   * fetchmail
   * cyrusimap
-Geändert:
+Geändert:
   * xampp
   * pam
 
 ------------------------------------------------------------------------
-r105 | ms | 2006-04-20 16:20:28 +0200 (Thu, 20 Apr 2006) | 7 lines
+r105 | ms | 2006-04-20 16:20:28 +0200 (Do, 20 Apr 2006) | 7 lines
 
-Hinzugefügt:
+Hinzugefügt:
   * Sane - Scanning
   * LibJPEG
-Geändert:
+Geändert:
   * pwlib
   * xinetd
 
 ------------------------------------------------------------------------
-r104 | ms | 2006-04-20 16:15:50 +0200 (Thu, 20 Apr 2006) | 2 lines
+r104 | ms | 2006-04-20 16:15:50 +0200 (Do, 20 Apr 2006) | 2 lines
 
-Allgemeine Aufräumarbeiten und Optimierungen
+Allgemeine Aufräumarbeiten und Optimierungen
 
 ------------------------------------------------------------------------
-r103 | ms | 2006-04-19 18:02:55 +0200 (Wed, 19 Apr 2006) | 4 lines
+r103 | ms | 2006-04-19 18:02:55 +0200 (Mi, 19 Apr 2006) | 4 lines
 
-Geändert:
+Geändert:
   * pwlib wird bei jedem Durchgang kompiliert, auch wenn schon geschehen :(
-  * Mirror-URL geändert
+  * Mirror-URL geändert
 
 ------------------------------------------------------------------------
-r102 | ms | 2006-04-19 15:30:44 +0200 (Wed, 19 Apr 2006) | 9 lines
+r102 | ms | 2006-04-19 15:30:44 +0200 (Mi, 19 Apr 2006) | 9 lines
 
-Geändert:
+Geändert:
   * Asterisk mit H323
 Neue Versionen:
   * OpenVPN
   * pwlib
   * openh323
 Fixed:
-  * Menü im Webinterface
+  * Menü im Webinterface
 
 ------------------------------------------------------------------------
-r101 | ms | 2006-04-15 01:12:47 +0200 (Sat, 15 Apr 2006) | 10 lines
+r101 | ms | 2006-04-15 01:12:47 +0200 (Sa, 15 Apr 2006) | 10 lines
 
-Hinzugefügt:
+Hinzugefügt:
   * Asterisk - mit Zaptel/LibPRI/BRISTUFF/app_fax
   * Spandsp
   * LibTIFF
   * LibXML2
   * eDonkey-commandline-client
-Geändert:
-  * busybox - tar-parameter zurückgesetzt
+Geändert:
+  * busybox - tar-parameter zurückgesetzt
   * postfix hat Beta-Status-1
 
 ------------------------------------------------------------------------
-r100 | ms | 2006-04-11 00:33:24 +0200 (Tue, 11 Apr 2006) | 6 lines
+r100 | ms | 2006-04-11 00:33:24 +0200 (Di, 11 Apr 2006) | 6 lines
 
-Hinzugefügt:
+Hinzugefügt:
   * Samba - Erste Test-Version
-  * STUNNEL - bisher nicht verwendet, aber SWAT sendet das root-Passwort im Klartext über die Leitung
-Geändert:
+  * STUNNEL - bisher nicht verwendet, aber SWAT sendet das root-Passwort im Klartext über die Leitung
+Geändert:
   * Linux-PAM - Libs waren falsch verlinkt
 
 ------------------------------------------------------------------------
-r99 | casemaster | 2006-04-10 23:10:53 +0200 (Mon, 10 Apr 2006) | 2 lines
+r99 | casemaster | 2006-04-10 23:10:53 +0200 (Mo, 10 Apr 2006) | 2 lines
 
-pwlib geändert.
-busybox: tar.c größe auf 150 gesetzt.
+pwlib geändert.
+busybox: tar.c größe auf 150 gesetzt.
 ------------------------------------------------------------------------
-r98 | ms | 2006-04-10 20:39:59 +0200 (Mon, 10 Apr 2006) | 4 lines
+r98 | ms | 2006-04-10 20:39:59 +0200 (Mo, 10 Apr 2006) | 4 lines
 
-Hinzugefügt:
+Hinzugefügt:
   * Xinetd - Super-Daemon
   * Sudo
 
 ------------------------------------------------------------------------
-r97 | ms | 2006-04-09 22:23:54 +0200 (Sun, 09 Apr 2006) | 4 lines
+r97 | ms | 2006-04-09 22:23:54 +0200 (So, 09 Apr 2006) | 4 lines
 
-Hinzugefügt:
+Hinzugefügt:
   * OpenVPN
   * LZO
 
 ------------------------------------------------------------------------
-r96 | ms | 2006-04-09 19:55:27 +0200 (Sun, 09 Apr 2006) | 7 lines
+r96 | ms | 2006-04-09 19:55:27 +0200 (So, 09 Apr 2006) | 7 lines
 
-Hinzugefügt:
+Hinzugefügt:
   * Midnight Commander 4.6.1 (GLIB/PKG-CONFIG)
-Geändert:
+Geändert:
   * OpenLDAP
   * PWLib - Compilier-Optionen
   * make-packages - Funktionen erweitert
 
 ------------------------------------------------------------------------
-r95 | ms | 2006-04-04 19:19:54 +0200 (Tue, 04 Apr 2006) | 2 lines
+r95 | ms | 2006-04-04 19:19:54 +0200 (Di, 04 Apr 2006) | 2 lines
 
-Kleine Fixes an den Graphs und dem Menü!
+Kleine Fixes an den Graphs und dem Menü!
 
 ------------------------------------------------------------------------
-r94 | casemaster | 2006-04-02 14:18:42 +0200 (Sun, 02 Apr 2006) | 2 lines
+r94 | casemaster | 2006-04-02 14:18:42 +0200 (So, 02 Apr 2006) | 2 lines
 
 src fuer openldap geaendert.
 ldap Unterstuetzung bei pwlib entfernt.
 ------------------------------------------------------------------------
-r93 | ms | 2006-03-28 20:54:43 +0200 (Tue, 28 Mar 2006) | 5 lines
+r93 | ms | 2006-03-28 20:54:43 +0200 (Di, 28 Mär 2006) | 5 lines
 
-Hinzugefügt:
+Hinzugefügt:
     * OpenLDAP
-Geändert:
+Geändert:
     * SASLAUTHD kann jetzt OpenLDAP.
 
 ------------------------------------------------------------------------
-r92 | ms | 2006-03-28 17:35:56 +0200 (Tue, 28 Mar 2006) | 2 lines
+r92 | ms | 2006-03-28 17:35:56 +0200 (Di, 28 Mär 2006) | 2 lines
 
 Allgemeine FIXES! Das Build sollte nun durchlaufen...
 
 ------------------------------------------------------------------------
-r91 | ms | 2006-03-28 16:16:15 +0200 (Tue, 28 Mar 2006) | 1 line
+r91 | ms | 2006-03-28 16:16:15 +0200 (Di, 28 Mär 2006) | 1 line
 
 SASL-Authd nun ohne PostgreSQL-Support.
 ------------------------------------------------------------------------
-r90 | ms | 2006-03-27 21:50:44 +0200 (Mon, 27 Mar 2006) | 1 line
+r90 | ms | 2006-03-27 21:50:44 +0200 (Mo, 27 Mär 2006) | 1 line
 
 URL von den Bridge-Utils gefixt.
 ------------------------------------------------------------------------
-r89 | casemaster | 2006-03-27 17:06:13 +0200 (Mon, 27 Mar 2006) | 1 line
+r89 | casemaster | 2006-03-27 17:06:13 +0200 (Mo, 27 Mär 2006) | 1 line
 
-Test gelöscht.
+Test gelöscht.
 ------------------------------------------------------------------------
-r88 | ms | 2006-03-27 16:43:30 +0200 (Mon, 27 Mar 2006) | 3 lines
+r88 | ms | 2006-03-27 16:43:30 +0200 (Mo, 27 Mär 2006) | 3 lines
 
 Toolchain-Download mit ./make.sh gettoolchain
-Beim Netstatus werden ab jetzt nur noch aktive Verbindungen angezeigt. Erhöht die Übersichtlichkeit...
+Beim Netstatus werden ab jetzt nur noch aktive Verbindungen angezeigt. Erhöht die Übersichtlichkeit...
 
 ------------------------------------------------------------------------
-r87 | casemaster | 2006-03-27 16:35:38 +0200 (Mon, 27 Mar 2006) | 1 line
+r87 | casemaster | 2006-03-27 16:35:38 +0200 (Mo, 27 Mär 2006) | 1 line
 
 Test 2 Write
 ------------------------------------------------------------------------
-r86 | ms | 2006-03-27 16:02:24 +0200 (Mon, 27 Mar 2006) | 2 lines
+r86 | ms | 2006-03-27 16:02:24 +0200 (Mo, 27 Mär 2006) | 2 lines
 
-Repariert: lib-links für postfix
+Repariert: lib-links für postfix
 
 ------------------------------------------------------------------------
-r85 | ms | 2006-03-26 20:46:32 +0200 (Sun, 26 Mar 2006) | 5 lines
+r85 | ms | 2006-03-26 20:46:32 +0200 (So, 26 Mär 2006) | 5 lines
 
 Update Squid to 2.5STABLE13.
 Added WGET/HDDTEMP/BRIDGE-UTILS.
@@ -637,39 +775,39 @@ SCSI-GRUB-Konfiguration angepasst.
 
 
 ------------------------------------------------------------------------
-r84 | ms | 2006-03-25 16:06:35 +0100 (Sat, 25 Mar 2006) | 4 lines
+r84 | ms | 2006-03-25 16:06:35 +0100 (Sa, 25 Mär 2006) | 4 lines
 
 Erste Version des Paketerstellers.
 Bisher nur Postfix. :(
 
 
 ------------------------------------------------------------------------
-r83 | guest | 2006-03-24 16:47:00 +0100 (Fri, 24 Mar 2006) | 1 line
+r83 | guest | 2006-03-24 16:47:00 +0100 (Fr, 24 Mär 2006) | 1 line
 
 nomsg
 ------------------------------------------------------------------------
-r82 | ms | 2006-03-22 20:11:17 +0100 (Wed, 22 Mar 2006) | 8 lines
+r82 | ms | 2006-03-22 20:11:17 +0100 (Mi, 22 Mär 2006) | 8 lines
 
 Webinterface gefixt.
 Ohne Anmeldung kommt man im Webinterface nichtmehr auf die Index-Seite.
 Berkeley-DB neu implementiert.
 Postfix geht jetzt.
 Graphs gefixt.
-IPCop-Updates gelöscht.
+IPCop-Updates gelöscht.
 
 
 ------------------------------------------------------------------------
-r81 | ms | 2006-03-18 12:24:42 +0100 (Sat, 18 Mar 2006) | 1 line
+r81 | ms | 2006-03-18 12:24:42 +0100 (Sa, 18 Mär 2006) | 1 line
 
 Quellenupdate
 ------------------------------------------------------------------------
-r80 | ms | 2006-03-17 01:46:51 +0100 (Fri, 17 Mar 2006) | 1 line
+r80 | ms | 2006-03-17 01:46:51 +0100 (Fr, 17 Mär 2006) | 1 line
 
 TEMP-DIR von /tmp nach /var/tmp verschoben.
 ------------------------------------------------------------------------
-r79 | ms | 2006-03-12 22:09:13 +0100 (Sun, 12 Mar 2006) | 11 lines
+r79 | ms | 2006-03-12 22:09:13 +0100 (So, 12 Mär 2006) | 11 lines
 
-Hinzugefügt:
+Hinzugefügt:
     * Postfix 2.2.9
     * PostGreSQL
 Gefixt und neu implementiert:
@@ -678,131 +816,131 @@ Gefixt und neu implementiert:
     * XAMPP + PostGreSQL
     * SASLAUTHD
 /opt/lampp/lib und /opt/lampp/lib/mysql befinden sich im Lib-Cache
-leichtes aufräumen in der make.sh
+leichtes aufräumen in der make.sh
 
 ------------------------------------------------------------------------
-r78 | ms | 2006-03-12 16:52:13 +0100 (Sun, 12 Mar 2006) | 1 line
+r78 | ms | 2006-03-12 16:52:13 +0100 (So, 12 Mär 2006) | 1 line
 
 New Webinterface-Style by benne
 ------------------------------------------------------------------------
-r77 | ms | 2006-03-06 15:30:36 +0100 (Mon, 06 Mar 2006) | 1 line
+r77 | ms | 2006-03-06 15:30:36 +0100 (Mo, 06 Mär 2006) | 1 line
 
 Webinterface-Bilder neu gemacht | IPAC-NG-Patches installiert | Berkeley-DB installiert
 ------------------------------------------------------------------------
-r76 | ms | 2006-03-02 21:55:58 +0100 (Thu, 02 Mar 2006) | 1 line
+r76 | ms | 2006-03-02 21:55:58 +0100 (Do, 02 Mär 2006) | 1 line
 
 PAM-MySQL + BerkeleyDB + SASLauthd hinzugefuegt
 ------------------------------------------------------------------------
-r75 | ms | 2006-02-28 22:11:50 +0100 (Tue, 28 Feb 2006) | 1 line
+r75 | ms | 2006-02-28 22:11:50 +0100 (Di, 28 Feb 2006) | 1 line
 
-ROOTFILES.i386 aufgeräumt
+ROOTFILES.i386 aufgeräumt
 ------------------------------------------------------------------------
-r74 | ms | 2006-02-28 22:10:58 +0100 (Tue, 28 Feb 2006) | 1 line
+r74 | ms | 2006-02-28 22:10:58 +0100 (Di, 28 Feb 2006) | 1 line
 
-ISO vergößert und XAMPP-1.5.1 DEVEL Paket installiert
+ISO vergößert und XAMPP-1.5.1 DEVEL Paket installiert
 ------------------------------------------------------------------------
-r73 | ms | 2006-02-27 21:13:17 +0100 (Mon, 27 Feb 2006) | 2 lines
+r73 | ms | 2006-02-27 21:13:17 +0100 (Mo, 27 Feb 2006) | 2 lines
 
 Quellenupdate... ipaddr busybox kernel
 
 ------------------------------------------------------------------------
-r72 | ms | 2006-02-27 18:13:57 +0100 (Mon, 27 Feb 2006) | 2 lines
+r72 | ms | 2006-02-27 18:13:57 +0100 (Mo, 27 Feb 2006) | 2 lines
 
-OpenH323 hinzugefügt
+OpenH323 hinzugefügt
 
 ------------------------------------------------------------------------
-r71 | ms | 2006-02-22 21:23:30 +0100 (Wed, 22 Feb 2006) | 1 line
+r71 | ms | 2006-02-22 21:23:30 +0100 (Mi, 22 Feb 2006) | 1 line
 
 IPAC-NG ging nicht... mal sehen
 ------------------------------------------------------------------------
-r70 | ms | 2006-02-22 21:21:51 +0100 (Wed, 22 Feb 2006) | 1 line
+r70 | ms | 2006-02-22 21:21:51 +0100 (Mi, 22 Feb 2006) | 1 line
 
 ROOTFILES aktualisiert
 ------------------------------------------------------------------------
-r69 | ms | 2006-02-22 20:52:10 +0100 (Wed, 22 Feb 2006) | 1 line
+r69 | ms | 2006-02-22 20:52:10 +0100 (Mi, 22 Feb 2006) | 1 line
 
 Endlich neues Webinterface
 ------------------------------------------------------------------------
-r68 | ms | 2006-02-21 22:26:55 +0100 (Tue, 21 Feb 2006) | 2 lines
+r68 | ms | 2006-02-21 22:26:55 +0100 (Di, 21 Feb 2006) | 2 lines
 
 SSH von vornherein aktiviert
 
 ------------------------------------------------------------------------
-r67 | ms | 2006-02-21 21:38:06 +0100 (Tue, 21 Feb 2006) | 2 lines
+r67 | ms | 2006-02-21 21:38:06 +0100 (Di, 21 Feb 2006) | 2 lines
 
 SMP-Config angepasst.. CGIs usw. wurden im Windoof-Format gespeichert... muss noch alles korrigiert werden...
 
 ------------------------------------------------------------------------
-r66 | ms | 2006-02-21 19:55:53 +0100 (Tue, 21 Feb 2006) | 1 line
+r66 | ms | 2006-02-21 19:55:53 +0100 (Di, 21 Feb 2006) | 1 line
 
 immernoch das alte Problem...
 ------------------------------------------------------------------------
-r65 | ms | 2006-02-21 17:55:11 +0100 (Tue, 21 Feb 2006) | 1 line
+r65 | ms | 2006-02-21 17:55:11 +0100 (Di, 21 Feb 2006) | 1 line
 
-EmbCop-V0.1-1.4.10 in branches eingefügt
+EmbCop-V0.1-1.4.10 in branches eingefügt
 ------------------------------------------------------------------------
-r64 | ms | 2006-02-20 22:23:51 +0100 (Mon, 20 Feb 2006) | 2 lines
+r64 | ms | 2006-02-20 22:23:51 +0100 (Mo, 20 Feb 2006) | 2 lines
 
-Kernel Config für SMP angepasst...
+Kernel Config für SMP angepasst...
 
 ------------------------------------------------------------------------
-r63 | ms | 2006-02-20 21:46:53 +0100 (Mon, 20 Feb 2006) | 2 lines
+r63 | ms | 2006-02-20 21:46:53 +0100 (Mo, 20 Feb 2006) | 2 lines
 
 Windows hat sie wieder zerschossen... :(
 
 ------------------------------------------------------------------------
-r62 | ms | 2006-02-20 21:13:28 +0100 (Mon, 20 Feb 2006) | 1 line
+r62 | ms | 2006-02-20 21:13:28 +0100 (Mo, 20 Feb 2006) | 1 line
 
 SMP wieder aktiviert (Zumindest versucht)
 ------------------------------------------------------------------------
-r61 | ms | 2006-02-20 21:01:45 +0100 (Mon, 20 Feb 2006) | 1 line
+r61 | ms | 2006-02-20 21:01:45 +0100 (Mo, 20 Feb 2006) | 1 line
 
 
 ------------------------------------------------------------------------
-r60 | ms | 2006-02-20 21:01:31 +0100 (Mon, 20 Feb 2006) | 1 line
+r60 | ms | 2006-02-20 21:01:31 +0100 (Mo, 20 Feb 2006) | 1 line
 
 Removed file/folder
 ------------------------------------------------------------------------
-r59 | ms | 2006-02-20 20:57:20 +0100 (Mon, 20 Feb 2006) | 1 line
+r59 | ms | 2006-02-20 20:57:20 +0100 (Mo, 20 Feb 2006) | 1 line
 
 
 ------------------------------------------------------------------------
-r58 | ms | 2006-02-20 20:56:37 +0100 (Mon, 20 Feb 2006) | 1 line
+r58 | ms | 2006-02-20 20:56:37 +0100 (Mo, 20 Feb 2006) | 1 line
 
 
 ------------------------------------------------------------------------
-r57 | ms | 2006-02-20 20:55:36 +0100 (Mon, 20 Feb 2006) | 1 line
+r57 | ms | 2006-02-20 20:55:36 +0100 (Mo, 20 Feb 2006) | 1 line
 
 Removed file/folder
 ------------------------------------------------------------------------
-r56 | ms | 2006-02-20 20:51:27 +0100 (Mon, 20 Feb 2006) | 1 line
+r56 | ms | 2006-02-20 20:51:27 +0100 (Mo, 20 Feb 2006) | 1 line
 
 
 ------------------------------------------------------------------------
-r55 | ms | 2006-02-20 20:50:08 +0100 (Mon, 20 Feb 2006) | 1 line
+r55 | ms | 2006-02-20 20:50:08 +0100 (Mo, 20 Feb 2006) | 1 line
 
 
 ------------------------------------------------------------------------
-r54 | ms | 2006-02-20 20:49:08 +0100 (Mon, 20 Feb 2006) | 2 lines
+r54 | ms | 2006-02-20 20:49:08 +0100 (Mo, 20 Feb 2006) | 2 lines
 
 Sicherheits-Update packages-list
 
 ------------------------------------------------------------------------
-r53 | ms | 2006-02-20 02:46:27 +0100 (Mon, 20 Feb 2006) | 2 lines
+r53 | ms | 2006-02-20 02:46:27 +0100 (Mo, 20 Feb 2006) | 2 lines
 
 driver.img ohne SMP
 
 ------------------------------------------------------------------------
-r52 | ms | 2006-02-20 02:39:21 +0100 (Mon, 20 Feb 2006) | 2 lines
+r52 | ms | 2006-02-20 02:39:21 +0100 (Mo, 20 Feb 2006) | 2 lines
 
-GD und gd Konflikt gelöst...
-make.sh zerstört :(
+GD und gd Konflikt gelöst...
+make.sh zerstört :(
 ------------------------------------------------------------------------
-r51 | ms | 2006-02-20 02:32:51 +0100 (Mon, 20 Feb 2006) | 1 line
+r51 | ms | 2006-02-20 02:32:51 +0100 (Mo, 20 Feb 2006) | 1 line
 
 Removed file/folder gd
 ------------------------------------------------------------------------
-r50 | ms | 2006-02-20 02:10:06 +0100 (Mon, 20 Feb 2006) | 5 lines
+r50 | ms | 2006-02-20 02:10:06 +0100 (Mo, 20 Feb 2006) | 5 lines
 
 ipac-ng fix
 uClibc fix
@@ -810,205 +948,205 @@ pam-patch fix
 
 
 ------------------------------------------------------------------------
-r49 | ms | 2006-02-19 23:25:48 +0100 (Sun, 19 Feb 2006) | 2 lines
+r49 | ms | 2006-02-19 23:25:48 +0100 (So, 19 Feb 2006) | 2 lines
 
-SMP entfernt / gd hinzugefügt!
+SMP entfernt / gd hinzugefügt!
 
 ------------------------------------------------------------------------
-r48 | ms | 2006-02-19 18:04:08 +0100 (Sun, 19 Feb 2006) | 2 lines
+r48 | ms | 2006-02-19 18:04:08 +0100 (So, 19 Feb 2006) | 2 lines
 
 Quellen-Update
 
 ------------------------------------------------------------------------
-r47 | ms | 2006-02-19 15:12:52 +0100 (Sun, 19 Feb 2006) | 1 line
+r47 | ms | 2006-02-19 15:12:52 +0100 (So, 19 Feb 2006) | 1 line
 
-Neuer Boot-Screen für GRUB
+Neuer Boot-Screen für GRUB
 ------------------------------------------------------------------------
-r46 | ms | 2006-02-19 14:16:13 +0100 (Sun, 19 Feb 2006) | 2 lines
+r46 | ms | 2006-02-19 14:16:13 +0100 (So, 19 Feb 2006) | 2 lines
 
 Installer repariert
 
 ------------------------------------------------------------------------
-r45 | ms | 2006-02-19 14:12:53 +0100 (Sun, 19 Feb 2006) | 2 lines
+r45 | ms | 2006-02-19 14:12:53 +0100 (So, 19 Feb 2006) | 2 lines
 
 Installer repariert
 
 ------------------------------------------------------------------------
-r44 | ms | 2006-02-19 13:19:49 +0100 (Sun, 19 Feb 2006) | 2 lines
+r44 | ms | 2006-02-19 13:19:49 +0100 (So, 19 Feb 2006) | 2 lines
 
 make.sh gefixt
 
 ------------------------------------------------------------------------
-r43 | ms | 2006-02-19 13:01:48 +0100 (Sun, 19 Feb 2006) | 1 line
+r43 | ms | 2006-02-19 13:01:48 +0100 (So, 19 Feb 2006) | 1 line
 
-IPCOP SOURCE Version 1.4.10 hinzugefügt
+IPCOP SOURCE Version 1.4.10 hinzugefügt
 ------------------------------------------------------------------------
-r42 | ms | 2006-02-19 12:34:16 +0100 (Sun, 19 Feb 2006) | 1 line
+r42 | ms | 2006-02-19 12:34:16 +0100 (So, 19 Feb 2006) | 1 line
 
 Renamed File
 ------------------------------------------------------------------------
-r41 | ms | 2006-02-19 12:25:43 +0100 (Sun, 19 Feb 2006) | 2 lines
+r41 | ms | 2006-02-19 12:25:43 +0100 (So, 19 Feb 2006) | 2 lines
 
 Port 445 -> 444 gewechselt und XTAccess-Regeln ausgeschaltet.
 Nach der Installation sind alle Ports geschlossen!
 ------------------------------------------------------------------------
-r40 | ms | 2006-02-18 22:39:37 +0100 (Sat, 18 Feb 2006) | 1 line
+r40 | ms | 2006-02-18 22:39:37 +0100 (Sa, 18 Feb 2006) | 1 line
 
 Ordnerstruktur 3. Teil 
 ------------------------------------------------------------------------
-r39 | ms | 2006-02-18 22:33:11 +0100 (Sat, 18 Feb 2006) | 1 line
+r39 | ms | 2006-02-18 22:33:11 +0100 (Sa, 18 Feb 2006) | 1 line
 
 Ordnerstruktur 2-ter Teil
 ------------------------------------------------------------------------
-r38 | ms | 2006-02-18 22:26:02 +0100 (Sat, 18 Feb 2006) | 1 line
+r38 | ms | 2006-02-18 22:26:02 +0100 (Sa, 18 Feb 2006) | 1 line
 
-Vernünftige Ordnerstruktur
+Vernünftige Ordnerstruktur
 ------------------------------------------------------------------------
-r37 | ms | 2006-02-16 22:18:00 +0100 (Thu, 16 Feb 2006) | 1 line
+r37 | ms | 2006-02-16 22:18:00 +0100 (Do, 16 Feb 2006) | 1 line
 
-Neuer Installer eingefügt...
+Neuer Installer eingefügt...
 ------------------------------------------------------------------------
-r36 | ms | 2006-02-16 20:20:41 +0100 (Thu, 16 Feb 2006) | 1 line
+r36 | ms | 2006-02-16 20:20:41 +0100 (Do, 16 Feb 2006) | 1 line
 
 
 ------------------------------------------------------------------------
-r35 | ms | 2006-02-16 20:09:00 +0100 (Thu, 16 Feb 2006) | 1 line
+r35 | ms | 2006-02-16 20:09:00 +0100 (Do, 16 Feb 2006) | 1 line
 
 Removed file/folder
 ------------------------------------------------------------------------
-r34 | ms | 2006-02-16 20:07:58 +0100 (Thu, 16 Feb 2006) | 1 line
+r34 | ms | 2006-02-16 20:07:58 +0100 (Do, 16 Feb 2006) | 1 line
 
 Renamed remotely
 ------------------------------------------------------------------------
-r33 | admin | 2006-02-16 20:04:42 +0100 (Thu, 16 Feb 2006) | 1 line
+r33 | admin | 2006-02-16 20:04:42 +0100 (Do, 16 Feb 2006) | 1 line
 
 Removed file/folder
 ------------------------------------------------------------------------
-r32 | admin | 2006-02-16 20:04:37 +0100 (Thu, 16 Feb 2006) | 1 line
+r32 | admin | 2006-02-16 20:04:37 +0100 (Do, 16 Feb 2006) | 1 line
 
 Removed file/folder
 ------------------------------------------------------------------------
-r31 | ipfire | 2006-02-16 13:20:54 +0100 (Thu, 16 Feb 2006) | 1 line
+r31 | ipfire | 2006-02-16 13:20:54 +0100 (Do, 16 Feb 2006) | 1 line
 
 
 ------------------------------------------------------------------------
-r30 | ipfire | 2006-02-16 13:18:34 +0100 (Thu, 16 Feb 2006) | 1 line
+r30 | ipfire | 2006-02-16 13:18:34 +0100 (Do, 16 Feb 2006) | 1 line
 
 
 ------------------------------------------------------------------------
-r29 | ipfire | 2006-02-16 13:18:15 +0100 (Thu, 16 Feb 2006) | 1 line
+r29 | ipfire | 2006-02-16 13:18:15 +0100 (Do, 16 Feb 2006) | 1 line
 
 
 ------------------------------------------------------------------------
-r28 | ipfire | 2006-02-16 13:09:46 +0100 (Thu, 16 Feb 2006) | 1 line
+r28 | ipfire | 2006-02-16 13:09:46 +0100 (Do, 16 Feb 2006) | 1 line
 
 Removed file/folder
 ------------------------------------------------------------------------
-r27 | ipfire | 2006-02-16 13:07:28 +0100 (Thu, 16 Feb 2006) | 1 line
+r27 | ipfire | 2006-02-16 13:07:28 +0100 (Do, 16 Feb 2006) | 1 line
 
 Removed Files
 ------------------------------------------------------------------------
-r26 | ipfire | 2006-02-16 13:06:41 +0100 (Thu, 16 Feb 2006) | 1 line
+r26 | ipfire | 2006-02-16 13:06:41 +0100 (Do, 16 Feb 2006) | 1 line
 
 Removed file/folder
 ------------------------------------------------------------------------
-r25 | ipfire | 2006-02-15 22:36:29 +0100 (Wed, 15 Feb 2006) | 1 line
+r25 | ipfire | 2006-02-15 22:36:29 +0100 (Mi, 15 Feb 2006) | 1 line
 
 Removed file/folder
 ------------------------------------------------------------------------
-r24 | ipfire | 2006-02-15 22:36:15 +0100 (Wed, 15 Feb 2006) | 1 line
+r24 | ipfire | 2006-02-15 22:36:15 +0100 (Mi, 15 Feb 2006) | 1 line
 
 Removed file/folder
 ------------------------------------------------------------------------
-r23 | ipfire | 2006-02-15 22:35:46 +0100 (Wed, 15 Feb 2006) | 1 line
+r23 | ipfire | 2006-02-15 22:35:46 +0100 (Mi, 15 Feb 2006) | 1 line
 
 Removed file/folder
 ------------------------------------------------------------------------
-r22 | ipfire | 2006-02-15 22:33:28 +0100 (Wed, 15 Feb 2006) | 1 line
+r22 | ipfire | 2006-02-15 22:33:28 +0100 (Mi, 15 Feb 2006) | 1 line
 
 Renamed remotely
 ------------------------------------------------------------------------
-r21 | ipfire | 2006-02-15 22:33:06 +0100 (Wed, 15 Feb 2006) | 1 line
+r21 | ipfire | 2006-02-15 22:33:06 +0100 (Mi, 15 Feb 2006) | 1 line
 
 Removed file/folder
 ------------------------------------------------------------------------
-r20 | ipfire | 2006-02-15 22:32:33 +0100 (Wed, 15 Feb 2006) | 1 line
+r20 | ipfire | 2006-02-15 22:32:33 +0100 (Mi, 15 Feb 2006) | 1 line
 
 Removed file/folder
 ------------------------------------------------------------------------
-r19 | ipfire | 2006-02-15 22:31:56 +0100 (Wed, 15 Feb 2006) | 1 line
+r19 | ipfire | 2006-02-15 22:31:56 +0100 (Mi, 15 Feb 2006) | 1 line
 
 Removed file/folder
 ------------------------------------------------------------------------
-r18 | ipfire | 2006-02-15 22:31:26 +0100 (Wed, 15 Feb 2006) | 1 line
+r18 | ipfire | 2006-02-15 22:31:26 +0100 (Mi, 15 Feb 2006) | 1 line
 
 Removed file/folder
 ------------------------------------------------------------------------
-r17 | ipfire | 2006-02-15 22:31:06 +0100 (Wed, 15 Feb 2006) | 1 line
+r17 | ipfire | 2006-02-15 22:31:06 +0100 (Mi, 15 Feb 2006) | 1 line
 
 Removed file/folder
 ------------------------------------------------------------------------
-r16 | ipfire | 2006-02-15 22:15:54 +0100 (Wed, 15 Feb 2006) | 1 line
+r16 | ipfire | 2006-02-15 22:15:54 +0100 (Mi, 15 Feb 2006) | 1 line
 
 
 ------------------------------------------------------------------------
-r15 | ipfire | 2006-02-15 22:21:38 +0100 (Wed, 15 Feb 2006) | 1 line
+r15 | ipfire | 2006-02-15 22:21:38 +0100 (Mi, 15 Feb 2006) | 1 line
 
 
 ------------------------------------------------------------------------
-r14 | ipfire | 2006-02-15 22:07:30 +0100 (Wed, 15 Feb 2006) | 1 line
+r14 | ipfire | 2006-02-15 22:07:30 +0100 (Mi, 15 Feb 2006) | 1 line
 
 
 ------------------------------------------------------------------------
-r13 | ipfire | 2006-02-15 11:46:10 +0100 (Wed, 15 Feb 2006) | 1 line
+r13 | ipfire | 2006-02-15 11:46:10 +0100 (Mi, 15 Feb 2006) | 1 line
 
 
 ------------------------------------------------------------------------
-r12 | ipfire | 2006-02-15 11:31:15 +0100 (Wed, 15 Feb 2006) | 1 line
+r12 | ipfire | 2006-02-15 11:31:15 +0100 (Mi, 15 Feb 2006) | 1 line
 
 Created folder remotely
 ------------------------------------------------------------------------
-r11 | ipfire | 2006-02-15 11:28:40 +0100 (Wed, 15 Feb 2006) | 1 line
+r11 | ipfire | 2006-02-15 11:28:40 +0100 (Mi, 15 Feb 2006) | 1 line
 
 Removed file/folder
 ------------------------------------------------------------------------
-r10 | ipfire | 2006-02-15 11:27:18 +0100 (Wed, 15 Feb 2006) | 1 line
+r10 | ipfire | 2006-02-15 11:27:18 +0100 (Mi, 15 Feb 2006) | 1 line
 
 Added a folder remotely
 ------------------------------------------------------------------------
-r9 | ipfire | 2006-02-15 11:26:47 +0100 (Wed, 15 Feb 2006) | 1 line
+r9 | ipfire | 2006-02-15 11:26:47 +0100 (Mi, 15 Feb 2006) | 1 line
 
 Moved remotely
 ------------------------------------------------------------------------
-r8 | ipfire | 2006-02-15 11:26:18 +0100 (Wed, 15 Feb 2006) | 1 line
+r8 | ipfire | 2006-02-15 11:26:18 +0100 (Mi, 15 Feb 2006) | 1 line
 
 Added a folder remotely
 ------------------------------------------------------------------------
-r7 | ipfire | 2006-02-15 11:25:16 +0100 (Wed, 15 Feb 2006) | 1 line
+r7 | ipfire | 2006-02-15 11:25:16 +0100 (Mi, 15 Feb 2006) | 1 line
 
 Added a file remotely
 ------------------------------------------------------------------------
-r6 | ipfire | 2006-02-15 11:24:03 +0100 (Wed, 15 Feb 2006) | 1 line
+r6 | ipfire | 2006-02-15 11:24:03 +0100 (Mi, 15 Feb 2006) | 1 line
 
 Added a folder remotely
 ------------------------------------------------------------------------
-r5 | ipfire | 2006-02-15 10:27:58 +0100 (Wed, 15 Feb 2006) | 1 line
+r5 | ipfire | 2006-02-15 10:27:58 +0100 (Mi, 15 Feb 2006) | 1 line
 
 Removed file/folder
 ------------------------------------------------------------------------
-r4 | ipfire | 2006-02-15 10:27:47 +0100 (Wed, 15 Feb 2006) | 1 line
+r4 | ipfire | 2006-02-15 10:27:47 +0100 (Mi, 15 Feb 2006) | 1 line
 
 Created folder remotely
 ------------------------------------------------------------------------
-r3 | admin | 2006-02-15 01:27:59 +0100 (Wed, 15 Feb 2006) | 1 line
+r3 | admin | 2006-02-15 01:27:59 +0100 (Mi, 15 Feb 2006) | 1 line
 
 Ordner im Projektarchiv angelegt
 ------------------------------------------------------------------------
-r2 | admin | 2006-02-15 01:14:05 +0100 (Wed, 15 Feb 2006) | 1 line
+r2 | admin | 2006-02-15 01:14:05 +0100 (Mi, 15 Feb 2006) | 1 line
 
 Ordner im Projektarchiv angelegt
 ------------------------------------------------------------------------
-r1 | admin | 2006-02-15 01:13:56 +0100 (Wed, 15 Feb 2006) | 1 line
+r1 | admin | 2006-02-15 01:13:56 +0100 (Mi, 15 Feb 2006) | 1 line
 
 Ordner im Projektarchiv angelegt
 ------------------------------------------------------------------------
index a890fe2b852ace11b7b63a3c8f38ed5c7331ff2e..8fea85b3c89c49a45f178616ac55a2e037993e3e 100644 (file)
@@ -54,6 +54,7 @@
   * coreutils-5.93
   * cups-1.1.23-source
   * cxacru-2003-10-05
+  * cyrus-imapd-2.2.12
   * cyrus-imapd-2.2.13
   * cyrus-sasl-2.1.21
   * cyrus-sasl-2.1.21-ldap
index f1c7b386924d54a8785caf76cb102e8ec8f89b33..4287110d4541e4685d483c09111fb09acdec5c6b 100644 (file)
@@ -82,6 +82,7 @@ $(TARGET) :
        cp $(DIR_SRC)/config/cfgroot/net-traffic-lib.pl         $(CONFIG_ROOT)/net-traffic/net-traffic-lib.pl
        cp $(DIR_SRC)/config/cfgroot/nfs-server                 $(CONFIG_ROOT)/nfs/nfs-server
        cp $(DIR_SRC)/config/cfgroot/proxy-acl                  $(CONFIG_ROOT)/proxy/acl-1.4
+       cp $(DIR_SRC)/config/cfgroot/ssh-settings                       $(CONFIG_ROOT)/remote/settings
        cp $(DIR_SRC)/config/cfgroot/xtaccess-config            $(CONFIG_ROOT)/xtaccess/config
        cp $(DIR_SRC)/config/cfgroot/time-settings              $(CONFIG_ROOT)/time/settings
        cp $(DIR_SRC)/config/cfgroot/logging-settings           $(CONFIG_ROOT)/logging/settings
index f8bf1883c065509ad8a77143083a7938115acf1b..a8059a815d7722ff10d8ce8596be62efe6b3e416 100644 (file)
@@ -26,7 +26,7 @@
 
 include Config
 
-VER        = 2.2.13
+VER        = 2.2.12
 
 THISAPP    = cyrus-imapd-$(VER)
 DL_FILE    = $(THISAPP).tar.gz
@@ -44,7 +44,7 @@ objects = $(DL_FILE)
 
 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
 
-$(DL_FILE)_MD5 = 3ff679714836d1d7b1e1df0e026d4844
+$(DL_FILE)_MD5 = 70b3bba526a8d36d3bb23a87d37e9188
 
 install : $(TARGET)
 
@@ -77,7 +77,32 @@ $(subst %,%_MD5,$(objects)) :
 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        @$(PREBUILD)
        @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
-       cd $(DIR_APP) && ./configure --prefix=/usr --sysconfdir=/var/ipfire/cyrusimap --with-auth=unix --with-perl --with-sasl --without-ucdsnmp
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/cyrus-imapd-2.2.12-no_transfig.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/cyrus-imapd-2.2.12-autocreate-0.9.4.diff
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/cyrus-imapd-2.2.12-autosievefolder-0.6.diff
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/cyrus-imapd-2.2.12-rmquota+deletemailbox-0.2-1.diff
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/cyrus-imapd-2.1.3-flock.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/cyrus-imapd-2.2.12-munge8bit.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/cyrus-imapd-2.1.16-getrlimit.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/cyrus-imapd-2.2.10-groupcache.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/cyrus-imapd-2.2.12-seenstate.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/cyrus-imapd-acceptinvalidfrom.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/cyrus-imapd-2.3.3-deleteacl_invalid_identifier_fix.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/cyrus-imapd-2.2.12-notify_sms.patch
+       cd $(DIR_APP) && patch -Np0 < $(DIR_SRC)/src/patches/cyrus-imapd-2.2.12-gcc4.patch
+       cd $(DIR_APP) && patch -Np0 < $(DIR_SRC)/src/patches/timsieved_reset_sasl_conn.patch
+       cd $(DIR_APP) && patch -Np0 < $(DIR_SRC)/src/patches/allow_auth_plain_proxying.patch
+       cd $(DIR_APP) && patch -Np0 < $(DIR_SRC)/src/patches/authid_normalize.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/cyrus-imapd-2.2.12-64bit_quota-p1.patch
+       # cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/cyrus-imapd-2.2.12-64bit_quota-p2.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/cyrus-imapd-2.2.12-singleinstancestore.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/cyrus-imapd-2.2.12-spool.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/cyrus-imapd-2.2.12-mupdate-thread-safe.patch
+       cp -f /usr/include/et/com_err.h /usr/include/com_err.h
+       cd $(DIR_APP) && ./configure --prefix=/usr --with-service-path=/usr/lib/cyrus \
+                               --with-cyrus-prefix=/usr/lib/cyrus --sysconfdir=/var/ipfire/cyrusimap \
+                               --with-auth=unix --with-perl --with-sasl --with-idle=idled \
+                               --with-syslogfacility=MAIL --enable-listext --without-snmp
        cd $(DIR_APP) && make depend
        cd $(DIR_APP) && make
        cd $(DIR_APP) && make install
@@ -97,5 +122,5 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        chown cyrus.mail /var/imap/socket
        # Wenn das Dateisystem ext2 wäre...
        # cd /var/imap && chattr +S user quota user/* quota/* && chattr +S /var/spool/imap /var/spool/imap/*
-       @rm -rf $(DIR_APP)
+       @rm -rf $(DIR_APP) /usr/include/com_err.h
        @$(POSTBUILD)
index e1690d923a26079f9167c6279ca46fe501500be2..3f97feb2ab91410fd2a0c2c72f06112a846bba8d 100644 (file)
@@ -8,34 +8,36 @@ usr/bin/pop3test
 usr/bin/sieveshell
 usr/bin/sivtest
 usr/bin/smtptest
-#usr/cyrus
-#usr/cyrus/bin
-usr/cyrus/bin/arbitron
-usr/cyrus/bin/chk_cyrus
-usr/cyrus/bin/ctl_cyrusdb
-usr/cyrus/bin/ctl_deliver
-usr/cyrus/bin/ctl_mboxlist
-usr/cyrus/bin/cvt_cyrusdb
-usr/cyrus/bin/cyr_expire
-usr/cyrus/bin/cyrdump
-usr/cyrus/bin/deliver
-usr/cyrus/bin/fud
-usr/cyrus/bin/imapd
-usr/cyrus/bin/ipurge
-usr/cyrus/bin/lmtpd
-usr/cyrus/bin/master
-usr/cyrus/bin/mbexamine
-usr/cyrus/bin/mbpath
-usr/cyrus/bin/notifyd
-usr/cyrus/bin/pop3d
-usr/cyrus/bin/pop3proxyd
-usr/cyrus/bin/quota
-usr/cyrus/bin/reconstruct
-usr/cyrus/bin/sievec
-usr/cyrus/bin/smmapd
-usr/cyrus/bin/squatter
-usr/cyrus/bin/timsieved
-usr/cyrus/bin/tls_prune
+#usr/lib/cyrus
+usr/lib/cyrus/arbitron
+usr/lib/cyrus/chk_cyrus
+usr/lib/cyrus/compile_sieve
+usr/lib/cyrus/ctl_cyrusdb
+usr/lib/cyrus/ctl_deliver
+usr/lib/cyrus/ctl_mboxlist
+usr/lib/cyrus/cvt_cyrusdb
+usr/lib/cyrus/cyr_expire
+usr/lib/cyrus/cyrdump
+usr/lib/cyrus/deliver
+usr/lib/cyrus/fud
+usr/lib/cyrus/idled
+usr/lib/cyrus/imapd
+usr/lib/cyrus/ipurge
+usr/lib/cyrus/lmtpd
+usr/lib/cyrus/master
+usr/lib/cyrus/mbexamine
+usr/lib/cyrus/mbpath
+usr/lib/cyrus/notifyd
+usr/lib/cyrus/pop3d
+usr/lib/cyrus/pop3proxyd
+usr/lib/cyrus/quota
+usr/lib/cyrus/reconstruct
+usr/lib/cyrus/sievec
+usr/lib/cyrus/smmapd
+usr/lib/cyrus/squatter
+usr/lib/cyrus/timsieved
+usr/lib/cyrus/tls_prune
+#usr/include/cyrus/byteorder64.h
 #usr/include/cyrus
 #usr/include/cyrus/acl.h
 #usr/include/cyrus/assert.h
@@ -87,7 +89,7 @@ usr/lib/perl5/site_perl/5.8.5/i386-linux/Cyrus/SIEVE/managesieve.pm
 usr/lib/perl5/site_perl/5.8.5/i386-linux/auto/Cyrus/IMAP/IMAP.bs
 usr/lib/perl5/site_perl/5.8.5/i386-linux/auto/Cyrus/IMAP/IMAP.so
 #usr/lib/perl5/site_perl/5.8.5/i386-linux/auto/Cyrus/SIEVE
-usr/lib/perl5/site_perl/5.8.5/i386-linux/auto/Cyrus/SIEVE/managesieve
+#usr/lib/perl5/site_perl/5.8.5/i386-linux/auto/Cyrus/SIEVE/managesieve
 #usr/lib/perl5/site_perl/5.8.5/i386-linux/auto/Cyrus/SIEVE/managesieve/.packlist
 usr/lib/perl5/site_perl/5.8.5/i386-linux/auto/Cyrus/SIEVE/managesieve/managesieve.bs
 usr/lib/perl5/site_perl/5.8.5/i386-linux/auto/Cyrus/SIEVE/managesieve/managesieve.so
@@ -139,4 +141,5 @@ usr/lib/perl5/site_perl/5.8.5/i386-linux/auto/Cyrus/SIEVE/managesieve/managesiev
 #usr/share/man/man8/tls_prune.8
 var/imap
 var/log/imap
-usr/sieve
\ No newline at end of file
+usr/sieve
+var/ipfire/cyrusimap
diff --git a/src/patches/allow_auth_plain_proxying.patch b/src/patches/allow_auth_plain_proxying.patch
new file mode 100644 (file)
index 0000000..33e067c
--- /dev/null
@@ -0,0 +1,28 @@
+--- imap/imapd.c
++++ imap/imapd.c       2004/01/16 12:25:51
+@@ -578,8 +578,11 @@
+       fatal("SASL failed initializing: sasl_server_new()", EC_TEMPFAIL);
+     }
+-    /* never allow plaintext, since IMAP has the LOGIN command */
+-    secprops = mysasl_secprops(SASL_SEC_NOPLAINTEXT);
++    if( (config_getswitch(IMAPOPT_ALLOWPLAINWITHOUTTLS) == 0) ) {
++        secprops = mysasl_secprops(SASL_SEC_NOPLAINTEXT);
++    } else {
++        secprops = mysasl_secprops(0);
++    }
+     sasl_setprop(imapd_saslconn, SASL_SEC_PROPS, secprops);
+     sasl_setprop(imapd_saslconn, SASL_SSF_EXTERNAL, &extprops_ssf);
+--- lib/imapoptions
++++ lib/imapoptions    2004/01/16 12:27:52
+@@ -684,6 +684,9 @@
+    to set this to yes, especially if OpenLDAP is used as authentication
+    source. */
++{ "allowplainwithouttls", 0, SWITCH }
++/* Allow plain login mechanism without an encrypted connection. */
++
+ /*
+ .SH SEE ALSO
+ .PP
diff --git a/src/patches/authid_normalize.patch b/src/patches/authid_normalize.patch
new file mode 100644 (file)
index 0000000..dcdc300
--- /dev/null
@@ -0,0 +1,77 @@
+--- lib/auth_unix.c
++++ lib/auth_unix.c    2004/05/31 11:32:50
+@@ -159,10 +159,12 @@
+ size_t len;
+ {
+     static char retbuf[81];
++    char backup[81];
+     struct group *grp;
+     char sawalpha;
+     char *p;
+     int username_tolower = 0;
++    int ic,rbc;
+     if(!len) len = strlen(identifier);
+     if(len >= sizeof(retbuf)) return NULL;
+@@ -210,6 +212,22 @@
+     if (!sawalpha) return NULL;  /* has to be one alpha char */
++    if( (libcyrus_config_getswitch(CYRUSOPT_NORMALIZEUID) == 1) ) {
++        strcpy(backup,retbuf);
++       /* remove leading blanks */
++       for(ic=0; isblank(backup[ic]); ic++);
++       for(rbc=0; backup[ic]; ic++) {
++            retbuf[rbc] = ( isalpha(backup[ic]) ?
++                 tolower(backup[ic]) : backup[ic] );
++            rbc++;
++       }
++       retbuf[rbc] = '\0';
++       /* remove trailing blanks */
++       for(--rbc; isblank(retbuf[rbc]); rbc--) {
++            retbuf[rbc] = '\0';
++       }
++    }
++
+     return retbuf;
+ }
+--- lib/imapoptions
++++ lib/imapoptions    2004/05/31 11:32:50
+@@ -832,6 +832,11 @@
+    interface, otherwise the user is assumed to be in the default
+    domain (if set). */
++{ "normalizeuid", 0, SWITCH }
++/* Lowercase uid and strip leading and trailing blanks. It is recommended
++   to set this to yes, especially if OpenLDAP is used as authentication
++   source. */
++
+ /*
+ .SH SEE ALSO
+ .PP
+--- lib/libcyr_cfg.c
++++ lib/libcyr_cfg.c   2004/05/31 11:32:50
+@@ -118,6 +118,11 @@
+       CFGVAL(int, 100),
+       CYRUS_OPT_INT },
++    { CYRUSOPT_NORMALIZEUID,
++      (union cyrus_config_value)((int)1),
++      CYRUS_OPT_SWITCH },
++
++
+     { CYRUSOPT_LAST, { NULL }, CYRUS_OPT_NOTOPT }
+ };
+--- lib/libcyr_cfg.h
++++ lib/libcyr_cfg.h   2004/05/31 11:33:10
+@@ -97,6 +97,8 @@
+     CYRUSOPT_BERKELEY_LOCKS_MAX,
+     /* BDB max txns (100) */
+     CYRUSOPT_BERKELEY_TXNS_MAX,
++    /* Lowercase uid and strip leading and trailing blanks (OFF) */
++    CYRUSOPT_NORMALIZEUID,
+     CYRUSOPT_LAST
+     
diff --git a/src/patches/cyrus-imapd-2.1.16-getrlimit.patch b/src/patches/cyrus-imapd-2.1.16-getrlimit.patch
new file mode 100644 (file)
index 0000000..08b7c3c
--- /dev/null
@@ -0,0 +1,23 @@
+--- cyrus-imapd-2.1.16/master/master.c.getrlimit       2003-12-28 17:32:46.000000000 +0100
++++ cyrus-imapd-2.1.16/master/master.c 2003-12-28 17:43:56.000000000 +0100
+@@ -1208,12 +1208,10 @@
+     rl.rlim_cur = x;
+     rl.rlim_max = x;
+     if (setrlimit(RLIMIT_NUMFDS, &rl) < 0) {
+-      syslog(LOG_ERR, "setrlimit: Unable to set file descriptors limit to %ld: %m", x);
+ #ifdef HAVE_GETRLIMIT
+       if (!getrlimit(RLIMIT_NUMFDS, &rl)) {
+-          syslog(LOG_ERR, "retrying with %ld (current max)", rl.rlim_max);
+           rl.rlim_cur = rl.rlim_max;
+           if (setrlimit(RLIMIT_NUMFDS, &rl) < 0) {
+               syslog(LOG_ERR, "setrlimit: Unable to set file descriptors limit to %ld: %m", x);
+@@ -1228,6 +1226,7 @@
+              rl.rlim_max);
+     }
+ #else
++      syslog(LOG_ERR, "setrlimit: Unable to set file descriptors limit to %ld: %m", x);
+     }
+ #endif /* HAVE_GETRLIMIT */
+ }
diff --git a/src/patches/cyrus-imapd-2.1.3-flock.patch b/src/patches/cyrus-imapd-2.1.3-flock.patch
new file mode 100644 (file)
index 0000000..b74b99d
--- /dev/null
@@ -0,0 +1,77 @@
+--- cyrus-imapd-2.1.3/lib/lock_flock.c Tue Oct  2 16:08:13 2001
++++ cyrus-imapd-2.1.3-patched/lib/lock_flock.c Tue Apr 16 09:44:58 2002
+@@ -51,6 +51,10 @@
+ #endif
+ #include "lock.h"
++#include <syslog.h>
++
++/* Locking timeout parameter */
++#define MAXTIME 99
+ const char *lock_method_desc = "flock";
+@@ -69,6 +73,18 @@
+  * 'failaction' is provided, it is filled in with a pointer to a fixed
+  * string naming the action that failed.
+  *
++ *  Modified by jwade 4/16/2002 to work around seen file locking problem
++ *  Added locking timeout parameter to allow processes that are  
++ *  waiting for a lock to eventually time out
++ *
++ *  Calls flock() in non-blocking fashion and then retries until a 
++ *  maximum delay is reached or the lock succeeds.
++ *  
++ *  As written, uses a quadratic backoff on retries with MAXTIME being
++ *  the longest interval delay.   Total delay time is the sum of the squares
++ *  of all integers whose square is less than MAXTIME.  In the case of 
++ *  MAXTIME = 99 this is 0+1+4+9+16+25+36+49+64+81= 285 Seconds   
++ *  This time is arbitrary and can be adjusted
+  */
+ int lock_reopen(fd, filename, sbuf, failaction)
+ int fd;
+@@ -79,17 +95,29 @@
+     int r;
+     struct stat sbuffile, sbufspare;
+     int newfd;
++    int delay=0, i=0;
+     if (!sbuf) sbuf = &sbufspare;
+-    for (;;) {
+-      r = flock(fd, LOCK_EX);
++    for(i=0,delay=0;;) {
++      r = flock(fd, LOCK_EX|LOCK_NB);
+       if (r == -1) {
+-          if (errno == EINTR) continue;
+-          if (failaction) *failaction = "locking";
++          if (errno == EINTR) {
++                 continue;
++            }
++            else if ((errno == EWOULDBLOCK) && (delay < MAXTIME)) {
++                syslog(LOG_DEBUG, "lock: reopen-blocked sleeping for %d on interval %d (%d, %s)" , delay, i, fd, filename);
++                sleep(delay);
++                i++;
++                delay = i*i;
++                continue;
++            }
++          if (failaction) {
++                if (delay >= MAXTIME) *failaction = "locking_timeout";
++                else *failaction = "locking";
++            }
+           return -1;
+       }
+-
+       fstat(fd, sbuf);
+       r = stat(filename, &sbuffile);
+       if (r == -1) {
+@@ -97,9 +125,7 @@
+           flock(fd, LOCK_UN);
+           return -1;
+       }
+-
+       if (sbuf->st_ino == sbuffile.st_ino) return 0;
+-
+       newfd = open(filename, O_RDWR);
+       if (newfd == -1) {
+           if (failaction) *failaction = "opening";
diff --git a/src/patches/cyrus-imapd-2.2.10-groupcache.patch b/src/patches/cyrus-imapd-2.2.10-groupcache.patch
new file mode 100644 (file)
index 0000000..4d1a04e
--- /dev/null
@@ -0,0 +1,43 @@
+diff -Naur cyrus-imapd-2.2.10.orig/lib/auth_unix.c cyrus-imapd-2.2.10/lib/auth_unix.c
+--- cyrus-imapd-2.2.10.orig/lib/auth_unix.c    Tue Sep 14 00:49:29 2004
++++ cyrus-imapd-2.2.10/lib/auth_unix.c Thu Dec 16 08:36:32 2004
+@@ -48,6 +48,7 @@
+ #include <stdlib.h>
+ #include <pwd.h>
+ #include <grp.h>
++#include <stdio.h>
+ #include <ctype.h>
+ #include <string.h>
+@@ -226,6 +227,10 @@
+     struct passwd *pwd;
+     struct group *grp;
+     char **mem;
++    FILE *groupcache;
++    char fnamebuf[1024];
++    const char *config_dir =
++        libcyrus_config_getstring(CYRUSOPT_CONFIG_DIR);
+     identifier = auth_canonifyid(identifier, 0);
+     if (!identifier) return 0;
+@@ -242,8 +247,11 @@
+     pwd = getpwnam(identifier);
+       
++    strcpy(fnamebuf, config_dir);
++    strcat(fnamebuf, "/group.cache");
++    groupcache = fopen(fnamebuf, "r");
+     setgrent();
+-    while ((grp = getgrent())) {
++    while (grp = ( (groupcache) ? fgetgrent(groupcache) : getgrent() )) {
+       for (mem = grp->gr_mem; *mem; mem++) {
+           if (!strcmp(*mem, identifier)) break;
+       }
+@@ -256,6 +264,7 @@
+       }
+     }
+     endgrent();
++    if (groupcache) fclose(groupcache);
+     return newstate;
+ }
diff --git a/src/patches/cyrus-imapd-2.2.12-64bit_quota-p1.patch b/src/patches/cyrus-imapd-2.2.12-64bit_quota-p1.patch
new file mode 100644 (file)
index 0000000..a20770e
--- /dev/null
@@ -0,0 +1,647 @@
+diff -Naur cyrus-imapd-2.2.12.orig/configure.in cyrus-imapd-2.2.12/configure.in
+--- cyrus-imapd-2.2.12.orig/configure.in       2005-01-19 00:46:00.000000000 +0100
++++ cyrus-imapd-2.2.12/configure.in    2006-04-25 07:35:25.000000000 +0200
+@@ -100,6 +100,15 @@
+ fi
+ AC_C_INLINE
++dnl Check if `long long int' is available
++AC_CHECK_SIZEOF(long long int)
++AC_CHECK_SIZEOF(unsigned long long int)
++if test "$ac_cv_sizeof_long_long_int" -eq 8 -a \
++        "$ac_cv_sizeof_unsigned_long_long_int" -eq 8; then
++  AC_DEFINE(HAVE_LONG_LONG_INT,[],[Does the compiler support long long int?])
++  AC_C_BIGENDIAN
++fi
++
+ CMU_C___ATTRIBUTE__
+ CMU_C_FPIC
+diff -Naur cyrus-imapd-2.2.12.orig/imap/append.c cyrus-imapd-2.2.12/imap/append.c
+--- cyrus-imapd-2.2.12.orig/imap/append.c      2004-05-22 05:45:48.000000000 +0200
++++ cyrus-imapd-2.2.12/imap/append.c   2006-04-25 07:35:25.000000000 +0200
+@@ -140,7 +140,7 @@
+     if (!r) {
+       if (m.quota.limit >= 0 && quotacheck >= 0 &&
+           m.quota.used + quotacheck > 
+-          ((unsigned) m.quota.limit * QUOTA_UNITS)) {
++          ((uquota_t) m.quota.limit * QUOTA_UNITS)) {
+           r = IMAP_QUOTA_EXCEEDED;
+       }
+     }
+@@ -208,7 +208,7 @@
+     if (!r) {
+       if (as->m.quota.limit >= 0 && quotacheck >= 0 &&
+           as->m.quota.used + quotacheck > 
+-          ((unsigned) as->m.quota.limit * QUOTA_UNITS)) {
++          ((uquota_t) as->m.quota.limit * QUOTA_UNITS)) {
+           quota_abort(&as->tid);
+           mailbox_close(&as->m);
+           r = IMAP_QUOTA_EXCEEDED;
+diff -Naur cyrus-imapd-2.2.12.orig/imap/imapd.c cyrus-imapd-2.2.12/imap/imapd.c
+--- cyrus-imapd-2.2.12.orig/imap/imapd.c       2005-02-14 07:39:55.000000000 +0100
++++ cyrus-imapd-2.2.12/imap/imapd.c    2006-04-25 07:35:25.000000000 +0200
+@@ -2626,10 +2626,10 @@
+            */
+           int warnsize = config_getint(IMAPOPT_QUOTAWARNKB);
+           if (warnsize <= 0 || warnsize >= imapd_mailbox->quota.limit ||
+-              (int)((imapd_mailbox->quota.limit * QUOTA_UNITS) -
+-                    imapd_mailbox->quota.used) < (warnsize * QUOTA_UNITS)) {
++              ((uquota_t) (imapd_mailbox->quota.limit - warnsize)) * QUOTA_UNITS < 
++              imapd_mailbox->quota.used) {
+               usage = ((double) imapd_mailbox->quota.used * 100.0) / (double)
+-                  (imapd_mailbox->quota.limit * QUOTA_UNITS);
++                  ((uquota_t) imapd_mailbox->quota.limit * QUOTA_UNITS);
+               if (usage >= 100.0) {
+                   prot_printf(imapd_out, "* NO [ALERT] %s\r\n",
+                               error_message(IMAP_NO_OVERQUOTA));
+@@ -4626,7 +4626,7 @@
+       printastring(name);
+       prot_printf(imapd_out, " (");
+       if (quota.limit >= 0) {
+-          prot_printf(imapd_out, "STORAGE %lu %d",
++          prot_printf(imapd_out, "STORAGE " UQUOTA_T_FMT " %d",
+                       quota.used/QUOTA_UNITS, quota.limit);
+       }
+       prot_printf(imapd_out, ")\r\n");
+@@ -4688,7 +4688,7 @@
+               printastring(mailboxname);
+               prot_printf(imapd_out, " (");
+               if (mailbox.quota.limit >= 0) {
+-                  prot_printf(imapd_out, "STORAGE %lu %d",
++                  prot_printf(imapd_out, "STORAGE " UQUOTA_T_FMT " %d",
+                               mailbox.quota.used/QUOTA_UNITS,
+                               mailbox.quota.limit);
+               }
+diff -Naur cyrus-imapd-2.2.12.orig/imap/mailbox.c cyrus-imapd-2.2.12/imap/mailbox.c
+--- cyrus-imapd-2.2.12.orig/imap/mailbox.c     2005-02-14 07:39:57.000000000 +0100
++++ cyrus-imapd-2.2.12/imap/mailbox.c  2006-04-25 07:36:13.000000000 +0200
+@@ -84,6 +84,7 @@
+ #include "seen.h"
+ #include "util.h"
+ #include "xmalloc.h"
++#include "byteorder64.h"
+ static int mailbox_doing_reconstruct = 0;
+ #define zeromailbox(m) { memset(&m, 0, sizeof(struct mailbox)); \
+@@ -788,8 +789,17 @@
+     mailbox->last_uid =
+       ntohl(*((bit32 *)(mailbox->index_base+OFFSET_LAST_UID)));
+-    mailbox->quota_mailbox_used =
+-      ntohl(*((bit32 *)(mailbox->index_base+OFFSET_QUOTA_MAILBOX_USED-quota_upgrade_offset)));
++#ifdef HAVE_LONG_LONG_INT
++    if (mailbox->minor_version > 5) {
++      /* newer versions may use 64bit quotas now */
++        mailbox->quota_mailbox_used =
++            ntohll(*((bit64 *)(mailbox->index_base+OFFSET_QUOTA_MAILBOX_USED64)));
++    } else
++#endif
++    {
++      mailbox->quota_mailbox_used =
++          ntohl(*((bit32 *)(mailbox->index_base+OFFSET_QUOTA_MAILBOX_USED-quota_upgrade_offset)));
++    }
+     if (mailbox->start_offset < OFFSET_POP3_LAST_LOGIN-quota_upgrade_offset+sizeof(bit32)) {
+       mailbox->pop3_last_login = 0;
+@@ -1183,9 +1193,18 @@
+     *((bit32 *)(buf+OFFSET_EXISTS)) = htonl(mailbox->exists);
+     *((bit32 *)(buf+OFFSET_LAST_APPENDDATE)) = htonl(mailbox->last_appenddate);
+     *((bit32 *)(buf+OFFSET_LAST_UID)) = htonl(mailbox->last_uid);
+-    *((bit32 *)(buf+OFFSET_QUOTA_RESERVED_FIELD)) = htonl(0); /* RESERVED */
++
++    /* quotas may be 64bit now */
++#ifdef HAVE_LONG_LONG_INT
++    *((bit64 *)(buf+OFFSET_QUOTA_MAILBOX_USED64)) =
++      htonll(mailbox->quota_mailbox_used);
++#else 
++    /* zero the unused 32bits */
++    *((bit32 *)(buf+OFFSET_QUOTA_MAILBOX_USED64)) = htonl(0);
+     *((bit32 *)(buf+OFFSET_QUOTA_MAILBOX_USED)) =
+       htonl(mailbox->quota_mailbox_used);
++#endif
++
+     *((bit32 *)(buf+OFFSET_POP3_LAST_LOGIN)) = htonl(mailbox->pop3_last_login);
+     *((bit32 *)(buf+OFFSET_UIDVALIDITY)) = htonl(mailbox->uidvalidity);
+     *((bit32 *)(buf+OFFSET_DELETED)) = htonl(mailbox->deleted);
+@@ -1430,9 +1449,18 @@
+     *((bit32 *)(buf+OFFSET_EXISTS)) = htonl(mailbox->exists);
+     *((bit32 *)(buf+OFFSET_LAST_APPENDDATE)) = htonl(mailbox->last_appenddate);
+     *((bit32 *)(buf+OFFSET_LAST_UID)) = htonl(mailbox->last_uid);
+-    /* OFFSET_QUOTA_RESERVED_FIELD left as zero */
++
++    /* newer versions may use 64bit quotas */
++#ifdef HAVE_LONG_LONG_INT
++    *((bit64 *)(buf+OFFSET_QUOTA_MAILBOX_USED64)) =
++      htonll(mailbox->quota_mailbox_used);
++#else 
++    /* zero the unused 32bits */
++    *((bit32 *)(buf+OFFSET_QUOTA_MAILBOX_USED64)) = htonl(0);
+     *((bit32 *)(buf+OFFSET_QUOTA_MAILBOX_USED)) =
+       htonl(mailbox->quota_mailbox_used);
++#endif
++
+     *((bit32 *)(buf+OFFSET_POP3_LAST_LOGIN)) = htonl(mailbox->pop3_last_login);
+     *((bit32 *)(buf+OFFSET_UIDVALIDITY)) = htonl(mailbox->uidvalidity);
+     *((bit32 *)(buf+OFFSET_DELETED)) = htonl(mailbox->deleted);
+@@ -1608,7 +1636,8 @@
+     size_t fnamebuf_len;
+     FILE *newindex = NULL, *newcache = NULL;
+     unsigned long *deleted;
+-    unsigned numdeleted = 0, quotadeleted = 0;
++    unsigned numdeleted = 0;
++    uquota_t quotadeleted = 0;
+     unsigned numansweredflag = 0;
+     unsigned numdeletedflag = 0;
+     unsigned numflaggedflag = 0;
+@@ -1829,8 +1858,13 @@
+     *((bit32 *)(buf+OFFSET_FLAGGED)) = htonl(newflagged);
+     /* Fix up quota_mailbox_used */
++#ifdef HAVE_LONG_LONG_INT
++    *((bit64 *)(buf+OFFSET_QUOTA_MAILBOX_USED64)) =
++      htonll(ntohll(*((bit64 *)(buf+OFFSET_QUOTA_MAILBOX_USED64)))-quotadeleted);
++#else
+     *((bit32 *)(buf+OFFSET_QUOTA_MAILBOX_USED)) =
+       htonl(ntohl(*((bit32 *)(buf+OFFSET_QUOTA_MAILBOX_USED)))-quotadeleted);
++#endif
+     /* Fix up start offset if necessary */
+     if (mailbox->start_offset < INDEX_HEADER_SIZE) {
+       *((bit32 *)(buf+OFFSET_START_OFFSET)) = htonl(INDEX_HEADER_SIZE);
+@@ -1862,7 +1896,7 @@
+       if (!r) quota_commit(&tid);
+       else {
+           syslog(LOG_ERR,
+-                 "LOSTQUOTA: unable to record free of %u bytes in quota %s",
++                 "LOSTQUOTA: unable to record free of " UQUOTA_T_FMT " bytes in quota %s",
+                  quotadeleted, mailbox->quota.root);
+       }
+     }
+@@ -2250,7 +2284,7 @@
+           strcmp(oldmailbox->quota.root, newmailbox->quota.root) != 0) {
+           if (!r && newmailbox->quota.limit >= 0 &&
+               newmailbox->quota.used + oldmailbox->quota_mailbox_used >
+-              ((unsigned) newmailbox->quota.limit * QUOTA_UNITS)) {
++              ((uquota_t) newmailbox->quota.limit * QUOTA_UNITS)) {
+               r = IMAP_QUOTA_EXCEEDED;
+           }
+       }
+@@ -2464,7 +2498,7 @@
+           strcmp(oldmailbox.quota.root, newmailbox.quota.root) != 0) {
+           if (!r && newmailbox.quota.limit >= 0 &&
+               newmailbox.quota.used + oldmailbox.quota_mailbox_used >
+-              ((unsigned) newmailbox.quota.limit * QUOTA_UNITS)) {
++              ((uquota_t) newmailbox.quota.limit * QUOTA_UNITS)) {
+               r = IMAP_QUOTA_EXCEEDED;
+           }
+       }
+@@ -2617,7 +2651,7 @@
+       else if (r2 == IMAP_QUOTAROOT_NONEXISTENT) r2 = 0;
+       if (r2) {
+           syslog(LOG_ERR,
+-            "LOSTQUOTA: unable to record use of %lu bytes in quota %s",
++            "LOSTQUOTA: unable to record use of " UQUOTA_T_FMT " bytes in quota %s",
+                  newmailbox.quota_mailbox_used, newmailbox.quota.root);
+       }
+     }
+diff -Naur cyrus-imapd-2.2.12.orig/imap/mailbox.h cyrus-imapd-2.2.12/imap/mailbox.h
+--- cyrus-imapd-2.2.12.orig/imap/mailbox.h     2004-01-22 22:17:09.000000000 +0100
++++ cyrus-imapd-2.2.12/imap/mailbox.h  2006-04-25 07:35:25.000000000 +0200
+@@ -45,6 +45,7 @@
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <limits.h>
++#include <config.h>
+ #include "auth.h"
+ #include "quota.h"
+@@ -61,6 +62,10 @@
+ #error dont know what to use for bit32
+ #endif
++#ifdef HAVE_LONG_LONG_INT
++typedef unsigned long long int bit64;
++#endif
++
+ #define MAX_MAILBOX_NAME 490
+ #define MAX_MAILBOX_PATH 4096
+@@ -126,7 +131,7 @@
+     unsigned long exists;
+     time_t last_appenddate;
+     unsigned long last_uid;
+-    unsigned long quota_mailbox_used;
++    uquota_t quota_mailbox_used;
+     unsigned long pop3_last_login;
+     unsigned long uidvalidity;
+@@ -168,8 +173,8 @@
+ #define OFFSET_EXISTS 20
+ #define OFFSET_LAST_APPENDDATE 24
+ #define OFFSET_LAST_UID 28
+-#define OFFSET_QUOTA_RESERVED_FIELD 32  /* Reserved for 64bit quotas */
+-#define OFFSET_QUOTA_MAILBOX_USED 36
++#define OFFSET_QUOTA_MAILBOX_USED64 32  /* offset for 64bit quotas */
++#define OFFSET_QUOTA_MAILBOX_USED 36    /* offset for 32bit quotas */
+ #define OFFSET_POP3_LAST_LOGIN 40
+ #define OFFSET_UIDVALIDITY 44
+ #define OFFSET_DELETED 48      /* added for ACAP */
+diff -Naur cyrus-imapd-2.2.12.orig/imap/mbdump.c cyrus-imapd-2.2.12/imap/mbdump.c
+--- cyrus-imapd-2.2.12.orig/imap/mbdump.c      2004-05-22 05:45:51.000000000 +0200
++++ cyrus-imapd-2.2.12/imap/mbdump.c   2006-04-25 07:35:25.000000000 +0200
+@@ -507,7 +507,7 @@
+ {
+     struct buf file, data;
+     char c;
+-    int quotaused = 0;
++    uquota_t quotaused = 0;
+     int r = 0;
+     int curfile = -1;
+     const char *userid = NULL;
+diff -Naur cyrus-imapd-2.2.12.orig/imap/mbexamine.c cyrus-imapd-2.2.12/imap/mbexamine.c
+--- cyrus-imapd-2.2.12.orig/imap/mbexamine.c   2004-12-17 17:32:16.000000000 +0100
++++ cyrus-imapd-2.2.12/imap/mbexamine.c        2006-04-25 07:35:25.000000000 +0200
+@@ -266,7 +266,7 @@
+     printf("  Minor Version: %d\n", mailbox.minor_version);
+     printf("  Header Size: %ld bytes  Record Size: %ld bytes\n",
+          mailbox.start_offset, mailbox.record_size);
+-    printf("  Number of Messages: %lu  Mailbox Size: %lu bytes\n",
++    printf("  Number of Messages: %lu  Mailbox Size: " UQUOTA_T_FMT " bytes\n",
+          mailbox.exists, mailbox.quota_mailbox_used);
+     printf("  Last Append Date: (%ld) %s", mailbox.last_appenddate,
+          ctime(&mailbox.last_appenddate));
+diff -Naur cyrus-imapd-2.2.12.orig/imap/quota.c cyrus-imapd-2.2.12/imap/quota.c
+--- cyrus-imapd-2.2.12.orig/imap/quota.c       2004-06-30 21:23:26.000000000 +0200
++++ cyrus-imapd-2.2.12/imap/quota.c    2006-04-25 07:35:25.000000000 +0200
+@@ -120,7 +120,7 @@
+     struct quota quota;
+     int refcount;
+     int deleted;
+-    unsigned long newused;
++    uquota_t newused;
+ };
+ #define QUOTAGROW 300
+@@ -251,7 +251,7 @@
+     }
+     memset(&quota[quota_num], 0, sizeof(struct quotaentry));
+     quota[quota_num].quota.root = xstrndup(key, keylen);
+-    sscanf(data, "%lu %d",
++    sscanf(data, UQUOTA_T_FMT " %d",
+          &quota[quota_num].quota.used, &quota[quota_num].quota.limit);
+   
+     quota_num++;
+@@ -422,7 +422,7 @@
+       (*count)++;
+     }
+     if (quota[thisquota].quota.used != quota[thisquota].newused) {
+-      printf("%s: usage was %lu, now %lu\n", quota[thisquota].quota.root,
++      printf("%s: usage was " UQUOTA_T_FMT ", now " UQUOTA_T_FMT "\n", quota[thisquota].quota.root,
+              quota[thisquota].quota.used, quota[thisquota].newused);
+       quota[thisquota].quota.used = quota[thisquota].newused;
+       r = quota_write(&quota[thisquota].quota, tid);
+@@ -489,12 +489,12 @@
+     int i;
+     char buf[MAX_MAILBOX_PATH+1];
+-    printf("   Quota  %% Used    Used Root\n");
++    printf("   Quota   %% Used     Used Root\n");
+     for (i = 0; i < quota_num; i++) {
+       if (quota[i].deleted) continue;
+       if (quota[i].quota.limit > 0) {
+-          printf(" %7d %7ld", quota[i].quota.limit,
++          printf(" %7d " QUOTA_REPORT_FMT , quota[i].quota.limit,
+                  ((quota[i].quota.used / QUOTA_UNITS) * 100) / quota[i].quota.limit);
+       }
+       else if (quota[i].quota.limit == 0) {
+@@ -507,6 +507,6 @@
+       (*quota_namespace.mboxname_toexternal)(&quota_namespace,
+                                              quota[i].quota.root,
+                                              "cyrus", buf);
+-      printf(" %7ld %s\n", quota[i].quota.used / QUOTA_UNITS, buf);
++      printf(" " QUOTA_REPORT_FMT " %s\n", quota[i].quota.used / QUOTA_UNITS, buf);
+     }
+ }
+diff -Naur cyrus-imapd-2.2.12.orig/imap/quota_db.c cyrus-imapd-2.2.12/imap/quota_db.c
+--- cyrus-imapd-2.2.12.orig/imap/quota_db.c    2004-05-22 05:45:52.000000000 +0200
++++ cyrus-imapd-2.2.12/imap/quota_db.c 2006-04-25 07:35:25.000000000 +0200
+@@ -89,7 +89,7 @@
+     switch (r) {
+     case CYRUSDB_OK:
+-      sscanf(data, "%lu %d", &quota->used, &quota->limit);
++      sscanf(data, UQUOTA_T_FMT " %d", &quota->used, &quota->limit);
+       break;
+     case CYRUSDB_AGAIN:
+@@ -151,7 +151,7 @@
+     if (!qrlen) return IMAP_QUOTAROOT_NONEXISTENT;
+     len = snprintf(buf, sizeof(buf) - 1,
+-                 "%lu %d", quota->used, quota->limit);
++                 UQUOTA_T_FMT " %d", quota->used, quota->limit);
+     r = QDB->store(qdb, quota->root, qrlen, buf, len, tid);
+     
+     switch (r) {
+diff -Naur cyrus-imapd-2.2.12.orig/imap/quota.h cyrus-imapd-2.2.12/imap/quota.h
+--- cyrus-imapd-2.2.12.orig/imap/quota.h       2004-02-27 18:44:56.000000000 +0100
++++ cyrus-imapd-2.2.12/imap/quota.h    2006-04-25 07:35:25.000000000 +0200
+@@ -45,18 +45,37 @@
+ #define INCLUDED_QUOTA_H
+ #include "cyrusdb.h"
++#include <config.h>
+ #define FNAME_QUOTADB "/quotas.db"
+ #define QUOTA_UNITS (1024)
++/* Define the proper quota type, it should either be a
++ * long or a long long int depending upon what the
++ * the compiler supports.
++ */
++#ifdef HAVE_LONG_LONG_INT
++typedef unsigned long long int uquota_t;
++typedef long long int quota_t;
++#define UQUOTA_T_FMT     "%llu"
++#define QUOTA_T_FMT      "%lld"
++#define QUOTA_REPORT_FMT "%8llu"
++#else
++typedef unsigned long uquota_t;
++typedef long quota_t;
++#define UQUOTA_T_FMT     "%lu"
++#define QUOTA_T_FMT      "%ld"
++#define QUOTA_REPORT_FMT "%8lu"
++#endif
++
+ extern struct db *qdb;
+ struct quota {
+     char *root;
+     /* Information in quota entry */
+-    unsigned long used;
++    uquota_t used;
+     int limit;                        /* in QUOTA_UNITS */
+ };
+diff -Naur cyrus-imapd-2.2.12.orig/imap/reconstruct.c cyrus-imapd-2.2.12/imap/reconstruct.c
+--- cyrus-imapd-2.2.12.orig/imap/reconstruct.c 2004-10-11 16:01:24.000000000 +0200
++++ cyrus-imapd-2.2.12/imap/reconstruct.c      2006-04-25 07:35:25.000000000 +0200
+@@ -93,6 +93,7 @@
+ #include "retry.h"
+ #include "convert_code.h"
+ #include "util.h"
++#include "byteorder64.h"
+ extern int optind;
+ extern char *optarg;
+@@ -434,7 +435,7 @@
+     char *list_acl, *list_part;
+     int list_type;
+-    unsigned long new_quota = 0;
++    uquota_t new_quota = 0;
+     struct index_record message_index, old_index;
+     static struct index_record zero_index;
+@@ -690,7 +691,14 @@
+     *((bit32 *)(buf+OFFSET_EXISTS)) = htonl(new_exists);
+     *((bit32 *)(buf+OFFSET_LAST_APPENDDATE)) = htonl(mailbox.last_appenddate);
+     *((bit32 *)(buf+OFFSET_LAST_UID)) = htonl(mailbox.last_uid);
++
++    /* quotas may be 64bit now */
++#ifdef HAVE_LONG_LONG_INT
++    *((bit64 *)(buf+OFFSET_QUOTA_MAILBOX_USED64)) = htonll(new_quota);
++#else
+     *((bit32 *)(buf+OFFSET_QUOTA_MAILBOX_USED)) = htonl(new_quota);
++#endif
++
+     *((bit32 *)(buf+OFFSET_POP3_LAST_LOGIN)) = htonl(mailbox.pop3_last_login);
+     *((bit32 *)(buf+OFFSET_UIDVALIDITY)) = htonl(mailbox.uidvalidity);
+     *((bit32 *)(buf+OFFSET_DELETED)) = htonl(new_deleted);
+diff -Naur cyrus-imapd-2.2.12.orig/lib/byteorder64.c cyrus-imapd-2.2.12/lib/byteorder64.c
+--- cyrus-imapd-2.2.12.orig/lib/byteorder64.c  1970-01-01 01:00:00.000000000 +0100
++++ cyrus-imapd-2.2.12/lib/byteorder64.c       2006-04-25 07:35:25.000000000 +0200
+@@ -0,0 +1,95 @@
++/* byteorder64.c -- convert 64-bit values between host and network byte order
++ * 
++ * Copyright (c) 2004 Carnegie Mellon University.  All rights reserved.
++ *
++ * 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. The name "Carnegie Mellon University" must not be used to
++ *    endorse or promote products derived from this software without
++ *    prior written permission. For permission or any other legal
++ *    details, please contact  
++ *      Office of Technology Transfer
++ *      Carnegie Mellon University
++ *      5000 Forbes Avenue
++ *      Pittsburgh, PA  15213-3890
++ *      (412) 268-4387, fax: (412) 268-7395
++ *      tech-transfer@andrew.cmu.edu
++ *
++ * 4. Redistributions of any form whatsoever must retain the following
++ *    acknowledgment:
++ *    "This product includes software developed by Computing Services
++ *     at Carnegie Mellon University (http://www.cmu.edu/computing/)."
++ *
++ * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
++ * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
++ * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE
++ * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
++ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
++ * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
++ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
++ *
++ * $Id: byteorder64.c,v 1.1.2.1 2004/08/09 18:51:21 ken3 Exp $
++ */
++
++#include <config.h>
++
++#if defined(HAVE_LONG_LONG_INT) && !defined(WORDS_BIGENDIAN)
++
++#include <netinet/in.h>
++
++/* Structure used to swap the bytes in a 64-bit unsigned long long. */
++union byteswap_64_u {
++    unsigned long long a;
++    uint32_t b[2];
++};
++
++/* Function to byteswap 64bit unsigned integers on
++ * little endian machines to big endian network order. 
++ * On big endian machines this will be a null macro.
++ * The macro htonll() is defined in byteorder64.h,
++ * and if needed refers to _htonll() here.
++ */
++unsigned long long _htonll(unsigned long long x)
++{
++    union byteswap_64_u u1;
++    union byteswap_64_u u2;
++
++    u1.a = x;
++
++    u2.b[0] = htonl(u1.b[1]);
++    u2.b[1] = htonl(u1.b[0]);
++
++    return u2.a;
++}
++
++
++/* Function to byteswap big endian 64bit unsigned integers
++ * back to little endian host order on little endian machines. 
++ * As above, on big endian machines this will be a null macro.
++ * The macro ntohll() is defined in byteorder64.h, and if needed,
++ * refers to _ntohll() here.
++ */
++unsigned long long _ntohll(unsigned long long x)
++{
++    union byteswap_64_u u1;
++    union byteswap_64_u u2;
++
++    u1.a = x;
++
++    u2.b[1] = ntohl(u1.b[0]);
++    u2.b[0] = ntohl(u1.b[1]);
++
++    return u2.a;
++}
++
++#endif /* defined(HAVE_LONG_LONG_INT) && !defined(WORDS_BIGENDIAN) */
+diff -Naur cyrus-imapd-2.2.12.orig/lib/byteorder64.h cyrus-imapd-2.2.12/lib/byteorder64.h
+--- cyrus-imapd-2.2.12.orig/lib/byteorder64.h  1970-01-01 01:00:00.000000000 +0100
++++ cyrus-imapd-2.2.12/lib/byteorder64.h       2006-04-25 07:35:25.000000000 +0200
+@@ -0,0 +1,65 @@
++/* byteorder64.h -- convert 64-bit values between host and network byte order
++ *
++ * Copyright (c) 2004 Carnegie Mellon University.  All rights reserved.
++ *
++ * 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. The name "Carnegie Mellon University" must not be used to
++ *    endorse or promote products derived from this software without
++ *    prior written permission. For permission or any other legal
++ *    details, please contact  
++ *      Office of Technology Transfer
++ *      Carnegie Mellon University
++ *      5000 Forbes Avenue
++ *      Pittsburgh, PA  15213-3890
++ *      (412) 268-4387, fax: (412) 268-7395
++ *      tech-transfer@andrew.cmu.edu
++ *
++ * 4. Redistributions of any form whatsoever must retain the following
++ *    acknowledgment:
++ *    "This product includes software developed by Computing Services
++ *     at Carnegie Mellon University (http://www.cmu.edu/computing/)."
++ *
++ * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
++ * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
++ * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE
++ * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
++ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
++ * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
++ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
++ *
++ * $Id: byteorder64.h,v 1.1.2.2 2004/08/16 11:44:34 ken3 Exp $
++ */
++
++#ifndef _BYTEORDER64_H
++#define _BYTEORDER64_H
++
++#include <config.h>
++
++#ifdef HAVE_LONG_LONG_INT
++
++/* 64-bit host/network byte-order swap macros */
++#ifdef WORDS_BIGENDIAN
++#define htonll(x) (x)
++#define ntohll(x) (x)
++#else
++#define htonll(x) _htonll(x)
++#define ntohll(x) _ntohll(x)
++
++/* little-endian 64-bit host/network byte-order swap functions */
++extern unsigned long long _htonll(unsigned long long);
++extern unsigned long long _ntohll(unsigned long long);
++
++#endif /* WORDS_BIGENDIAN */
++#endif /* HAVE_LONG_LONG_INT */
++#endif /* _BYTEORDER64_H */
+diff -Naur cyrus-imapd-2.2.12.orig/lib/Makefile.in cyrus-imapd-2.2.12/lib/Makefile.in
+--- cyrus-imapd-2.2.12.orig/lib/Makefile.in    2004-05-28 20:03:04.000000000 +0200
++++ cyrus-imapd-2.2.12/lib/Makefile.in 2006-04-25 07:35:25.000000000 +0200
+@@ -85,7 +85,7 @@
+       $(srcdir)/lsort.h $(srcdir)/stristr.h \
+       $(srcdir)/util.h $(srcdir)/xmalloc.h $(srcdir)/imapurl.h \
+       $(srcdir)/cyrusdb.h $(srcdir)/iptostring.h $(srcdir)/rfc822date.h \
+-      $(srcdir)/libcyr_cfg.h
++      $(srcdir)/libcyr_cfg.h $(srcdir)/byteorder64.h
+ LIBCYR_OBJS = acl.o bsearch.o charset.o glob.o retry.o util.o \
+       libcyr_cfg.o mkgmtime.o prot.o parseaddr.o imclient.o imparse.o \
+@@ -93,7 +93,7 @@
+       chartable.o imapurl.o nonblock_@WITH_NONBLOCK@.o lock_@WITH_LOCK@.o \
+       gmtoff_@WITH_GMTOFF@.o map_@WITH_MAP@.o $(ACL) $(AUTH) \
+       @LIBOBJS@ @CYRUSDB_OBJS@ \
+-      iptostring.o xmalloc.o wildmat.o
++      iptostring.o xmalloc.o wildmat.o byteorder64.o
+ LIBCYRM_HDRS = $(srcdir)/hash.h $(srcdir)/mpool.h $(srcdir)/xmalloc.h \
+       $(srcdir)/strhash.o $(srcdir)/libconfig.h $(srcdir)/assert.h \
+diff -Naur cyrus-imapd-2.2.12.orig/lib/prot.c cyrus-imapd-2.2.12/lib/prot.c
+--- cyrus-imapd-2.2.12.orig/lib/prot.c 2004-02-27 23:08:56.000000000 +0100
++++ cyrus-imapd-2.2.12/lib/prot.c      2006-04-25 07:35:25.000000000 +0200
+@@ -894,6 +894,31 @@
+               prot_write(s, buf, strlen(buf));
+               break;
++#ifdef HAVE_LONG_LONG_INT
++            case 'l': {
++              long long int ll;
++              unsigned long long int ull;
++
++              switch (*++percent) {
++              case 'd':
++                  ll = va_arg(pvar, long long int);
++                  snprintf(buf, sizeof(buf), "%lld", ll);
++                  prot_write(s, buf, strlen(buf));
++                  break;
++
++              case 'u':
++                  ull = va_arg(pvar, unsigned long long int);
++                  snprintf(buf, sizeof(buf), "%llu", ull);
++                  prot_write(s, buf, strlen(buf));
++                  break;
++
++              default:
++                  abort();
++              }
++              break;
++          }
++#endif
++
+           default:
+               abort();
+           }
diff --git a/src/patches/cyrus-imapd-2.2.12-64bit_quota-p2.patch b/src/patches/cyrus-imapd-2.2.12-64bit_quota-p2.patch
new file mode 100644 (file)
index 0000000..53d6dc7
--- /dev/null
@@ -0,0 +1,24 @@
+diff -urN cyrus-imapd-2.2.12~/imap/mailbox.c cyrus-imapd-2.2.12/imap/mailbox.c
+--- cyrus-imapd-2.2.12~/imap/mailbox.c 2005-02-14 07:39:57.000000000 +0100
++++ cyrus-imapd-2.2.12/imap/mailbox.c  2005-08-30 12:13:34.000000000 +0200
+@@ -2132,7 +2165,7 @@
+       r = quota_write(&mailbox->quota, &tid);
+       if (r) {
+           syslog(LOG_ERR,
+-                 "LOSTQUOTA: unable to record free of %lu bytes in quota %s",
++                 "LOSTQUOTA: unable to record free of " UQUOTA_T_FMT " bytes in quota %s",
+                  mailbox->quota_mailbox_used, mailbox->quota.root);
+       }
+       else
+diff -urN cyrus-imapd-2.2.12~/imap/mboxlist.c cyrus-imapd-2.2.12/imap/mboxlist.c
+--- cyrus-imapd-2.2.12~/imap/mboxlist.c        2004-07-26 20:08:03.000000000 +0200
++++ cyrus-imapd-2.2.12/imap/mboxlist.c 2005-08-30 12:09:28.000000000 +0200
+@@ -2540,7 +2540,7 @@
+       r = quota_write(&mailbox.quota, tid);
+       if (r) {
+           syslog(LOG_ERR,
+-                 "LOSTQUOTA: unable to record free of %lu bytes in quota %s",
++                 "LOSTQUOTA: unable to record free of " UQUOTA_T_FMT " bytes in quota %s",
+                  mailbox.quota_mailbox_used, mailbox.quota.root);
+       }
+       free(mailbox.quota.root);
diff --git a/src/patches/cyrus-imapd-2.2.12-autocreate-0.9.4.diff b/src/patches/cyrus-imapd-2.2.12-autocreate-0.9.4.diff
new file mode 100644 (file)
index 0000000..cb4c6c9
--- /dev/null
@@ -0,0 +1,2159 @@
+diff -Naur cyrus-imapd-2.2.12/README.autocreate cyrus-imapd-2.2.12.autocreate2/README.autocreate
+--- cyrus-imapd-2.2.12/README.autocreate       1970-01-01 02:00:00.000000000 +0200
++++ cyrus-imapd-2.2.12.autocreate2/README.autocreate   2005-10-19 14:48:57.930991000 +0300
+@@ -0,0 +1,181 @@
++Cyrus IMAP autocreate Inbox patch
++----------------------------------
++
++NOTE : This patch has been created at the University of Athens. For more info, as well 
++as more patches on Cyrus IMAPD server, please visit http://email.uoa.gr 
++
++The design of Cyrus IMAP server does not predict the automatic creation of users'
++INBOX folders. The creation of a user's INBOX is considered to be an external task,
++that has to be completed as part of the user e-mail account creation procedure. 
++Hence, to create a new e-mail account the site administrator has to 
++a) Include the new account in the user database for the authentication procedure
++   (e.g. sasldb, shadow, mysql, ldap).
++b) Create the corresponding INBOX folder. 
++
++Alternatively, the user, if succesfully authenticated, may create his own INBOX folder,
++as long as the configuration of the site allows it (see "autocreatequota" in imapd.conf).
++Unlike what uncareful readers may think, enabling the "autocreatequota" option, doesn't 
++lead to the automatic INBOX folder creation by Cyrus IMAP server.
++In fact, "autocreate" means that the IMAP clients are allowed to automatically create 
++the user INBOX. 
++
++This patch adds the functionality of automatic creation of the users' INBOX folders into
++the Cyrus IMAP server. It is implemented as two features, namely the  "create on login"
++and "create on post".
++ 
++
++
++Create on login
++===============
++This feauture provides automatic creation of a user's INBOX folder when all of the 
++following requirements are met:
++
++i)  The user has succesfully passed the authentication procedure.
++
++ii) The user's authorization ID (typically the same as the user's
++authentication ID)  doesn't belong to the imap_admins or admins
++accounts (see imapd.conf).
++
++iii) The "autocreatequota" option in the imap configuration file 
++has been set to a non zero value. 
++
++iv) The corresponding to the user's authorizationID INBOX folder
++does not exist.
++
++The user's first login is the most typical case when all four requirements are met. 
++Note that if the authenticatedID is allowed to proxy to another account for which 
++all of the above requirements are met, the corresponding INBOX folder for that account 
++will be created.
++
++
++
++Create on post
++==============
++This feauture provides automatic creation of a user's INBOX folder when all of the 
++following requirements are met. 
++
++i) An e-mail message addressed to the user has been received.  
++
++ii) The recipient is not any of the imap_admins or admins accounts. 
++Note that passing e-mails to admins or imap_admins accounts from 
++the MTA to LMTP should be avoided in any case.
++
++iii) The recipient's INBOX does not exist.
++
++iv) The "autocreatequota" option in the imap configuration file 
++has been set to a non zero value. 
++
++v) The "createonpost" option in the imap configuration file 
++has been switched on. 
++
++
++Besides the automatic creation of INBOX folder, additional functionalities are
++provided:
++
++A) Automatic creation of INBOX subfolders controlled by "autocreateinboxfolders"
++configuration option. eg 
++
++autocreateinboxfolders: sent|drafts|spam|templates
++
++B) Automatic subscription of INBOX subfolders controlled by "autosubscribeinboxfolders"
++configuration option. eg
++
++autosubscribeinboxfolders: sent|spam
++
++Obviously, only subscription to subfolders included in the "autocreateinboxfolder"
++list is meaningfull. 
++
++C) Automatic subscription to shared folders (bulletin boards). The user gets
++automatically subscribed to the shared folders declared in the "autosubscribesharedfolders"
++configuration option in imapd.conf.
++eg autosubscribesharedfolders: public_folder | public_folder.subfolder
++
++In order the above action to succeed, the shared folder has to pre-exist the INBOX creation
++and the user must have the apropriate permissions in order to be able to subscribe to the
++shared folder.
++
++* A new config option has been added. 'autosubscribe_all_sharedfolders' is a yes/no
++option. When set to yes, the user is automatically subscribed to all shared folders one 
++has permission to subscribe to. Please, note that when this option is set to yes, then
++'autosubscribesharedfolders' option is overriden.
++
++D) Automatic creation of a predefined default sieve script.
++
++This is very useful when a default sieve script is used for every user. Usually, a
++default anti-spam script may me be written in a file and copied to each user
++sieve scripts upon the INBOX creation. The imapd.conf options that have been added
++are 'autocreate_sieve_script', 'autocreate_sieve_compiledscript' and 
++'generate_compiled_sieve_script'. 
++
++autocreate_sieve_script configuration option refers to the full path of the file 
++that contains the sieve script. The default value is null and if no file is defined,
++then no default script is created upon INBOX creation. (The feature is disabled)
++eg autocreate_sieve_script: /etc/default_sieve_script
++
++autocreate_sieve_compiledscript configuration option refers to the full path of the
++file that contains the bytecode compiled sieve script. If this filename is defined
++in imapd.conf and the file exists, then it is automatically copied in the user's sieve
++directory. If it is not defined, then a bytecode sieve script gets on the fly compiled
++by the daemon. 
++eg autocreate_sieve_compiledscript: /etc/default_sieve_script.bc
++
++generate_compiled_sieve_script is a boolean option that triggers the compilation of the 
++source sieve script to bytecode sieve script. The file that the bytecode script will
++be saved is pointed by autocreate_sieve_compiledscript.
++
++Ways of compiling a sieve script : 
++1. Compile a sieve script using the standard sievec utility, distributed by CMU
++2. Compile a sieve script using the compile_sieve utility, released by UoA. This 
++   tool is almost identical to the sievec utility, with the difference that it 
++   reads the input and output file from autocreate_sieve_script and 
++   autocreate_sieve_compiledscript options in imapd.conf
++3. Let cyrus create a compiled sieve script using a source script. Cyrus can be
++   instructed to save the compiled script any time a compiled script does not exist.
++
++NOTES : 
++1. In order this functionality to work, the following requirements must have been met:
++   - 'sieveusehomedir' option must be 'no' in the configuration (default).
++   - 'sievedir' option must have a valid value.
++2. Currently, this patch checks the validity of the source script while generating a 
++   bytecode compiled script, but not the validity of the bytecode sieve script file.
++   The administrator should make sure that the provided files contain a valid sieve
++   script as well as the compiled script is updated every time the source script changes.
++
++
++
++Issues to be considered 
++=======================
++
++I) In order to use the create on post feauture one should be absolutely sure that: 
++a) The MTA checks the validity of the e-mail recipient before sending the e-mail to
++LMTP. This is an RFC821 requirement. This usually expands to "the mta should be 
++able to use the account database as user mailbox database". 
++b) Only authorized accounts/services can talk to LMTP.
++
++II) Especially in the case of imap logins, the current patch implementation checks
++for the INBOX folder existence upon login, causing an extra mailbox lookup in most 
++of the cases. 
++A better approach would be to chase the "IMAP_MAILBOX_NONEXISTENT" error code and
++check if the error is associated with an INBOX folder. However, this would mess up
++Cyrus code. The way it was implemented may not have been the most performance
++optimized, but it produces a much cleaner and simple patch.
++
++
++
++Virtual Domains Support
++=======================
++
++Virtual domains are supported by all versions of the patch for cyrus-imapd-2.2.1-BETA and 
++later. However, it is not possible to declare different INBOX subfolders to be created or 
++shared folders to be subscribed to for every domain.
++
++
++
++Things to be done
++=================
++
++1. Support MURDER architecture. 
++
++
++For more information and updates please visit http://email.uoa.gr/autocreate
++
+diff -Naur cyrus-imapd-2.2.12/imap/Makefile.in cyrus-imapd-2.2.12.autocreate2/imap/Makefile.in
+--- cyrus-imapd-2.2.12/imap/Makefile.in        2004-05-28 21:03:02.000000000 +0300
++++ cyrus-imapd-2.2.12.autocreate2/imap/Makefile.in    2005-10-19 14:48:57.935240000 +0300
+@@ -104,7 +104,7 @@
+       convert_code.o duplicate.o saslclient.o saslserver.o signals.o \
+       annotate.o search_engines.o squat.o squat_internal.o mbdump.o \
+       imapparse.o telemetry.o user.o notify.o protocol.o quota_db.o \
+-      $(SEEN) $(IDLE)
++      autosieve.o $(SEEN) $(IDLE)
+ IMAPDOBJS=pushstats.o backend.o imapd.o index.o tls.o version.o
+@@ -122,7 +122,7 @@
+       fud smmapd reconstruct quota mbpath ipurge \
+       cyrdump chk_cyrus cvt_cyrusdb deliver ctl_mboxlist \
+       ctl_deliver ctl_cyrusdb squatter mbexamine cyr_expire arbitron \
+-      @IMAP_PROGS@
++      compile_sieve @IMAP_PROGS@
+ BUILTSOURCES = imap_err.c imap_err.h pushstats.c pushstats.h \
+       lmtpstats.c lmtpstats.h xversion.h mupdate_err.c mupdate_err.h \
+@@ -188,7 +188,7 @@
+ ### Services
+ idled: idled.o mutex_fake.o libimap.a $(DEPLIBS)
+       $(CC) $(LDFLAGS) -o idled \
+-       idled.o mutex_fake.o libimap.a $(DEPLIBS) $(LIBS)
++       idled.o mutex_fake.o libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
+ lmtpd: lmtpd.o $(LMTPOBJS) $(SIEVE_OBJS) mutex_fake.o libimap.a $(SIEVE_LIBS) \
+       $(DEPLIBS) $(SERVICE)
+@@ -214,10 +214,10 @@
+        $(SERVICE) lmtpproxyd.o backend.o $(LMTPOBJS) mutex_fake.o \
+        libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS) $(LIB_WRAP)
+-imapd: xversion $(IMAPDOBJS) mutex_fake.o libimap.a $(DEPLIBS) $(SERVICE)
++imapd: xversion $(IMAPDOBJS) mutex_fake.o libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(SERVICE)
+       $(CC) $(LDFLAGS) -o imapd \
+        $(SERVICE) $(IMAPDOBJS) mutex_fake.o \
+-      libimap.a $(DEPLIBS) $(LIBS) $(LIB_WRAP)
++      libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS) $(LIB_WRAP)
+ imapd.pure: $(IMAPDOBJS) mutex_fake.o libimap.a $(DEPLIBS) $(SERVICE)
+       $(PURIFY) $(PUREOPT) $(CC) $(LDFLAGS) -o imapd.pure \
+@@ -232,7 +232,7 @@
+ proxyd: $(PROXYDOBJS) mutex_fake.o libimap.a $(DEPLIBS) $(SERVICE)
+       $(CC) $(LDFLAGS) -o proxyd \
+        $(SERVICE) $(PROXYDOBJS) mutex_fake.o libimap.a \
+-       $(DEPLIBS) $(LIBS) $(LIB_WRAP)
++       $(SIEVE_LIBS) $(DEPLIBS) $(LIBS) $(LIB_WRAP)
+ proxyd.pure: $(PROXYDOBJS) mutex_fake.o libimap.a $(DEPLIBS) $(SERVICE)
+       $(PURIFY) $(PUREOPT) $(CC) $(LDFLAGS) -o proxyd.pure \
+@@ -244,7 +244,7 @@
+       $(CC) $(LDFLAGS) -o mupdate \
+        $(SERVICETHREAD) mupdate.o mupdate-slave.o mupdate-client.o \
+        mutex_pthread.o tls.o libimap.a \
+-       $(DEPLIBS) $(LIBS) $(LIB_WRAP) -lpthread
++       $(SIEVE_LIBS) $(DEPLIBS) $(LIBS) $(LIB_WRAP) -lpthread
+ mupdate.pure: mupdate.o mupdate-slave.o mupdate-client.o mutex_pthread.o \
+       libimap.a $(DEPLIBS)
+@@ -252,92 +252,96 @@
+        $(SERVICETHREAD) mupdate.o mupdate-slave.o mupdate-client.o \
+        mutex_pthread.o libimap.a $(DEPLIBS) $(LIBS) $(LIB_WRAP) -lpthread
+-pop3d: pop3d.o backend.o tls.o mutex_fake.o libimap.a $(DEPLIBS) $(SERVICE)
++pop3d: pop3d.o backend.o tls.o mutex_fake.o libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(SERVICE)
+       $(CC) $(LDFLAGS) -o pop3d pop3d.o backend.o tls.o $(SERVICE) \
+-       mutex_fake.o libimap.a $(DEPLIBS) $(LIBS) $(LIB_WRAP)
++       mutex_fake.o libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS) $(LIB_WRAP)
+ nntpd: nntpd.o backend.o index.o smtpclient.o spool.o tls.o \
+        mutex_fake.o nntp_err.o libimap.a $(DEPLIBS) $(SERVICE)
+       $(CC) $(LDFLAGS) -o nntpd nntpd.o backend.o index.o spool.o \
+        smtpclient.o tls.o $(SERVICE) mutex_fake.o nntp_err.o \
+-       libimap.a $(DEPLIBS) $(LIBS) $(LIB_WRAP)
++       libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS) $(LIB_WRAP)
+-fud: fud.o libimap.a mutex_fake.o $(DEPLIBS) $(SERVICE)
++fud: fud.o libimap.a mutex_fake.o $(SIEVE_LIBS) $(DEPLIBS) $(SERVICE)
+       $(CC) $(LDFLAGS) -o fud $(SERVICE) fud.o mutex_fake.o libimap.a \
+-      $(DEPLIBS) $(LIBS) $(LIB_WRAP)
++      $(SIEVE_LIBS) $(DEPLIBS) $(LIBS) $(LIB_WRAP)
+-smmapd: smmapd.o libimap.a mutex_fake.o $(DEPLIBS) $(SERVICE)
++smmapd: smmapd.o libimap.a mutex_fake.o $(SIEVE_LIBS) $(DEPLIBS) $(SERVICE)
+       $(CC) $(LDFLAGS) -o smmapd $(SERVICE) smmapd.o mutex_fake.o libimap.a \
+-      $(DEPLIBS) $(LIBS) $(LIB_WRAP)
++      $(SIEVE_LIBS) $(DEPLIBS) $(LIBS) $(LIB_WRAP)
+ ### Command Line Utilities
+-arbitron: arbitron.o $(CLIOBJS) libimap.a $(DEPLIBS)
++arbitron: arbitron.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS)
+       $(CC) $(LDFLAGS) -o arbitron arbitron.o $(CLIOBJS) \
+-      libimap.a $(DEPLIBS) $(LIBS)
++      libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
++
++compile_sieve: compile_sieve.o libimap.a $(SIEVE_LIBS) $(DEPLIBS)
++      $(CC) $(LDFLAGS) -o compile_sieve compile_sieve.o $(CLIOBJS) \
++      libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
+-cvt_cyrusdb: cvt_cyrusdb.o mutex_fake.o libimap.a $(DEPLIBS)
++cvt_cyrusdb: cvt_cyrusdb.o mutex_fake.o libimap.a $(SIEVE_LIBS) $(DEPLIBS)
+       $(CC) $(LDFLAGS) -o cvt_cyrusdb cvt_cyrusdb.o $(CLIOBJS) \
+-      libimap.a $(DEPLIBS) $(LIBS)
++      libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
+-chk_cyrus: chk_cyrus.o mutex_fake.o libimap.a $(DEPLIBS)
++chk_cyrus: chk_cyrus.o mutex_fake.o libimap.a $(SIEVE_LIBS) $(DEPLIBS)
+       $(CC) $(LDFLAGS) -o chk_cyrus chk_cyrus.o $(CLIOBJS) \
+-      libimap.a $(DEPLIBS) $(LIBS)
++      libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
+-deliver: deliver.o backend.o $(LMTPOBJS) mutex_fake.o libimap.a $(DEPLIBS)
++deliver: deliver.o backend.o $(LMTPOBJS) mutex_fake.o libimap.a $(SIEVE_LIBS) $(DEPLIBS)
+       $(CC) $(LDFLAGS) -o deliver deliver.o backend.o $(LMTPOBJS) \
+-      mutex_fake.o libimap.a $(DEPLIBS) $(LIBS)
++      mutex_fake.o libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
+-ctl_deliver: ctl_deliver.o $(CLIOBJS) libimap.a $(DEPLIBS)
++ctl_deliver: ctl_deliver.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS)
+       $(CC) $(LDFLAGS) -o \
+-       $@ ctl_deliver.o $(CLIOBJS) libimap.a $(DEPLIBS) $(LIBS)
++       $@ ctl_deliver.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
+-ctl_mboxlist: ctl_mboxlist.o mupdate-client.o $(CLIOBJS) libimap.a $(DEPLIBS)
++ctl_mboxlist: ctl_mboxlist.o mupdate-client.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS)
+       $(CC) $(LDFLAGS) -o $@ ctl_mboxlist.o mupdate-client.o $(CLIOBJS) \
+-      libimap.a $(DEPLIBS) $(LIBS)
++      libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
+-ctl_cyrusdb: ctl_cyrusdb.o $(CLIOBJS) libimap.a $(DEPLIBS)
++ctl_cyrusdb: ctl_cyrusdb.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS)
+       $(CC) $(LDFLAGS) -o \
+-       $@ ctl_cyrusdb.o $(CLIOBJS) libimap.a $(DEPLIBS) $(LIBS)
++       $@ ctl_cyrusdb.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
+-cyr_expire: cyr_expire.o $(CLIOBJS) libimap.a $(DEPLIBS)
++cyr_expire: cyr_expire.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS)
+       $(CC) $(LDFLAGS) -o $@ cyr_expire.o $(CLIOBJS) \
+-      libimap.a $(DEPLIBS) $(LIBS)
++      libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
+-fetchnews: fetchnews.o $(CLIOBJS) libimap.a $(DEPLIBS)
++fetchnews: fetchnews.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS)
+       $(CC) $(LDFLAGS) -o \
+-       $@ fetchnews.o $(CLIOBJS) libimap.a $(DEPLIBS) $(LIBS)
++       $@ fetchnews.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
+-squatter: squatter.o index.o squat_build.o $(CLIOBJS) libimap.a $(DEPLIBS)
++squatter: squatter.o index.o squat_build.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS)
+       $(CC) $(LDFLAGS) -o squatter squatter.o index.o squat_build.o \
+-      $(CLIOBJS) libimap.a $(DEPLIBS) $(LIBS)
++      $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
+-mbpath: mbpath.o $(CLIOBJS) libimap.a $(DEPLIBS)
++mbpath: mbpath.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS)
+       $(CC) $(LDFLAGS) -o mbpath mbpath.o $(CLIOBJS) libimap.a \
+-      $(DEPLIBS) $(LIBS)
++      $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
+-ipurge: ipurge.o $(CLIOBJS) libimap.a $(DEPLIBS)
++ipurge: ipurge.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS)
+       $(CC) $(LDFLAGS) -o ipurge ipurge.o $(CLIOBJS) \
+-      libimap.a $(DEPLIBS) $(LIBS)
++      libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
+-cyrdump: cyrdump.o index.o $(CLIOBJS) libimap.a $(DEPLIBS)
++cyrdump: cyrdump.o index.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS)
+       $(CC) $(LDFLAGS) -o cyrdump cyrdump.o index.o $(CLIOBJS) \
+-      libimap.a $(DEPLIBS) $(LIBS)
++      libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
+-mbexamine: mbexamine.o $(CLIOBJS) libimap.a $(DEPLIBS)
++mbexamine: mbexamine.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS)
+       $(CC) $(LDFLAGS) -o \
+-       mbexamine mbexamine.o $(CLIOBJS) libimap.a $(DEPLIBS) $(LIBS)
++       mbexamine mbexamine.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
+-reconstruct: reconstruct.o $(CLIOBJS) libimap.a $(DEPLIBS)
++reconstruct: reconstruct.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS)
+       $(CC) $(LDFLAGS) -o \
+-       reconstruct reconstruct.o $(CLIOBJS) libimap.a $(DEPLIBS) $(LIBS)
++       reconstruct reconstruct.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
+-quota: quota.o $(CLIOBJS) libimap.a $(DEPLIBS)
++quota: quota.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS)
+       $(CC) $(LDFLAGS) -o quota quota.o $(CLIOBJS) \
+-      libimap.a $(DEPLIBS) $(LIBS)
++      libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
+-tls_prune: tls_prune.o tls.o $(CLIOBJS) libimap.a $(DEPLIBS)
++tls_prune: tls_prune.o tls.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS)
+       $(CC) $(LDFLAGS) -o \
+-       $@ tls_prune.o tls.o $(CLIOBJS) libimap.a $(DEPLIBS) $(LIBS)
++       $@ tls_prune.o tls.o $(CLIOBJS) libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS)
+ ### Other Misc Targets
+diff -Naur cyrus-imapd-2.2.12/imap/autosieve.c cyrus-imapd-2.2.12.autocreate2/imap/autosieve.c
+--- cyrus-imapd-2.2.12/imap/autosieve.c        1970-01-01 02:00:00.000000000 +0200
++++ cyrus-imapd-2.2.12.autocreate2/imap/autosieve.c    2005-10-19 14:48:57.940098000 +0300
+@@ -0,0 +1,587 @@
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++
++#ifdef HAVE_UNISTD_H
++#include <unistd.h>
++#endif
++
++#include <errno.h>
++#include <sys/types.h>
++#include <sys/stat.h>
++#include <sys/uio.h>
++#include <fcntl.h>
++#include <ctype.h>
++#include <time.h>
++#include <syslog.h>
++#include <com_err.h>
++#include <config.h>
++
++#include "global.h"
++#include "util.h"
++#include "mailbox.h"
++#include "imap_err.h"
++#include "sieve_interface.h"
++#include "script.h"
++
++#define TIMSIEVE_FAIL         -1
++#define TIMSIEVE_OK   0
++#define MAX_FILENAME  1024
++
++static int get_script_name(char *sievename, size_t buflen, const char *filename);
++static int get_script_dir(char *sieve_script_dir, size_t buflen, char *userid, const char *sieve_dir);
++int autoadd_sieve(char *userid, const char *source_script);
++
++static void fatal(const char *s, int code);
++static void foo(void);
++static int sieve_notify(void *ac __attribute__((unused)),
++                        void *interp_context __attribute__((unused)),
++                        void *script_context __attribute__((unused)),
++                        void *message_context __attribute__((unused)),
++                        const char **errmsg __attribute__((unused)));
++static int mysieve_error(int lineno, const char *msg,
++                  void *i __attribute__((unused)), void *s);
++static int is_script_parsable(FILE *stream, char **errstr, sieve_script_t **ret);
++
++
++sieve_vacation_t vacation2 = {
++    0,                          /* min response */
++    0,                          /* max response */
++    (sieve_callback *) &foo,    /* autorespond() */
++    (sieve_callback *) &foo     /* send_response() */
++};
++
++
++/*
++ * Find the name of the sieve script
++ * given the source script and compiled script names
++ */
++static int get_script_name(char *sievename, size_t buflen, const char *filename)
++{
++  char *p;
++  int r;
++
++  p = strrchr(filename, '/');
++  if (p == NULL)
++      p = (char *) filename;
++  else
++      p++;
++
++  r = strlcpy(sievename, p, buflen) - buflen;
++  return (r >= 0 || r == -buflen ? 1 : 0);
++}
++
++
++/*
++ * Find the directory where the sieve scripts of the user
++ * reside
++ */
++static int get_script_dir(char *sieve_script_dir, size_t buflen, char *userid, const char *sieve_dir)
++{
++    char *user = NULL, *domain = NULL;
++
++    /* Setup the user and the domain */
++    if(config_virtdomains && (domain = strchr(userid, '@'))) {
++        user = (char *) xmalloc((domain - userid +1) * sizeof(char));
++        strlcpy(user, userid, domain - userid + 1);
++        domain++;
++    } else
++        user = userid;
++
++    /*  Find the dir path where the sieve scripts of the user will reside */   
++    if (config_virtdomains && domain) {
++         if(snprintf(sieve_script_dir, buflen, "%s%s%c/%s/%c/%s/",
++              sieve_dir, FNAME_DOMAINDIR, dir_hash_c(domain), domain, dir_hash_c(user), user) >= buflen) {
++                 free(user);
++                 return 1;
++       }
++    } else {
++         if(snprintf(sieve_script_dir, buflen, "%s/%c/%s/", 
++            sieve_dir, dir_hash_c(user), user) >= buflen) 
++                 return 1;
++    }
++
++    /* Free the xmalloced user memory, reserved above */
++    if(user != userid)
++        free(user);
++
++    return 0;
++}
++
++int autoadd_sieve(char *userid, const char *source_script)
++{   
++    sieve_script_t *s = NULL;
++    bytecode_info_t *bc = NULL;
++    char *err = NULL;
++    FILE *in_stream, *out_fp;
++    int out_fd, in_fd, r, k;
++    int do_compile = 0;
++    const char *sieve_dir = NULL;
++    const char *compiled_source_script = NULL;
++    char sievename[MAX_FILENAME];
++    char sieve_script_name[MAX_FILENAME];
++    char sieve_script_dir[MAX_FILENAME];
++    char sieve_bcscript_name[MAX_FILENAME];
++    char sieve_default[MAX_FILENAME];
++    char sieve_tmpname[MAX_FILENAME];
++    char sieve_bctmpname[MAX_FILENAME];
++    char sieve_bclink_name[MAX_FILENAME];
++    char buf[4096];
++    mode_t oldmask;
++    struct stat statbuf;
++
++    /* We don't support using the homedirectory, like timsieved */
++    if (config_getswitch(IMAPOPT_SIEVEUSEHOMEDIR)) {
++        syslog(LOG_WARNING,"autocreate_sieve: autocreate_sieve does not work with sieveusehomedir option in imapd.conf");
++        return 1;
++    }
++
++    /* Check if sievedir is defined in imapd.conf */
++    if(!(sieve_dir = config_getstring(IMAPOPT_SIEVEDIR))) { 
++        syslog(LOG_WARNING, "autocreate_sieve: sievedir option is not defined. Check imapd.conf");
++        return 1;
++    }
++
++    /* Check if autocreate_sieve_compiledscript is defined in imapd.conf */
++    if(!(compiled_source_script  = config_getstring(IMAPOPT_AUTOCREATE_SIEVE_COMPILEDSCRIPT))) {
++        syslog(LOG_WARNING, "autocreate_sieve: autocreate_sieve_compiledscript option is not defined. Compiling it");
++        do_compile = 1;
++    }
++
++    if(get_script_dir(sieve_script_dir, sizeof(sieve_script_dir), userid, sieve_dir)) {
++        syslog(LOG_WARNING, "autocreate_sieve: Cannot find sieve scripts directory");
++        return 1;
++    }
++
++    if (get_script_name(sievename, sizeof(sievename), source_script)) {
++        syslog(LOG_WARNING, "autocreate_sieve: Invalid sieve script %s", source_script);
++        return 1;
++    }
++
++    if(snprintf(sieve_tmpname, sizeof(sieve_tmpname), "%s%s.script.NEW",sieve_script_dir, sievename) >= sizeof(sieve_tmpname)) {
++        syslog(LOG_WARNING, "autocreate_sieve: Invalid sieve path %s, %s, %s", sieve_dir, sievename, userid);
++        return 1;
++    }
++    if(snprintf(sieve_bctmpname, sizeof(sieve_bctmpname), "%s%s.bc.NEW",sieve_script_dir, sievename) >= sizeof(sieve_bctmpname)) {
++        syslog(LOG_WARNING, "autocreate_sieve: Invalid sieve path %s, %s, %s", sieve_dir, sievename, userid);
++        return 1;
++    }    
++    if(snprintf(sieve_script_name, sizeof(sieve_script_name), "%s%s.script",sieve_script_dir, sievename) >= sizeof(sieve_script_name)) {
++        syslog(LOG_WARNING, "autocreate_sieve: Invalid sieve path %s, %s, %s", sieve_dir, sievename, userid);
++        return 1;
++    }
++    if(snprintf(sieve_bcscript_name, sizeof(sieve_bcscript_name), "%s%s.bc",sieve_script_dir, sievename) >= sizeof(sieve_bcscript_name)) {
++        syslog(LOG_WARNING, "autocreate_sieve: Invalid sieve path %s, %s, %s", sieve_dir, sievename, userid);
++        return 1;
++    }
++    if(snprintf(sieve_default, sizeof(sieve_default), "%s%s",sieve_script_dir,"defaultbc") >= sizeof(sieve_default)) {
++        syslog(LOG_WARNING, "autocreate_sieve: Invalid sieve path %s, %s, %s", sieve_dir, sievename, userid);
++        return 1;
++    }
++    if(snprintf(sieve_bclink_name, sizeof(sieve_bclink_name), "%s.bc", sievename) >= sizeof(sieve_bclink_name))  {
++        syslog(LOG_WARNING, "autocreate_sieve: Invalid sieve path %s, %s, %s", sieve_dir, sievename, userid);
++        return 1;
++    }
++
++    /* Check if a default sieve filter alrady exists */
++    if(!stat(sieve_default,&statbuf)) {
++        syslog(LOG_WARNING,"autocreate_sieve: Default sieve script already exists");
++        fclose(in_stream);
++        return 1;
++    }
++
++    /* Open the source script. if there is a problem with that exit */
++    in_stream = fopen(source_script, "r");
++    if(!in_stream) {
++        syslog(LOG_WARNING,"autocreate_sieve: Unable to open sieve script %s. Check permissions",source_script);
++        return 1;
++    }
++    
++    
++    /* 
++     * At this point we start the modifications of the filesystem 
++     */
++
++    /* Create the directory where the sieve scripts will reside */
++    r = cyrus_mkdir(sieve_script_dir, 0755);
++    if(r == -1) {
++        /* If this fails we just leave */
++        syslog(LOG_WARNING,"autocreate_sieve: Unable to create directory %s. Check permissions",sieve_script_name);
++        return 1;
++    }
++
++    /*
++     * We open the file that will be used as the bc file. If this file exists, overwrite it 
++     * since something bad has happened. We open the file here so that this error checking is
++     * done before we try to open the rest of the files to start copying etc. 
++     */
++    out_fd = open(sieve_bctmpname, O_CREAT|O_TRUNC|O_WRONLY, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH);
++    if(out_fd < 0) {
++        if(errno == EEXIST) {
++            syslog(LOG_WARNING,"autocreate_sieve: File %s already exists. Probaly left over. Ignoring",sieve_bctmpname);
++        } else if (errno == EACCES) {
++            syslog(LOG_WARNING,"autocreate_sieve: No access to create file %s. Check permissions",sieve_bctmpname);
++            fclose(in_stream);
++            return 1;
++        } else {
++            syslog(LOG_WARNING,"autocreate_sieve: Unable to create %s. Unknown error",sieve_bctmpname);
++            fclose(in_stream);
++            return 1;
++        }
++    }
++
++    if(!do_compile && compiled_source_script && (in_fd = open(compiled_source_script, O_RDONLY)) != -1) {
++        while((r = read(in_fd, buf, sizeof(buf))) > 0) {
++            if((k=write(out_fd, buf,r)) < 0) {
++                syslog(LOG_WARNING, "autocreate_sieve: Error writing to file: %s, error: %d", sieve_bctmpname, errno);
++                close(out_fd);
++                close(in_fd);
++                fclose(in_stream);
++                unlink(sieve_bctmpname);
++                return 1;
++           }
++        } 
++
++        if(r == 0) { /* EOF */
++            close(out_fd);
++            close(in_fd);
++        } else if (r < 0) {
++            syslog(LOG_WARNING, "autocreate_sieve: Error reading compiled script file: %s. Will try to compile it", 
++                           compiled_source_script);
++            close(in_fd);
++            do_compile = 1;
++            if(lseek(out_fd, 0, SEEK_SET)) {
++                syslog(LOG_WARNING, "autocreate_sieve: Major IO problem. Aborting");
++                return 1;
++            }
++        }
++        close(in_fd);
++    } else {
++        if(compiled_source_script)
++              syslog(LOG_WARNING,"autocreate_sieve: Problem opening compiled script file: %s. Compiling it", compiled_source_script);
++        do_compile = 1;
++    }
++
++
++    /* Because we failed to open a precompiled bc sieve script, we compile one */
++    if(do_compile) {
++       if(is_script_parsable(in_stream,&err, &s) == TIMSIEVE_FAIL) {
++            if(err && *err) {
++               syslog(LOG_WARNING,"autocreate_sieve: Error while parsing script %s.",err);
++               free(err);
++            } else
++                syslog(LOG_WARNING,"autocreate_sieve: Error while parsing script");
++    
++            unlink(sieve_bctmpname);
++            fclose(in_stream);
++            close(out_fd);
++            return 1;
++        }
++
++        /* generate the bytecode */
++        if(sieve_generate_bytecode(&bc, s) == TIMSIEVE_FAIL) {
++            syslog(LOG_WARNING,"autocreate_sieve: problem compiling sieve script");
++            /* removing the copied script and cleaning up memory */
++            unlink(sieve_bctmpname);
++            sieve_script_free(&s);
++            fclose(in_stream);
++            close(out_fd);
++            return 1;
++        }
++
++        if(sieve_emit_bytecode(out_fd, bc) == TIMSIEVE_FAIL) {
++            syslog(LOG_WARNING,"autocreate_sieve: problem emiting sieve script");
++            /* removing the copied script and cleaning up memory */
++            unlink(sieve_bctmpname);
++            sieve_free_bytecode(&bc);
++            sieve_script_free(&s);
++            fclose(in_stream);
++            close(out_fd);
++            return 1;
++        }
++
++        /* clean up the memory */
++        sieve_free_bytecode(&bc);
++        sieve_script_free(&s);
++    }
++
++    close(out_fd);
++    rewind(in_stream);
++
++    /* Copy the initial script */
++    oldmask = umask(077);
++    if((out_fp = fopen(sieve_tmpname, "w")) == NULL) {
++        syslog(LOG_WARNING,"autocreate_sieve: Unable to open %s destination sieve script", sieve_tmpname);
++        unlink(sieve_bctmpname);
++        umask(oldmask);
++        fclose(in_stream);
++        return 1;
++    }
++    umask(oldmask);
++
++    while((r = fread(buf,sizeof(char), sizeof(buf), in_stream))) {
++        if( fwrite(buf,sizeof(char), r, out_fp) != r) {
++            syslog(LOG_WARNING,"autocreate_sieve: Problem writing to sieve script file: %s",sieve_tmpname);
++            fclose(out_fp);
++            unlink(sieve_tmpname);
++            unlink(sieve_bctmpname);
++            fclose(in_stream);
++            return 1;
++        }
++    }
++    
++    if(feof(in_stream)) {
++        fclose(out_fp);
++    } else { /* ferror */
++        fclose(out_fp);
++        unlink(sieve_tmpname);
++        unlink(sieve_bctmpname);
++        fclose(in_stream);
++        return 1;
++    }
++
++    /* Renaming the necessary stuff */
++    if(rename(sieve_tmpname, sieve_script_name)) {
++        unlink(sieve_tmpname);
++        unlink(sieve_bctmpname);
++        return 1;
++    }
++
++    if(rename(sieve_bctmpname, sieve_bcscript_name)) {
++        unlink(sieve_bctmpname);
++        unlink(sieve_bcscript_name);
++        return 1;
++    }
++
++    /* end now with the symlink */
++    if(symlink(sieve_bclink_name, sieve_default)) {
++        if(errno != EEXIST) {
++            syslog(LOG_WARNING, "autocreate_sieve: problem making the default link.");
++            /* Lets delete the files */
++            unlink(sieve_script_name);
++            unlink(sieve_bcscript_name);
++        }
++    }
++
++    /* 
++     * If everything has succeeded AND we have compiled the script AND we have requested
++     * to generate the global script so that it is not compiled each time then we create it.
++     */
++    if(do_compile && 
++          config_getswitch(IMAPOPT_GENERATE_COMPILED_SIEVE_SCRIPT)) {
++
++        if(!compiled_source_script) {
++            syslog(LOG_WARNING, "autocreate_sieve: To save a compiled sieve script, autocreate_sieve_compiledscript must have been defined in imapd.conf");
++            return 0;
++        }
++
++        if(snprintf(sieve_tmpname, sizeof(sieve_tmpname), "%s.NEW", compiled_source_script) >= sizeof(sieve_tmpname))
++            return 0;
++
++        /*
++         * Copy everything from the newly created bc sieve sieve script.
++         */
++        if((in_fd = open(sieve_bcscript_name, O_RDONLY))<0) {
++            return 0;
++        }
++
++        if((out_fd = open(sieve_tmpname, O_CREAT|O_EXCL|O_WRONLY, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH)) < 0) {
++            if(errno == EEXIST) {
++               /* Someone is already doing this so just bail out. */
++               syslog(LOG_WARNING, "autocreate_sieve: %s already exists. Some other instance processing it, or it is left over", sieve_tmpname);
++                close(in_fd);
++                return 0; 
++            } else if (errno == EACCES) {
++                syslog(LOG_WARNING,"autocreate_sieve: No access to create file %s. Check permissions",sieve_tmpname);
++                close(in_fd);
++                return 0;
++            } else {
++                syslog(LOG_WARNING,"autocreate_sieve: Unable to create %s",sieve_tmpname);
++                close(in_fd);
++                return 0;
++            }
++        }
++
++        while((r = read(in_fd, buf, sizeof(buf))) > 0) {
++            if((k = write(out_fd,buf,r)) < 0) {
++                syslog(LOG_WARNING, "autocreate_sieve: Error writing to file: %s, error: %d", sieve_tmpname, errno);
++                close(out_fd);
++                close(in_fd);
++                unlink(sieve_tmpname);
++                return 0;
++           }
++        }
++
++        if(r == 0 ) { /*EOF */
++            close(out_fd);
++            close(in_fd);
++        } else if (r < 0) {
++                syslog(LOG_WARNING, "autocreate_sieve: Error writing to file: %s, error: %d", sieve_tmpname, errno);
++                close(out_fd);
++                close(in_fd);
++                unlink(sieve_tmpname);
++                return 0;
++        }
++
++        /* Rename the temporary created sieve script to its final name. */
++        if(rename(sieve_tmpname, compiled_source_script)) {
++            if(errno != EEXIST) {
++               unlink(sieve_tmpname);
++               unlink(compiled_source_script);
++        }
++            return 0;
++        }
++
++        syslog(LOG_NOTICE, "autocreate_sieve: Compiled sieve script was successfully saved in %s", compiled_source_script);
++    }
++
++    return 0;
++}
++
++static void fatal(const char *s, int code)
++{   
++    printf("Fatal error: %s (%d)\r\n", s, code);
++    exit(1);
++}
++
++/* to make larry's stupid functions happy :) */
++static void foo(void)
++{
++    fatal("stub function called", 0);
++}
++
++static int sieve_notify(void *ac __attribute__((unused)),
++                        void *interp_context __attribute__((unused)),
++                        void *script_context __attribute__((unused)),
++                        void *message_context __attribute__((unused)),
++                        const char **errmsg __attribute__((unused)))
++{
++    fatal("stub function called", 0);
++    return SIEVE_FAIL;
++}
++
++static int mysieve_error(int lineno, const char *msg,
++                  void *i __attribute__((unused)), void *s)
++{
++    char buf[1024];
++    char **errstr = (char **) s;
++
++    snprintf(buf, 80, "line %d: %s\r\n", lineno, msg);
++    *errstr = (char *) xrealloc(*errstr, strlen(*errstr) + strlen(buf) + 30);
++    syslog(LOG_DEBUG, "%s", buf);
++    strcat(*errstr, buf);
++
++    return SIEVE_OK;
++}
++
++/* end the boilerplate */
++
++/* returns TRUE or FALSE */
++int is_script_parsable(FILE *stream, char **errstr, sieve_script_t **ret)
++{
++    sieve_interp_t *i;
++    sieve_script_t *s;
++    int res;
++
++    res = sieve_interp_alloc(&i, NULL);
++    if (res != SIEVE_OK) {
++        syslog(LOG_WARNING, "sieve_interp_alloc() returns %d\n", res);
++        return TIMSIEVE_FAIL;
++    }
++
++    res = sieve_register_redirect(i, (sieve_callback *) &foo);
++    if (res != SIEVE_OK) {
++        syslog(LOG_WARNING, "sieve_register_redirect() returns %d\n", res);
++        return TIMSIEVE_FAIL;
++    }
++    res = sieve_register_discard(i, (sieve_callback *) &foo);
++    if (res != SIEVE_OK) {
++        syslog(LOG_WARNING, "sieve_register_discard() returns %d\n", res);
++        return TIMSIEVE_FAIL;
++    }
++    res = sieve_register_reject(i, (sieve_callback *) &foo);
++    if (res != SIEVE_OK) {
++        syslog(LOG_WARNING, "sieve_register_reject() returns %d\n", res);
++        return TIMSIEVE_FAIL;
++    }
++    res = sieve_register_fileinto(i, (sieve_callback *) &foo);
++    if (res != SIEVE_OK) {
++        syslog(LOG_WARNING, "sieve_register_fileinto() returns %d\n", res);
++        return TIMSIEVE_FAIL;
++    }
++    res = sieve_register_keep(i, (sieve_callback *) &foo);
++    if (res != SIEVE_OK) {
++        syslog(LOG_WARNING, "sieve_register_keep() returns %d\n", res);
++        return TIMSIEVE_FAIL;
++    }
++
++    res = sieve_register_imapflags(i, NULL);
++    if (res != SIEVE_OK) {
++        syslog(LOG_WARNING, "sieve_register_imapflags() returns %d\n", res);
++        return TIMSIEVE_FAIL;
++    }
++
++    res = sieve_register_size(i, (sieve_get_size *) &foo);
++    if (res != SIEVE_OK) {
++        syslog(LOG_WARNING, "sieve_register_size() returns %d\n", res);
++        return TIMSIEVE_FAIL;
++    }
++
++    res = sieve_register_header(i, (sieve_get_header *) &foo);
++    if (res != SIEVE_OK) {
++        syslog(LOG_WARNING, "sieve_register_header() returns %d\n", res);
++        return TIMSIEVE_FAIL;
++    }
++
++    res = sieve_register_envelope(i, (sieve_get_envelope *) &foo);
++    if (res != SIEVE_OK) {
++        syslog(LOG_WARNING, "sieve_register_envelope() returns %d\n", res);
++        return TIMSIEVE_FAIL;
++    }
++
++    res = sieve_register_vacation(i, &vacation2);
++    if (res != SIEVE_OK) {
++        syslog(LOG_WARNING, "sieve_register_vacation() returns %d\n", res);
++        return TIMSIEVE_FAIL;
++    }
++
++    res = sieve_register_notify(i, &sieve_notify);
++    if (res != SIEVE_OK) {
++        syslog(LOG_WARNING, "sieve_register_notify() returns %d\n", res);
++        return TIMSIEVE_FAIL;
++    }
++
++    res = sieve_register_parse_error(i, &mysieve_error);
++    if (res != SIEVE_OK) {
++        syslog(LOG_WARNING, "sieve_register_parse_error() returns %d\n", res);
++        return TIMSIEVE_FAIL;
++    }
++
++    rewind(stream);
++
++    *errstr = (char *) xmalloc(20 * sizeof(char));
++    strcpy(*errstr, "script errors:\r\n");
++
++    res = sieve_script_parse(i, stream, errstr, &s);
++
++    if (res == SIEVE_OK) {
++        if(ret) {
++            *ret = s;
++        } else {
++            sieve_script_free(&s);
++        }
++        free(*errstr);
++        *errstr = NULL;
++    }
++
++    /* free interpreter */
++    sieve_interp_free(&i);
++
++    return (res == SIEVE_OK) ? TIMSIEVE_OK : TIMSIEVE_FAIL;
++}
++
++/*
++ * Btw the initial date of this patch is Sep, 02 2004 which is the birthday of
++ * Pavlos. Author of cyrusmaster. So consider this patch as his birthday present
++ */
++
+diff -Naur cyrus-imapd-2.2.12/imap/compile_sieve.c cyrus-imapd-2.2.12.autocreate2/imap/compile_sieve.c
+--- cyrus-imapd-2.2.12/imap/compile_sieve.c    1970-01-01 02:00:00.000000000 +0200
++++ cyrus-imapd-2.2.12.autocreate2/imap/compile_sieve.c        2005-10-19 14:48:57.943407000 +0300
+@@ -0,0 +1,364 @@
++/* This tool compiles the sieve script from a command
++line so that it can be used wby the autoadd patch */
++#include <stdio.h>
++#include <stdlib.h>
++
++#include <config.h>
++#include <string.h>
++#ifdef HAVE_UNISTD_H
++#include <unistd.h>
++#endif
++#include <errno.h>
++#include <sys/types.h>
++#include <sys/stat.h>
++#include <sys/uio.h>
++#include <fcntl.h>
++#include <ctype.h>
++#include <time.h>
++#include <com_err.h>
++
++#include "global.h"
++
++#include "util.h"
++#include "mailbox.h"
++#include "imap_err.h"
++#include "sieve_interface.h"
++#include "script.h"
++
++#include <pwd.h>
++
++#define TIMSIEVE_FAIL                 -1
++#define TIMSIEVE_OK           0
++#define MAX_FILENAME_SIZE     100
++
++/* Needed by libconfig */
++const int config_need_data = 0;
++
++static int is_script_parsable(FILE *stream, char **errstr, sieve_script_t **ret);
++
++static void fatal(const char *s, int code)
++{   
++    printf("Fatal error: %s (%d)\r\n", s, code);
++
++    exit(1);
++}
++
++void usage(void)
++{
++    fprintf(stderr,
++            "Usage:\n\tcompile_sieve [-C <altconfig>] [-i <infile> -o <outfile>]\n");
++    exit(-1);
++}
++
++
++int main (int argc, char **argv)
++{   
++
++    sieve_script_t *s = NULL;
++    bytecode_info_t *bc = NULL;
++    char *err = NULL;
++    FILE *in_stream;
++    int  out_fd,r, k, opt;
++    char *source_script = NULL;
++    char *compiled_source_script = NULL;
++    mode_t oldmask;
++    struct stat statbuf;
++    char *alt_config = NULL;
++    extern char *optarg;
++    char sieve_tmpname[MAX_MAILBOX_NAME+1];
++
++    if (geteuid() == 0) fatal("must run as the Cyrus user", EC_USAGE);
++
++    while((opt = getopt(argc, argv, "C:i:o:")) != EOF) {
++        switch (opt) {
++            case 'C': /* alt config file */
++              alt_config =  optarg;
++              break;
++          case 'i': /* input script file */
++              source_script = optarg;
++              break;
++          case 'o': /* output script file */
++              compiled_source_script = optarg;
++              break;
++          default:
++              usage();
++              break;
++      }
++    }
++
++    if(source_script && !compiled_source_script) {
++          fprintf(stderr, "No output file was defined\n");
++          usage();
++    } else if (!source_script && compiled_source_script) {
++          fprintf(stderr, "No input file was defined\n");
++          usage();
++    } 
++
++    /*
++     * If no <infile> has been defined, then read them from
++     * the configuration file.
++     */
++    if (!source_script && !compiled_source_script) { 
++          cyrus_init(alt_config, "compile_sieve", 0);
++
++          /* Initially check if we want to have the sieve script created */
++          if(!(source_script = (char *) config_getstring(IMAPOPT_AUTOCREATE_SIEVE_SCRIPT))) {
++              fprintf(stderr,"autocreate_sieve_script option not defined. Check imapd.conf\n");
++              return 1;
++          }
++
++          /* Check if we have an already compiled sieve script*/
++          if(!(compiled_source_script = (char *) config_getstring(IMAPOPT_AUTOCREATE_SIEVE_COMPILEDSCRIPT))) {
++              fprintf(stderr, "autocreate_sieve_compiledscript option not defined. Check imapd.conf\n");
++              return 1;
++          }
++
++          if(!strrchr(source_script,'/') || !strrchr(compiled_source_script,'/')) {
++                      /* 
++               * At this point the only think that is inconsistent is the directory 
++               * that was created. But if the user will have any sieve scripts then 
++               * they will eventually go there, so no big deal 
++               */
++              fprintf(stderr, 
++                      "In imapd.conf the full path of the filenames must be defined\n");
++              return 1;
++          }
++    }
++
++    printf("input file : %s, output file : %s\n", source_script, compiled_source_script);
++
++
++    if(strlen(compiled_source_script) + sizeof(".NEW") + 1 > sizeof(sieve_tmpname)) {
++          fprintf(stderr, "Filename %s is too big\n", compiled_source_script);
++          return 1;
++    }
++      
++    snprintf(sieve_tmpname, sizeof(sieve_tmpname), "%s.NEW", compiled_source_script);
++
++    in_stream = fopen(source_script,"r");
++
++    if(!in_stream) {
++        fprintf(stderr,"Unable to open %s source sieve script\n",source_script);
++        return;
++    }
++
++    /* 
++     * We open the file that will be used as the bc file. If this file exists, overwrite it 
++     * since something bad has happened. We open the file here so that this error checking is
++     * done before we try to open the rest of the files to start copying etc. 
++     */
++    out_fd = open(sieve_tmpname, O_CREAT|O_EXCL|O_WRONLY, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH);
++    if(out_fd < 0) {
++        if(errno == EEXIST) {
++            fprintf(stderr, "File %s already exists\n", sieve_tmpname);
++        } else if (errno == EACCES) {
++            fprintf(stderr,"No access to create file %s. Please check that you have the correct permissions\n",
++                          sieve_tmpname);
++        } else {
++            fprintf(stderr,"Unable to create %s. Please check that you have the correct permissions\n", 
++                          sieve_tmpname);
++        }
++      
++      fclose(in_stream);
++      return 1;
++    }
++
++    if(is_script_parsable(in_stream,&err, &s) == TIMSIEVE_FAIL) {
++        if(err && *err) {
++           fprintf(stderr, "Error while parsing script %s\n",err);
++           free(err);
++        }
++        else
++            fprintf(stderr,"Error while parsing script\n");
++            unlink(sieve_tmpname);
++          fclose(in_stream);
++          close(out_fd);
++        return;
++   }
++
++
++    /* generate the bytecode */
++    if(sieve_generate_bytecode(&bc,s) == TIMSIEVE_FAIL) {
++        fprintf(stderr,"Error occured while compiling sieve script\n");
++        /* removing the copied script and cleaning up memory */
++        unlink(sieve_tmpname);
++        sieve_script_free(&s);
++        fclose(in_stream);
++        close(out_fd);
++        return;
++    }
++    if(sieve_emit_bytecode(out_fd,bc) == TIMSIEVE_FAIL) {
++        fprintf(stderr, "Error occured while emitting sieve script\n");
++        unlink(sieve_tmpname);
++        sieve_free_bytecode(&bc);
++        sieve_script_free(&s);
++        fclose(in_stream);
++        close(out_fd);
++        return;
++    }
++
++    /* clean up the memory */
++    sieve_free_bytecode(&bc);
++    sieve_script_free(&s);
++
++    close(out_fd);
++
++    if(rename(sieve_tmpname, compiled_source_script)) {
++        if(errno != EEXIST) {
++            unlink(sieve_tmpname);
++            unlink(compiled_source_script);
++            return 1;
++        }
++    }
++    return 0;
++}
++
++
++/* to make larry's stupid functions happy :) */
++static void foo(void)
++{
++    fatal("stub function called", 0);
++}
++
++extern sieve_vacation_t vacation2;/* = {
++    0,                          / min response /
++    0,                          / max response /
++    (sieve_callback *) &foo,    / autorespond() /
++    (sieve_callback *) &foo     / send_response() /
++}; */
++
++static int sieve_notify(void *ac __attribute__((unused)),
++                        void *interp_context __attribute__((unused)),
++                        void *script_context __attribute__((unused)),
++                        void *message_context __attribute__((unused)),
++                        const char **errmsg __attribute__((unused)))
++{
++    fatal("stub function called", 0);
++    return SIEVE_FAIL;
++}
++
++static int mysieve_error(int lineno, const char *msg,
++                  void *i __attribute__((unused)), void *s)
++{
++    char buf[1024];
++    char **errstr = (char **) s;
++
++    snprintf(buf, 80, "line %d: %s\r\n", lineno, msg);
++    *errstr = (char *) xrealloc(*errstr, strlen(*errstr) + strlen(buf) + 30);
++    fprintf(stderr, "%s\n", buf);
++    strcat(*errstr, buf);
++
++    return SIEVE_OK;
++}
++
++/* end the boilerplate */
++
++/* returns TRUE or FALSE */
++int is_script_parsable(FILE *stream, char **errstr, sieve_script_t **ret)
++{
++    sieve_interp_t *i;
++    sieve_script_t *s;
++    int res;
++
++    res = sieve_interp_alloc(&i, NULL);
++    if (res != SIEVE_OK) {
++        fprintf(stderr, "sieve_interp_alloc() returns %d\n", res);
++        return TIMSIEVE_FAIL;
++    }
++
++    res = sieve_register_redirect(i, (sieve_callback *) &foo);
++    if (res != SIEVE_OK) {
++        fprintf(stderr, "sieve_register_redirect() returns %d\n", res);
++        return TIMSIEVE_FAIL;
++    }
++    res = sieve_register_discard(i, (sieve_callback *) &foo);
++    if (res != SIEVE_OK) {
++        fprintf(stderr, "sieve_register_discard() returns %d\n", res);
++        return TIMSIEVE_FAIL;
++    }
++    res = sieve_register_reject(i, (sieve_callback *) &foo);
++    if (res != SIEVE_OK) {
++        fprintf(stderr, "sieve_register_reject() returns %d\n", res);
++        return TIMSIEVE_FAIL;
++    }
++    res = sieve_register_fileinto(i, (sieve_callback *) &foo);
++    if (res != SIEVE_OK) {
++        fprintf(stderr, "sieve_register_fileinto() returns %d\n", res);
++        return TIMSIEVE_FAIL;
++    }
++    res = sieve_register_keep(i, (sieve_callback *) &foo);
++    if (res != SIEVE_OK) {
++        fprintf(stderr, "sieve_register_keep() returns %d\n", res);
++        return TIMSIEVE_FAIL;
++    }
++
++    res = sieve_register_imapflags(i, NULL);
++    if (res != SIEVE_OK) {
++        fprintf(stderr, "sieve_register_imapflags() returns %d\n", res);
++        return TIMSIEVE_FAIL;
++    }
++
++    res = sieve_register_size(i, (sieve_get_size *) &foo);
++    if (res != SIEVE_OK) {
++        fprintf(stderr, "sieve_register_size() returns %d\n", res);
++        return TIMSIEVE_FAIL;
++    }
++
++    res = sieve_register_header(i, (sieve_get_header *) &foo);
++    if (res != SIEVE_OK) {
++        fprintf(stderr, "sieve_register_header() returns %d\n", res);
++        return TIMSIEVE_FAIL;
++    }
++
++    res = sieve_register_envelope(i, (sieve_get_envelope *) &foo);
++    if (res != SIEVE_OK) {
++        fprintf(stderr, "sieve_register_envelope() returns %d\n", res);
++        return TIMSIEVE_FAIL;
++    }
++
++    res = sieve_register_vacation(i, &vacation2);
++    if (res != SIEVE_OK) {
++        fprintf(stderr, "sieve_register_vacation() returns %d\n", res);
++        return TIMSIEVE_FAIL;
++    }
++
++    res = sieve_register_notify(i, &sieve_notify);
++    if (res != SIEVE_OK) {
++        fprintf(stderr, "sieve_register_notify() returns %d\n", res);
++        return TIMSIEVE_FAIL;
++    }
++
++    res = sieve_register_parse_error(i, &mysieve_error);
++    if (res != SIEVE_OK) {
++        fprintf(stderr, "sieve_register_parse_error() returns %d\n", res);
++        return TIMSIEVE_FAIL;
++    }
++
++    rewind(stream);
++
++    *errstr = (char *) xmalloc(20 * sizeof(char));
++    strcpy(*errstr, "script errors:\r\n");
++
++    res = sieve_script_parse(i, stream, errstr, &s);
++
++    if (res == SIEVE_OK) {
++        if(ret) {
++            *ret = s;
++        } else {
++            sieve_script_free(&s);
++        }
++        free(*errstr);
++        *errstr = NULL;
++    }
++
++    /* free interpreter */
++    sieve_interp_free(&i);
++
++    return (res == SIEVE_OK) ? TIMSIEVE_OK : TIMSIEVE_FAIL;
++}
++
++
++
++
++
++
+diff -Naur cyrus-imapd-2.2.12/imap/imapd.c cyrus-imapd-2.2.12.autocreate2/imap/imapd.c
+--- cyrus-imapd-2.2.12/imap/imapd.c    2005-02-14 08:39:55.000000000 +0200
++++ cyrus-imapd-2.2.12.autocreate2/imap/imapd.c        2005-10-19 14:48:57.966749000 +0300
+@@ -158,6 +158,7 @@
+ void motd_file(int fd);
+ void shut_down(int code);
+ void fatal(const char *s, int code);
++void autocreate_inbox(void);
+ void cmdloop(void);
+ void cmd_login(char *tag, char *user);
+@@ -1693,6 +1694,42 @@
+ }
+ /*
++ * Autocreate Inbox and subfolders upon login
++ */
++void autocreate_inbox()
++{
++    char inboxname[MAX_MAILBOX_NAME+1];
++    int autocreatequota;
++    int r;
++ 
++    /*
++     * Exlude admin's accounts
++     */
++    if (imapd_userisadmin || imapd_userisproxyadmin)
++        return;
++ 
++    /*
++     * Exclude anonymous
++     */
++    if (!strcmp(imapd_userid, "anonymous"))
++        return;
++ 
++    if ((autocreatequota = config_getint(IMAPOPT_AUTOCREATEQUOTA))) {
++        /* This is actyally not required
++           as long as the lenght of userid is ok */
++           r = (*imapd_namespace.mboxname_tointernal) (&imapd_namespace,
++                                      "INBOX", imapd_userid, inboxname);
++           if (!r)
++               r = mboxlist_lookup(inboxname, NULL, NULL, NULL);
++ 
++           if (r == IMAP_MAILBOX_NONEXISTENT)
++               mboxlist_autocreateinbox(&imapd_namespace, imapd_userid,
++                         imapd_authstate, inboxname, autocreatequota);
++     }
++}
++
++
++/*
+  * Perform a LOGIN command
+  */
+ void cmd_login(char *tag, char *user)
+@@ -1848,6 +1885,9 @@
+                               strcspn(imapd_userid, "@") : 0);
+     freebuf(&passwdbuf);
++
++    autocreate_inbox();
++
+     return;
+ }
+@@ -1993,6 +2033,8 @@
+                               config_virtdomains ?
+                               strcspn(imapd_userid, "@") : 0);
++    autocreate_inbox();
++
+     return;
+ }
+diff -Naur cyrus-imapd-2.2.12/imap/lmtpd.c cyrus-imapd-2.2.12.autocreate2/imap/lmtpd.c
+--- cyrus-imapd-2.2.12/imap/lmtpd.c    2004-12-17 18:32:15.000000000 +0200
++++ cyrus-imapd-2.2.12.autocreate2/imap/lmtpd.c        2005-10-19 14:48:57.971145000 +0300
+@@ -106,6 +106,8 @@
+ static FILE *spoolfile(message_data_t *msgdata);
+ static void removespool(message_data_t *msgdata);
++static int autocreate_inbox(char *rcpt_userid);
++
+ /* current namespace */
+ static struct namespace lmtpd_namespace;
+@@ -504,10 +506,55 @@
+     exit(code);
+ }
++/*
++ * Autocreate Inbox and subfolders upon login
++ */
++int autocreate_inbox(char *rcpt_userid)
++{
++    struct auth_state *authstate;
++    char inboxname[MAX_MAILBOX_NAME+1];
++    int rcptisadmin;
++    int autocreatequota;
++    int r;
++
++    if(rcpt_userid == NULL)
++          return IMAP_MAILBOX_NONEXISTENT;
++    
++    /*
++     * Exclude anonymous
++     */
++    if (!strcmp(rcpt_userid, "anonymous"))
++        return IMAP_MAILBOX_NONEXISTENT;
++
++    /*
++     * Check for autocreatequota and createonpost
++     */
++    if (!(autocreatequota = config_getint(IMAPOPT_AUTOCREATEQUOTA)) ||
++        !(config_getswitch(IMAPOPT_CREATEONPOST)))
++        return IMAP_MAILBOX_NONEXISTENT;
++
++    /*
++     * Exclude admin's accounts
++     */
++     authstate = auth_newstate(rcpt_userid);
++     rcptisadmin = global_authisa(authstate, IMAPOPT_ADMINS);
++     if (rcptisadmin)
++          return IMAP_MAILBOX_NONEXISTENT;
++
++     r = (*lmtpd_namespace.mboxname_tointernal) (&lmtpd_namespace,
++                                "INBOX", rcpt_userid, inboxname);
++     if (!r)
++     r = mboxlist_autocreateinbox(&lmtpd_namespace, rcpt_userid,
++                         authstate, inboxname, autocreatequota);
++     return r;
++}
++
++
+ static int verify_user(const char *user, const char *domain, const char *mailbox,
+                      long quotacheck, struct auth_state *authstate)
+ {
+     char namebuf[MAX_MAILBOX_NAME+1] = "";
++    char *userinbox = NULL;
+     int r = 0;
+     if ((!user && !mailbox) ||
+@@ -545,6 +592,28 @@
+        */
+       r = append_check(namebuf, MAILBOX_FORMAT_NORMAL, authstate,
+                        !user ? ACL_POST : 0, quotacheck > 0 ? 0 : quotacheck);
++        if (r == IMAP_MAILBOX_NONEXISTENT && user) {
++          if(domain) {
++              int k;
++              userinbox = (char *)xmalloc((strlen(user)+strlen(domain)+2)*sizeof(char));
++              k = strlcpy(userinbox, user, strlen(user)+1);
++              *(userinbox + k) = '@';
++              strlcpy(userinbox+k+1, domain, strlen(domain)+1);
++          }
++          else userinbox = user;
++            /* 
++           * Try to create automatically the mailbox, if
++           * autocreate inbox option is enabled.
++           */
++          r = autocreate_inbox(userinbox);
++          
++          if(userinbox != user)
++              free(userinbox);
++          if (!r)
++                r = append_check(namebuf, MAILBOX_FORMAT_NORMAL, authstate,
++                              0, quotacheck > 0 ? 0 : quotacheck);
++      }
++
+     }
+     if (r) syslog(LOG_DEBUG, "verify_user(%s) failed: %s", namebuf,
+diff -Naur cyrus-imapd-2.2.12/imap/mboxlist.c cyrus-imapd-2.2.12.autocreate2/imap/mboxlist.c
+--- cyrus-imapd-2.2.12/imap/mboxlist.c 2004-07-26 21:08:03.000000000 +0300
++++ cyrus-imapd-2.2.12.autocreate2/imap/mboxlist.c     2005-10-19 14:49:25.972032000 +0300
+@@ -81,6 +81,12 @@
+ #include "mboxlist.h"
+ #include "quota.h"
++#ifdef USE_SIEVE
++extern int autoadd_sieve(char *userid, 
++              const char *source_script);
++#endif
++
++
+ #define DB config_mboxlist_db
+ #define SUBDB config_subscription_db
+@@ -98,11 +104,29 @@
+ static int mboxlist_changequota(const char *name, int matchlen, int maycreate,
+                               void *rock);
++static int mboxlist_autochangesub(char *name, int matchlen, int maycreate,
++                            void *rock);
++
++static int mboxlist_autosubscribe_sharedfolders(struct namespace *namespace,
++                        char *userid, char *auth_userid,
++                        struct auth_state *auth_state);
++
+ struct change_rock {
+     struct quota *quota;
+     struct txn **tid;
+ };
++/*
++ * Struct needed to be passed as void *rock to
++ * mboxlist_autochangesub();
++ */
++struct changesub_rock_st {
++        char *userid;
++        char *auth_userid;
++        struct auth_state *auth_state;
++};
++
++
+ #define FNAME_SUBSSUFFIX ".sub"
+ /*
+@@ -3124,3 +3148,338 @@
+     return DB->abort(mbdb, tid);
+ }
++
++/*
++ * Automatically subscribe user to *ALL* shared folders,
++ * one has permissions to be subscribed to.
++ * INBOX subfolders are excluded.
++ */
++static int mboxlist_autochangesub(char *name, int matchlen, int maycreate,
++                        void *rock) {
++
++  struct changesub_rock_st *changesub_rock = (struct changesub_rock_st *) rock;
++  char *userid = changesub_rock->userid;
++  char *auth_userid = changesub_rock->auth_userid;
++  struct auth_state *auth_state = changesub_rock->auth_state;
++  int r;
++
++
++  if((strlen(name) == 5 && !strncmp(name, "INBOX", 5)) || /* Exclude INBOX */
++     (strlen(name) > 5  && !strncmp(name, "INBOX.",6)) || /* Exclude INBOX subfolders */
++     (strlen(name) > 4  && !strncmp(name, "user.", 5)))   /* Exclude other users' folders */
++        return 0;
++
++     
++  r = mboxlist_changesub(name, userid, auth_state, 1, 0);
++
++  if (r) {
++      syslog(LOG_WARNING,
++             "autosubscribe: User %s to folder %s, subscription failed: %s",
++             auth_userid, name, error_message(r));
++  } else {
++      syslog(LOG_NOTICE,
++             "autosubscribe: User %s to folder %s, subscription succeeded",
++             auth_userid, name);
++  }
++
++  return 0;
++}
++
++#define SEP '|'
++
++/*
++ * Automatically subscribe user to a shared folder.
++ * Subscription is done successfully, if the shared
++ * folder exists and the user has the necessary 
++ * permissions.
++ */
++static int mboxlist_autosubscribe_sharedfolders(struct namespace *namespace,
++                        char *userid, char *auth_userid,
++                        struct auth_state *auth_state) {
++        
++    const char *sub ;
++    char *p, *q, *next_sub;
++    char folder[MAX_MAILBOX_NAME+1], name[MAX_MAILBOX_NAME+1], mailboxname[MAX_MAILBOX_NAME+1];
++    int len;
++    int r = 0;
++    int subscribe_all_sharedfolders = 0;
++
++    subscribe_all_sharedfolders = config_getswitch(IMAPOPT_AUTOSUBSCRIBE_ALL_SHAREDFOLDERS);
++
++    /*
++     * If subscribeallsharedfolders is set to yes in imapd.conf, then
++     * subscribe user to every shared folder one has the apropriate 
++     * permissions.
++     */
++    if(subscribe_all_sharedfolders) {
++       char pattern[MAX_MAILBOX_PATH+1];
++       struct changesub_rock_st changesub_rock;
++
++       strcpy(pattern, "*");
++       changesub_rock.userid = userid;
++       changesub_rock.auth_userid = auth_userid;
++       changesub_rock.auth_state = auth_state;
++
++       r = mboxlist_findall(namespace, pattern, 0, userid,
++                            auth_state, mboxlist_autochangesub, &changesub_rock);
++
++       return r;
++    }
++
++    if ((sub=config_getstring(IMAPOPT_AUTOSUBSCRIBESHAREDFOLDERS)) == NULL)
++       return r;
++
++    next_sub = (char *) sub;
++    while (*next_sub) {
++        for (p = next_sub ; isspace((int) *p) || *p == SEP ; p++);
++        for (next_sub = p ; *next_sub && *next_sub != SEP ; next_sub++);
++        for (q = next_sub ; q > p && (isspace((int) *q) || *q == SEP || !*q) ; q--);
++        if (!*p ) continue;
++
++        len = q - p + 1;
++        /* Check for folder length */
++        if (len  > sizeof(folder)-1)
++                continue;
++
++        if (!r) {
++                strncpy(folder, p, len);
++                folder[len] = '\0';
++
++               strlcpy(name, namespace->prefix[NAMESPACE_SHARED], sizeof(name));
++               len = strlcat(name, folder, sizeof(name));
++
++               r = (namespace->mboxname_tointernal) (namespace, name, userid,
++                                                                  mailboxname);
++       }
++                                                                  
++        if (!r)
++               r = mboxlist_changesub(mailboxname, userid, auth_state, 1, 0);
++
++        if (!r) {
++                syslog(LOG_NOTICE, "autosubscribe: User %s to %s succeeded", 
++                       userid, folder);
++        } else {
++                syslog(LOG_WARNING, "autosubscribe: User %s to %s failed: %s", 
++                       userid, folder, error_message(r));
++                r = 0;
++        }
++    }
++
++    return r;
++}
++
++
++
++int mboxlist_autocreateinbox(struct namespace *namespace,
++                        char *userid,
++                        struct auth_state *auth_state,
++                        char *mailboxname, int autocreatequota) {
++    char name [MAX_MAILBOX_NAME+1];
++    char folder [MAX_MAILBOX_NAME+1];
++    char *auth_userid = NULL;
++    char *partition = NULL;
++    const char *crt;
++    const char *sub;
++    char *p, *q, *next_crt, *next_sub;
++    int len;
++    int r = 0;
++    int numcrt = 0;
++    int numsub = 0;
++#ifdef USE_SIEVE
++    const char *source_script;
++#endif
++
++   /*
++    * While this is not needed for admins
++    * and imap_admins accounts, it would be
++    * better to separate *all* admins and
++    * proxyservers from normal accounts
++    * (accounts that have mailboxes).
++    * UOA Specific note(1): Even if we do not
++    * exclude these servers-classes here,
++    * UOA specific code, will neither return
++    * role, nor create INBOX, because none of these
++    * administrative accounts belong to  the
++    * mailRecipient objectclass, or have imapPartition.
++    * UOA Specific note(2): Another good reason for doing
++    * this, is to prevent the code, from getting into
++    * cyrus_ldap.c because of the continues MSA logins to LMTPd.
++    */
++
++   /*
++    * admins and the coresponding imap
++    * service, had already been excluded.
++    */
++
++   /*
++    * Do we really need group membership
++    * for admins or service_admins?
++    */
++    if (global_authisa(auth_state, IMAPOPT_ADMINS)) return 0;
++    if (global_authisa(auth_state, IMAPOPT_ADMINS)) return 0;
++
++   /*
++    * Do we really need group membership
++    * for proxyservers?
++    */
++    if (global_authisa(auth_state, IMAPOPT_PROXYSERVERS)) return 0;
++    if (global_authisa(auth_state, IMAPOPT_PROXYSERVERS)) return 0;
++
++    auth_userid = auth_canonuser(auth_state);
++
++    if (auth_userid == NULL) {
++         /*
++          * Couldn't get cannon userid
++          */
++          syslog(LOG_ERR,
++                 "Could not get cannon userid for user %s", userid);
++          return IMAP_PARTITION_UNKNOWN;
++    }
++
++#if 0
++        /*
++         * Get Partition info or return.
++         * (Here you should propably use
++         * you own "get_partition(char *userid)"
++         * function. Otherwise all new INBOXes will be
++         * created into whatever partition has been declared
++         * as default in your imapd.conf)
++         */
++
++        partition = get_partition(userid);
++
++        if (partition == NULL) {
++            /*
++             * Couldn't get partition info
++             */
++            syslog(LOG_ERR,
++                   "Could not get imapPartition info for user %s", userid);
++            return IMAP_PARTITION_UNKNOWN;
++        }
++#endif
++
++    r = mboxlist_createmailbox(mailboxname, MAILBOX_FORMAT_NORMAL, NULL,
++                                      1, userid, auth_state, 0, 0, 0);
++
++    if (!r && autocreatequota > 0)
++        r = mboxlist_setquota(mailboxname, autocreatequota, 0);
++
++    if (!r)
++        r = mboxlist_changesub(mailboxname, userid,
++                              auth_state, 1, 1);
++
++    if (!r) {
++       syslog(LOG_NOTICE, "autocreateinbox: User %s, INBOX was successfully created in partition %s", 
++               auth_userid, partition == NULL ? "default" : partition);
++    } else {
++       syslog(LOG_ERR, "autocreateinbox: User %s, INBOX failed. %s", 
++               auth_userid, error_message(r));
++    }
++
++
++#if 0
++    /* Allocated from get_partition, and not needed any more */
++    free_partition(partition);
++#endif
++
++    if (r) return r;
++
++
++    /* INBOX's subfolders */
++    if ((crt=config_getstring(IMAPOPT_AUTOCREATEINBOXFOLDERS)))
++        sub=config_getstring(IMAPOPT_AUTOSUBSCRIBEINBOXFOLDERS);
++
++    /* Roll through crt */
++    next_crt = (char *) crt;
++    while (next_crt!=NULL && *next_crt) {
++          for (p = next_crt ; isspace((int) *p) || *p == SEP ; p++);
++          for (next_crt = p ; *next_crt && *next_crt != SEP ; next_crt++);
++          for (q = next_crt ; q > p && (isspace((int) *q) || *q == SEP || !*q); q--);
++
++          if (!*p) continue;
++
++          len = q - p + 1;
++
++          /* First time we check for length */
++          if (len > sizeof(folder) - 5)
++              r = IMAP_MAILBOX_BADNAME;
++
++          if (!r) {
++                  strncpy(folder, p, len);
++                  folder[len] = '\0';
++
++                  strlcpy(name, namespace->prefix[NAMESPACE_INBOX], sizeof(name));
++                  len = strlcat(name, folder, sizeof(name));
++          }
++
++          if (!r)
++            r = (namespace->mboxname_tointernal) (namespace, name, userid,
++                                                 mailboxname);
++          if (!r)
++             r = mboxlist_createmailbox(mailboxname, MAILBOX_FORMAT_NORMAL, NULL,
++                                            1, userid, auth_state, 0, 0, 0);
++
++          if (!r) {
++            numcrt++;
++            syslog(LOG_NOTICE, "autocreateinbox: User %s, subfolder %s creation succeeded.", 
++               auth_userid, name);
++         } else {
++             syslog(LOG_WARNING, "autocreateinbox: User %s, subfolder %s creation failed. %s", 
++               auth_userid, name, error_message(r));
++             r=0;
++             continue;
++          }
++
++          /* Roll through sub */
++          next_sub = (char *) sub;
++          while (next_sub!=NULL && *next_sub) {
++                for (p = next_sub ; isspace((int) *p) || *p == SEP ; p++);
++                for (next_sub = p ; *next_sub && *next_sub != SEP ; next_sub++);
++                for (q = next_sub ; q > p && (isspace((int) *q) || *q == SEP || !*q) ; q--);
++                if (!*p ) continue;
++
++                len = q - p + 1;
++
++                if (len != strlen(folder) || strncmp(folder, p, len))
++                    continue;
++
++                r = mboxlist_changesub(mailboxname, userid, auth_state, 1, 1);
++
++               if (!r) {
++                   numsub++;
++                   syslog(LOG_NOTICE,"autocreateinbox: User %s, subscription to %s succeeded",
++                       auth_userid, name);
++               } else
++                    syslog(LOG_WARNING, "autocreateinbox: User %s, subscription to  %s failed. %s",
++                       auth_userid, name, error_message(r));
++
++                break;
++         }
++    }
++
++    if (crt!=NULL && *crt)
++       syslog(LOG_INFO, "User %s, Inbox subfolders, created %d, subscribed %d", 
++               auth_userid, numcrt, numsub);
++
++    /*
++     * Check if shared folders are available for subscription.
++     */
++    mboxlist_autosubscribe_sharedfolders(namespace, userid, auth_userid, auth_state);
++
++#ifdef USE_SIEVE
++    /*
++     * Here the autocreate sieve script feature is iniated from.
++     */
++    source_script = config_getstring(IMAPOPT_AUTOCREATE_SIEVE_SCRIPT);
++ 
++    if (source_script) {
++        if (!autoadd_sieve(userid, source_script))
++            syslog(LOG_NOTICE, "autocreate_sieve: User %s, default sieve script creation succeeded", auth_userid);
++        else
++            syslog(LOG_WARNING, "autocreate_sieve: User %s, default sieve script creation failed", auth_userid);
++    }
++#endif
++
++    return r;
++}
++
+diff -Naur cyrus-imapd-2.2.12/imap/mboxlist.h cyrus-imapd-2.2.12.autocreate2/imap/mboxlist.h
+--- cyrus-imapd-2.2.12/imap/mboxlist.h 2004-03-17 20:07:49.000000000 +0200
++++ cyrus-imapd-2.2.12.autocreate2/imap/mboxlist.h     2005-10-19 14:48:58.027033000 +0300
+@@ -197,4 +197,10 @@
+ int mboxlist_commit(struct txn *tid);
+ int mboxlist_abort(struct txn *tid);
++int mboxlist_autocreateinbox(struct namespace *namespace,
++                        char *userid,
++                        struct auth_state *auth_state,
++                        char *mailboxname, int autocreatequota);
++
++
+ #endif
+diff -Naur cyrus-imapd-2.2.12/imap/pop3d.c cyrus-imapd-2.2.12.autocreate2/imap/pop3d.c
+--- cyrus-imapd-2.2.12/imap/pop3d.c    2005-01-04 17:06:13.000000000 +0200
++++ cyrus-imapd-2.2.12.autocreate2/imap/pop3d.c        2005-10-19 14:48:58.033335000 +0300
+@@ -152,6 +152,8 @@
+ static char popd_apop_chal[45 + MAXHOSTNAMELEN + 1]; /* <rand.time@hostname> */
+ static void cmd_apop(char *response);
++static int autocreate_inbox(char *inboxname, char *userid);
++
+ static void cmd_auth(char *arg);
+ static void cmd_capa(void);
+ static void cmd_pass(char *pass);
+@@ -1084,6 +1086,7 @@
+       popd_userid = xstrdup(p);
+       prot_printf(popd_out, "+OK Name is a valid mailbox\r\n");
+     }
++
+ }
+ void cmd_pass(char *pass)
+@@ -1328,6 +1331,46 @@
+ }
+ /*
++ * Autocreate Inbox and subfolders upon login
++ */
++int autocreate_inbox(char *inboxname, char *auth_userid)
++{
++    struct auth_state *authstate;
++    int userisadmin;
++    int autocreatequota;
++    int r;
++
++    if(inboxname == NULL || auth_userid == NULL)
++          return IMAP_MAILBOX_NONEXISTENT;
++    
++    /*
++     * Exclude anonymous
++     */
++    if (!strcmp(popd_userid, "anonymous"))
++        return IMAP_MAILBOX_NONEXISTENT;
++
++    /*
++     * Check for autocreatequota
++     */
++    if (!(autocreatequota = config_getint(IMAPOPT_AUTOCREATEQUOTA)))
++        return IMAP_MAILBOX_NONEXISTENT;
++
++    /*
++     * Exclude admin's accounts
++     */
++
++     authstate = auth_newstate(popd_userid);
++     userisadmin = global_authisa(authstate, IMAPOPT_ADMINS);
++     if (userisadmin)
++          return IMAP_MAILBOX_NONEXISTENT;
++
++     r = mboxlist_autocreateinbox(&popd_namespace, auth_userid,
++                         authstate, inboxname, autocreatequota);
++     return r;
++}
++
++
++/*
+  * Complete the login process by opening and locking the user's inbox
+  */
+ int openinbox(void)
+@@ -1349,6 +1392,10 @@
+                                             userid, inboxname);
+     if (!r) r = mboxlist_detail(inboxname, &type, NULL, &server, &acl, NULL);
++    /* Try once again after autocreate_inbox */
++    if (r == IMAP_MAILBOX_NONEXISTENT && !(r = autocreate_inbox(inboxname, userid)))
++        r = mboxlist_detail(inboxname, &type, NULL, &server, &acl, NULL);
++
+     if (!r && (config_popuseacl = config_getswitch(IMAPOPT_POPUSEACL)) &&
+       (!acl ||
+        !((myrights = cyrus_acl_myrights(popd_authstate, acl)) & ACL_READ))) {
+diff -Naur cyrus-imapd-2.2.12/lib/auth.h cyrus-imapd-2.2.12.autocreate2/lib/auth.h
+--- cyrus-imapd-2.2.12/lib/auth.h      2003-10-22 21:50:12.000000000 +0300
++++ cyrus-imapd-2.2.12.autocreate2/lib/auth.h  2005-10-19 14:48:58.035324000 +0300
+@@ -60,4 +60,6 @@
+ extern struct auth_state *auth_newstate(const char *identifier);
+ extern void auth_freestate(struct auth_state *auth_state);
++extern char *auth_canonuser(struct auth_state *auth_state);
++
+ #endif /* INCLUDED_AUTH_H */
+diff -Naur cyrus-imapd-2.2.12/lib/auth_krb.c cyrus-imapd-2.2.12.autocreate2/lib/auth_krb.c
+--- cyrus-imapd-2.2.12/lib/auth_krb.c  2003-11-11 05:26:00.000000000 +0200
++++ cyrus-imapd-2.2.12.autocreate2/lib/auth_krb.c      2005-10-19 14:48:58.038180000 +0300
+@@ -338,3 +338,11 @@
+     free((char *)auth_state);
+ }
++char *
++auth_canonuser(struct auth_state *auth_state)
++{
++    if (auth_state)
++       return auth_state->userid;
++    return NULL;
++}
++
+diff -Naur cyrus-imapd-2.2.12/lib/auth_krb5.c cyrus-imapd-2.2.12.autocreate2/lib/auth_krb5.c
+--- cyrus-imapd-2.2.12/lib/auth_krb5.c 2004-01-16 17:28:58.000000000 +0200
++++ cyrus-imapd-2.2.12.autocreate2/lib/auth_krb5.c     2005-10-19 14:48:58.040108000 +0300
+@@ -193,4 +193,11 @@
+     free(auth_state);
+ }
++char *
++auth_canonuser(struct auth_state *auth_state)
++{
++    if (auth_state)
++       return auth_state->userid;
++    return NULL;
++}
+diff -Naur cyrus-imapd-2.2.12/lib/auth_pts.c cyrus-imapd-2.2.12.autocreate2/lib/auth_pts.c
+--- cyrus-imapd-2.2.12/lib/auth_pts.c  2004-02-25 01:11:37.000000000 +0200
++++ cyrus-imapd-2.2.12.autocreate2/lib/auth_pts.c      2005-10-19 14:48:58.042343000 +0300
+@@ -349,3 +349,11 @@
+ {
+     free(auth_state);
+ }
++
++char *auth_canonuser(struct auth_state *auth_state)
++{
++    if (auth_state)
++       return auth_state->userid.id;
++    return NULL;
++}
++
+diff -Naur cyrus-imapd-2.2.12/lib/auth_unix.c cyrus-imapd-2.2.12.autocreate2/lib/auth_unix.c
+--- cyrus-imapd-2.2.12/lib/auth_unix.c 2004-09-14 01:49:29.000000000 +0300
++++ cyrus-imapd-2.2.12.autocreate2/lib/auth_unix.c     2005-10-19 14:48:58.044431000 +0300
+@@ -267,4 +267,11 @@
+     free((char *)auth_state);
+ }
++char *auth_canonuser(struct auth_state *auth_state)
++{
++    if (auth_state)
++         return auth_state->userid;
++    
++    return NULL;
++}
+diff -Naur cyrus-imapd-2.2.12/lib/imapoptions cyrus-imapd-2.2.12.autocreate2/lib/imapoptions
+--- cyrus-imapd-2.2.12/lib/imapoptions 2004-07-21 22:07:45.000000000 +0300
++++ cyrus-imapd-2.2.12.autocreate2/lib/imapoptions     2005-10-19 14:48:58.048748000 +0300
+@@ -169,6 +169,51 @@
+ /* Number of seconds to wait before returning a timeout failure when
+    performing a client connection (e.g. in a murder enviornment) */
++{ "createonpost", 0, SWITCH }
++/* If yes, when lmtpd receives an incoming mail for an INBOX that does not exist,
++   then the INBOX is automatically created by lmtpd. */
++
++{ "autocreateinboxfolders", NULL, STRING }
++/* If a user does not have an INBOX created then the INBOX as well as some INBOX subfolders are
++   created under two conditions.
++     1. The user logins via the IMAP or the POP3 protocol. (autocreatequota option must have a nonzero value)
++     2. A message arrives for the user through the LMTPD protocol.(createonpost option must yes)
++   autocreateinboxfolders is a list of INBOX's subfolders separated by a "|", that are automatically created by the server
++   under the previous two situations. */
++
++{ "autosubscribeinboxfolders", NULL, STRING }
++/* A list of folder names, separated by "|" that the users get automatically subscribed to, when their INBOX
++  is created.
++  These folder names must have been included in the autocreateinboxfolders option of the imapd.conf. */
++
++{ "autosubscribesharedfolders", NULL, STRING }
++/* A list of shared folders (bulletin boards), separated by "|" that the users get
++   automatically subscribed to, after their INBOX
++   is created. The shared folder must have been created and the user must have the
++   required permissions to get subscribed to the it. Otherwise the subscription fails. */
++
++{ "autosubscribe_all_sharedfolders", 0, SWITCH }
++/* If set to yes then the user is automatically subscribed to all shared folders, one has permission
++   to subscribe to. */
++
++{ "autocreate_sieve_script", NULL, STRING }
++/* The full path of a file that contains a sieve script. This script automatically becomes a
++   user's initial default sieve filter script. When this option is not defined, no default 
++   sieve filter is created. The file must be readable by the cyrus daemon. */
++
++{ "autocreate_sieve_compiledscript", NULL, STRING }
++/* The full path of a file that contains a compiled in bytecode sieve script. This script 
++   automatically becomes a user's initial default sieve filter script. 
++   If this option is not specified, or the filename doesn't exist then the script defined 
++   by autocreate_sieve_script is compiled on the fly and installed as the user's default
++   sieve script */
++
++{ "generate_compiled_sieve_script", 0, SWITCH }
++/* If set to yes and no compiled sieve script file exists then the sieve script that is 
++   compiled on the fly will be saved in the file name that autocreate_sieve_compiledscript 
++   option points. In order a compiled script to be generated, autocreate_sieve_script and 
++   autocreate_sieve_compiledscript must have valid values */
++
+ { "configdirectory", NULL, STRING }
+ /* The pathname of the IMAP configuration directory.  This field is
+    required. */
+diff -Naur cyrus-imapd-2.2.12/notifyd/Makefile.in cyrus-imapd-2.2.12.autocreate2/notifyd/Makefile.in
+--- cyrus-imapd-2.2.12/notifyd/Makefile.in     2004-05-28 21:03:06.000000000 +0300
++++ cyrus-imapd-2.2.12.autocreate2/notifyd/Makefile.in 2005-10-19 14:48:58.050575000 +0300
+@@ -69,10 +69,11 @@
+ SERVICE=../master/service.o
+ IMAP_LIBS = @IMAP_LIBS@ @LIB_RT@
++SIEVE_LIBS = @SIEVE_LIBS@
+ IMAP_COM_ERR_LIBS = @IMAP_COM_ERR_LIBS@
+ LIB_WRAP = @LIB_WRAP@
+ LIBS = @ZEPHYR_LIBS@ @LIBS@ $(IMAP_COM_ERR_LIBS)
+-DEPLIBS=../imap/mutex_fake.o ../imap/libimap.a ../lib/libcyrus.a ../lib/libcyrus_min.a @DEPLIBS@
++DEPLIBS=../imap/mutex_fake.o ../imap/libimap.a $(SIEVE_LIBS) ../lib/libcyrus.a ../lib/libcyrus_min.a @DEPLIBS@
+ PURIFY=/usr/local/bin/purify
+ PUREOPT=-best-effort
+diff -Naur cyrus-imapd-2.2.12/notifyd/notifyd.c cyrus-imapd-2.2.12.autocreate2/notifyd/notifyd.c
+--- cyrus-imapd-2.2.12/notifyd/notifyd.c       2004-12-17 18:32:25.000000000 +0200
++++ cyrus-imapd-2.2.12.autocreate2/notifyd/notifyd.c   2005-10-19 14:48:58.052220000 +0300
+@@ -97,7 +97,7 @@
+ #define NOTIFY_MAXSIZE 8192
+-int do_notify()
++static int do_notify()
+ {
+     struct sockaddr_un sun_data;
+     socklen_t sunlen = sizeof(sun_data);
+diff -Naur cyrus-imapd-2.2.12/ptclient/Makefile.in cyrus-imapd-2.2.12.autocreate2/ptclient/Makefile.in
+--- cyrus-imapd-2.2.12/ptclient/Makefile.in    2004-05-28 21:03:08.000000000 +0300
++++ cyrus-imapd-2.2.12.autocreate2/ptclient/Makefile.in        2005-10-19 14:48:58.053762000 +0300
+@@ -57,10 +57,11 @@
+ AFS_LDFLAGS = @AFS_LDFLAGS@ @COM_ERR_LDFLAGS@
+ AFS_LIBS = @AFS_LIBS@
+ IMAP_LIBS = @IMAP_LIBS@ @LIB_RT@
++SIEVE_LIBS = @SIEVE_LIBS@
+ LIBS = $(IMAP_LIBS) @COM_ERR_LIBS@
+ LIB_SASL = @LIB_SASL@
+ LIB_WRAP = @LIB_WRAP@
+-DEPLIBS = ../imap/libimap.a ../lib/libcyrus.a ../lib/libcyrus_min.a @DEPLIBS@
++DEPLIBS = ../imap/libimap.a $(SIEVE_LIBS) ../lib/libcyrus.a ../lib/libcyrus_min.a @DEPLIBS@ 
+ UTIL_LIBS = ../imap/mutex_fake.o ../imap/cli_fatal.o
+ LDAP_LIBS=@LDAP_LIBS@
diff --git a/src/patches/cyrus-imapd-2.2.12-autosievefolder-0.6.diff b/src/patches/cyrus-imapd-2.2.12-autosievefolder-0.6.diff
new file mode 100644 (file)
index 0000000..ce672d3
--- /dev/null
@@ -0,0 +1,193 @@
+diff -Naur cyrus-imapd-2.2.12/README.autosievefolder cyrus-imapd-2.2.12-autosieve.uncompiled/README.autosievefolder
+--- cyrus-imapd-2.2.12/README.autosievefolder  1970-01-01 02:00:00 +0200
++++ cyrus-imapd-2.2.12-autosieve.uncompiled/README.autosievefolder     2005-02-15 13:59:51 +0200
+@@ -0,0 +1,42 @@
++Cyrus IMAP autosievefolder patch
++----------------------------------
++
++NOTE : This patch has been created at the University of Athens. For more info, as well 
++as more patches on Cyrus IMAPD server, please visit http://email.uoa.gr 
++
++
++  When the lmtpd daemon receives an email message prior to delivering it to the 
++INBOX folder of the user, checks if the user has specified sieve filters. If the
++user has specified sieve filters the filters are evaluated. If the message matches
++any of the filters the action that is specified in the filter is executed. If the action 
++is FileInto it is stored in the subfolder specified in the filter. If the 
++subfolder doesn't exist then the message is sent to the INBOX folder of the user.
++
++  With this patch if the folder doesn't exist AND the name of the subfolder is 
++specified in the autosievefolders option, OR the anysievefolder is set to 
++yes in the cyrus-imap configuration file then the subfolder is created and the mail 
++is stored there.
++
++
++Check the following options of the imapd.conf file
++==================================================
++
++* anysievefolder : It must be "yes" in order to permit the autocreation of any 
++INBOX subfolder requested by a sieve filter, through the "fileinto" action. (default = no)
++* autosievefolders : It is a "|" separated list of subfolders of INBOX that will be 
++automatically created, if requested by a sieve filter, through the "fileinto" 
++action. (default = null)
++      i.e. autosievefolders: Junk | Spam
++
++WARNING: anysievefolder, takes precedence over autosievefolders . Which means that if 
++anysievefolder is set to "yes", cyrus will create any INBOX subfolder requested, no-matter what the value of autosievefolders is.
++
++
++Things to be done
++=================
++
++1. Support cyrus wildcards in the autosievefolders option. 
++
++
++For more information and updates please visit http://email.uoa.gr/projects/cyrus/autosievefolder
++
+diff -Naur cyrus-imapd-2.2.12/imap/lmtp_sieve.c cyrus-imapd-2.2.12-autosieve.uncompiled/imap/lmtp_sieve.c
+--- cyrus-imapd-2.2.12/imap/lmtp_sieve.c       2004-06-01 16:47:16 +0300
++++ cyrus-imapd-2.2.12-autosieve.uncompiled/imap/lmtp_sieve.c  2005-02-15 13:59:51 +0200
+@@ -72,6 +72,8 @@
+ #include "util.h"
+ #include "version.h"
+ #include "xmalloc.h"
++#include "imap_err.h"
++
+ static int sieve_usehomedir = 0;
+ static const char *sieve_dir = NULL;
+@@ -98,6 +100,9 @@
+                          int quotaoverride,
+                          int acloverride);
++static int autosieve_subfolder(char *userid, struct auth_state *auth_state,
++                               char *subfolder, struct namespace *namespace);
++
+ static char *make_sieve_db(const char *user)
+ {
+     static char buf[MAX_MAILBOX_PATH+1];
+@@ -312,6 +317,7 @@
+ }
++
+ static int sieve_redirect(void *ac, 
+                         void *ic __attribute__((unused)), 
+                         void *sc, void *mc, const char **errmsg)
+@@ -444,7 +450,18 @@
+                             sd->username, mdata->notifyheader,
+                             namebuf, quotaoverride, 0);
+     }
+-
++    if (ret == IMAP_MAILBOX_NONEXISTENT) {
++        /* if "plus" folder under INBOX, then try to create it */
++        syslog(LOG_DEBUG, "calling autosieve folder for : %s", namebuf);
++        ret = autosieve_subfolder((char *) sd->username, sd->authstate, namebuf, mdata->namespace);
++
++        if (!ret)
++            ret = deliver_mailbox(md->data, mdata->stage, md->size,
++                                  fc->imapflags->flag, fc->imapflags->nflags,
++                                  (char *) sd->username, sd->authstate, md->id,
++                                  sd->username, mdata->notifyheader,
++                                  namebuf, quotaoverride, 0);
++    }
+     if (!ret) {
+       snmp_increment(SIEVE_FILEINTO, 1);
+       return SIEVE_OK;
+@@ -882,3 +899,77 @@
+     return r;
+ }
++
++
++#define SEP '|'
++
++static int autosieve_subfolder(char *userid, struct auth_state *auth_state,
++                               char *subfolder, struct namespace *namespace)
++{
++     char option_name_external[MAX_MAILBOX_NAME + 1];
++     char option_name_internal[MAX_MAILBOX_NAME + 1];
++     const char *subf ;
++     char *p, *q, *next_subf;
++     int len, r = 0;
++     int createsievefolder = 0;
++
++    /* Check if subfolder or userid are NULL */
++    if(subfolder == NULL || userid == NULL)
++         return IMAP_MAILBOX_NONEXISTENT;
++
++    if (config_getswitch(IMAPOPT_ANYSIEVEFOLDER))
++         createsievefolder = 1;
++    else if ((subf = config_getstring(IMAPOPT_AUTOSIEVEFOLDERS)) != NULL) {
++         /* Roll through subf */
++         next_subf = (char *) subf;
++         while (*next_subf) {
++              for (p = next_subf ; isspace((int) *p) || *p == SEP ; p++);
++              for (next_subf = p ; *next_subf && *next_subf != SEP ; next_subf++);
++              for (q = next_subf ; q > p && (isspace((int) *q) || *q == SEP || !*q); q--);
++
++              if (!*p) continue;
++                    
++              len = q - p + 1;
++             /*
++              * This is a preliminary length check based on the assumption
++              * that the *final* internal format will be something
++              * like user.userid.subfolder(s).
++              */
++              if (len > sizeof(option_name_external) - strlen(userid) - 5)
++                   return IMAP_MAILBOX_BADNAME;
++
++              strlcpy(option_name_external, namespace->prefix[NAMESPACE_INBOX], sizeof(option_name_external));
++            strncat(option_name_external, p, len);
++                    
++              /* 
++               * Transform the option folder name to internal namespace and compare it
++             * with what must be created.
++               */
++              r = namespace->mboxname_tointernal(namespace, option_name_external, userid, option_name_internal);
++              if (r) continue;
++
++              if (!strcmp(option_name_internal, subfolder)) {
++                  createsievefolder = 1;
++                  break;
++              }
++         }
++    }
++
++    if (createsievefolder) {
++        /* Folder is already in internal namespace format */
++        r = mboxlist_createmailbox(subfolder, MAILBOX_FORMAT_NORMAL, NULL,
++                                           1, userid, auth_state, 0, 0, 0);
++        if (!r) {
++            mboxlist_changesub(subfolder, userid, auth_state, 1, 1);
++            syslog(LOG_DEBUG, "autosievefolder: User %s, folder %s creation succeeded.",
++                                                   userid, subfolder);
++            return 0;
++        } else {
++            syslog(LOG_ERR, "autosievefolder: User %s, folder %s creation failed. %s",
++                                                  userid, subfolder,error_message(r));
++            return r;
++        }
++    } else
++        return IMAP_MAILBOX_NONEXISTENT;
++}
++
+diff -Naur cyrus-imapd-2.2.12/lib/imapoptions cyrus-imapd-2.2.12-autosieve.uncompiled/lib/imapoptions
+--- cyrus-imapd-2.2.12/lib/imapoptions 2004-07-21 22:07:45 +0300
++++ cyrus-imapd-2.2.12-autosieve.uncompiled/lib/imapoptions    2005-02-15 13:59:51 +0200
+@@ -752,6 +752,15 @@
+ /* If enabled, lmtpd will look for Sieve scripts in user's home
+    directories: ~user/.sieve. */
++{ "anysievefolder", 0, SWITCH }
++/* It must be "yes" in order to permit the autocreation of any INBOX subfolder 
++   requested by a sieve filter, through the "fileinto" action. (default = no) */
++
++{ "autosievefolders", NULL, STRING }
++/* It is a "|" separated list of subfolders of INBOX that will be automatically created, 
++   if requested by a sieve filter, through the "fileinto" action. (default = null)
++   i.e. autosievefolders: Junk | Spam */
++
+ { "singleinstancestore", 1, SWITCH }
+ /* If enabled, lmtpd and nntpd attempt to only write one copy of a message per
+    partition and create hard links, resulting in a potentially large
diff --git a/src/patches/cyrus-imapd-2.2.12-gcc4.patch b/src/patches/cyrus-imapd-2.2.12-gcc4.patch
new file mode 100644 (file)
index 0000000..3363bea
--- /dev/null
@@ -0,0 +1,48 @@
+--- tools/config2header        2005/04/13 08:56:16     1.1
++++ tools/config2header        2005/04/13 08:57:48
+@@ -214,7 +214,6 @@
+ print HFILE <<EOF
+   IMAPOPT_LAST
+ };
+-extern struct imapopt_s imapopts[];
+ enum enum_value {
+   IMAP_ENUM_ZERO = 0,
+@@ -260,6 +259,9 @@
+ print HFILE <<EOF
+ };
++
++extern struct imapopt_s imapopts[];
++
+ #endif /* INCLUDED_IMAPOPTIONS_H */
+ EOF
+     ;
+--- imap/fud.c 2005/04/13 09:19:05     1.1
++++ imap/fud.c 2005/04/13 09:20:02
+@@ -202,6 +202,7 @@
+     r = begin_handling();
+     shut_down(r);
++    return 0;
+ }
+ static void cyrus_timeout(int signo __attribute__((unused)))
+--- imap/smmapd.c      2005/04/13 09:19:12     1.1
++++ imap/smmapd.c      2005/04/13 09:19:50
+@@ -199,6 +199,7 @@
+     r = begin_handling();
+     shut_down(r);
++    return 0;
+ }
+ int verify_user(const char *key, long quotacheck,
+--- notifyd/notifyd.c  2005/04/13 09:19:23     1.1
++++ notifyd/notifyd.c  2005/04/13 09:19:39
+@@ -266,4 +266,5 @@
+     r = do_notify();
+     shut_down(r);
++    return 0;
+ }
diff --git a/src/patches/cyrus-imapd-2.2.12-munge8bit.patch b/src/patches/cyrus-imapd-2.2.12-munge8bit.patch
new file mode 100644 (file)
index 0000000..d6f1484
--- /dev/null
@@ -0,0 +1,133 @@
+diff -Naur cyrus-imapd-2.2.12/doc/man/deliver.8.html cyrus-imapd-2.2.12.munge8bit/doc/man/deliver.8.html
+--- cyrus-imapd-2.2.12/doc/man/deliver.8.html  2005-02-14 19:02:17.000000000 +0100
++++ cyrus-imapd-2.2.12.munge8bit/doc/man/deliver.8.html        2005-06-18 19:02:39.000000000 +0200
+@@ -223,13 +223,15 @@
+ <td width="10%"></td>
+ <td width="89%">
+ <p>Depending on the setting of <b>reject8bit</b> in
+-<b>imapd.conf(5)</b>, deliver either rejects messages with
+-8-bit-set characters in the headers or changes these
+-characters to &lsquo;X&rsquo;. This is because such
+-characters can&rsquo;t be interpreted since the character
+-set is not known, although some communities not well-served
+-by US-ASCII assume that those characters can be used to
+-represent characters not present in US-ASCII.</p>
++<b>imapd.conf(5)</b>, deliver either rejects/accepts
++messages with 8-bit-set characters in the headers. If we
++accept messages with 8-bit-set characters in the headers,
++then depending on the setting of <b>munge8bit</b>, these
++characters are either left un-touched or changed to &lsquo;X&rsquo;. This
++is because such characters can&rsquo;t be interpreted since
++the character set is not known, although some communities
++not well-served by US-ASCII assume that those characters can
++be used to represent characters not present in US-ASCII.</p>
+ <!-- INDENTATION -->
+ <p>A method for encoding 8-bit-set characters is provided by
+ RFC 2047.</p>
+diff -Naur cyrus-imapd-2.2.12/doc/man/imapd.conf.5.html cyrus-imapd-2.2.12.munge8bit/doc/man/imapd.conf.5.html
+--- cyrus-imapd-2.2.12/doc/man/imapd.conf.5.html       2005-02-14 19:02:18.000000000 +0100
++++ cyrus-imapd-2.2.12.munge8bit/doc/man/imapd.conf.5.html     2005-06-18 18:59:46.000000000 +0200
+@@ -2562,7 +2562,7 @@
+ <td width="80%">
+ <p>If enabled, lmtpd rejects messages with 8-bit characters
+ in the headers. Otherwise, 8-bit characters are changed to
+-&lsquo;X&rsquo;. (A proper soultion to non-ASCII characters
++&lsquo;X&rsquo;. (A proper solution to non-ASCII characters
+ in headers is offered by RFC 2047 and its predecessors.)</p>
+ </td>
+ </table>
+diff -Naur cyrus-imapd-2.2.12/imap/message.c cyrus-imapd-2.2.12.munge8bit/imap/message.c
+--- cyrus-imapd-2.2.12/imap/message.c  2004-09-16 19:58:54.000000000 +0200
++++ cyrus-imapd-2.2.12.munge8bit/imap/message.c        2005-06-18 18:58:33.000000000 +0200
+@@ -227,6 +227,7 @@
+     int n;
+     int sawcr = 0, sawnl;
+     int reject8bit = config_getswitch(IMAPOPT_REJECT8BIT);
++    int munge8bit = config_getswitch(IMAPOPT_MUNGE8BIT);
+     int inheader = 1, blankline = 1;
+     while (size) {
+@@ -262,7 +263,7 @@
+                       /* We have been configured to reject all mail of this
+                          form. */
+                       if (!r) r = IMAP_MESSAGE_CONTAINS8BIT;
+-                  } else {
++                  } else if (munge8bit) {
+                       /* We have been configured to munge all mail of this
+                          form. */
+                       *p = 'X';
+diff -Naur cyrus-imapd-2.2.12/imap/spool.c cyrus-imapd-2.2.12.munge8bit/imap/spool.c
+--- cyrus-imapd-2.2.12/imap/spool.c    2004-10-27 22:40:50.000000000 +0200
++++ cyrus-imapd-2.2.12.munge8bit/imap/spool.c  2005-06-18 18:58:33.000000000 +0200
+@@ -140,6 +140,7 @@
+     state s = NAME_START;
+     int r = 0;
+     int reject8bit = config_getswitch(IMAPOPT_REJECT8BIT);
++    int munge8bit = config_getswitch(IMAPOPT_MUNGE8BIT);
+     const char **skip = NULL;
+     if (namelen == 0) {
+@@ -266,7 +267,7 @@
+                          form. */
+                       r = IMAP_MESSAGE_CONTAINS8BIT;
+                       goto ph_error;
+-                  } else {
++                  } else if (munge8bit) {
+                       /* We have been configured to munge all mail of this
+                          form. */
+                       c = 'X';
+diff -Naur cyrus-imapd-2.2.12/lib/imapoptions cyrus-imapd-2.2.12.munge8bit/lib/imapoptions
+--- cyrus-imapd-2.2.12/lib/imapoptions 2004-07-21 21:07:45.000000000 +0200
++++ cyrus-imapd-2.2.12.munge8bit/lib/imapoptions       2005-06-18 18:58:33.000000000 +0200
+@@ -458,6 +458,12 @@
+ { "mboxlist_db", "skiplist", STRINGLIST("flat", "berkeley", "skiplist")}
+ /* The cyrusdb backend to use for the mailbox list. */
++{ "munge8bit", 1, SWITCH }
++/* If enabled, lmtpd munges messages with 8-bit characters.  These characters
++   are changed to `X'.  If \fBreject8bit\fR is enabled, setting \fBmunge8bit\fR
++   has no effect.  (A proper solution to non-ASCII characters in headers is
++   offered by RFC 2047 and its predecessors.) */
++
+ # xxx badly worded
+ { "mupdate_connections_max", 128, INT }
+ /* The max number of connections that a mupdate process will allow, this
+@@ -670,9 +676,7 @@
+ { "reject8bit", 0, SWITCH }
+ /* If enabled, lmtpd rejects messages with 8-bit characters in the
+-   headers.  Otherwise, 8-bit characters are changed to `X'.  (A
+-   proper soultion to non-ASCII characters in headers is offered by  
+-   RFC 2047 and its predecessors.) */
++   headers. */
+ { "rfc2046_strict", 0, SWITCH }
+ /* If enabled, imapd will be strict (per RFC 2046) when matching MIME
+diff -Naur cyrus-imapd-2.2.12/man/deliver.8 cyrus-imapd-2.2.12.munge8bit/man/deliver.8
+--- cyrus-imapd-2.2.12/man/deliver.8   2004-06-21 20:40:10.000000000 +0200
++++ cyrus-imapd-2.2.12.munge8bit/man/deliver.8 2005-06-18 18:58:33.000000000 +0200
+@@ -147,8 +147,10 @@
+ Accept messages using the LMTP protocol.
+ .SH NOTES
+ Depending on the setting of \fBreject8bit\fR in \fBimapd.conf(5)\fR, deliver
+-either rejects messages with 8-bit-set characters in the headers or 
+-changes these characters to `X'.
++either rejects/accepts messages with 8-bit-set characters in the headers.
++If we accept messages with 8-bit-set characters in the headers, then depending
++on the setting of \fBmunge8bit\fR, these characters are either left un-touched
++or changed to .
+ This is because such characters can't be interpreted since the
+ character set is not known, although some communities not well-served by
+ US-ASCII assume that those characters can be used to represent characters not
+diff -Naur cyrus-imapd-2.2.12/man/imapd.conf.5 cyrus-imapd-2.2.12.munge8bit/man/imapd.conf.5
+--- cyrus-imapd-2.2.12/man/imapd.conf.5        2005-02-14 19:02:16.000000000 +0100
++++ cyrus-imapd-2.2.12.munge8bit/man/imapd.conf.5      2005-06-18 18:59:08.000000000 +0200
+@@ -551,7 +551,7 @@
+ .IP "\fBreject8bit:\fR 0" 5
+ If enabled, lmtpd rejects messages with 8-bit characters in the
+ headers.  Otherwise, 8-bit characters are changed to `X'.  (A
+-proper soultion to non-ASCII characters in headers is offered by  
++proper solution to non-ASCII characters in headers is offered by  
+ RFC 2047 and its predecessors.) 
+ .IP "\fBrfc2046_strict:\fR 0" 5
+ If enabled, imapd will be strict (per RFC 2046) when matching MIME
diff --git a/src/patches/cyrus-imapd-2.2.12-mupdate-thread-safe.patch b/src/patches/cyrus-imapd-2.2.12-mupdate-thread-safe.patch
new file mode 100644 (file)
index 0000000..4af8aee
--- /dev/null
@@ -0,0 +1,41 @@
+diff -Naur cyrus-imapd-2.2.12.orig/imap/mupdate.c cyrus-imapd-2.2.12/imap/mupdate.c
+--- cyrus-imapd-2.2.12.orig/imap/mupdate.c     2004-12-17 17:32:16.000000000 +0100
++++ cyrus-imapd-2.2.12/imap/mupdate.c  2005-11-04 14:24:04.000000000 +0100
+@@ -460,9 +460,36 @@
+     return 0;
+ }
++
++/*
++ * The auth_*.c backends called by mysasl_proxy_policy()
++ * use static variables which we need to protect with a mutex.
++ */
++static pthread_mutex_t proxy_policy_mutex = PTHREAD_MUTEX_INITIALIZER;
++
++static int mupdate_proxy_policy(sasl_conn_t *conn,
++                              void *context,
++                              const char *requested_user, unsigned rlen,
++                              const char *auth_identity, unsigned alen,
++                              const char *def_realm,
++                              unsigned urlen,
++                              struct propctx *propctx)
++{
++    int r;
++
++    pthread_mutex_lock(&proxy_policy_mutex); /* LOCK */
++
++    r = mysasl_proxy_policy(conn, context, requested_user, rlen,
++                          auth_identity, alen, def_realm, urlen, propctx);
++
++    pthread_mutex_unlock(&proxy_policy_mutex); /* UNLOCK */
++
++    return r;
++}
++
+ static struct sasl_callback mysasl_cb[] = {
+     { SASL_CB_GETOPT, &mysasl_config, NULL },
+-    { SASL_CB_PROXY_POLICY, &mysasl_proxy_policy, NULL },
++    { SASL_CB_PROXY_POLICY, &mupdate_proxy_policy, NULL },
+     { SASL_CB_LIST_END, NULL, NULL }
+ };
diff --git a/src/patches/cyrus-imapd-2.2.12-no_transfig.patch b/src/patches/cyrus-imapd-2.2.12-no_transfig.patch
new file mode 100644 (file)
index 0000000..dd78906
--- /dev/null
@@ -0,0 +1,13 @@
+diff -Naur cyrus-imapd-2.2.12.orig/doc/Makefile.dist cyrus-imapd-2.2.12/doc/Makefile.dist
+--- cyrus-imapd-2.2.12.orig/doc/Makefile.dist  Wed Oct 22 20:50:04 2003
++++ cyrus-imapd-2.2.12/doc/Makefile.dist       Wed Nov  9 13:23:58 2005
+@@ -13,7 +13,7 @@
+       rm -f groff-html-*.png pod2htm*
+-      fig2dev -L png murder.fig murder.png
+-      fig2dev -L png netnews.fig netnews.png
++#     fig2dev -L png murder.fig murder.png
++#     fig2dev -L png netnews.fig netnews.png
+       (cd text; make)
diff --git a/src/patches/cyrus-imapd-2.2.12-notify_sms.patch b/src/patches/cyrus-imapd-2.2.12-notify_sms.patch
new file mode 100644 (file)
index 0000000..de4e18b
--- /dev/null
@@ -0,0 +1,304 @@
+diff -Naur cyrus-imapd-2.2.12.orig/doc/man/imapd.conf.5.html cyrus-imapd-2.2.12/doc/man/imapd.conf.5.html
+--- cyrus-imapd-2.2.12.orig/doc/man/imapd.conf.5.html  2005-02-14 19:02:18.000000000 +0100
++++ cyrus-imapd-2.2.12/doc/man/imapd.conf.5.html       2005-08-16 13:32:36.000000000 +0200
+@@ -2751,6 +2751,24 @@
+ <tr valign="top" align="left">
+ <td width="10%"></td>
+ <td width="89%">
++<p><b>sendsms:</b> /usr/bin/sendsms</p></td>
++</table></p>
++<!-- INDENTATION -->
++<table width="100%" border=0 rules="none" frame="void"
++       cols="2" cellspacing="0" cellpadding="0">
++<tr valign="top" align="left">
++<td width="19%"></td>
++<td width="80%">
++<p>The pathname of the sendsms executable. Sieve invokes
++sendsms for sending SMS notifications.</p>
++</td>
++</table>
++<!-- INDENTATION -->
++<p><table width="100%" border=0 rules="none" frame="void"
++       cols="2" cellspacing="0" cellpadding="0">
++<tr valign="top" align="left">
++<td width="10%"></td>
++<td width="89%">
+ <p><b>servername:</b> &lt;none&gt;</p></td>
+ </table></p>
+ <!-- INDENTATION -->
+diff -Naur cyrus-imapd-2.2.12.orig/doc/man/notifyd.8.html cyrus-imapd-2.2.12/doc/man/notifyd.8.html
+--- cyrus-imapd-2.2.12.orig/doc/man/notifyd.8.html     2005-02-14 19:02:19.000000000 +0100
++++ cyrus-imapd-2.2.12/doc/man/notifyd.8.html  2005-08-16 13:17:33.000000000 +0200
+@@ -181,6 +181,18 @@
+ <td width="11%"></td>
+ <td width="10%">
++<p><b>sms</b></p>
++</td>
++<td width="77%">
++
++<p>Send the notification as SMS. This method can ONLY be used in
++a Sieve &rsquo;notify&rsquo; action as it requires a
++<i>sms:</i> URL to be specified as an <i>:option</i>.</p>
++</td>
++<tr valign="top" align="left">
++<td width="11%"></td>
++<td width="10%">
++
+ <p><b>zephyr</b></p>
+ </td>
+ <td width="77%">
+diff -Naur cyrus-imapd-2.2.12.orig/lib/imapoptions cyrus-imapd-2.2.12/lib/imapoptions
+--- cyrus-imapd-2.2.12.orig/lib/imapoptions    2004-07-21 21:07:45.000000000 +0200
++++ cyrus-imapd-2.2.12/lib/imapoptions 2005-08-16 13:27:08.000000000 +0200
+@@ -721,6 +721,10 @@
+ /* The pathname of the sendmail executable.  Sieve invokes sendmail
+    for sending rejections, redirects and vacation responses. */
++{ "sendsms", "/usr/bin/sendsms", STRING }
++/* The pathname of the sendsms executable.  Sieve invokes sendsms
++   for sending SMS notifications. */
++
+ { "servername", NULL, STRING }
+ /* This is the hostname visible in the greeting messages of the POP,
+    IMAP and LMTP daemons. If it is unset, then the result returned
+diff -Naur cyrus-imapd-2.2.12.orig/man/imapd.conf.5 cyrus-imapd-2.2.12/man/imapd.conf.5
+--- cyrus-imapd-2.2.12.orig/man/imapd.conf.5   2005-02-14 19:02:16.000000000 +0100
++++ cyrus-imapd-2.2.12/man/imapd.conf.5        2005-08-16 13:35:40.000000000 +0200
+@@ -590,6 +590,9 @@
+ .IP "\fBsendmail:\fR /usr/lib/sendmail" 5
+ The pathname of the sendmail executable.  Sieve invokes sendmail
+ for sending rejections, redirects and vacation responses. 
++.IP "\fBsendsms:\fR /usr/bin/sendsms" 5
++The pathname of the sendsms executable.  Sieve invokes sendsms
++for sending SMS notifications. 
+ .IP "\fBservername:\fR <none>" 5
+ This is the hostname visible in the greeting messages of the POP,
+ IMAP and LMTP daemons. If it is unset, then the result returned
+diff -Naur cyrus-imapd-2.2.12.orig/man/notifyd.8 cyrus-imapd-2.2.12/man/notifyd.8
+--- cyrus-imapd-2.2.12.orig/man/notifyd.8      2003-08-10 01:43:14.000000000 +0200
++++ cyrus-imapd-2.2.12/man/notifyd.8   2005-08-16 13:18:03.000000000 +0200
+@@ -110,6 +110,11 @@
+ Sieve 'notify' action as it requires a \fImailto:\fR URL to be
+ specified as an \fI:option\fR.
+ .TP
++.B sms
++Send the notification as SMS.  This method can ONLY be used in a
++Sieve 'notify' action as it requires a \fIsms:\fR URL to be
++specified as an \fI:option\fR.
++.TP
+ .B zephyr
+ Send the notification as a zephyrgram.  If used in a Sieve 'notify'
+ action, additional recipients can be specified as \fI:options\fR.
+diff -Naur cyrus-imapd-2.2.12.orig/notifyd/Makefile.in cyrus-imapd-2.2.12/notifyd/Makefile.in
+--- cyrus-imapd-2.2.12.orig/notifyd/Makefile.in        2004-05-28 20:03:06.000000000 +0200
++++ cyrus-imapd-2.2.12/notifyd/Makefile.in     2005-08-16 15:18:45.000000000 +0200
+@@ -82,7 +82,7 @@
+ install:
+       $(INSTALL) -m 755 notifyd $(DESTDIR)$(service_path)
+-OBJS= notifyd.o notify_null.o notify_log.o notify_mailto.o notify_zephyr.o
++OBJS= notifyd.o notify_null.o notify_log.o notify_mailto.o notify_sms.o notify_zephyr.o
+ notifytest: notifytest.o
+       $(CC) $(LDFLAGS) -o notifytest \
+diff -Naur cyrus-imapd-2.2.12.orig/notifyd/notifyd.h cyrus-imapd-2.2.12/notifyd/notifyd.h
+--- cyrus-imapd-2.2.12.orig/notifyd/notifyd.h  2003-02-13 21:15:48.000000000 +0100
++++ cyrus-imapd-2.2.12/notifyd/notifyd.h       2005-08-16 12:58:17.000000000 +0200
+@@ -48,6 +48,7 @@
+ #include "notify_null.h"
+ #include "notify_log.h"
+ #include "notify_mailto.h"
++#include "notify_sms.h"
+ #include "notify_zephyr.h"
+ /* Notify method dispatch table definition */
+@@ -64,6 +65,7 @@
+     { "null", notify_null },          /* do nothing */
+     { "log",  notify_log },           /* use syslog (for testing) */
+     { "mailto",       notify_mailto },        /* send an email */
++    { "sms",  notify_sms },           /* send an sms */
+ #ifdef HAVE_ZEPHYR
+     { "zephyr",       notify_zephyr },        /* send a zephyrgram */
+ #endif
+diff -Naur cyrus-imapd-2.2.12.orig/notifyd/notify_sms.c cyrus-imapd-2.2.12/notifyd/notify_sms.c
+--- cyrus-imapd-2.2.12.orig/notifyd/notify_sms.c       1970-01-01 01:00:00.000000000 +0100
++++ cyrus-imapd-2.2.12/notifyd/notify_sms.c    2005-08-16 18:43:56.000000000 +0200
+@@ -0,0 +1,111 @@
++/* notify_sms.c -- SMS notification method
++ * Simon Matter
++ */
++/*
++ * Copyright (c) 1998-2003 Carnegie Mellon University.  All rights reserved.
++ *
++ * 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. The name "Carnegie Mellon University" must not be used to
++ *    endorse or promote products derived from this software without
++ *    prior written permission. For permission or any other legal
++ *    details, please contact  
++ *      Office of Technology Transfer
++ *      Carnegie Mellon University
++ *      5000 Forbes Avenue
++ *      Pittsburgh, PA  15213-3890
++ *      (412) 268-4387, fax: (412) 268-7395
++ *      tech-transfer@andrew.cmu.edu
++ *
++ * 4. Redistributions of any form whatsoever must retain the following
++ *    acknowledgment:
++ *    "This product includes software developed by Computing Services
++ *     at Carnegie Mellon University (http://www.cmu.edu/computing/)."
++ *
++ * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
++ * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
++ * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE
++ * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
++ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
++ * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
++ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
++ *
++ * notify_sms is based on code from notify_mailto by Ken Murchison.
++ * Copyright (c) 2005 Simon Matter, Invoca Systems.
++ * Release 2005081600/2.2.12
++*/
++
++#include <config.h>
++
++#include "notify_sms.h"
++
++#include <stdio.h>
++#include <string.h>
++#include <unistd.h>
++#include <sys/types.h>
++#include <sys/wait.h>
++
++#include "global.h"
++#include "libconfig.h"
++#include "sieve_interface.h"
++
++static int global_outgoing_count = 0;
++
++char* notify_sms(const char *class __attribute__((unused)),
++                  const char *priority __attribute__((unused)),
++                  const char *user __attribute__((unused)),
++                  const char *mailbox __attribute__((unused)),
++                  int nopt, char **options,
++                  const char *message)
++{
++    FILE *sm;
++    const char *smbuf[10];
++    int sm_stat;
++    pid_t sm_pid;
++    int fds[2];
++
++    /* XXX check/parse options (sms URI) */
++    if (nopt < 1)
++      return strdup("NO sms URI not specified");
++
++    smbuf[0] = "sendsms";
++    smbuf[1] = options[0];
++    smbuf[2] = NULL;
++
++    pipe(fds);
++    if ((sm_pid = fork()) == 0) {
++      /* i'm the child! run sendsms! */
++      close(fds[1]);
++      /* make the pipe be stdin */
++      dup2(fds[0], 0);
++      execv(config_getstring(IMAPOPT_SENDSMS), (char **) smbuf);
++
++      /* if we're here we suck */
++      return strdup("NO sms couldn't exec");
++    }
++    /* i'm the parent */
++    close(fds[0]);
++    sm = fdopen(fds[1], "w");
++
++    if (!sm)
++      return strdup("NO sms could not spawn sendsms process");
++
++    fprintf(sm, message);
++
++    fclose(sm);
++    while (waitpid(sm_pid, &sm_stat, 0) < 0);
++
++    /* XXX check for sendsms exit code */
++
++    return strdup("OK sms notification successful");
++}
+diff -Naur cyrus-imapd-2.2.12.orig/notifyd/notify_sms.h cyrus-imapd-2.2.12/notifyd/notify_sms.h
+--- cyrus-imapd-2.2.12.orig/notifyd/notify_sms.h       1970-01-01 01:00:00.000000000 +0100
++++ cyrus-imapd-2.2.12/notifyd/notify_sms.h    2005-08-16 14:57:16.000000000 +0200
+@@ -0,0 +1,62 @@
++/* notify_sms.h -- SMS notification method
++ * Simon Matter
++ */
++/*
++ * Copyright (c) 1998-2003 Carnegie Mellon University.  All rights reserved.
++ *
++ * 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. The name "Carnegie Mellon University" must not be used to
++ *    endorse or promote products derived from this software without
++ *    prior written permission. For permission or any other legal
++ *    details, please contact  
++ *      Office of Technology Transfer
++ *      Carnegie Mellon University
++ *      5000 Forbes Avenue
++ *      Pittsburgh, PA  15213-3890
++ *      (412) 268-4387, fax: (412) 268-7395
++ *      tech-transfer@andrew.cmu.edu
++ *
++ * 4. Redistributions of any form whatsoever must retain the following
++ *    acknowledgment:
++ *    "This product includes software developed by Computing Services
++ *     at Carnegie Mellon University (http://www.cmu.edu/computing/)."
++ *
++ * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
++ * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
++ * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE
++ * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
++ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
++ * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
++ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
++ *
++ * notify_sms is based on code from notify_mailto by Ken Murchison.
++ * Copyright (c) 2005 Simon Matter, Invoca Systems.
++ * Release 2005081600/2.2.12
++ *
++ */
++
++#ifndef _NOTIFY_SMS_H_
++#define _NOTIFY_SMS_H_
++
++#include <config.h>
++
++/* the only option should be a sms URI */
++char* notify_sms(const char *class __attribute__((unused)),
++                  const char *priority __attribute__((unused)),
++                  const char *user __attribute__((unused)),
++                  const char *mailbox __attribute__((unused)),
++                  int nopt, char **options,
++                  const char *message);
++
++#endif /* _NOTIFY_SMS_H_ */
diff --git a/src/patches/cyrus-imapd-2.2.12-rmquota+deletemailbox-0.2-1.diff b/src/patches/cyrus-imapd-2.2.12-rmquota+deletemailbox-0.2-1.diff
new file mode 100644 (file)
index 0000000..ce2cce0
--- /dev/null
@@ -0,0 +1,491 @@
+diff -Naur cyrus-imapd-2.2.12.orig/imap/ctl_cyrusdb.c cyrus-imapd-2.2.12/imap/ctl_cyrusdb.c
+--- cyrus-imapd-2.2.12.orig/imap/ctl_cyrusdb.c Tue Jul 13 04:34:20 2004
++++ cyrus-imapd-2.2.12/imap/ctl_cyrusdb.c      Mon Mar  7 11:30:58 2005
+@@ -136,7 +136,7 @@
+     /* if it is MBTYPE_RESERVED, unset it & call mboxlist_delete */
+     if(!r && (mbtype & MBTYPE_RESERVE)) {
+       if(!r) {
+-          r = mboxlist_deletemailbox(name, 1, NULL, NULL, 0, 0, 1);
++          r = mboxlist_deletemailbox(name, 1, NULL, NULL, 0, 0, 1, 1);
+           if(r) {
+               /* log the error */
+               syslog(LOG_ERR,
+diff -Naur cyrus-imapd-2.2.12.orig/imap/ctl_mboxlist.c cyrus-imapd-2.2.12/imap/ctl_mboxlist.c
+--- cyrus-imapd-2.2.12.orig/imap/ctl_mboxlist.c        Sat May 22 05:45:48 2004
++++ cyrus-imapd-2.2.12/imap/ctl_mboxlist.c     Mon Mar  7 11:30:58 2005
+@@ -456,7 +456,7 @@
+           
+           wipe_head = wipe_head->next;
+           
+-          ret = mboxlist_deletemailbox(me->mailbox, 1, "", NULL, 0, 1, 1);
++          ret = mboxlist_deletemailbox(me->mailbox, 1, "", NULL, 0, 1, 1, 1);
+           if(ret) {
+               fprintf(stderr, "couldn't delete defunct mailbox %s\n",
+                       me->mailbox);
+diff -Naur cyrus-imapd-2.2.12.orig/imap/imapd.c cyrus-imapd-2.2.12/imap/imapd.c
+--- cyrus-imapd-2.2.12.orig/imap/imapd.c       Mon Feb 14 07:39:55 2005
++++ cyrus-imapd-2.2.12/imap/imapd.c    Mon Mar  7 11:30:58 2005
+@@ -3724,7 +3724,7 @@
+     r = mboxlist_deletemailbox(name, imapd_userisadmin,
+                              imapd_userid, imapd_authstate,
+-                             0, 0, 0);
++                             0, 0, 0, 1);
+     
+     if(r) {
+       prot_printf(imapd_out, "* NO delete %s: %s\r\n",
+@@ -3743,6 +3743,12 @@
+     char mailboxname[MAX_MAILBOX_NAME+1];
+     char *p;
+     int domainlen = 0;
++    int keepQuota = 1;
++
++    if(name && *name == '+') {
++        keepQuota = 0;
++        name++;
++    }
+     r = (*imapd_namespace.mboxname_tointernal)(&imapd_namespace, name,
+                                              imapd_userid, mailboxname);
+@@ -3753,7 +3759,7 @@
+       r = mboxlist_deletemailbox(mailboxname, imapd_userisadmin,
+                                  imapd_userid, imapd_authstate, 1,
+-                                 localonly, 0);
++                                 localonly, 0, keepQuota);
+     }
+     /* was it a top-level user mailbox? */
+@@ -4718,6 +4724,7 @@
+ {
+     int newquota = -1;
+     int badresource = 0;
++    int rmquota = 0;
+     int c;
+     int force = 0;
+     static struct buf arg;
+@@ -4732,7 +4739,8 @@
+     if (c != ')' || arg.s[0] != '\0') {
+       for (;;) {
+           if (c != ' ') goto badlist;
+-          if (strcasecmp(arg.s, "storage") != 0) badresource = 1;
++          if (strcasecmp(arg.s, "remove") == 0) rmquota = 1;
++          else if (strcasecmp(arg.s, "storage") != 0) badresource = 1;
+           c = getword(imapd_in, &arg);
+           if (c != ' ' && c != ')') goto badlist;
+           if (arg.s[0] == '\0') goto badlist;
+@@ -4769,7 +4777,10 @@
+                                                  imapd_userid, mailboxname);
+       if (!r) {
+-          r = mboxlist_setquota(mailboxname, newquota, force);
++            if(!rmquota)
++                r = mboxlist_setquota(mailboxname, newquota, force);
++            else
++                r = mboxlist_unsetquota(mailboxname);
+       }
+     }
+@@ -6416,7 +6427,7 @@
+       /* note also that we need to remember to let proxyadmins do this */
+       r = mboxlist_deletemailbox(mailboxname,
+                                  imapd_userisadmin || imapd_userisproxyadmin,
+-                                 imapd_userid, imapd_authstate, 0, 1, 0);
++                                 imapd_userid, imapd_authstate, 0, 1, 0, 1);
+       if(r) syslog(LOG_ERR,
+                    "Could not delete local mailbox during move of %s",
+                    mailboxname);
+diff -Naur cyrus-imapd-2.2.12.orig/imap/mailbox.c cyrus-imapd-2.2.12/imap/mailbox.c
+--- cyrus-imapd-2.2.12.orig/imap/mailbox.c     Mon Feb 14 07:39:57 2005
++++ cyrus-imapd-2.2.12/imap/mailbox.c  Mon Mar  7 11:30:58 2005
+@@ -2117,27 +2117,7 @@
+     seen_delete_mailbox(mailbox);
+-    if (delete_quota_root && !rquota) {
+-      quota_delete(&mailbox->quota, &tid);
+-      free(mailbox->quota.root);
+-      mailbox->quota.root = NULL;
+-    } else if (!rquota) {
+-      /* Free any quota being used by this mailbox */
+-      if (mailbox->quota.used >= mailbox->quota_mailbox_used) {
+-          mailbox->quota.used -= mailbox->quota_mailbox_used;
+-      }
+-      else {
+-          mailbox->quota.used = 0;
+-      }
+-      r = quota_write(&mailbox->quota, &tid);
+-      if (r) {
+-          syslog(LOG_ERR,
+-                 "LOSTQUOTA: unable to record free of %lu bytes in quota %s",
+-                 mailbox->quota_mailbox_used, mailbox->quota.root);
+-      }
+-      else
+-          quota_commit(&tid);
+-    }
++    mailbox_updatequota(mailbox,NULL);
+     /* remove all files in directory */
+     strlcpy(buf, mailbox->path, sizeof(buf));
+@@ -2751,3 +2731,49 @@
+       if (*p == '.') *p = '/';
+     }
+ }
++
++
++/* This function is used to update the quota. Can be used to replace
++ * identical parts of the code, and can be quite handy some times 
++ * The tid is used in order to make possible to make the quota update
++ * being a part of a bigger transaction to the quota db */
++int mailbox_updatequota(struct mailbox *mailbox, struct txn **tid)
++{
++    int r = 0, havetid = 0;
++    struct txn **ltid = NULL;
++
++    if(tid) {
++        ltid = tid;
++        havetid = 1;
++    }
++    /* Ensure that we are locked */
++    if(!mailbox->header_lock_count) return IMAP_INTERNAL;
++
++
++    if(mailbox->quota.root) {
++        r = quota_read(&mailbox->quota, ltid, 1);
++        if( r == 0 ) {
++            if (mailbox->quota.used >= mailbox->quota_mailbox_used) {
++                mailbox->quota.used -= mailbox->quota_mailbox_used;
++            }
++            else {
++                mailbox->quota.used = 0;
++            }
++            r = quota_write(&mailbox->quota, ltid);
++            if (r) {
++                syslog(LOG_ERR,
++                   "LOSTQUOTA: unable to record free of %lu bytes in quota %s",
++                   mailbox->quota_mailbox_used, mailbox->quota.root);
++            }
++            else if(!havetid)
++                quota_commit(tid);
++        }
++        /* It is not a big mistake not to have quota .. just remove from the mailbox */
++        else if ( r == IMAP_QUOTAROOT_NONEXISTENT) {
++                free(mailbox->quota.root);
++                r = 0;
++        }
++    }
++    return r;
++}
++
+diff -Naur cyrus-imapd-2.2.12.orig/imap/mailbox.h cyrus-imapd-2.2.12/imap/mailbox.h
+--- cyrus-imapd-2.2.12.orig/imap/mailbox.h     Thu Jan 22 22:17:09 2004
++++ cyrus-imapd-2.2.12/imap/mailbox.h  Mon Mar  7 11:30:58 2005
+@@ -305,6 +305,8 @@
+                         struct mailbox *mailboxp);
+ extern int mailbox_delete(struct mailbox *mailbox, int delete_quota_root);
++extern int mailbox_updatequota(struct mailbox *mailbox, struct txn **tid);
++
+ extern int mailbox_rename_copy(struct mailbox *oldmailbox, 
+                              const char *newname, char *newpath,
+                              bit32 *olduidvalidityp, bit32 *newuidvalidityp,
+diff -Naur cyrus-imapd-2.2.12.orig/imap/mboxlist.c cyrus-imapd-2.2.12/imap/mboxlist.c
+--- cyrus-imapd-2.2.12.orig/imap/mboxlist.c    Mon Jul 26 20:08:03 2004
++++ cyrus-imapd-2.2.12/imap/mboxlist.c Mon Mar  7 11:30:58 2005
+@@ -93,6 +93,11 @@
+ static int mboxlist_opensubs();
+ static void mboxlist_closesubs();
++static int child_cb(char *name,
++                    int matchlen __attribute__((unused)),
++                    int maycreate __attribute__((unused)),
++                    void *rock);
++
+ static int mboxlist_rmquota(const char *name, int matchlen, int maycreate,
+                           void *rock);
+ static int mboxlist_changequota(const char *name, int matchlen, int maycreate,
+@@ -100,6 +105,7 @@
+ struct change_rock {
+     struct quota *quota;
++    struct quota *oldquota;
+     struct txn **tid;
+ };
+@@ -893,9 +899,9 @@
+  */
+ int mboxlist_deletemailbox(const char *name, int isadmin, char *userid, 
+                          struct auth_state *auth_state, int checkacl,
+-                         int local_only, int force)
++                         int local_only, int force, int keepQuota)
+ {
+-    int r;
++    int r, has_children = 0;
+     char *acl;
+     long access;
+     struct mailbox mailbox;
+@@ -907,6 +913,7 @@
+     int deleteright = get_deleteright();
+     const char *p;
+     mupdate_handle *mupdate_h = NULL;
++    char *quotaroot = NULL;
+     if(!isadmin && force) return IMAP_PERMISSION_DENIED;
+@@ -1018,13 +1025,44 @@
+     if ((r && !force) || isremote) goto done;
+-    if (!r || force) r = mailbox_delete(&mailbox, deletequotaroot);
++    if (!r || force) {
++        /* first we have to keep the previous quota root in order to delete it */
++        if(mailbox.quota.root)
++                quotaroot = xstrdup(mailbox.quota.root);
++      r = mailbox_delete(&mailbox, deletequotaroot);
++    }
+     /*
+      * See if we have to remove mailbox's quota root
+      */
+-    if (!r && mailbox.quota.root != NULL) {
++    if (!r && quotaroot != NULL) {
+       /* xxx look for any other mailboxes in this quotaroot */
++        /* If we have not asked to remove the quota (default behaviour), we check 
++         * whether there are any subfolders beneeth the quota root. If there aren't
++         * any subfolders the reasonable thing is to delete the quota */
++        if(keepQuota) {
++            char pattern[MAX_MAILBOX_PATH+1];
++            strlcpy(pattern, quotaroot, sizeof(pattern));
++            if (config_virtdomains && name[strlen(name)-1] == '!') {
++                strlcat(pattern, "*", sizeof(pattern));
++            }
++            else {
++                strlcat(pattern, ".*", sizeof(pattern));
++            }
++              /* find if there are subfolders. Then we want to 
++               * keep the existing quota */
++            mboxlist_findall(NULL, pattern, isadmin, userid,
++                    auth_state, child_cb, (void *) &has_children);
++
++          if(!has_children)
++                if(!mboxlist_mylookup(quotaroot, NULL, NULL, NULL, NULL, NULL, 0 ))
++                  has_children = 1;
++        }
++        /* If we want to remove the quota explicitely or the quota root folder has no subfolders
++         * we execute the rmquota patch */
++        if(!keepQuota || !has_children )
++            mboxlist_unsetquota(quotaroot);
++        free(quotaroot);
+     }
+  done:
+@@ -2357,6 +2395,7 @@
+     if (r) return r;
+     crock.quota = &quota;
++    crock.oldquota = NULL;
+     crock.tid = &tid;
+     /* top level mailbox */
+     if(have_mailbox)
+@@ -2375,17 +2414,21 @@
+  */
+ int mboxlist_unsetquota(const char *root)
+ {
++    char newquota[MAX_MAILBOX_PATH+1];
+     char pattern[MAX_MAILBOX_PATH+1];
+     struct quota quota;
+-    int r=0;
++    struct change_rock crock;
++    int r=0, k=0;
+     if (!root[0] || root[0] == '.' || strchr(root, '/')
+       || strchr(root, '*') || strchr(root, '%') || strchr(root, '?')) {
+       return IMAP_MAILBOX_BADNAME;
+     }
++      
++    crock.tid=NULL;
+     
+     quota.root = (char *) root;
+-    r = quota_read(&quota, NULL, 0);
++    r = quota_read(&quota, crock.tid, 0);
+     if (r == IMAP_QUOTAROOT_NONEXISTENT) {
+       /* already unset */
+       return 0;
+@@ -2402,13 +2445,45 @@
+     }
+     else
+       strlcat(pattern, ".*", sizeof(pattern));
+-    
+-    /* top level mailbox */
+-    mboxlist_rmquota(root, 0, 0, (void *)root);
+-    /* submailboxes - we're using internal names here */
+-    mboxlist_findall(NULL, pattern, 1, 0, 0, mboxlist_rmquota, (void *)root);
+-    r = quota_delete(&quota, NULL);
++    r = quota_delete(&quota, crock.tid);
++
++    /* If we cannot delete the quota then abort the operation */
++    if(!r) {
++       /* quota_findroot performs several checks that we can
++        * assume that are already done, and don't have to perform
++        * them again. One of them is that it returns 1 only if
++        * quotaroot exists.
++        */
++        if(quota_findroot(newquota, sizeof(newquota), root)) {
++            struct quota rootquota;
++            rootquota.root = newquota;
++            k = quota_read(&rootquota, crock.tid, 0);
++            if (!k) {
++                crock.quota = &rootquota;
++                crock.oldquota = &quota;
++                /* top level mailbox */
++                k = mboxlist_changequota(root, 0, 0, &crock);
++            }
++            /* submailboxes - we're using internal names here */
++            if (!k)
++                k = mboxlist_findall(NULL, pattern, 1, 0, 0, mboxlist_changequota, &crock);
++            if(!k)
++                k = quota_write(&rootquota, crock.tid);
++
++         }
++         else {
++           /* top level mailbox */
++           mboxlist_rmquota(root, 0, 0, (void *)root);
++           /* submailboxes - we're using internal names here */
++           mboxlist_findall(NULL, pattern, 1, 0, 0, mboxlist_rmquota, (void *)root);
++       }
++    }
++
++    if(!r && !k)
++        quota_commit(crock.tid);
++    else
++        quota_abort(crock.tid);
+     return r;
+ }
+@@ -2506,6 +2581,7 @@
+     struct mailbox mailbox;
+     struct change_rock *crock = (struct change_rock *) rock;
+     struct quota *mboxlist_newquota = crock->quota;
++    struct quota *mboxlist_oldquota = crock->oldquota;
+     struct txn **tid = crock->tid;
+     assert(rock != NULL);
+@@ -2523,27 +2599,24 @@
+     if (r) goto error;
+     if (mailbox.quota.root) {
+-      if (strlen(mailbox.quota.root) >= strlen(mboxlist_newquota->root)) {
+-          /* Part of a child quota root */
+-          mailbox_close(&mailbox);
+-          return 0;
+-      }
+-
+-      r = quota_read(&mailbox.quota, tid, 1);
+-      if (r) goto error;
+-      if (mailbox.quota.used >= mailbox.quota_mailbox_used) {
+-          mailbox.quota.used -= mailbox.quota_mailbox_used;
+-      }
+-      else {
+-          mailbox.quota.used = 0;
+-      }
+-      r = quota_write(&mailbox.quota, tid);
+-      if (r) {
+-          syslog(LOG_ERR,
+-                 "LOSTQUOTA: unable to record free of %lu bytes in quota %s",
+-                 mailbox.quota_mailbox_used, mailbox.quota.root);
+-      }
+-      free(mailbox.quota.root);
++        if(mboxlist_oldquota) {
++            if (strlen(mailbox.quota.root) > strlen(mboxlist_oldquota->root)) {
++                /* Part of a child quota root */
++                mailbox_close(&mailbox);
++                return 0;
++            }
++        }
++        else {
++            if (strlen(mailbox.quota.root) >= strlen(mboxlist_newquota->root)) {
++                /* Part of a child quota root */
++                mailbox_close(&mailbox);
++                return 0;
++            }
++        }
++
++        r = mailbox_updatequota(&mailbox,tid);
++        if (r)
++            goto error;
+     }
+     mailbox.quota.root = xstrdup(mboxlist_newquota->root);
+@@ -2553,18 +2626,24 @@
+     mboxlist_newquota->used += mailbox.quota_mailbox_used;
+     mailbox_close(&mailbox);
+     return 0;
+-
++ 
+  error:
+     mailbox_close(&mailbox);
++    syslog(LOG_ERR, "LOSTQUOTA: unable to change quota root for %s to %s: %s. \
++                        Command aborted. Run reconstruct to make sure mailboxes \
++                         are in consistent state",
++           name, mboxlist_newquota->root, error_message(r));
++    return 1;
+  error_noclose:
+     syslog(LOG_ERR, "LOSTQUOTA: unable to change quota root for %s to %s: %s",
+-         name, mboxlist_newquota->root, error_message(r));
++           name, mboxlist_newquota->root, error_message(r));
+     /* Note, we're a callback, and it's not a huge tragedy if we
+      * fail, so we don't ever return a failure */
+     return 0;
+ }
++
+ /* must be called after cyrus_init */
+ void mboxlist_init(int myflags)
+ {
+diff -Naur cyrus-imapd-2.2.12.orig/imap/mboxlist.h cyrus-imapd-2.2.12/imap/mboxlist.h
+--- cyrus-imapd-2.2.12.orig/imap/mboxlist.h    Wed Mar 17 19:07:49 2004
++++ cyrus-imapd-2.2.12/imap/mboxlist.h Mon Mar  7 11:30:58 2005
+@@ -122,7 +122,7 @@
+  * the planet */
+ int mboxlist_deletemailbox(const char *name, int isadmin, char *userid, 
+                          struct auth_state *auth_state, int checkacl,
+-                         int local_only, int force);
++                         int local_only, int force, int keepQuota);
+ /* Rename/move a mailbox (hierarchical) */
+ int mboxlist_renamemailbox(char *oldname, char *newname, char *partition, 
+diff -Naur cyrus-imapd-2.2.12.orig/imap/mupdate.c cyrus-imapd-2.2.12/imap/mupdate.c
+--- cyrus-imapd-2.2.12.orig/imap/mupdate.c     Fri Dec 17 17:32:16 2004
++++ cyrus-imapd-2.2.12/imap/mupdate.c  Mon Mar  7 11:30:58 2005
+@@ -2190,7 +2190,7 @@
+           remote_boxes.head = r->next;
+       } else if (ret < 0) {
+           /* Local without corresponding remote, delete it */
+-          mboxlist_deletemailbox(l->mailbox, 1, "", NULL, 0, 0, 0);
++          mboxlist_deletemailbox(l->mailbox, 1, "", NULL, 0, 0, 0, 1);
+           local_boxes.head = l->next;
+       } else /* (ret > 0) */ {
+           /* Remote without corresponding local, insert it */
+@@ -2205,7 +2205,7 @@
+     if(l && !r) {
+       /* we have more deletes to do */
+       while(l) {
+-          mboxlist_deletemailbox(l->mailbox, 1, "", NULL, 0, 0, 0);
++          mboxlist_deletemailbox(l->mailbox, 1, "", NULL, 0, 0, 0, 1);
+           local_boxes.head = l->next;
+           l = local_boxes.head;
+       }
+diff -Naur cyrus-imapd-2.2.12.orig/imap/nntpd.c cyrus-imapd-2.2.12/imap/nntpd.c
+--- cyrus-imapd-2.2.12.orig/imap/nntpd.c       Fri Jan  7 21:59:04 2005
++++ cyrus-imapd-2.2.12/imap/nntpd.c    Mon Mar  7 11:30:58 2005
+@@ -3298,7 +3298,7 @@
+     /* XXX should we delete right away, or wait until empty? */
+     r = mboxlist_deletemailbox(mailboxname, 0,
+-                             newsmaster, newsmaster_authstate, 1, 0, 0);
++                             newsmaster, newsmaster_authstate, 1, 0, 0, 1);
+     return r;
+ }
diff --git a/src/patches/cyrus-imapd-2.2.12-seenstate.patch b/src/patches/cyrus-imapd-2.2.12-seenstate.patch
new file mode 100644 (file)
index 0000000..1de1d8f
--- /dev/null
@@ -0,0 +1,163 @@
+# Small patch to Cyrus IMAP 2.2.12 which modifies \Seen state handling to
+# make it compatible with Outlook Express. OE makes two connections to a
+# given mailfolder: one generates indexes while the other fetches messages.
+# Unfortunately it gets confused if \Seen updates caused by the message
+# stream aren't immediately flushed and picked up by the index stream.
+#
+# Apparently Mozilla Thunderbird has the same problem.
+#
+# This patch is a 2.2.12 port from the patch found here:
+# http://www-uxsup.csx.cam.ac.uk/~dpc22/cyrus/patches/2.1.16/seenstate.patch
+#
+diff -Naur cyrus-imapd-2.2.12.orig/imap/imapd.c cyrus-imapd-2.2.12/imap/imapd.c
+--- cyrus-imapd-2.2.12.orig/imap/imapd.c       2005-02-14 07:39:55.000000000 +0100
++++ cyrus-imapd-2.2.12/imap/imapd.c    2006-01-04 07:41:45.000000000 +0100
+@@ -3095,6 +3095,10 @@
+     snprintf(mytime, sizeof(mytime), "%2.3f", 
+            (clock() - start) / (double) CLOCKS_PER_SEC);
++    /* Checkpoint \Seen immediately after each FETCH completes. Checks for
++     * changes from other processes at the same time */
++    index_check_existing(imapd_mailbox, usinguid, 1);
++
+     if (r) {
+       prot_printf(imapd_out, "%s NO %s (%s sec)\r\n", tag,
+                   error_message(r), mytime);
+@@ -3219,7 +3223,8 @@
+     index_fetch(imapd_mailbox, msgno, 0, &fetchargs, &fetchedsomething);
+-    index_check(imapd_mailbox, 0, 0);
++    /* Vanilla index_check() can generate illegal EXPUNGE events */
++    index_check_existing(imapd_mailbox, 0, 1);
+     if (fetchedsomething) {
+       prot_printf(imapd_out, "%s OK %s\r\n", tag,
+@@ -3352,7 +3357,9 @@
+                   flag, nflags);
+     if (usinguid) {
+-      index_check(imapd_mailbox, 1, 0);
++      index_check(imapd_mailbox, 1, 1);   /* Check \Seen too */
++    } else {
++        index_check_existing(imapd_mailbox, 0, 1);
+     }
+     if (r) {
+diff -Naur cyrus-imapd-2.2.12.orig/imap/imapd.h cyrus-imapd-2.2.12/imap/imapd.h
+--- cyrus-imapd-2.2.12.orig/imap/imapd.h       2004-06-22 23:36:18.000000000 +0200
++++ cyrus-imapd-2.2.12/imap/imapd.h    2006-01-04 07:41:45.000000000 +0100
+@@ -232,6 +232,8 @@
+ extern void index_operatemailbox(struct mailbox *mailbox);
+ extern void index_check(struct mailbox *mailbox, int usinguid,
+                          int checkseen);
++extern void
++index_check_existing(struct mailbox *mailbox, int usinguid, int checkseen);
+ extern void index_checkseen(struct mailbox *mailbox, int quiet,
+                              int usinguid, int oldexists);
+diff -Naur cyrus-imapd-2.2.12.orig/imap/index.c cyrus-imapd-2.2.12/imap/index.c
+--- cyrus-imapd-2.2.12.orig/imap/index.c       2005-02-14 17:42:08.000000000 +0100
++++ cyrus-imapd-2.2.12/imap/index.c    2006-01-04 08:08:51.000000000 +0100
+@@ -425,6 +425,53 @@
+     }
+ }
++/* Nasty hack to report system + user flags updates without checking for
++ * new mail or expunge (relies on index atomic rewrite+rename for expunge).
++ *
++ * Needed to keep Outlook Express happy without breaking IMAP concurrent
++ * access regime which (quite correctly) prohibits unsolicited EXPUNGE and
++ * EXIST responses for non-UID versions of FETCH and STORE. Otherwise you
++ * can end up with hilarous situations such as:
++ *
++ *   . FETCH 2 fast
++ *   * EXPUNGE 1          <-- from concurrent session.
++ *   . FETCH (data relating to previous message _3_, if it exists)
++ *
++ */
++
++void
++index_check_existing(struct mailbox *mailbox, int usinguid, int checkseen)
++{
++    struct stat sbuf;
++    int msgno, i;
++    bit32 user_flags[MAX_USER_FLAGS/32];
++
++    if (imapd_exists == -1)
++      return;
++
++    /* Bail out if the mailbox was rotated under our feet */
++    if ((index_len > 0) &&
++      ((stat(FNAME_INDEX+1, &sbuf) != 0) ||
++      (sbuf.st_ino != mailbox->index_ino) ||
++      (index_ino != mailbox->index_ino)))
++      return;
++
++    if (checkseen)
++      index_checkseen(mailbox, 0, usinguid, imapd_exists);
++
++    for (msgno = 1; msgno <= imapd_exists; msgno++) {
++      if (flagreport[msgno] < LAST_UPDATED(msgno)) {
++          for (i = 0; i < VECTOR_SIZE(user_flags); i++) {
++              user_flags[i] = USER_FLAGS(msgno, i);
++          }
++          index_fetchflags(mailbox, msgno, SYSTEM_FLAGS(msgno), user_flags,
++                          LAST_UPDATED(msgno));
++          if (usinguid) prot_printf(imapd_out, " UID %u", UID(msgno));
++          prot_printf(imapd_out, ")\r\n");
++      }
++    }
++}
++
+ /*
+  * Checkpoint the user's \Seen state
+  *
+@@ -458,6 +505,7 @@
+     char *saveseenuids, *save;
+     int savealloced;
+     unsigned start, newallseen, inrange, usecomma;
++    mailbox_notifyproc_t *updatenotifier;
+     if (!keepingseen || !seendb) return;
+     if (imapd_exists == 0) {
+@@ -731,6 +779,9 @@
+     free(newseenuids);
+     seenuids = saveseenuids;
++
++    updatenotifier = mailbox_get_updatenotifier();
++    if (updatenotifier) updatenotifier(mailbox);
+ }
+diff -Naur cyrus-imapd-2.2.12.orig/imap/mailbox.c cyrus-imapd-2.2.12/imap/mailbox.c
+--- cyrus-imapd-2.2.12.orig/imap/mailbox.c     2005-02-14 07:39:57.000000000 +0100
++++ cyrus-imapd-2.2.12/imap/mailbox.c  2006-01-04 07:41:45.000000000 +0100
+@@ -230,6 +230,14 @@
+ }
+ /*
++ * Get the updatenotifier function
++ */
++mailbox_notifyproc_t *mailbox_get_updatenotifier(void)
++{
++    return updatenotifier;
++}
++
++/*
+  * Create connection to acappush (obsolete)
+  */
+ int mailbox_initialize(void)
+diff -Naur cyrus-imapd-2.2.12.orig/imap/mailbox.h cyrus-imapd-2.2.12/imap/mailbox.h
+--- cyrus-imapd-2.2.12.orig/imap/mailbox.h     2004-01-22 22:17:09.000000000 +0100
++++ cyrus-imapd-2.2.12/imap/mailbox.h  2006-01-04 07:41:45.000000000 +0100
+@@ -224,6 +224,8 @@
+ extern void mailbox_set_updatenotifier(mailbox_notifyproc_t *notifyproc);
++extern mailbox_notifyproc_t *mailbox_get_updatenotifier(void);
++
+ extern int mailbox_initialize(void);
+ extern char *mailbox_message_fname(struct mailbox *mailbox,
diff --git a/src/patches/cyrus-imapd-2.2.12-singleinstancestore.patch b/src/patches/cyrus-imapd-2.2.12-singleinstancestore.patch
new file mode 100644 (file)
index 0000000..5251552
--- /dev/null
@@ -0,0 +1,144 @@
+diff -Naur cyrus-imapd-2.2.12/imap/append.c cyrus-imapd-2.2.12.cvs/imap/append.c
+--- cyrus-imapd-2.2.12/imap/append.c   2004-05-22 05:45:48.000000000 +0200
++++ cyrus-imapd-2.2.12.cvs/imap/append.c       2005-06-03 07:10:24.000000000 +0200
+@@ -1,5 +1,5 @@
+ /* append.c -- Routines for appending messages to a mailbox
+- * $Id: append.c,v 1.107 2004/05/22 03:45:48 rjs3 Exp $
++ * $Id: append.c,v 1.108 2005/06/02 15:47:50 ken3 Exp $
+  *
+  * Copyright (c)1998, 2000 Carnegie Mellon University.  All rights reserved.
+  *
+@@ -801,7 +801,8 @@
+ int append_copy(struct mailbox *mailbox, 
+               struct appendstate *as,
+               int nummsg, 
+-              struct copymsg *copymsg)
++              struct copymsg *copymsg,
++              int nolink)
+ {
+     struct mailbox *append_mailbox = &as->m;
+     int msg;
+@@ -845,7 +846,7 @@
+           mailbox_message_get_fname(mailbox, copymsg[msg].uid, fnamebuf,
+                                     sizeof(fnamebuf));
+           /* Link/copy message file */
+-          r = mailbox_copyfile(fnamebuf, fname, 0);
++          r = mailbox_copyfile(fnamebuf, fname, nolink);
+           if (r) goto fail;
+           /* Write out cache info, copy other info */
+diff -Naur cyrus-imapd-2.2.12/imap/append.h cyrus-imapd-2.2.12.cvs/imap/append.h
+--- cyrus-imapd-2.2.12/imap/append.h   2004-01-22 22:17:07.000000000 +0100
++++ cyrus-imapd-2.2.12.cvs/imap/append.h       2005-06-03 07:10:24.000000000 +0200
+@@ -1,5 +1,5 @@
+ /* append.h -- Description of messages to be copied 
+- * $Id: append.h,v 1.26 2004/01/22 21:17:07 ken3 Exp $ 
++ * $Id: append.h,v 1.27 2005/06/02 15:47:51 ken3 Exp $ 
+  *
+  * Copyright (c) 1998, 2000 Carnegie Mellon University.  All rights reserved.
+  *
+@@ -137,7 +137,7 @@
+ extern int append_copy(struct mailbox *mailbox,
+                      struct appendstate *append_mailbox,
+-                     int nummsg, struct copymsg *copymsg);
++                     int nummsg, struct copymsg *copymsg, int nolink);
+ extern int append_collectnews(struct appendstate *mailbox,
+                             const char *group, unsigned long feeduid);
+diff -Naur cyrus-imapd-2.2.12/imap/imapd.c cyrus-imapd-2.2.12.cvs/imap/imapd.c
+--- cyrus-imapd-2.2.12/imap/imapd.c    2005-02-14 07:39:55.000000000 +0100
++++ cyrus-imapd-2.2.12.cvs/imap/imapd.c        2005-06-03 07:11:52.000000000 +0200
+@@ -38,7 +38,7 @@
+  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+  */
+-/* $Id: imapd.c,v 1.490 2005/02/14 06:39:55 shadow Exp $ */
++/* $Id: imapd.c,v 1.493 2005/06/02 15:47:51 ken3 Exp $ */
+ #include <config.h>
+@@ -3593,7 +3593,7 @@
+                                              imapd_userid, mailboxname);
+     if (!r) {
+       r = index_copy(imapd_mailbox, sequence, usinguid, mailboxname,
+-                     &copyuid);
++                     &copyuid, !config_getswitch(IMAPOPT_SINGLEINSTANCESTORE));
+     }
+     index_check(imapd_mailbox, usinguid, 0);
+diff -Naur cyrus-imapd-2.2.12/imap/imapd.h cyrus-imapd-2.2.12.cvs/imap/imapd.h
+--- cyrus-imapd-2.2.12/imap/imapd.h    2004-06-22 23:36:18.000000000 +0200
++++ cyrus-imapd-2.2.12.cvs/imap/imapd.h        2005-06-03 07:10:24.000000000 +0200
+@@ -1,5 +1,5 @@
+ /* imapd.h -- Common state for IMAP daemon
+- * $Id: imapd.h,v 1.61 2004/06/22 21:36:18 rjs3 Exp $
++ * $Id: imapd.h,v 1.62 2005/06/02 15:47:57 ken3 Exp $
+  *
+  * Copyright (c) 1998-2003 Carnegie Mellon University.  All rights reserved.
+  *
+@@ -249,7 +249,7 @@
+ extern int index_thread(struct mailbox *mailbox, int algorithm,
+                       struct searchargs *searchargs, int usinguid);
+ extern int index_copy(struct mailbox *mailbox, char *sequence,
+-                       int usinguid, char *name, char **copyuidp);
++                    int usinguid, char *name, char **copyuidp, int nolink);
+ extern int index_status(struct mailbox *mailbox, char *name,
+                          int statusitems);
+diff -Naur cyrus-imapd-2.2.12/imap/index.c cyrus-imapd-2.2.12.cvs/imap/index.c
+--- cyrus-imapd-2.2.12/imap/index.c    2005-02-14 17:42:08.000000000 +0100
++++ cyrus-imapd-2.2.12.cvs/imap/index.c        2005-06-03 07:13:04.000000000 +0200
+@@ -41,7 +41,7 @@
+  *
+  */
+ /*
+- * $Id: index.c,v 1.213 2005/02/14 16:42:08 shadow Exp $
++ * $Id: index.c,v 1.218 2005/06/02 15:47:58 ken3 Exp $
+  */
+ #include <config.h>
+@@ -1145,7 +1145,8 @@
+          char *sequence, 
+          int usinguid,
+          char *name, 
+-         char **copyuidp)
++         char **copyuidp,
++         int nolink)
+ {
+     static struct copyargs copyargs;
+     int i;
+@@ -1176,7 +1177,7 @@
+     if (r) return r;
+     r = append_copy(mailbox, &append_mailbox, copyargs.nummsg,
+-                  copyargs.copymsg);
++                  copyargs.copymsg, nolink);
+     if (!r) append_commit(&append_mailbox, totalsize,
+                         &uidvalidity, &startuid, &num);
+     if (!r) {
+diff -Naur cyrus-imapd-2.2.12/lib/imapoptions cyrus-imapd-2.2.12.cvs/lib/imapoptions
+--- cyrus-imapd-2.2.12/lib/imapoptions 2004-07-21 21:07:45.000000000 +0200
++++ cyrus-imapd-2.2.12.cvs/lib/imapoptions     2005-06-03 07:14:07.000000000 +0200
+@@ -42,7 +42,7 @@
+ .\" AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
+ .\" OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ .\" 
+-.\" $Id: imapoptions,v 1.30 2004/07/21 19:07:45 rjs3 Exp $
++.\" $Id: imapoptions,v 1.33 2005/06/02 15:47:59 ken3 Exp $
+ .SH NAME
+ imapd.conf \- IMAP configuration file
+ .SH DESCRIPTION
+@@ -753,9 +753,9 @@
+    directories: ~user/.sieve. */
+ { "singleinstancestore", 1, SWITCH }
+-/* If enabled, lmtpd and nntpd attempt to only write one copy of a message per
+-   partition and create hard links, resulting in a potentially large
+-   disk savings. */
++/* If enabled, imapd, lmtpd and nntpd attempt to only write one copy
++   of a message per partition and create hard links, resulting in a
++   potentially large disk savings. */
+ { "skiplist_unsafe", 0, SWITCH }
+ /* If enabled, this option forces the skiplist cyrusdb backend to
diff --git a/src/patches/cyrus-imapd-2.2.12-spool.patch b/src/patches/cyrus-imapd-2.2.12-spool.patch
new file mode 100644 (file)
index 0000000..4171a5e
--- /dev/null
@@ -0,0 +1,12 @@
+diff -Naur cyrus-imapd-2.2.12.orig/imap/spool.c cyrus-imapd-2.2.12/imap/spool.c
+--- cyrus-imapd-2.2.12.orig/imap/spool.c       2004-10-27 22:40:50.000000000 +0200
++++ cyrus-imapd-2.2.12/imap/spool.c    2005-10-24 15:08:37.000000000 +0200
+@@ -451,7 +451,7 @@
+           p[1] = '\n';
+           p[2] = '\0';
+       }
+-      else if (p[0] != '\n' && (strlen(buf) < sizeof(buf)-2)) {
++      else if (p[0] != '\n' && (strlen(buf) < sizeof(buf)-3)) {
+           /* line contained a \0 not at the end */
+           r = IMAP_MESSAGE_CONTAINSNULL;
+           continue;
diff --git a/src/patches/cyrus-imapd-2.3.3-deleteacl_invalid_identifier_fix.patch b/src/patches/cyrus-imapd-2.3.3-deleteacl_invalid_identifier_fix.patch
new file mode 100644 (file)
index 0000000..a21c186
--- /dev/null
@@ -0,0 +1,44 @@
+diff -Naur cyrus-imapd-2.3.3.orig/lib/acl_afs.c cyrus-imapd-2.3.3/lib/acl_afs.c
+--- cyrus-imapd-2.3.3.orig/lib/acl_afs.c       2005-12-13 20:36:11.000000000 +0100
++++ cyrus-imapd-2.3.3/lib/acl_afs.c    2006-04-12 07:28:50.000000000 +0200
+@@ -114,6 +114,7 @@
+ cyrus_acl_canonproc_t *canonproc;
+ void *canonrock;
+ {
++    const char *canonid;
+     char *newidentifier = 0;
+     char *newacl;
+     char *thisid, *nextid;
+@@ -122,9 +123,14 @@
+     /* Convert 'identifier' into canonical form */
+     if (*identifier == '-') {
+-      char *canonid = auth_canonifyid(identifier+1, 0);
++      canonid = auth_canonifyid(identifier+1, 0);
+       if (!canonid) {
+-          return -1;
++          if (access != 0L) {
++              return -1;
++          } else {
++              /* trying to delete invalid/non-existent identifier */
++              canonid = identifier+1;
++          }
+       }
+       newidentifier = xmalloc(strlen(canonid)+2);
+       newidentifier[0] = '-';
+@@ -135,9 +141,13 @@
+       }
+     }
+     else {
+-      identifier = auth_canonifyid(identifier, 0);
+-      if (!identifier) {
++      canonid = auth_canonifyid(identifier, 0);
++      if (canonid) {
++          identifier = canonid;
++      } else if (access != 0L) {
+           return -1;
++      } else {
++          /* trying to delete invalid/non-existent identifier */
+       }
+       if (canonproc) {
+           access = canonproc(canonrock, identifier, access);
diff --git a/src/patches/cyrus-imapd-acceptinvalidfrom.patch b/src/patches/cyrus-imapd-acceptinvalidfrom.patch
new file mode 100644 (file)
index 0000000..b44ab59
--- /dev/null
@@ -0,0 +1,34 @@
+--- cyrus-imapd-2.2.6/imap/message.c.acceptinvalidfrom 2004-10-30 15:03:02.220642392 -0700
++++ cyrus-imapd-2.2.6/imap/message.c   2004-10-30 15:06:01.838336352 -0700
+@@ -229,6 +229,8 @@
+     int reject8bit = config_getswitch(IMAPOPT_REJECT8BIT);
+     int munge8bit = config_getswitch(IMAPOPT_MUNGE8BIT);
+     int inheader = 1, blankline = 1;
++    char is_from;
++    static const char * from_header = "From ";
+     while (size) {
+       n = prot_read(from, buf, size > 4096 ? 4096 : size);
+@@ -294,8 +296,20 @@
+       /* Check for valid header name */
+       if (sawnl && buf[0] != ' ' && buf[0] != '\t') {
+           if (buf[0] == ':') return IMAP_MESSAGE_BADHEADER;
+-          for (p = (unsigned char *)buf; *p != ':'; p++) {
+-              if (*p <= ' ') return IMAP_MESSAGE_BADHEADER;
++            p = (unsigned char *) buf;
++            if (*p == '>')
++                p++;
++            if (*p == from_header[0])
++                is_from = 0;
++            else
++                is_from = -1;
++            for (; *p != ':' && is_from < 5; p++) {
++                if (is_from > 0 && *p != from_header[is_from])
++                    is_from = -1;
++                if (is_from >= 0)
++                    is_from++;
++                else
++                    if (*p <= ' ') return IMAP_MESSAGE_BADHEADER;
+           }
+       }
diff --git a/src/patches/timsieved_reset_sasl_conn.patch b/src/patches/timsieved_reset_sasl_conn.patch
new file mode 100644 (file)
index 0000000..af08f57
--- /dev/null
@@ -0,0 +1,19 @@
+--- timsieved/parser.c
++++ timsieved/parser.c 2005/08/24 09:14:42
+@@ -664,8 +664,14 @@
+       
+       if(r) {
+         /* mboxlist_detail error */
+-        *errmsg = "mailbox unknown";
+-        return FALSE;
++        syslog(LOG_ERR, error_message(r));
++
++        if(reset_saslconn(&sieved_saslconn, ssf, authid) != SASL_OK)
++          fatal("could not reset the sasl_conn_t after failure",
++          EC_TEMPFAIL);
++        
++        ret = FALSE;
++        goto cleanup;
+       }
+       if(type & MBTYPE_REMOTE) {