Support for RFC 5260: Date and Index Extensions

2011-02-02 Thread Carsten Hoeger
Hi,

does anybody know whether it is planned to support

http://tools.ietf.org/html/rfc5260

in cyrus-imapd?


-- 
With best regards,

Carsten Hoeger


signature.asc
Description: Digital signature

Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/

cyrus and 500k to 1M mails per inbox

2010-02-11 Thread Carsten Hoeger
Hi,


we have a customer running cyrus imap on RHEL5 cluster with a few thousand
mailboxes. 
Every single mail is sent to a second host acting as a read-only archive (all
imap acls set to no write access).

The plan is, that all mail on that second host is kept for a long time.

After some years, old mail will be purged automatically.

It's quite likely, that these mailboxes will grow to 50 or even more then
1M mails per mailbox.

Does anybody have experience with such big mailboxes?
The filesystem is LVM with ext3.

-- 
With best regards,

Carsten Hoeger


pgpjSUXKVm1zZ.pgp
Description: PGP signature

Cyrus Home Page: http://cyrusimap.web.cmu.edu/
Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html

Re: cyrus-imapd-2.2.12-10 -- impurge and -f recursion --

2010-01-20 Thread Carsten Hoeger
On Fri, Jan 15, James B. Byrne wrote:

 I run cyrus-imapd under CentOS-4.8 (a RedHat el4 clone).  I am
 trying to discover if there is any way to purge a user's INBOX of
 old and over-sized messages without affecting the contents of any
 subfolders thereof.
 
 I have looked at impurge as the mechanism. However,my reading of the
 man page, and of online discussions relating to this matter,
 indicate that in order for impurge to remove any mail from the INBOX
 then the -f switch has to be passed.  But, I also gather that
 whenever the -f switch is used then ALL subfolders of the target
 directory are purged recursively as well.
 
 This strikes me as a rather odd combination of attributes but I
 cannot see any way to prevent recursion if the -f switch is used. 
 What is the recommended way to purge mail from a user's INBOX only
 using criteria such as age and size?

You are not the only one searching for a better control of what ipurge should
delete.
I created a feature request for that and submitted a patch to the cmu
bugzilla:

https://bugzilla.andrew.cmu.edu/show_bug.cgi?id=3167

This is the link to the patch including documentation in the manpage:

https://bugzilla.andrew.cmu.edu/attachment.cgi?id=1232

-- 
With best regards,

Carsten Hoeger


pgp1vwdw9zf5k.pgp
Description: PGP signature

Cyrus Home Page: http://cyrusimap.web.cmu.edu/
Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html

Re: Patch: add regex support to ipurge to improve folder selection

2009-09-10 Thread Carsten Hoeger
On Wed, Sep 09, Adam Tauno Williams wrote:

 On Tue, 2009-07-21 at 11:57 -0400, Matt Selsky wrote:
  On Jul 21, 2009, at 10:43 AM, Carsten Hoeger wrote:
  
   attached the patch to add regex pattern matching to folders for  
   ipurge.
  
  Can you add this to bugzilla for tracking?
 
 Was this ever uploaded to the bugzilla?

Yes: https://bugzilla.andrew.cmu.edu/show_bug.cgi?id=3167

-- 
With best regards,

Carsten Hoeger


pgpoi9AArh3Vz.pgp
Description: PGP signature

Cyrus Home Page: http://cyrusimap.web.cmu.edu/
Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html

Patch: add regex support to ipurge to improve folder selection

2009-07-21 Thread Carsten Hoeger
Hi,


attached the patch to add regex pattern matching to folders for ipurge.



-- 
With best regards,

Carsten Hoeger
diff -urN cyrus-imapd-2.3.7.orig/imap/ipurge.c cyrus-imapd-2.3.7/imap/ipurge.c
--- cyrus-imapd-2.3.7.orig/imap/ipurge.c	2009-07-21 10:43:19.0 +0200
+++ cyrus-imapd-2.3.7/imap/ipurge.c	2009-07-21 10:43:43.0 +0200
@@ -68,6 +68,9 @@
 #include xmalloc.h
 #include mboxlist.h
 
+#include sys/types.h
+#include regex.h
+
 /* config.c stuff */
 const int config_need_data = CONFIG_NEED_PARTITION_DATA;
 
@@ -85,6 +88,8 @@
 int skipflagged = 0;
 int datemode = OFFSET_SENTDATE;
 int invertmatch = 0;
