Sieve reject working but emails get delivered to inbox ?
Hi, I installed the contrib/sieve-spamassassin patches and everything is working in my 2.2-cvs installation. My problem now is, that sieve reject seems to not work properly. require ["spam", "fileinto", "reject"]; if spam { reject "This email did not pass our spam-detection tests and was identified as beeing spam! The recipient did NOT receive this email!"; discard ; } This is a part of my sieve-script. It should reply to all spam identified emails with the reject text und afterthat should discard the email so that it will not get delivered to the inbox. This does not work for me! The rejection-email gets send but the email will not get discarded and thus gets delivered to the users inbox what I do not want! How can I auto-reply to and discard emails with sieve ? --Christian--
Major Cyrus Problems
Hi, I'm running Cyrus 2.0.16 and a problem has arisen - users cannot see some of their mail folders even though the directories are there and reconstruct does recognise these folders when run. Any suggestions? Chris
Re: {Resend} Failed opening 'D.B.php' (fwd)
On Sat, 4 Jan 2003, Yann Debonne wrote: > Hi, > > Upon logging into web-cyradm I get the following error: > > -- > > Warning: Failed opening 'DB.php' for inclusion > (include_path='.:/usr/local/lib/php/PEAR') in > /home/www/web-cyradm/auth.inc.php on line 12 > > Fatal error: Undefined class name 'db' in /home/www/web-cyradm/auth.inc.php > on line 16 ... Is DB.php readable by your web server, and in a directory accessible by your web server? Tom
Re: solved: sieve notifyd method for sending sms doesn't work
As it seems that cyrus doesn't support the notify example scripts in the contrib directory anymore I have come up with a workaround: All Mail to *@sms-gateway.internal is piped to an external shell script which sends the mail as sms (the user part is used as the number). Just define a new mailtransport in /etc/postfix/master.cf . I'm using postfix as the mta but I'm sure sendmail can do the same. Now forward important mail by sieve to the address [EMAIL PROTECTED] in addition to any other archiving sorting etc. If anyone is interested I can supply the script and a more detailed description. Micha
Re: Including UCD-SNMP support in Cyrus IMAPD
>Try, >LIBS="-lkstat -lkvm" ./configure ... I now had a try and it finally compiled perfectly ! Now, is that somehow normal that I need to do that, shouldn't this be automatically done with the configure script ? Regards Marc
Re: Cyrus Authentication Problem
Jon \"GenKIller\" Gaudette wrote: > > I have recently installed Cyrus-imapd on a new server that I have been > trying to setup as a e-mail server. The server is running RedHat Linux > 8.0 with postfix as the MTA (although sendmail is installed and ready to > be used in case the need arises). > > I used the rpm version of cyrus (cyrus-imapd-2.1.11-3.src.rpm) available > from http://home.teleport.ch/simix/ and the installation went very > smoothly (no errors during installation). > > However, I am now having a problem with authentication. When I attempt > to log in to the pop3 server via telnet, I receive the following error: > > > Script started on Sun Jan 5 12:03:28 2003 > [jon@warlord jon]$ telnet auburn.k12.ma.us 110 > Trying 216.20.114.12... > > Connected to [url] (ip). > > Escape character is '^]'. > > +OK mail.auburn.k12.ma.us Cyrus POP3 v2.1.11-Invoca-RPM-2.1.11-3 server > ready <[EMAIL PROTECTED]> > user cyrus > +OK Name is a valid mailbox > pass > -ERR [AUTH] Invalid login > quit > Connection closed by foreign host. > > [jon@warlord jon]$ exit > > Script done on Sun Jan 5 12:05:07 2003 > --- > > When doing an imtest on the local machine, I get the following error > > --- > bash-2.05b$ imtest -m login -p imap localhost > S: * OK mail.url Cyrus IMAP4 v2.1.11-Invoca-RPM-2.1.11-3 server ready > C: C01 CAPABILITY > S: * CAPABILITY IMAP4 IMAP4rev1 ACL QUOTA LITERAL+ MAILBOX-REFERRALS > NAMESPACE UIDPLUS ID NO_ATOMIC_RENAME UNSELECT CHILDREN MULTIAPPEND SORT > THREAD=ORDEREDSUBJECT THREAD=REFERENCES IDLE STARTTLS LISTEXT > LIST-SUBSCRIBED ANNOTATEMORE X-NETSCAPE > S: C01 OK Completed > Please enter your password: > C: L01 LOGIN cyrus {8} > S: + go ahead > C: > S: L01 NO Login failed: no mechanism available > Authentication failed. generic failure > Security strength factor: 0 > C: Q01 LOGOUT > * BYE LOGOUT received > Q01 OK Completed > Connection closed > --- > > My /etc/imapd.conf file contains the following: > > --- > configdirectory: /var/lib/imap > partition-default: /var/spool/imap > admins: cyrus > allowanonymouslogin: no > sieveuserhomedir: no > sievedir: /var/lib/imap/sieve > sendmail: /usr/sbin/sendmail > hashimapspool: true > sasl_pwcheck_method: shadow ^^ This is not valid with SASLv2 (I'm guessing that you read this in an old FAQ somewhere). Change this to 'saslauthd' and start 'saslauthd -a shadow' > sasl_mech_list: PLAIN > tls_cert_file: /usr/share/ssl/certs/cyrus-imapd.pem > tls_key_file: /usr/share/ssl/certs/cyrus-imapd.pem > --- > > I thought that perhaps the user 'cyrus' is not used as a regular > authenticated imap user, so I did teh following as user "CYRUS" > > --- > bash-2.05b$ cyradm localhost > IMAP Password: > > Login failed: no mechanism available at > /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Cyrus/IMAP/Admin.pm line 114 > cyradm: cannot authenticate to server with as cyrus > --- > > I'm assuming all of these errors are interlinked with the authentication > mechanism. However, I have no idea how to fix this, and am hoping some > of you on this list can help me out. > > Thank you in advance for any help any of you can provide. If I have the > wrong list for this type of help, please direct me to the appropriate > list. Thank you in advance. > > -- > -Jon "GenKiller" Gaudette > Digital Drip Webmaster (digital-drip.com) > CNCNZ Co-Webmaster (cncnz.com) -- Kenneth Murchison Oceana Matrix Ltd. Software Engineer 21 Princeton Place 716-662-8973 x26 Orchard Park, NY 14127 --PGP Public Key--http://www.oceana.com/~ken/ksm.pgp
Cyrus Authentication Problem
I have recently installed Cyrus-imapd on a new server that I have been trying to setup as a e-mail server. The server is running RedHat Linux 8.0 with postfix as the MTA (although sendmail is installed and ready to be used in case the need arises). I used the rpm version of cyrus (cyrus-imapd-2.1.11-3.src.rpm) available from http://home.teleport.ch/simix/ and the installation went very smoothly (no errors during installation). However, I am now having a problem with authentication. When I attempt to log in to the pop3 server via telnet, I receive the following error: Script started on Sun Jan 5 12:03:28 2003 [jon@warlord jon]$ telnet auburn.k12.ma.us 110 Trying 216.20.114.12... Connected to [url] (ip). Escape character is '^]'. +OK mail.auburn.k12.ma.us Cyrus POP3 v2.1.11-Invoca-RPM-2.1.11-3 server ready <[EMAIL PROTECTED]> user cyrus +OK Name is a valid mailbox pass -ERR [AUTH] Invalid login quit Connection closed by foreign host. [jon@warlord jon]$ exit Script done on Sun Jan 5 12:05:07 2003 --- When doing an imtest on the local machine, I get the following error --- bash-2.05b$ imtest -m login -p imap localhost S: * OK mail.url Cyrus IMAP4 v2.1.11-Invoca-RPM-2.1.11-3 server ready C: C01 CAPABILITY S: * CAPABILITY IMAP4 IMAP4rev1 ACL QUOTA LITERAL+ MAILBOX-REFERRALS NAMESPACE UIDPLUS ID NO_ATOMIC_RENAME UNSELECT CHILDREN MULTIAPPEND SORT THREAD=ORDEREDSUBJECT THREAD=REFERENCES IDLE STARTTLS LISTEXT LIST-SUBSCRIBED ANNOTATEMORE X-NETSCAPE S: C01 OK Completed Please enter your password: C: L01 LOGIN cyrus {8} S: + go ahead C: S: L01 NO Login failed: no mechanism available Authentication failed. generic failure Security strength factor: 0 C: Q01 LOGOUT * BYE LOGOUT received Q01 OK Completed Connection closed --- My /etc/imapd.conf file contains the following: --- configdirectory: /var/lib/imap partition-default: /var/spool/imap admins: cyrus allowanonymouslogin: no sieveuserhomedir: no sievedir: /var/lib/imap/sieve sendmail: /usr/sbin/sendmail hashimapspool: true sasl_pwcheck_method: shadow sasl_mech_list: PLAIN tls_cert_file: /usr/share/ssl/certs/cyrus-imapd.pem tls_key_file: /usr/share/ssl/certs/cyrus-imapd.pem --- I thought that perhaps the user 'cyrus' is not used as a regular authenticated imap user, so I did teh following as user "CYRUS" --- bash-2.05b$ cyradm localhost IMAP Password: Login failed: no mechanism available at /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Cyrus/IMAP/Admin.pm line 114 cyradm: cannot authenticate to server with as cyrus --- I'm assuming all of these errors are interlinked with the authentication mechanism. However, I have no idea how to fix this, and am hoping some of you on this list can help me out. Thank you in advance for any help any of you can provide. If I have the wrong list for this type of help, please direct me to the appropriate list. Thank you in advance. -- -Jon "GenKiller" Gaudette Digital Drip Webmaster (digital-drip.com) CNCNZ Co-Webmaster (cncnz.com)
[PATCH] close potential buffer overflow in prot_flush (was: Re: [PATCH] imapd segfaults after broken pipe)
On Sun, 05 Jan 2003, Henrique de Moraes Holschuh wrote: > On Sun, 05 Jan 2003, Gerd v. Egidy wrote: > > > The attached patch fixes this. The attached patch fixes the bug in prot_flush. It also adds an assert that protects the code from another potentially letal bug. Gerd's patch fixes another issue, which is that putc really should not be suceeding on write streams that are on error or closed. -- "One disk to rule them all, One disk to find them. One disk to bring them all and in the darkness grind them. In the Land of Redmond where the shadows lie." -- The Silicon Valley Tarot Henrique Holschuh Index: lib/prot.c === RCS file: /home/cvs/debian/cyrus21-imapd/lib/prot.c,v retrieving revision 1.9 diff -u -r1.9 prot.c --- lib/prot.c 26 Oct 2002 13:00:17 - 1.9 +++ lib/prot.c 5 Jan 2003 16:25:55 - @@ -214,6 +214,7 @@ int prot_setflushonread(struct protstream *s, struct protstream *flushs) { assert(!s->write); +if (flushs) assert(flushs->write); s->flushonread = flushs; return 0; @@ -589,6 +590,9 @@ #endif /* HAVE_SSL */ if (n == -1 && errno != EINTR) { s->error = xstrdup(strerror(errno)); + /* Reset the output buffer, we are returning EOF */ + s->ptr = s->buf; + s->cnt = s->maxplain; return EOF; }
Re: [PATCH] imapd segfaults after broken pipe
On Sun, 05 Jan 2003, Gerd v. Egidy wrote: > > The attached patch fixes this. Looking through the code, it looks like it must never happen for cnt to be zero outside of prot_*, for write streams. IMHO proper asserts should be added to the #define macros to guard against this (it looks like there is at least one bug somewhere that violates that assumption), the same way their function counterparts do. As for prot_flush, it looks buggy. It does not clean up after itself on failures (such as getting a sigpipe or whatever) in a way to make sure it will NEVER exit with the write buffer full (cnt = 0). I am still not 100% sure of my accessment of the situation: I am still reading through the code, so I may be completely wrong about the issue. I am *really* not sure about adding the s->error and s->eof tests, though. Are you sure they belong there? (I need to better grasp the workings of prot.* before I answer that myself). -- "One disk to rule them all, One disk to find them. One disk to bring them all and in the darkness grind them. In the Land of Redmond where the shadows lie." -- The Silicon Valley Tarot Henrique Holschuh
Re: [PATCH] imapd segfaults after broken pipe
> The attached patch fixes this. Just a cosmetic fix - the defined prot_putc now returns EOF in case of error. diff -r -u cyrus-imapd-2.1.11.orig/lib/prot.c cyrus-imapd-2.1.11/lib/prot.c --- cyrus-imapd-2.1.11.orig/lib/prot.c Mon Oct 21 22:44:22 2002 +++ cyrus-imapd-2.1.11/lib/prot.c Sat Jan 4 23:19:56 2003 @@ -793,6 +793,7 @@ int prot_putc(int c, struct protstream *s) { assert(s->write); +if(s->error || s->eof) return EOF; assert(s->cnt > 0); *s->ptr++ = c; diff -r -u cyrus-imapd-2.1.11.orig/lib/prot.h cyrus-imapd-2.1.11/lib/prot.h --- cyrus-imapd-2.1.11.orig/lib/prot.h Tue Apr 2 05:59:04 2002 +++ cyrus-imapd-2.1.11/lib/prot.h Sat Jan 4 23:21:55 2003 @@ -104,7 +104,7 @@ #define prot_getc(s) ((s)->cnt-- > 0 ? (int)*(s)->ptr++ : prot_fill(s)) #define prot_ungetc(c, s) ((s)->cnt++, (*--(s)->ptr = (c))) -#define prot_putc(c, s) ((*(s)->ptr++ = (c)), --(s)->cnt == 0 ? prot_flush(s) : 0) +#define prot_putc(c, s) (!((s)->error || (s)->eof) ? ((*(s)->ptr++ = (c)), --(s)->cnt == 0 ? prot_flush(s) : 0) : EOF) #define prot_BLOCK(s) ((s)->dontblock = 0) #define prot_NONBLOCK(s) ((s)->dontblock = 1)
(fwd) patch for correct utf7 support in Cyrus folder names
Please see attached message -- "One disk to rule them all, One disk to find them. One disk to bring them all and in the darkness grind them. In the Land of Redmond where the shadows lie." -- The Silicon Valley Tarot Henrique Holschuh --- Begin Message --- Hi! I've been trying to send this to the cyrus-info mailing list, but my mails seem to get lost (seems strange - CMU may have to check their servers). E.g. folder name &wfrr4+Dw8ero- (which is OK) cannot pass the mboxname_policycheck (it seems to find out there is an invalid BASE64 character, which is not correct). We are migrating to Cyrus from latest courier-imap, but we require this functionality (and used to use it with success). That's why we created this patch. We like the function that checks for correct utf7 in the PHP function imap_utf7_decode so we didn't write the code from scratch but used it. The patch is working fine on our production servers for a week now and I felt that although the list seems not to want my mail :) someone should send the patch to the list or you can even patch the current CVS tree :) We are correcting a function that has not changed since 2.0 and the difference is only slight from 1.6, but this is not a problem that has been overseen - lots of people are complaining about it in Russian and Bulgarian mailing lists. We think we have solved the problem (at least here - on our servers) and we hope this might help. If you have any influence, I will be grateful if I can also send to the list :) Today a question was asked which I wanted to answer, but the mail seems lost again. Regards, Momchil ___ Momchil Shumackov mail.bG __ _ powered by Stefan Karadja 12B / / (_)__ __ __ Sofia BG-1000 / /__/ / _ \/ // /\ \/ / Tel: +359 2 9885007 //_/_//_/\_,_/ /_/\_\ __ 12MB-POP3-WAP-SMS-AHTÈCÏAM--TOBA-E-mail.bG -- HOB ÁEÇÏËATEH AÄPEC - http://mail.bg/new/ -- --- mboxname.c.old 2002-01-24 18:39:28.0 +0200 +++ mboxname.c 2003-01-05 12:03:19.0 +0200 @@ -453,21 +453,53 @@ /* * Apply site policy restrictions on mailbox names. - * Restrictions are hardwired for now. + * + * cannibalized from PHP source and adapted for cyrus by: + * Angel Sinigerski <[EMAIL PROTECTED]> and + * Momchil Shumackov <[EMAIL PROTECTED]> + * original author: Andrew Skalski <[EMAIL PROTECTED]> + * */ -#define GOODCHARS " +,-.0123456789:=@ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz~" + +/* tests `c' and returns true if it is a special character */ +#define SPECIAL(c) ((c) <= 0x1f || (c) >= 0x7f) + +/* validate a modified-base64 character */ +#define B64CHAR(c) (isalnum(c) || (c) == '+' || (c) == ',') + +/* map the low 64 bits of `n' to the modified-base64 characters */ +#define B64(n) ("ABCDEFGHIJKLMNOPQRSTUVWXYZ" \ +"abcdefghijklmnopqrstuvwxyz0123456789+,"[(n) & 0x3f]) + +/* map the modified-base64 character `c' to its 64 bit value */ +#define UNB64(c)((c) == '+' ? 62 : (c) == ',' ? 63 : (c) >= 'a' ? \ +(c) - 71 : (c) >= 'A' ? (c) - 65 : (c) + 4) + int mboxname_policycheck(char *name) { -int i; +/* author: Andrew Skalski <[EMAIL PROTECTED]> */ +const unsigned char *inp, *endp; +unsigned char *out, *outp; +int inlen, outlen, i; struct glob *g; -int sawutf7 = 0; -unsigned c1, c2, c3, c4, c5, c6, c7, c8; -int ucs4; +enum { +ST_NORMAL, /* printable text */ +ST_DECODE0, /* encoded text rotation... */ +ST_DECODE1, +ST_DECODE2, +ST_DECODE3 +} state; + int unixsep; unixsep = config_getswitch("unixhierarchysep", 0); -if (strlen(name) > MAX_MAILBOX_NAME) return IMAP_MAILBOX_BADNAME; +inlen = strlen( name ); + +if ( inlen > MAX_MAILBOX_NAME ) { +/* Name too long */ +return IMAP_MAILBOX_BADNAME; +} for (i = 0; i < NUM_BADMBOXPATTERNS; i++) { g = glob_init(badmboxpatterns[i], 0); if (GLOB_TEST(g, name) != -1) { @@ -477,81 +509,63 @@ glob_free(&g); } -if (*name == '~') return IMAP_MAILBOX_BADNAME; -while (*name) { - if (*name == '&') { - /* Modified UTF-7 */ - name++; - while (*name != '-') { - if (sawutf7) { - /* Two adjacent utf7 sequences */ +/* validate and compute length of output string */ +outlen = 0; +state = ST_NORMAL; +for (endp = (inp = name) + inlen; inp < endp; inp++) { +if (state == ST_NORMAL) { +/* process printable character */ +if( *inp == '.' && (!unixsep) ) +{ return IMAP_MAILBOX_BADNAME; } - - if ((c1 = CHARMOD64(*name++)) == XX || - (c2 = CHARMOD64(*name++))