Re: upgrading a 2.2.12 murder to 2.3.14

2009-07-21 Thread Brian Awood


On Thursday 16 July 2009 @ 11:05, Nic Bernstein wrote:
> Brian,
> I certainly would be interested in seeing those.  Please post them
> here, or to the Wiki.
>
> Best regards,
> -nic

Our email operations group manager put together a summary of our cyrus 
implementation recently for a meeting we have yearly with several 
other Universities.  It has links to the scripts we use, the caveat 
being they are all written for our environment and likely wouldn't 
run at another site the way they are currently.  However, they 
probably wouldn't be too difficult to port.  
http://blackops.mail.umich.edu/cyrus

-Brian

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-07-21 Thread Matt Selsky
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?


-- 
Matt

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 
+#include 
+
 /* 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 ] [-x] [-X] [-i] {-d days | -b bytes|-k Kbytes|-m Mbytes}\n\t[mboxpattern1 ... [mboxpatternN]]\n", name);
+  printf("usage: %s [-f] [-s] [-C ] [-x] [-X] [-i] [-p  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

Re: Help with tweaking complete mail setup based on Cyrus + Postfix + MySQL

2009-07-21 Thread Simon Matter
> On Tue, 2009-07-21 at 05:01 -0700, Nybbles2Byte wrote:
>> Hello ,
>> Well, I finally got the whole email setup working. The system
>> comprises of:
>> OpenSuSE 11.0
>> Cyrus-Imap
>> Cyrus-SASL
>> Postfix
>> MySQL
>> Amavis
>>   SpamAssassin
>>   ClamAV
>> setup up to work with multiple domains.
>> I am sure that there are a bunch of little tricks that would make this
>> system sing that an experienced administrator would know, and that
>> would take me months to find out.  So, is there someone there, knowing
>> that all the initial setup has been done and works, that could/would
>> shell into my server and just tweak whatever he can with his
>> experience.
>
> I don't know what I'd do unless there was a specific problem or issue.
> Of the cuff my thoughts are:
>
> 1.) Make sure you are using Skiplist and not Berkley DB for databases
> that default to Berkeley.
> 2.) Enable delayed expunge and configure a cyr_expunge job
> 3.) Disable, shoot, and burn SpamAssassin; that slow bloated buggy cow
> isn't worth the resource and maintenance cost for the very small
> improvement in SPAM prevention it offers over just RBLs, good MTA
> configuration, and greylisting.  All of which are simple and low
> [resource] cost.  Absolutely nothing else will do more to improve
> performance.

That's getting a bit OT but - why exactly is it so bad?
Slow bloated cow - maybe, but apart from that it can be configured to run
almost maintenance free. We are running it with spampd
(http://www.worlddesign.com/index.cfm/rd/mta/spampd.htm) and it tags more
than 99% of spam as spam and it does so for may years.

Regards,
Simon


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: Help with tweaking complete mail setup based on Cyrus + Postfix + MySQL

2009-07-21 Thread Adam Tauno Williams
On Tue, 2009-07-21 at 05:01 -0700, Nybbles2Byte wrote:
> Hello ,
> Well, I finally got the whole email setup working. The system
> comprises of:
> OpenSuSE 11.0
> Cyrus-Imap
> Cyrus-SASL
> Postfix
> MySQL
> Amavis
>   SpamAssassin
>   ClamAV
> setup up to work with multiple domains.
> I am sure that there are a bunch of little tricks that would make this
> system sing that an experienced administrator would know, and that
> would take me months to find out.  So, is there someone there, knowing
> that all the initial setup has been done and works, that could/would
> shell into my server and just tweak whatever he can with his
> experience.

I don't know what I'd do unless there was a specific problem or issue.
Of the cuff my thoughts are:

1.) Make sure you are using Skiplist and not Berkley DB for databases
that default to Berkeley.
2.) Enable delayed expunge and configure a cyr_expunge job
3.) Disable, shoot, and burn SpamAssassin; that slow bloated buggy cow
isn't worth the resource and maintenance cost for the very small
improvement in SPAM prevention it offers over just RBLs, good MTA
configuration, and greylisting.  All of which are simple and low
[resource] cost.  Absolutely nothing else will do more to improve
performance.
4.) Make sure you have directory hashing enabled
5.) Disable atime on your mail store and meta-data store filesystems.
If using ext3 then investigate the data= options as well.
6.) Test your backup/restore procedure.
7.) Take a look at the Cyrus chapter of WMOGAG


> While I am a single consultant working from home, I do realize that
> this should be paid for so a quote/estimate is welcome.  I just think
> it would be worth it to have an expert eye fine tune the system.
> I'm not sure if this is the best place to ask this question and if
> not, a pointer to the right place would be appreciated.



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


Help with tweaking complete mail setup based on Cyrus + Postfix + MySQL

2009-07-21 Thread Nybbles2Byte
Hello ,

Well, I finally got the whole email setup working. The system comprises of:

OpenSuSE 11.0
Cyrus-Imap
Cyrus-SASL
Postfix
MySQL
Amavis
  SpamAssassin
  ClamAV

setup up to work with multiple domains.

I am sure that there are a bunch of little tricks that would make this system 
sing that an experienced administrator would know, and that would take me 
months to find out.  So, is there someone there, knowing that all the initial 
setup has been done and works, that could/would shell into my server and just 
tweak whatever he can with his experience.

While I am a single consultant working from home, I do realize that this should 
be paid for so a quote/estimate is welcome.  I just think it would be worth it 
to have an expert eye fine tune the system.

I'm not sure if this is the best place to ask this question and if not, a 
pointer to the right place would be appreciated.

Cheers!

-- 
Reg  mailto:nybbles2b...@gmail.com
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