+char* regpattern = NULL;
+int notpattern = 0;
 
 /* for statistical purposes */
 typedef struct mbox_stats_s {
@@ -115,11 +120,17 @@
 
   if (geteuid() == 0) fatal(must run as the Cyrus user, EX_USAGE);
 
-  while ((option = getopt(argc, argv, C:hxd:b:k:m:fsXi)) != EOF) {
+  while ((option = getopt(argc, argv, C:hxd:b:k:m:fsXip:n)) != EOF) {
 switch (option) {
 case 'C': /* alt config file */
   alt_config = optarg;
   break;
+case 'p':
+  regpattern = optarg;
+  break;
+case 'n':
+  notpattern = 1;
+  break;
 case 'd': {
   if (optarg == 0) {
 	usage(argv[0]);
@@ -211,7 +222,7 @@
 
 int
 usage(char *name) {
-  printf(usage: %s [-f] [-s] [-C alt_config] [-x] [-X] [-i] {-d days | -b bytes|-k Kbytes|-m Mbytes}\n\t[mboxpattern1 ... [mboxpatternN]]\n, name);
+  printf(usage: %s [-f] [-s] [-C alt_config] [-x] [-X] [-i] [-p pattern] [-n] {-d days | -b bytes|-k Kbytes|-m Mbytes}\n\t[mboxpattern1 ... [mboxpatternN]]\n, name);
   printf(\tthere are no defaults and at least one of -d, -b, -k, -m\n\tmust be specified\n);
   printf(\tif no mboxpattern is given %s works on all mailboxes\n, name);
   printf(\t -x specifies an exact match for days or size\n);
@@ -219,6 +230,8 @@
   printf(\t -s skip over messages that are flagged.\n);
   printf(\t -X use delivery time instead of date header for date matches.\n);
   printf(\t -i invert match logic: -x means not equal, date is for newer, size is for smaller.\n);
+  printf(\t -p pattern apply an additional regex pattern to mailbox.\n);
+  printf(\t -n negate pattern specified with -p (not matches).\n);
   exit(0);
 }
 
@@ -237,12 +250,31 @@
 
   memset(stats, '\0', sizeof(mbox_stats_t));
 
-  if (verbose) {
-  char mboxname[MAX_MAILBOX_NAME+1];
+  char mboxname[MAX_MAILBOX_NAME+1];
+  /* Convert internal name to external */
+  (*purge_namespace.mboxname_toexternal)(purge_namespace, name,
+	 cyrus, mboxname);
+  if( regpattern != NULL ) {
+#define BLEN 512
+char regerrbuf[BLEN];
+regex_t preg;
+int ret;
+if( (ret=regcomp(preg, regpattern, REG_EXTENDED)) ) {
+  syslog(LOG_ERR, regcomp failed on mboxname %s: %s, name,regerror(ret, preg, regerrbuf, BLEN));
+  return 1;
+}
+
+ret = regexec(preg, mboxname, 0, NULL, 0);
+if( ret ) {
+  if( !notpattern )
+	return 0;
+} else {
+  if( notpattern )
+	return 0;
+}
+  }
 
-  /* Convert internal name to external */
-  (*purge_namespace.mboxname_toexternal)(purge_namespace, name,
-	 cyrus, mboxname);
+  if (verbose) {
   printf(Working on %s...\n, mboxname);
   }
 
diff -urN cyrus-imapd-2.3.7.orig/man/ipurge.8 cyrus-imapd-2.3.7/man/ipurge.8
--- cyrus-imapd-2.3.7.orig/man/ipurge.8	2009-07-21 10:43:19.0 +0200
+++ cyrus-imapd-2.3.7/man/ipurge.8	2009-07-21 10:57:16.0 +0200
@@ -75,6 +75,14 @@
 ]
 .br
[
+.B \-p
+.I regex-pattern
+]
+[
+.B \-n
+]
+.br
+   [
 .IR mailbox-pattern ...
 ]
 .SH DESCRIPTION
@@ -128,6 +136,17 @@
 .TP
 .B \-s
 Skip over messages that have the \\Flagged flag set.
+.TP
+.B \-p
+Specify an additional
+.IR regex (7)
+pattern to limit the mailbox(es) where to apply the requested operation. All mailboxes matching
+the \fImailbox-pattern\fR as specified above must also match this addtional expression, if specified.
+.TP
+.B \-n
+Negate the expression as specified with -p. All mailboxes matching the
+\fImailbox-pattern\fR as specified above must \fBNOT\fR match this addtional expression.
+.TP
 .SH FILES
 .TP
 .B /etc/imapd.conf


pgpKSwGhWdWxw.pgp
Description: PGP signature

Cyrus Home Page: http://cyrusimap.web.cmu.edu/
Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html

how to exclude subfolder from expiration using annotations?

2009-07-20 Thread Carsten Hoeger
Hi,


I'm currently trying to find out how to use cyr_expire in combination with
annotations exluding one single subfolder per mailbox.

I'm running RHEL5 with v2.3.7-Invoca-RPM-2.3.7-2.el5_3.2.

What I did:

. setannotation user/test1001 /vendor/cmu/cyrus-imapd/expire 
(value.shared 1)
. OK Completed

. getannotation user/test1001 /vendor/cmu/cyrus-imapd/expire value.shared
* ANNOTATION user/test1001 /vendor/cmu/cyrus-imapd/expire (value.shared 
1)
. OK Completed

Now I want to exclude the Sent Items folder from expiring, so I did

. setannotation user/test1001/Sent Items /vendor/cmu/cyrus-imapd/expire 
(value.shared NIL)
. OK Completed

But that does not work:

$ su - cyrus -c '/usr/lib/cyrus-imapd/cyr_expire -E 3 -v'
expiring messages in user.test1001 older than 1 days
expiring messages in user.test1001.Drafts older than 1 days
expiring messages in user.test1001.Junk older than 1 days
expiring messages in user.test1001.Sent Items older than 1 days
expiring messages in user.test1001.Trash older than 1 days
expiring messages in user.test1001.confirmed-ham older than 1 days
expiring messages in user.test1001.confirmed-spam older than 1 days
expiring messages in user.test1001.subfolder older than 1 days
expiring messages in user.test1001.subfolder.subsubfolder older than 1 days
expiring messages in user.test1001.subfolder.subsubfolder.subsubsubfolder older 
than 1 days

In the cyr_expire manpage I read:


[...]

The  value  of  the /vendor/cmu/cyrus-imapd/expire annotation is inherited by
all children of the given mailbox, so an entire mailbox tree can be expired by
seting a single annotation on the root of that tree.  If a mailbox does not
have a /vendor/cmu/cyrus-imapd/expire annotation set on it (or does not
inherit then no messages are expired from the mailbox.

[...]

I found no further resources describing how to achieve what I want.
Is that possible at all?

-- 
With best regards,

Carsten Hoeger


pgpzXLfNYVuz5.pgp
Description: PGP signature

Cyrus Home Page: http://cyrusimap.web.cmu.edu/
Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html

Re: how to exclude subfolder from expiration using annotations?

2009-07-20 Thread Carsten Hoeger
On Mon, Jul 20, Reinaldo de Carvalho wrote:

  I'm currently trying to find out how to use cyr_expire in combination with
  annotations exluding one single subfolder per mailbox.

[...]

 Don't set expire for user (root) mailbox, only to user/test1001/Sent Items.

I want to _EXCLUDE_ user/test1001/Sent Items and not the other way around.

I want to expire everything BUT user/test1001/Sent Items.
 

-- 
With best regards,

Carsten Hoeger


pgpVjjpJLOyOK.pgp
Description: PGP signature

Cyrus Home Page: http://cyrusimap.web.cmu.edu/
Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html

Re: how to exclude subfolder from expiration using annotations?

2009-07-20 Thread Carsten Hoeger
On Mon, Jul 20, Reinaldo de Carvalho wrote:

   I'm currently trying to find out how to use cyr_expire in combination 
   with
   annotations exluding one single subfolder per mailbox.
 
  [...]
 
  Don't set expire for user (root) mailbox, only to user/test1001/Sent 
  Items.
 
  I want to _EXCLUDE_ user/test1001/Sent Items and not the other way around.
 
 
 Do you try set annotattion for user/test1001/Sent Items with high
 value (not to be reached)?

No.
Instead I wrote a patch for ipurge to accept a regex pattern to include or NOT
to include folders matching that pattern.

I'll send the patch as soon as I'm done.

-- 
With best regards,

Carsten Hoeger


pgpEmYihBslCc.pgp
Description: PGP signature

Cyrus Home Page: http://cyrusimap.web.cmu.edu/
Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html

Re: Sieve: Vacation not working

2009-05-27 Thread Carsten Hoeger
On Wed, May 27, Garry wrote:

  Also, the logfile created by this line:
  [..]
  doesn't show up right away either ...

 Actually, I just noticed that timsieved of course isn't even the process
 responsible for doing any filtering, but only for doing the back-end
 script stuff ... so I added the -D to the lmtpd line, which I _assume_
 (please correct me if I'm wrong) is the process that actually should be
 doing the sieve checking and processing ... anyway, there was no sign
 that lmtpd attempted to do any sendmail interaction ...

AFAIR the Mail headers must contain the addresses you specified in the
vacation rules. Did you check that?

Also keep in mind, that vacation mail is not sent, when sender and recipient
are the same.

-- 
With best regards,

Carsten Hoeger


pgplHmVSCKyux.pgp
Description: PGP signature

Cyrus Home Page: http://cyrusimap.web.cmu.edu/
Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html

Re: Bulk installation of sieve filters

2009-03-16 Thread Carsten Hoeger
On Mon, Mar 16, Andres Tarallo wrote:

 I have an installation with about 2000 mailboxes. Now we want to send all
 the mails tagged as SPAM (by spamassassin) to the spam folder.
 
 I'm trying to automate the process of doing that job. I know how to create
 in bulk the spam folder. But I can't find if it's possible to do such work
 with sieve.
 
 Thanks in advance. Apologize poor English

1. write you sieve script and test/upload it for one mailbox.
2. copy the script sourcecode into the subdirectory /var/lib/sieve/[...]
   (depends on distribution which is in use)
3. run masssievec to compile a bunch of scrips into bytecode

-- 
With best regards,

Carsten Hoeger


pgpi83rDJMeTo.pgp
Description: PGP signature

Cyrus Home Page: http://cyrusimap.web.cmu.edu/
Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html

Re: version on header

2006-02-15 Thread Carsten Hoeger
On Wednesday, 15. February 2006 04:07 Diego Ventrice wrote:

 Does anybody know how to get Cyrus version off from emails headers ?

Using postfix you could get rid of it using header_checks(5) and the IGNORE 
fetaure e.g. like this:

/^.*Cyrus.*$/  IGNORE


-- 
mit freundlichen Gruessen/with best regards,

Carsten Hoeger

Cyrus Home Page: http://asg.web.cmu.edu/cyrus
Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html


Re: More than 2GB quotas

2005-08-30 Thread Carsten Hoeger
On Tue, Aug 30, Simon Matter wrote:

The cyrus22 debian packages have been released into the 'experimental'
 
 While we are at it, could one of the debian package maintainers provide a
 large quota patch? I didn't manage to backport the code from 2.3 and it
 seems it has been done for the debian package. The problem is that deb
 source packages don't contain multiple patches but contain a single large
 patch instead, which makes it impossible to extract just a single patch.

If you also accept patches from a non-debian maintainer, you can use this one:

ftp://ftp.suse.com/pub/people/choeger/SLES9/cyrus-imapd-22-sles9-64bit-quota/source/64bit_quota.patch

I created it using Kens instructions from

https://bugzilla.andrew.cmu.edu/show_bug.cgi?id=1212#c13

-- 
With best regards,

Carsten Hoeger


pgp0lRa5bhkhV.pgp
Description: PGP signature

Cyrus Home Page: http://asg.web.cmu.edu/cyrus
Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html

Re: More than 2GB quotas

2005-08-30 Thread Carsten Hoeger
On Tue, Aug 30, Ondrej Sury wrote:

  I created it using Kens instructions from
  
  https://bugzilla.andrew.cmu.edu/show_bug.cgi?id=1212#c13
 
 Is there a reason why you dropped LONG LONG checks?  I am not sure if
 all archs in Debian has support for long long datatype (mips?), so I am
 unsure if I can use your patch directly.

You are probably right. I don't remember, why I dropped that check. It might
be because I did not need it.

-- 
With best regards,

Carsten Hoeger


pgpyb6y9HuT8U.pgp
Description: PGP signature

Cyrus Home Page: http://asg.web.cmu.edu/cyrus
Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html

cyrus-imapd 2.2 and timsieved problems

2005-08-23 Thread Carsten Hoeger
Hi,

I'm unable to do a successfull PLAIN authentication with timsieved on
cyrus-imapd 2.2 (tried with 2.2.3 and 2.2.12).

I've no problem to authenticate with timsieved of 2.1.16, however.

I have a test user called choeger with password system. I'm able to
authenticate against imapd without problems:

telnet localhost imap
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
* OK d141 Cyrus IMAP4 v2.2.3 server ready
. auth plain 
. BAD Please login first
. authenticate plain
+ 
Y2hvZWdlcgBjaG9lZ2VyAHN5c3RlbQ==
. OK Success (no protection)

(Note: I enabled PLAIN without using TLS/SSL in removing SASL_SEC_NOPLAINTEXT
 from secprops in imapd.c)

The same authstring does not work with timsieved:

telnet localhost sieve
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
IMPLEMENTATION Cyrus timsieved v2.2.3
SASL LOGIN PLAIN
SIEVE fileinto reject envelope vacation imapflags notify subaddress
relational regex
OK
AUTHENTICATE PLAIN {33+}
Y2hvZWdlcgBjaG9lZ2VyAHN5c3RlbQ==
NO Authentication Error
Connection closed by foreign host.


On an old server running 2.1.16 it works:

telnet imapdevel sieve
Trying 10.10.0.9...
Connected to imapdevel.
Escape character is '^]'.
IMPLEMENTATION Cyrus timsieved v2.1.16
SASL LOGIN PLAIN
SIEVE fileinto reject envelope vacation imapflags notify subaddress
relational regex
STARTTLS
OK
AUTHENTICATE PLAIN {33+}
Y2hvZWdlcgBjaG9lZ2VyAHN5c3RlbQ==
OK


Even worse: When I use sieveshell to contact timsieved of cyrus-imapd 2.2,
timsieved segfaults. This is the ethereal captured protocol:


IMPLEMENTATION Cyrus timsieved v2.2.3
SASL LOGIN PLAIN
SIEVE fileinto reject envelope vacation imapflags notify subaddress
relational regex
OK
AUTHENTICATE LOGIN
{12}
VXNlcm5hbWU6
{12+}
Y2hvZWdlcg==
{12}
UGFzc3dvcmQ6
{12+}
U2FsYWhtMQ==
NO Authentication Error
AUTHENTICATE PLAIN {32+}
Y2hvZWdlcgBjaG9lZ2VyAFNhbGFobTE=
NO Authentication Error
OK Logout Complete

And then, timsieved segfaults.

This is the backtrace of timsieved:

#1  0x40035617 in sasl_server_start (conn=0x8138728, mech=0x81344e4 PLAIN, 
clientin=0x817d860 choeger, clientinlen=22, serverout=0xbfffc6c8, 
serveroutlen=0xbfffc6c4) at server.c:1303
#2  0x0805156c in cmd_authenticate (sieved_out=0x8134298, sieved_in=0x8134228, 
mechanism_name=0x81344e0, initial_challenge=0x817db78, errmsg=0xbfffd748)
at parser.c:524
#3  0x08050d8d in parser (sieved_out=0x8134298, sieved_in=0x8134228)
at parser.c:181
#4  0x0805051e in cmdloop () at timsieved.c:163
#5  0x0805099f in service_main (argc=1, argv=0x8132008, envp=0xb51c)
at timsieved.c:289
#6  0x0804db0f in main (argc=1, argv=0xb514, envp=0xb51c)
at service.c:546


The code in line 1303 of lib/server.c (that's sourcecode of cyrus-sasl version
2.1.18, most recent version == same behaviour):

s_conn-mech-plug-mech_dispose(conn-context,
 s_conn-sparams-utils);

Using a debugger shows, that s_conn-mech-plug-mech_dispose() points to 0 in
that case.

I'm currently trying to find out, where the problem is. I can't say, that I am
a SASL expert, so any help is appreciated.

-- 
With best regards,

Carsten Hoeger


pgplmv3TDCNPJ.pgp
Description: PGP signature

Cyrus Home Page: http://asg.web.cmu.edu/cyrus
Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html

How to update cyrus db to BerkeleyDB 4.3?

2005-02-04 Thread Carsten Hoeger
Hi,

I'm trying to find out how to convert configdirectory/db/ from BerkeleyDB 4.2
to the 4.3 version. I tried to do what's written in

http://www.sleepycat.com/docs/ref/upgrade/process.html

with a little helper program implemented to convert openldap2 db backend from
4.2 to 4.3 without success.

The only chance I had was to remove configdirectory/db/*

Does anybody know, how to do that conversion?

-- 
With best regards,

Carsten Hoeger


pgp4lRte40qc8.pgp
Description: PGP signature


Re: pop3[6358]: error sending to idled: 2

2004-11-15 Thread Carsten Hoeger
On Sat, Nov 13, Johan Barelds wrote:

 After i upgraded Cyrus-imap 2.2.8-6 i got the following message in my message 
 log:
 
 --
 Nov 13 21:52:56 beast pop3[8196]: error sending to idled: 2
 --
 
 I happens after someone pop's his email via cyrus pop3.
 Anyone a clue what this could be?

Your cyrus-imapd 2.2.8 has support for idled.
Simply enable it in /etc/cyrus.conf

-- 
With best regards,

Carsten Hoeger


pgp0Ro9r2J7Bp.pgp
Description: PGP signature


Re: Cyrus 2.2.x and a tool how to see which users are logged in

2004-10-18 Thread Carsten Hoeger
On Fri, Oct 15, Marc-Christian Petersen wrote:

 is there any tool available or any method how to see which users are loggged 
 in via IMAP/POP3? I need this to see if a user is currently connected or not 
 to be able to deny mailbox renaming or not.

$localstatedir/imap/proc/ contains connection information, but it only shows
user information, if a user SELECTed a specific mailbox.


-- 
With best regards,

Carsten Hoeger


pgpSITbdPwnJV.pgp
Description: PGP signature


Re: Getting vacation to run under cyrus-imapd 2.2.6 and cyrus-imapd 2.2.8

2004-08-23 Thread Carsten Hoeger
On Fri, Aug 20, Sujit Choudhury wrote:

 We are running SuSE 8.1 and I understand people had problem with this
 version. We are using name space as follows: user/johndoe; user/johndoe/Sent
 Mail etc.  Kendrik Vargas inform me that sendmail parameter was required and
 since then vacation DOES WORK when there is just one hop to the mail, but
 whenever there is multiple hops it seems to fail.We are running out of
 ideas.  Can anybody help?

Please note that cyrus-sieve does only autoreply, if the ENVELOPE-FROM address
is different to the final recipient!

If you are automatically FORWARDING messages, the envelope from address is
normaly changed to the users account, which is forwarding the mail (e.g. when
using .forward) and in this case, sieve will NOT respond!

-- 
With best regards,

Carsten Hoeger


pgpDM7Rwu5IYT.pgp
Description: PGP signature


Re: Patch help, new cyrus-imapd

2004-07-30 Thread Carsten Hoeger
On Fri, Jul 30, Anders Norrbring wrote:

 I'm working on adapting cyrus-imapd 2.2.8 for use with SuSE 9.1, and I've
 ran into a patch that I can't make up my mind about..
 
 Can somebody please help me out?  Is it at all needed, and if so, how should
 I adapt it to the new cyrus-imapd?  The code is heavily updated since v2.2.3
 that the patch is originally intended for.

This is my latest version (untested)

-- 
With best regards,

Carsten Hoeger
--- imap/lmtpengine.c
+++ imap/lmtpengine.c   2004/05/31 12:24:07
@@ -817,6 +817,8 @@
 address_data_t *ret = (address_data_t *) xmalloc(sizeof(address_data_t));
 int forcedowncase = config_getswitch(IMAPOPT_LMTP_DOWNCASE_RCPT);
 int quoted, detail;
+char *luser_relay = NULL;
+int has_luser_relay = 0;
 
 assert(addr != NULL  msg != NULL);
 
@@ -873,6 +875,13 @@
 }
 *dest = '\0';

+luser_relay = config_getstring(IMAPOPT_LMTP_LUSER_RELAY);
+if( luser_relay ) {
+  if( !verify_user(luser_relay, NULL, NULL, ignorequota ? -1 : msg-size, 
msg-authstate) ) {
+  has_luser_relay = 1;
+  }
+}
+
 /* make a working copy of rcpt */
 ret-user = ret-rcpt = xstrdup(rcpt);
 
@@ -898,12 +907,17 @@
 r = verify_user(ret-user, ret-domain, ret-mailbox,
ignorequota ? -1 : msg-size, msg-authstate);
 if (r) {
-   /* we lost */
-   free(ret-all);
-   free(ret-rcpt);
-   free(ret);
-   return r;
+   if( r == IMAP_MAILBOX_NONEXISTENT  has_luser_relay ) {
+   ret-user = xstrdup(luser_relay);
+   } else {
+   /* we lost */
+   free(ret-all);
+   free(ret-rcpt);
+   free(ret);
+   return r;
+   }
 }
+
 ret-ignorequota = ignorequota;
 
 msg-rcpt[msg-rcpt_num] = ret;
--- lib/imapoptions
+++ lib/imapoptions 2004/05/31 11:57:52
@@ -837,6 +837,10 @@
to set this to yes, especially if OpenLDAP is used as authentication
source. */
 
+{ lmtp_luser_relay, NULL, STRING }
+/* Send mail to mailboxes, which do not exists, to this user. NOTE: This must
+   be an existing local mailbox name. NOT an email address! */
+
 /*
 .SH SEE ALSO
 .PP


pgp49rQA6UonL.pgp
Description: PGP signature


Re: decrease log verbosity

2004-06-30 Thread Carsten Hoeger
On Tue, Jun 29, Ken Murchison wrote:

 Is there any way to decrease the syslog messages verbosity?
 
 E.g., for each message i get about 9 syslog messages about lmtpunix. I
 wonder if there's a config flag or something to discard all of them with
 the exception of either duplicate_check or duplicate_mark. The reason i
 want to keep one of these is that they contain the destination folder of
 the message.
 
 Logging is handled by syslog.  Adjust your settings for the local6 
 facility in syslog.conf.

Well, you must admit that cyrus-imapd/cyrus-sasl are two of a VERY limited set
of software packages, which us syslog to configure different debugging levels.
That's for sure a little bit strange... :-)
I heard about a lot of complaints already for this reason.

But to provide a cure:

Use syslog-ng. It allows to filter log messages by regular expressions.

If you need an example configuration, here it is:

ftp://ftp.suse.com/pub/people/choeger/SLOX/syslog-ng2slox/

-- 
With best regards,

Carsten Hoeger


pgpvFjZc2Cmpk.pgp
Description: PGP signature


minimum poptimeout value to high in case of client connection loss

2004-06-24 Thread Carsten Hoeger
Hi,

on a setup with lots of roaming users, the following happens frequently:

- users are logging in using pop3
- users connection breaks down or
  users client breaks down (so the tcp session is not terminated)
- user tries to login again
- mailbox of user is locked for poptimeout minutes

10 minutes is a very long time to wait to be able to access mail again.
Is there a specific reason, why this minimum is that high?

-- 
With best regards,

Carsten Hoeger


pgpfdNfarv0KZ.pgp
Description: PGP signature


RFC: OpenSLP support in cyrus-imapd (+patch)

2004-02-17 Thread Carsten Hoeger
Hi,


I need cyrus-imapd to register it's services to an slp daemon, if it is
running.

I prepared a patch against 2.2.3 using calls to functions of libslp of the
OpenSLP project:

http://www.openslp.org/


[...]

What is SLP?

Service Location Protocol is an IETF standards track protocol that
provides a framework to allow networking applications to discover the
existence, location, and configuration of networked services in enterprise
networks. (click here for full introduction )

http://www.openslp.org/#What%20is%20SLP?

[...]

I patched only master/master.c master/Makefile.in and configure.in similar to
what contrib/drac_auth.patch does.

The SLP behaviour is currently not configurable with my patch, but usually,
that should not be neccessary, as a SLPRegister() call will just quickly come
back in case of no running slpd instance.

Also the server name of the service url should maybe be configurable like with
servername in imapd.conf.

The patch is attached.
In case of common interest, I'll submit it also to bugzilla.andrew.cmu.edu.

Btw.: Is there a specific reason, why the drac_auth patch is still not
  integrated?

-- 
With best regards,

Carsten Hoeger
--- configure.in
+++ configure.in2004/02/17 14:15:49
@@ -950,6 +950,19 @@
 SNMP_SUBDIRS=
 AC_SUBST(SNMP_SUBDIRS)
 
+dnl
+dnl Test for OpenSLP
+dnl
+SLPLIBS=
+AC_ARG_WITH(openslp, [  --with-openslp=DIR use OpenSLP library in DIR [no] 
],
+   if test -d $withval; then
+   LDFLAGS=$LDFLAGS -L${withval}
+   AC_CHECK_LIB(slp, SLPOpen,
+   AC_DEFINE(USE_SLP,[],[Compile with OpenSLP?])
+   SLPLIBS=-lslp)
+   fi)
+AC_SUBST(SLPLIBS)
+
 CMU_LIBWRAP
 CMU_UCDSNMP
 
--- master/Makefile.in
+++ master/Makefile.in  2004/02/17 14:09:47
@@ -58,7 +58,7 @@
 
 CFLAGS = @CFLAGS@
 LDFLAGS = @LDFLAGS@ @COM_ERR_LDFLAGS@
-LIBS = ../lib/libcyrus_min.a @LIB_UCDSNMP@ @LIBS@ @COM_ERR_LIBS@
+LIBS = ../lib/libcyrus_min.a @LIB_UCDSNMP@ @LIBS@ @COM_ERR_LIBS@ @SLPLIBS@
 
 SHELL = /bin/sh
 MAKEDEPEND = @MAKEDEPEND@
--- master/master.c
+++ master/master.c 2004/02/17 15:49:46
@@ -97,6 +97,10 @@
 
 #endif
 
+#ifdef USE_SLP
+#include slp.h
+#endif
+
 #include masterconf.h
 
 #include master.h
@@ -106,6 +110,16 @@
 
 #include xmalloc.h
 
+#ifdef USE_SLP
+#define URL_MAX 1024
+SLPHandle  phslp;
+struct slpurl {
+char srvurl[URL_MAX];
+struct slpurl *next;
+};
+struct slpurl *start = NULL;
+#endif
+
 enum {
 become_cyrus_early = 1,
 child_table_size = 1,
@@ -161,10 +175,41 @@
 void limit_fds(rlim_t);
 void schedule_event(struct event *a);
 
+#ifdef USE_SLP
+void SLPRegReportCB(SLPHandle hslp, SLPError errcode, void* cookie)
+{
+/* return the error code in the cookie */
+*(SLPError*)cookie = errcode;
+
+/* You could do something else here like print out  */
+/* the errcode, etc.  Remember, as a general rule,  */
+/* do not try to do too much in a callback because  */
+/* it is being executed by the same thread that is  */
+/* reading slp packets from the wire.   */
+}
+
+void SLPshutdown(void)
+{ 
+struct slpurl *ttmp,*tmp = start;
+SLPError callbackerr;
+while( tmp ) {
+   syslog(LOG_INFO,SLPderegister [%s],tmp-srvurl);
+   SLPDereg(phslp, tmp-srvurl, SLPRegReportCB, callbackerr);
+   ttmp = tmp;
+   tmp = tmp-next;
+   free(ttmp);
+}
+SLPClose(phslp);
+}
+#endif
+
 void fatal(const char *msg, int code)
 {
 syslog(LOG_CRIT, %s, msg);
 syslog(LOG_NOTICE, exiting);
+#ifdef USE_SLP
+SLPshutdown();
+#endif
 exit(code);
 }
 
@@ -475,7 +520,90 @@
s-socket = 0;
continue;
}
-   
+
+#ifdef USE_SLP
+   if ((!strcmp(s-proto, tcp))  s-listen[0] != '/' ) {
+  SLPError err;
+  SLPError callbackerr;
+  char *listen, *service;
+  char *listen_addr;
+  int port;
+  char hname[URL_MAX];
+  char dname[URL_MAX];
+  char turl[URL_MAX];
+  struct slpurl *u;
+  char registered = 0;
+
+
+  /* parse_listen() and resolve_host() are destructive,
+   * so make a work copy of s-listen
+   */
+  listen = xstrdup(s-listen);
+
+   if ((service = parse_listen(listen)) == NULL) {
+   /* listen IS the port */
+  service = listen;
+  listen_addr = NULL;
+   } else {
+   /* s-listen is now just the address */
+  listen_addr = parse_host(listen);
+  if (*listen_addr == '\0')
+   listen_addr = NULL; 
+   }
+  port = ntohs(((struct sockaddr_in *)(res)-ai_addr)-sin_port);
+  gethostname(hname,URL_MAX);
+  getdomainname(dname,URL_MAX);
+
+  snprintf(turl,URL_MAX,service:%s://%s.%s:%d,
+service,
+hname, dname,
+port);
+
+  /* check, whether we already registered the service

Re: RFC: OpenSLP support in cyrus-imapd (+patch)

2004-02-17 Thread Carsten Hoeger
On Tue, Feb 17, Ken Murchison wrote:

   Btw.: Is there a specific reason, why the drac_auth patch is still not
   integrated?
 
 Because its an outdated hack.  Any recent MTA *should* have SMTP AUTH 
 support and sites *should* be using it instead of DRAC.  If you 
 disagree, then argue with Rob.  ;)

Well, personally I definetely do NOT disagree.
And yes, POP before SMTP is a PITA.

-- 
With best regards,

Carsten Hoeger


pgp0.pgp
Description: PGP signature


Re: PATCH: cyrus-imapd-2.2.3 doesn't use --mandir

2004-02-09 Thread Carsten Hoeger
On Sat, Feb 07, Andreas Winkelmann wrote:

 The ./configure --mandir does not work as excepted. In two Makefile.in's  
 $(prefix)/man will be used instead.

Ahh, well and libdir is also missing in some Makefile.in

https://bugzilla.andrew.cmu.edu/show_bug.cgi?id=2362

-- 
With best regards,

Carsten Hoeger


pgp0.pgp
Description: PGP signature


Re: Altnamespace and cyrus-imapd 2.1.16

2004-02-06 Thread Carsten Hoeger
On Wed, Feb 04, Ken Murchison wrote:

 I think I have backported all of the relevent fixes from 2.2.3.  If you 
 want to try them, you'll want to grab the cyrus-2_1_tail branch from CVS.

Well, that fixes the shared folder Problem.
There's still another strange problem.

A13 LIST  INBOX.%
* LIST (\HasNoChildren) . INBOX.EntwAPw-rfe
* LIST (\HasNoChildren) . INBOX.GelAPY-schte Objekte
* LIST (\HasNoChildren) . INBOX.Gesendete Objekte
* LIST (\HasNoChildren) . INBOX.High Imp
* LIST (\HasNoChildren) . INBOX.Low Imp
* LIST (\HasNoChildren) . INBOX.Message Classes
* LIST (\HasNoChildren) . INBOX.Postausgang
* LIST (\HasNoChildren) . INBOX.RTF Items
* LIST (\HasNoChildren) . INBOX.Receipts
* LIST (\HasNoChildren) . INBOX.SuSE
* LIST (\HasNoChildren) . INBOX.SuSE-Security
* LIST (\Noselect \HasChildren) . INBOX.SuSE
* LIST (\HasChildren) . INBOX.Subfolders
A13 OK Completed (0.000 secs 17 calls)

that's with

altnamespace: no
unixhierarchysep: no

A13 LIST  INBOX.*
* LIST (\HasNoChildren) . INBOX.EntwAPw-rfe
* LIST (\HasNoChildren) . INBOX.GelAPY-schte Objekte
* LIST (\HasNoChildren) . INBOX.Gesendete Objekte
* LIST (\HasNoChildren) . INBOX.High Imp
* LIST (\HasNoChildren) . INBOX.Low Imp
* LIST (\HasNoChildren) . INBOX.Message Classes
* LIST (\HasNoChildren) . INBOX.Postausgang
* LIST (\HasNoChildren) . INBOX.RTF Items
* LIST (\HasNoChildren) . INBOX.Receipts
* LIST (\HasNoChildren) . INBOX.SuSE
* LIST (\HasNoChildren) . INBOX.SuSE-Security
* LIST (\HasNoChildren) . INBOX.SuSE.Suse-Slox
* LIST (\HasChildren) . INBOX.Subfolders
* LIST (\HasChildren) . INBOX.Subfolders.Folder1
* LIST (\HasChildren) . INBOX.Subfolders.Folder1.Folder2
* LIST (\HasNoChildren) . INBOX.Subfolders.Folder1.Folder2.Folder3
A13 OK Completed (0.000 secs 17 calls)

So INBOX.SuSE has children, but is listed as

* LIST (\HasNoChildren) . INBOX.SuSE

and

* LIST (\Noselect \HasChildren) . INBOX.SuSE


-- 
With best regards,

Carsten Hoeger


pgp0.pgp
Description: PGP signature


Re: Altnamespace and cyrus-imapd 2.1.16

2004-02-05 Thread Carsten Hoeger
On Wed, Feb 04, Ken Murchison wrote:

 I think I have backported all of the relevent fixes from 2.2.3.  If you 
 want to try them, you'll want to grab the cyrus-2_1_tail branch from CVS.

I just checked it out.
That pretty looks like it IS 2.2 now. None of my patches apply anymore.
Even the new lib/imapoptions is now in there... :-(

I would be very glad, if you can tell me, what files within 2.1.16 did you
change in order to backport the relevant fixes.


-- 
With best regards,

Carsten Hoeger


pgp0.pgp
Description: PGP signature


Re: Altnamespace and cyrus-imapd 2.1.16

2004-02-05 Thread Carsten Hoeger
On Thu, Feb 05, Ken Murchison wrote:

 I just checked it out.
 That pretty looks like it IS 2.2 now. None of my patches apply anymore.
 Even the new lib/imapoptions is now in there... :-(
 
 Hmm.  That shouldn't be the case.  I just did:
 
 cvs update -r cyrus-2_1-tail
 
 and I don't see any 2.2 stuff.

Yes, you are right.
I just was to dense to use cvs... :-)

-- 
With best regards,

Carsten Hoeger


pgp0.pgp
Description: PGP signature


Re: Cyrus IMAPd 2.2.3 Released

2004-01-21 Thread Carsten Hoeger
On Fri, Jan 16, Ken Murchison wrote:

 What about this issue:
 
 http://asg.web.cmu.edu/archive/message.php?mailbox=archive.info-cyrussearchterm=request%20info%20until%20latermsg=23996
 
 Using 2.2.3 and saslauthd I get the same error.

[...]

 using cyrus-sasl-2.1.7
 
 2.1.7 or 2.1.17?  I just went through the trouble of configuring 
 pam_mysql (0.4.7) for use with saslauthd (2.1.17) and it works fine with 
 Cyrus 2.2.3.  If you share your config, perhaps we can help.

It's saslauthd -a pam using pam_ldap.

And I can only use sasl2.1.7, as I don't have 2.1.17 currently on the platform
I am testing. I was not even able to compile all things together and don't
want to investigate any more time.

I'll try with more recent environment within the next weeks. 

-- 
With best regards,

Carsten Hoeger


pgp0.pgp
Description: PGP signature


Re: Cyrus IMAPd 2.2.3 Released

2004-01-16 Thread Carsten Hoeger
On Thu, Jan 15, Rob Siemborski wrote:

 I'm quite pleased to announce the long-awaited stable release of Cyrus
 IMAPd 2.2.3.  This release contains substantial new features over the 2.1
 series including extensive support for mailbox annotations, NNTP, much
 more stable process accounting, and of course, virtual domains.

What about this issue:

http://asg.web.cmu.edu/archive/message.php?mailbox=archive.info-cyrussearchterm=request%20info%20until%20latermsg=23996

Using 2.2.3 and saslauthd I get the same error.

Process 19491 attached - interrupt to quit
select(1, [0], NULL, NULL, {1480, 44}) = 1 (in [0], left {1477, 98})
time(NULL)  = 1074265801
read(0, . login cyrus secret1\r\n, 4096) = 23
socket(PF_UNIX, SOCK_STREAM, 0) = 10
connect(10, {sa_family=AF_UNIX, path=/var/run/sasl2//mux}, 110) = 0
writev(10, [{\0\5cyrus\0\7secret1\0\4imap\0\0, 24}], 1) = 24
read(10, \0\2, 2) = 2
read(10, OK, 2)   = 2
close(10)   = 0
select(1, [0], NULL, NULL, {0, 0})  = 0 (Timeout)
write(1, . NO Login failed: can\'t request..., 63) = 63
time(NULL)  = 1074265801
select(1, [0], NULL, NULL, {1800, 0}

using cyrus-sasl-2.1.7


-- 
With best regards,

Carsten Hoeger


pgp0.pgp
Description: PGP signature


reconstruct broken in cyrus-imapd-2.1.15

2003-12-17 Thread Carsten Hoeger
Hi,

when the cyrus.* files within a mailbox are missing, reconstruct is no longer
able to create them.

With cyrus-imapd-2.1.9 it works as expected. 2.1.15 prints out the following
message:

user.x: Mailbox has an invalid format 

and does not create them.

-- 
mit freundlichen Gruessen,

Carsten Hoeger


pgp0.pgp
Description: PGP signature


Re: reconstruct broken in cyrus-imapd-2.1.15

2003-12-17 Thread Carsten Hoeger
On Wed, Dec 17, Carsten Hoeger wrote:

 when the cyrus.* files within a mailbox are missing, reconstruct is no longer
 able to create them.
 
 With cyrus-imapd-2.1.9 it works as expected. 2.1.15 prints out the following
 message:
 
 user.x: Mailbox has an invalid format 
 
 and does not create them.

I am currently searching for the bug.
It would be very good to know, where the error message above is printed.
It does not appear to be in reconstruct.c. The above message is defined in
imap_err.c and I guess cyrusdb_strerror() converts the return code to strings.

In mboxlist.c only syslog is used to log errors.


-- 
With best regards,

Carsten Hoeger


pgp0.pgp
Description: PGP signature


Re: reconstruct broken in cyrus-imapd-2.1.15

2003-12-17 Thread Carsten Hoeger
On Wed, Dec 17, Rob Siemborski wrote:

  I am currently searching for the bug.
  It would be very good to know, where the error message above is printed.
  It does not appear to be in reconstruct.c. The above message is defined in
  imap_err.c and I guess cyrusdb_strerror() converts the return code to strings.
 
  In mboxlist.c only syslog is used to log errors.
 
 You definately want to upgrade to 2.1.16, which should fix this.

Ahh, well, that fixed it, thanks.

-- 
With best regards,

Carsten Hoeger


pgp0.pgp
Description: PGP signature


Re: [PATCH] Use INTERNALDATE for ipurge (was: ipurge to use -d as receive date and not sent date)

2003-11-05 Thread Carsten Hoeger
On Tue, Oct 14, Henrique de Moraes Holschuh wrote:

 Please try the attached patch.
 
 It switches default behaviour to least-surprise (INTERNALDATE), adds
 -X to get the old behaviour, and enhances ipurge by adding -i to invert
 match logic.

I am a little bit late on this topic, but I also made a patch and solved it a
little bit different. Btw.: I don't like changing defaults, even if they do
not make a lot of sense.


-- 
With best regards,

Carsten Hoeger
--- imap/ipurge.c   2003/11/04 09:27:08 1.1
+++ imap/ipurge.c   2003/11/05 10:00:05
@@ -77,6 +77,7 @@
 extern int  optopt;
 
 /* globals for callback functions */
+int sent_day = 1;
 int days = -1;
 int size = -1;
 int exact = -1;
@@ -114,7 +115,7 @@
 usage(argv[0]);
   }
 
-  while ((option = getopt(argc, argv, C:hxd:b:k:m:f)) != EOF) {
+  while ((option = getopt(argc, argv, C:hxd:b:k:m:fR)) != EOF) {
 switch (option) {
 case 'C': /* alt config file */
   alt_config = optarg;
@@ -125,6 +126,9 @@
   }
   days = atoi(optarg) * 86400 /* nominal # of seconds in a 'day' */;
 } break;
+case 'R': {
+   sent_day = 0;
+} break;
 case 'b': {
   if (optarg == 0) {
usage(argv[0]);
@@ -192,11 +196,13 @@
 
 int
 usage(char *name) {
-  printf(usage: %s [-f] [-C alt_config] [-x] {-d days | -b bytes|-k Kbytes|-m 
Mbytes}\n\t[mboxpattern1 ... [mboxpatternN]]\n, name);
+  printf(usage: %s [-f] [-C alt_config] [-x] {-d days [-R|-S] | -b bytes|-k 
Kbytes|-m Mbytes}\n\t[mboxpattern1 ... [mboxpatternN]]\n, name);
   printf(\tthere are no defaults and at least one of -d, -b, -k, -m\n\tmust be 
specified\n);
   printf(\tif no mboxpattern is given %s works on all mailboxes\n, name);
   printf(\t -x specifies an exact match for days or size\n);
   printf(\t -f force also to delete mail below user.* and INBOX.*\n);
+  printf(\t -R use received date to purge mails older then -d days\n);
+  printf(\t(default is sent date)\n);
   exit(0);
 }
 
@@ -265,7 +271,11 @@
   bit32 senttime;
   bit32 msgsize;
 
-  senttime = ntohl(*((bit32 *)(buf + OFFSET_SENTDATE)));
+  if( sent_day ) {
+   senttime = ntohl(*((bit32 *)(buf + OFFSET_SENTDATE)));
+  } else {
+   senttime = ntohl(*((bit32 *)(buf + OFFSET_INTERNALDATE)));
+  }
   msgsize = ntohl(*((bit32 *)(buf + OFFSET_SIZE)));
 
   stats-total++;
--- man/ipurge.82003/11/04 09:37:16 1.1
+++ man/ipurge.82003/11/04 10:09:27
@@ -57,6 +57,9 @@
 .br
[
 .BI \-d  days
+[
+.B \-R
+]
 |
 .BI \-b  bytes
 |
@@ -99,6 +102,10 @@
 .BI \-d  days
 Age of message in \fIdays\fR.
 .TP
+.BI \-R
+Use the received date to purge mails in conjunction with \fB-d\fR instead of
+the sent date, which is the default.
+.TP
 .BI \-b  bytes
 Size of message in \fIbytes\fR.
 .TP


pgp0.pgp
Description: PGP signature


ipurge to use -d as receive date and not sent date

2003-10-14 Thread Carsten Hoeger
Hi,

I recently sat down over a customer bug report and found out, that ipurge uses
the sent date (which is what is in the Date: Header of a mail or the offset
OFFSET_SENTDATE) to determine the age of a single message. The problem with
that is, that there's an increasing amount of messages (sort SPAM) with dates
in the far future and therefor these mails won't get deleted using ipurge.

A short look at the source made me try to use OFFSET_INTERNALDATE (from
imap/mailbox.h), which seems to do what I want, deleting mails which had been
received n days ago.

Is that assumption right, or do I have to reckon some strange side effects?

-- 
With best regards,

Carsten Hoeger


pgp0.pgp
Description: PGP signature


Re: ipurge to use -d as receive date and not sent date

2003-10-14 Thread Carsten Hoeger
On Tue, Oct 14, Rob Siemborski wrote:

  I recently sat down over a customer bug report and found out, that ipurge uses
  the sent date (which is what is in the Date: Header of a mail or the offset
  OFFSET_SENTDATE) to determine the age of a single message. The problem with
  that is, that there's an increasing amount of messages (sort SPAM) with dates
  in the far future and therefor these mails won't get deleted using ipurge.
 
  A short look at the source made me try to use OFFSET_INTERNALDATE (from
  imap/mailbox.h), which seems to do what I want, deleting mails which had been
  received n days ago.
 
  Is that assumption right, or do I have to reckon some strange side effects?
 
 This will probably do what you want.
 
 If a patch was supplied to make this be handled by a command-line option,
 we'd probably take it (it shouldn't be that much work).

Yes.
It's quite simple, but I don't want to do it without asking.
I'll submit it if it is ready.

-- 
With best regards,

Carsten Hoeger


pgp0.pgp
Description: PGP signature


Re: Please help! Probs with cyrus-imapd 2.1.9 and db3 - DBERROR db3: Unable to allocate memory

2002-11-18 Thread Carsten Hoeger
On Mon, Nov 18, Marc Sebastian Pelzer wrote:

 i successfully compiled cyrus-imapd 2.1.9 with SASL 2.1.9 and Berkeley
 DB 3.1.17 on a Sun Sparc 10 with SuSE 7.3 and 128MB RAM and get the
 following errors in /var/log/messages after starting the
 '/usr/cyrus/bin/master' process and try to test it via 'telnet
 prime 143'. Telnet opens the connection and then 'hangs' - no
 prompt from the imap-Server.
 
 I read the mailinglist-archives, searched the SuSE Help-DB and read the
 FAQ's but didnt find anything that solves the problem. I only found
 questions from users with the same problem - but no answers.
 
 Please help! :)

You need the attached patch for the bdb3.

-- 
With best regards,

Carsten Hoeger

SuSE, The Linux Experts, http://suse.com - http://unitedlinux.com

--- db-3.1.17/./lock/lock_region.c~ Tue May 30 04:31:14 2000
+++ db-3.1.17/./lock/lock_region.c  Tue Mar 19 14:22:14 2002
@@ -686,17 +686,17 @@
 * map one-to-one with the __db_shalloc calls in __lock_init.
 */
retval = 0;
-   retval += ALIGN(sizeof(DB_LOCKREGION) + gb, 1);
-   retval += ALIGN(dbenv-lk_modes * dbenv-lk_modes + gb, 1);
-   retval += ALIGN(nelements * (sizeof(DB_HASHTAB) + gb), 1);
-   retval += ALIGN(nelements * (sizeof(DB_HASHTAB) + gb), 1);
+   retval += ALIGN(sizeof(DB_LOCKREGION) + gb, sizeof(db_align_t));
+   retval += ALIGN(dbenv-lk_modes * dbenv-lk_modes + gb, sizeof(db_align_t));
+   retval += ALIGN(nelements * (sizeof(DB_HASHTAB) + gb), sizeof(db_align_t));
+   retval += ALIGN(nelements * (sizeof(DB_HASHTAB) + gb), sizeof(db_align_t));
for (i = 0; i  nlocks; ++i)
retval +=
ALIGN(sizeof(struct __db_lock) + gb , MUTEX_ALIGN);
for (i = 0; i  nlocks; ++i)
-   retval += ALIGN(sizeof(DB_LOCKOBJ) + gb , 1);
+   retval += ALIGN(sizeof(DB_LOCKOBJ) + gb , sizeof(db_align_t));
for (i = 0; i  nlocks; ++i)
-   retval += ALIGN(sizeof(DB_LOCKER) + gb , 1);
+   retval += ALIGN(sizeof(DB_LOCKER) + gb , sizeof(db_align_t));
 
/*
 * Aproximate the memory allocation overhead.  This breaks the




msg09290/pgp0.pgp
Description: PGP signature


Re: Please help! Probs with cyrus-imapd 2.1.9 and db3 - DBERROR db3: Unable to allocate memory

2002-11-18 Thread Carsten Hoeger
On Mon, Nov 18, Marc Sebastian Pelzer wrote:

  You need the attached patch for the bdb3.
 
 I apply the patch and 'make clean'  re-compile db3, SASL and imapd but
 it doesnt work for me:
 
 Nov 18 17:08:55 prime master: setrlimit: Unable to set file descriptors
 limit to 2147483647: Operation not permitted Nov 18 17:08:55 prime
 master[7532]: process started Nov 18 17:08:55 prime master[7533]: about
 to exec /usr/cyrus/bin/ctl_cyrusdb Nov 18 17:08:55 prime
 ctl_cyrusdb[7533]: recovering cyrus databases Nov 18 17:08:59 prime
 ctl_cyrusdb[7533]: DBERROR db3: Unable to allocate memory for the lock
 table

Sure that you installed the recompiled sasl libraries?

-- 
mit freundlichen Gruessen,

Carsten Hoeger

SuSE Linux AG, - The Linux Experts - Nuernberg, Germany
http://www.suse.de   -   http://www.unitedlinux.com 



msg09303/pgp0.pgp
Description: PGP signature


Re: default port of sieve

2002-04-26 Thread Carsten Hoeger

On Fri, Apr 26, Simon Matter wrote:

  Since SuSE 8.0 in /etc/services  is defined as the sieve port.
  
  the php-sieve lib uses 2000.
  
  Which is correct? SuSE or php-sieve?
  
  thanks a lot
  
  rgds
  
  Luc
 
 Sieve uses 2000:
 
 sieve   2000/tcp# Sieve mail filter

G.
It seems that I mixed the RFC number with the port number... :-(

Sorry for that.

-- 
With best regards,

Carsten Hoeger

SuSE, The Linux Experts, http://www.suse.com

Key fingerprint = E3B6 7FDB 4800 0F22 DC09  EB2B 7988 B6A8 6691 C94A



msg07393/pgp0.pgp
Description: PGP signature


Re: spaces around uid

2002-02-22 Thread Carsten Hoeger

On Thu, Feb 21, Henrique de Moraes Holschuh wrote:

 The RFCs ask for case insensitiveness. MTAs are often configured to be
 case-insensitive as well.

Right.
 
 Actually, I welcome that patch very very much. It will put an end to our
 lusers doing braindead stuff in their imap clients.
 
 I would like (and I will probably code it sooner or later) Cyrus to force
 ALL folder and usernames to lowercase, always.  If I code it, it will be a
 config option, of course :)

Yes. Would be better, to make that configurable.

-- 
With best regards,

Carsten Hoeger

SuSE, The Linux Experts, http://www.suse.com

Key fingerprint = E3B6 7FDB 4800 0F22 DC09  EB2B 7988 B6A8 6691 C94A



msg06151/pgp0.pgp
Description: PGP signature


spaces around uid

2002-02-21 Thread Carsten Hoeger

Hi,

we noticed, that cyrus-imapd allows users to prepend or append
whitespaces to their uid like this:

. loginuser   secret

cyrus-imapd hand's over this string as is to the underlying
authentication system. In case of pam with pam_ldap, this results in a
DN like this:

uid=   user  ,dc=some,dc=dom

which will then be normalized by OpenLDAP to

uid=user,dc=some,dc=dom

and will give a successfull authentication... :-(

Another point is, that the uid attribute is caseINsensitve as defined
in the core openldap schema, which makes things even harder:

. loginuSer   secret

would be the same as 

. loginuser   secret

for openldap in this case.

Most mailclients would then notice, that there is no inbox -because
imapd is now looking into /var/imap/user/   uSer  / which currently
does not exist. Then they issue a create inbox command and voila, we
have a new directory called /var/imap/user/   uSer  /.

So I wrote a small patch for the auth_canonifyid function, which
strips off leading and trailing whitespaces and lowers alpha chars.

I am not exactly sure, if this is the right place to fix, but it
works.

I attached the patch to this mail.

-- 
With best regards,

Carsten Hoeger

SuSE, The Linux Experts, http://www.suse.com

Key fingerprint = E3B6 7FDB 4800 0F22 DC09  EB2B 7988 B6A8 6691 C94A


diff -urN cyrus-imapd-2.0.16/lib/auth_unix.c cyrus-imapd-2.0.16.SuSE/lib/auth_unix.c
--- cyrus-imapd-2.0.16/lib/auth_unix.c  Tue May 23 22:56:12 2000
+++ cyrus-imapd-2.0.16.SuSE/lib/auth_unix.c Wed Feb 20 15:32:44 2002
@@ -154,9 +154,11 @@
 const char *identifier;
 {
 static char retbuf[81];
+char backup[81];
 struct group *grp;
 char sawalpha;
 char *p;
+int ic,rbc;
 
 if (strcasecmp(identifier, anonymous) == 0) {
return anonymous;
@@ -210,6 +212,21 @@
 *p = 0;
 
 if (!sawalpha) return NULL;  /* has to be one alpha char */
+
+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;
 }



msg06101/pgp0.pgp
Description: PGP signature


Re: spaces around uid

2002-02-21 Thread Carsten Hoeger

On Thu, Feb 21, Birger Toedtmann wrote:

  Most mailclients would then notice, that there is no inbox -because
  imapd is now looking into /var/imap/user/   uSer  / which currently
  does not exist. Then they issue a create inbox command and voila, we
  have a new directory called /var/imap/user/   uSer  /.
  
  So I wrote a small patch for the auth_canonifyid function, which
  strips off leading and trailing whitespaces and lowers alpha chars.
 [...]
 
 With the whitespaces I'm not sure but I don't think one should enforce
 case insensitivety - instead one should instruct OpenLDAP to behave case 
 sensitive.

Yes, that's what I also thought in the past.
In the OpenLDAP core schema, you can read:

# OpenLDAP Core schema
#
# Includes LDAPv3 schema items from:
#   RFC2251-RFC2256 (LDAPv3)
#
# select standard track schema items:
#   RFC2079 (URI)
#   RFC1274 (uid/dc)

[...]

#
# Derived from RFC1274, but with new short names
#
attributetype ( 0.9.2342.19200300.100.1.1
NAME ( 'uid' 'userid' )
DESC 'RFC1274: user identifier'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} )

[...]

And in RFC 1274:

[...]

9.3.1.  Userid

   The Userid attribute type specifies a computer system login name.

 userid ATTRIBUTE
 WITH ATTRIBUTE-SYNTAX
 caseIgnoreStringSyntax
 (SIZE (1 .. ub-user-identifier))
 ::= {pilotAttributeType 1}

[...]

They all speak about caseinsensity.

Maybe we should include the openldap people into this discussion.

My original Mail:


we noticed, that cyrus-imapd allows users to prepend or append
whitespaces to their uid like this:

. loginuser   secret

cyrus-imapd hand's over this string as is to the underlying
authentication system. In case of pam with pam_ldap, this results in a
DN like this:

uid=   user  ,dc=some,dc=dom

which will then be normalized by OpenLDAP to

uid=user,dc=some,dc=dom

and will give a successfull authentication... :-(

Another point is, that the uid attribute is caseINsensitve as defined
in the core openldap schema, which makes things even harder:

. loginuSer   secret

would be the same as

. loginuser   secret

for openldap in this case.

Most mailclients would then notice, that there is no inbox -because
imapd is now looking into /var/imap/user/   uSer  / which currently
does not exist. Then they issue a create inbox command and voila, we
have a new directory called /var/imap/user/   uSer  /.

So I wrote a small patch for the auth_canonifyid function, which
strips off leading and trailing whitespaces and lowers alpha chars.

I am not exactly sure, if this is the right place to fix, but it
works.



-- 
With best regards,

Carsten Hoeger

SuSE, The Linux Experts, http://www.suse.com

Key fingerprint = E3B6 7FDB 4800 0F22 DC09  EB2B 7988 B6A8 6691 C94A



msg06119/pgp0.pgp
Description: PGP signature


Re: character in mailbox name

2002-02-13 Thread Carsten Hoeger

On Tue, Feb 12, Enric Ramos wrote:

 I had tried this, but cyrus doesn't accept it
 
 cyrus2 cm user.user-co  
 syntax error: cannot deal with `' here

H. Then you have to create this folder with telnet localhost imap
or use an external client (mutt, Nutscrape or Lookout).

-- 
mit freundlichen Gruessen,

Carsten Hoeger  - SuSE The Linux Experts -

SuSE GmbH,   Deutschherrnstr. 15-19,90429 Nuernberg, Germany
Tel: +49-911-74053-0  http://suse.com  Fax: +49-911-74053674

Key fingerprint = E3B6 7FDB 4800 0F22 DC09  EB2B 7988 B6A8 6691 C94A



msg05923/pgp0.pgp
Description: PGP signature


Re: character in mailbox name

2002-02-12 Thread Carsten Hoeger

On Tue, Feb 12, Enric Ramos wrote:

 I need to create some mailboxes using '' character...
 (For instance user.userco)
 
 When I try to do this, cyradm show the following error:
 
 cyrus cm user.userco
 syntax error: cannot deal with `' here
   
 Is there any limitation in using this character ?
 If yes: someone knows what characters else souldn't be used ?

 and - have special meanings and are used to mark utf7 encoded
characters in folder names. If you want to use , you have to write
-, e.g. user.user-co

-- 
With best regards,

Carsten Hoeger

SuSE, The Linux Experts, http://www.suse.com

Key fingerprint = E3B6 7FDB 4800 0F22 DC09  EB2B 7988 B6A8 6691 C94A



msg05860/pgp0.pgp
Description: PGP signature


Re: Postfix-20010228/Cyrus-Imapd 2.0.12 deliver problems

2001-06-06 Thread Carsten Hoeger

On Tue, Jun 05, Jörg Spilker wrote:

 the problem is that lmtp always gives me an connection refused error.
 
 This is from /etc/postfix/master.cf
 
 #lmtp unix  -   -   y   -   -   lmtp
 lmtp  unix  -   -   n   -   -   lmtp
 cyrus unix  -   n   n   -   -   pipe
 flags=R user=cyrus argv=/usr/cyrus/bin/deliver -e -m ${extension} ${user}
 
 /etc/postfix/main.cf
 
 mailbox_transport = lmtp:unix:/var/imap/socket/lmtp
 #mailbox_transport = cyrus
 
 /etc/cyrus.conf
 
 # at least one LMTP is required for delivery
 #  lmtp cmd=lmtpd listen=lmtp prefork=0
   lmtpunix  cmd=lmtpd listen=/var/imap/socket/lmtp prefork=1
 
 /var/log/mail
 
 Jun  5 19:04:31 daolin postfix/lmtp[31062]: 4A039E31:
 to=[EMAIL PROTECTED]
 , relay=none, delay=209, status=deferred (connect to
 /var/imap/socket/lmtp[/var
 /imap/socket/lmtp]: Connection refused)
 
 it works with mailbox_transport = cyrus which seems strange to me as deliver
 itself now connects to the cyrus lmtpd socket without any problems.

Hmmm, strange. I am not sure, if lmtp of postfix is able to access
files beyond of /var/spool/postfix.

Anyway, I am running lmtp chrooted and my main.cf looks like this:

mailbox_transport = lmtp:unix:public/lmtp

cyrus.conf

lmtpunix  cmd=lmtpd listen=/var/spool/postfix/public/lmtp prefork=1

But take also care, that your cyrus master process is realy
running. What shows up in /var/log/messages?

-- 
mit freundlichen Gruessen,

Carsten Hoeger  - SuSE The Linux Experts -

SuSE GmbH,Schanzaeckerstr. 10,  90443 Nuernberg, Germany
Tel: +49-911-7405331  http://suse.com  Fax: +49-911-74053674

Key fingerprint = E3B6 7FDB 4800 0F22 DC09  EB2B 7988 B6A8 6691 C94A

 PGP signature


Re: Postfix-20010228/Cyrus-Imapd 2.0.12 deliver problems

2001-06-05 Thread Carsten Hoeger

On Mon, Jun 04, Jörg Spilker wrote:

 i´ve some strange problem with delivering local mail to my imap box. I´m
 using a SuSE Linux 7.1 distribution with the preinstalled postfix and
 cyrus-imapd (2.0.12, together with the latest SASL package) which i compiled
 myself. Mailbox_transport is set to cyrus and cyrus is set up in master.cf
 to call deliver. This can work for several days but then i found my
 mailqueue full with messages for localhost and lots of hanging deliver
 processes. All the deliver processes are waiting in the read system call. I
 had to stop cyrus and postfix, kill all deliver processes and then start the
 services again. This will empty the queue until it happens next.
 
 I´ve no idea if the problem is caused by cyrus or postfix.

I am just wondering, why you do not use LMTP delivery.

-- 
With best regards,

Carsten Hoeger

SuSE, The Linux Experts, http://www.suse.com

Key fingerprint = E3B6 7FDB 4800 0F22 DC09  EB2B 7988 B6A8 6691 C94A

 PGP signature


Re: Have to restart Cyrus on linux to get it running

2001-03-09 Thread Carsten Hoeger

On Mon, Mar 05, [EMAIL PROTECTED] wrote:

 I am running cyrus 2.0.12 on Linux 2.2.16 (SuSE 7.0) with sasl 1.5.24
 
 I authenticate with pam to /etc/shadow.
 
 After booting the system it is not possible to connect via IMAP.
 
 I restart the master with the scripts used during booting and after that all
 is well functioning.

Just noticed, that I get the same message on the startup of my machine:

Mar  9 08:09:11 bad master: unable to change limit of file descriptors available

But I am able to login. And I also use startproc to start the master
process. I have now further idea, what may be the problem on your 7.0
machine. I am using a 7.1 based system.

-- 
With best regards,

Carsten Hoeger

SuSE, The Linux Experts, http://www.suse.com



Re: Have to restart Cyrus on linux to get it running

2001-03-05 Thread Carsten Hoeger

On Mon, Mar 05, [EMAIL PROTECTED] wrote:

 I am running cyrus 2.0.12 on Linux 2.2.16 (SuSE 7.0) with sasl 1.5.24
 
 I authenticate with pam to /etc/shadow.
 
 After booting the system it is not possible to connect via IMAP.
 
 I restart the master with the scripts used during booting and after that all
 is well functioning.

Maybe the runlevel links are missing?
Do you have links from /sbin/init.d/rc.[23].d/[SK]xxcyrus to
/sbin/init.d/cyrus?

-- 
With best regards,

Carsten Hoeger

SuSE, The Linux Experts, http://www.suse.com



Re: Have to restart Cyrus on linux to get it running

2001-03-05 Thread Carsten Hoeger

On Mon, Mar 05, [EMAIL PROTECTED] wrote:

  Maybe the runlevel links are missing?
  Do you have links from /sbin/init.d/rc.[23].d/[SK]xxcyrus to
  /sbin/init.d/cyrus?
 
 Yes !!  The master process is really running after boot and it spawns
 imapd's, but I can not authenticate.
 
 additional ideas ?

What appears in /var/log/message and/or /var/log/warn?

-- 
mit freundlichen Gruessen,

Carsten Hoeger  - SuSE The Linux Experts -

SuSE GmbH,  Schanzaeckerstr. 10,  90443 Nuernberg, Germany
Tel: +49-911-7405331 Fax: +49-911-74053674



Re: deliver and lmtpd

2001-02-14 Thread Carsten Hoeger

On Tue, Feb 13, Ken Murchison wrote:

  It's written in the upgrade notice, that deliver is only a wrapper to
  the lmtp server and that a lmtp client is required.
 
 This is NOT true.  Deliver's sole purpose in life in 2.x is so that you
 do NOT need an LMTP client.  It provides the same command line interface
 as in 1.6 and still injects messages into the mailstore.  The only
 difference is that in 2.x it talks to lmtpd instead of dealing with the
 mailstore directly.

Sorry, but that's NOT true.
If you want to have the old behaviour, you have to set the envelope
return path with -[fr], if you are using deliver of 2.0.x.

That was not necessary with deliver of versions 1.[56].x

-- 
With best regards,

Carsten Hoeger

SuSE, The Linux Experts, http://www.suse.com



Re: cyrus imap 2.0**

2000-12-07 Thread Carsten Hoeger

On Thu, Dec 07, Martin Stockhammer wrote:

 Does anybody know whether postfix can talk lmtp?

Yes, but only recent snapshot releases.

-- 
With best regards,

Carsten Hoeger

SuSE, The Linux Experts, http://www.suse.com