[imp] Problem with maintenance tasks / renaming sent-mail folder

Jan Schneider jan@horde.org
Thu, 23 May 2002 15:17:43 +0200


Zitat von Tero Matinlassi <tero.matinlassi@edu.vantaa.fi>:

> Lainaus Tero Matinlassi <tero.matinlassi@edu.vantaa.fi>:
> 
> > When renaming the sent-mail folder to "sent-mail-month-year" at
> > monthly 
> > maintenance tasks, the folder gets renamed to "sent-mail-month
> > -year". 
> > There's extra empty character (not space, just some other empty 
> > character). After that IMP complains about this folder name and gives
> > 
> > error messages related to this in the mailbox view. Also this folder
> > is 
> > not shown on the folder page / menu.
> > 
> > Has anybody encountered this problem? (This happens in RELENG. I
> > don't 
> > know if this is happening in HEAD, haven't tested it yet.)
> 
> Ahm, replying to myself. I got a bit into this and did a test file 
> which had:
> <?php
> 
> setlocale( LC_ALL, 'fi_FI' );
> 
> $last_login = mktime(0, 0, 0, date('m') - 1, date('d'));
> 
> echo 'sent-mail'.strtolower(strftime("-%b-%Y", $last_login));
> 
> When I open this file with my browser it outputs:
> sent-mail-huhti -2002
> 
> So that's where the extra empty character is coming from. Any 
> suggestions how to handle with this?

Looks like broken locales on your system.

Anyway, you can use something like:

'sent-mail-' . strtolower(trim(strftime('%b', $last_login)) . '-' .        
      
  strftime('%Y', $last_login))

Jan.

--
http://www.horde.org - The Horde Project
http://www.ammma.de - discover your knowledge
http://www.tip4all.de - Deine private Tippgemeinschaft