Hello,

There was two problems (one + one).

I have applied   20050427-courier-imap-4.0.2-automakemaildir-0.1.diff  patch 


First problem was qmail hopes mailQuotaSize like integer and CourierImap hopes 
mailQuotaSize like String.
First solution was put 'S' in code (imap/imapd.c)

       /* automake maildirsize */
       char *maildirsize = malloc(strlen(p) + sizeof("/maildirsize"));
       strcat(strcpy(maildirsize, p), "/maildirsize");
       if (getenv("MAILDIRQUOTA") != NULL && stat(maildirsize, &sbuf) != 0) {
         /* If quota is not null and maildirsize does not exist, make */
         char *mquota = malloc(sizeof(getenv("MAILDIRQUOTA"))+1);
         strcpy(mquota, getenv("MAILDIRQUOTA"));
         strcat(mquota,"S");
         maildir_quota_set(p, mquota);

It made that maildir_quota_set function runs in other way because mailQuotaSize 
it was parseable.


Second Problem was maildir_quota_set subfunctions get in a loop

static char *makenewmaildirsizename(const char *dir, int *fd)
{
char    hostname[256];
struct  stat stat_buf;
time_t  t;
char    *p;

        hostname[0]=0;
        hostname[sizeof(hostname)-1]=0;
        gethostname(hostname, sizeof(hostname)-1);
        p=(char *)malloc(strlen(dir)+strlen(hostname)+130);
        if (!p) return (0);

        for (;;)
        {
        char    tbuf[NUMBUFSIZE];
        char    pbuf[NUMBUFSIZE];

                time(&t);
                strcat(strcpy(p, dir), "/tmp/");
                sprintf(p+strlen(p), "%s.%s_NeWmAiLdIrSiZe.%s",
                        libmail_str_time_t(t, tbuf),
                        libmail_str_pid_t(getpid(), pbuf), hostname);

                if (stat( (const char *)p, &stat_buf) < 0 &&
                        (*fd=maildir_safeopen(p,
                                O_CREAT|O_RDWR|O_APPEND, 0644)) >= 0)
                        break;
                sleep(3);
        }
        return (p);
}
 

You must to know pwd = > /domains/mydomian.com/user/Maildir

It was trying to create infinitely some temporary file in 
./Maildir/tmp/32178198.hostname

It was a problem becasue Maildir repeats twice.  
(/domains/mydomian.com/user/Maildir/Maildir/tmp/32178198.hostname) and then ==> 
LOOP

Solution: Inside imap/imapd.c 

Put 

        if (chdir(p))
        {
                fprintf(stderr, "chdir %s: %s\n", p, strerror(errno));
                write_error_exit(p);
        }

after /* automake maildirsize end */ and not before.




---------------------------------------------------------------------
 
Carlos García Gómez
Sistemas de Información y Comunicaciones
Fundación Integra. http://www.f-integra.org
 
Teléfono: +34 968 355161
Fax:      +34 968 355131
Correo:   [email protected]
 
----------------------------------------------------------------------
 
Este mensaje y los posibles documentos adjuntos al mismo son confidenciales y 
dirigidos exclusivamente a los destinatarios de los mismos. Si por un error de 
transmisión, o equivocación en la dirección de envío, usted ha recibido este 
mensaje y no es el destinatario de la información, por favor, notifíqueselo
al remitente y borre este mensaje, sin usar, informar, distribuir, imprimir, 
copiar o difundir el mensaje, total o parcialmente, por ningún medio. Gracias.
  ----- Original Message ----- 
  From: Carlos García Gómez 
  To: [email protected] 
  Sent: Monday, April 20, 2009 11:10 AM
  Subject: WARN: quota string '250000000' not parseable


  Hi,

  I´m using qmail-ldap-couierImap like mix mail solution.

  I have a problem with maildirsize file. CourierImap & Courier-authlib takes 
LDAP_MAILDIRQUOTA from LDAP in order to know user quota.

  This is 

  ##NAME: LDAP_MAILDIRQUOTA:0
  #
  # The following variable, if defined, specifies the field containing the
  # maildir quota, see README.maildirquota for more information
  #
  LDAP_MAILDIRQUOTA       mailQuotaSize          #( mailQuotaSieze is ldap name 
attribute)

  I have seen that if maildirQuotaSize is 250000000 then I have problem => 
WARN: quota string '250000000' not parseable
  but if I set aildirQuotaSize to 250000000S courier-imap not login!!!!

  I have been seeing the code where maildirsize file is regenerated or created 
(if doesn´t exists) and I don´t know where is the problem.

  It seems like it´s looping and never show LOGIN in logs. Timeout drops 
  conexion.

  Any solutions?

  Regards.


  ---------------------------------------------------------------------
   
  Carlos García Gómez
  Sistemas de Información y Comunicaciones
  Fundación Integra. http://www.f-integra.org
   
  Teléfono: +34 968 355161
  Fax:      +34 968 355131
  Correo:   [email protected]
   
  ----------------------------------------------------------------------
   
  Este mensaje y los posibles documentos adjuntos al mismo son confidenciales y 
dirigidos exclusivamente a los destinatarios de los mismos. Si por un error de 
transmisión, o equivocación en la dirección de envío, usted ha recibido este 
mensaje y no es el destinatario de la información, por favor, notifíqueselo
  al remitente y borre este mensaje, sin usar, informar, distribuir, imprimir, 
copiar o difundir el mensaje, total o parcialmente, por ningún medio. Gracias.
------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations 
Conference from O'Reilly Media. Velocity features a full day of 
expert-led, hands-on workshops and two days of sessions from industry 
leaders in dedicated Performance & Operations tracks. Use code vel09scf 
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
_______________________________________________
Courier-imap mailing list
[email protected]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-imap

Reply via email to