Hi everybody;
we are using vpopmail in a deployment which involves many programs.
We use maildrop for some (but not all) deliveries, dovecot for imap access, 
some custom perl script to forward some mail.
Log story short, we cannot use (at the moment) vusaged to track the mail 
usage. 
I've looked the code and found that there were no option to disable the usage. 
I can avoid to start the server, of course, but that will pollute the log 
files with failure messages as the client cannot connect.
So I've wrote this patch to add a configuration option to vusagec.conf, 
disabling the connection altogether.

Here is the patch:

--- ../vpopmail-5.4.28/client.c 2009-08-24 17:56:04.000000000 +0200
+++ client.c    2009-09-03 09:32:50.000000000 +0200
@@ -74,6 +74,15 @@
          fprintf(stderr, "client_connect: warning: config_begin failed\n");

    /*
+          Check if vusaged is disabled
+   */
+   str = config_fetch_by_name(config, "Global", "Disable");
+   if (str) {
+         fl = atoi(str);
+         if (fl == 1)
+               return 0;
+   }
+   /*
          Get timeout
    */

I hope that will be included in the next releases of vpopmail.

I will also be nice if (adding a return 0; at line 74, and a couple of curly 
braces around that) vdelivermail wouldn't segfault if the config file is 
missing or unparsable.
Now, at version 5.4.28, if vusagec.conf is missing, the code try to proceed 
and segfault.

Thanks for the attention
-- 
Simone Lazzaris
   INTERACTIVE NETWORK SRL
   Via Roggia Vignola 9, 24047 Treviglio (BG)
   tel : +39 0363.302820
   fax : +39 0363.304352
   web : http://www.interactive.eu
   email : s.lazza...@interactive.eu

Attachment: signature.asc
Description: This is a digitally signed message part.

!DSPAM:4a9fd55c32711506825904!

Reply via email to