8 messages in net.sourceforge.lists.courier-sqwebmailRe: [sqwebmail] Problem with renaming...
FromSent OnAttachments
Pawel TeczaMay 11, 2006 7:53 am 
Sam VarshavchikMay 11, 2006 3:29 pm 
Pawel TeczaMay 12, 2006 12:11 am 
Pawel TeczaMay 12, 2006 3:15 am 
Sam VarshavchikMay 12, 2006 4:03 pm 
Lars AlthofMay 12, 2006 5:34 pm 
Sam VarshavchikMay 12, 2006 8:08 pm 
Pawel TeczaMay 15, 2006 1:06 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [sqwebmail] Problem with renaming Sent folderActions...
From:Sam Varshavchik (mrs@courier-mta.com)
Date:May 12, 2006 4:03:47 pm
List:net.sourceforge.lists.courier-sqwebmail

Pawel Tecza writes:

On Fri, 12 May 2006, Pawel Tecza wrote:

On Thu, 11 May 2006, Sam Varshavchik wrote:

[...]

But you shouldn't get double folders, unless something else is broken, because sqwebmail should only attempt to create the sent folder once.

OK, I'll look at this and try to find a bug.

The Sqwebmail creates the Sent folder once, but it does it for _each_ language version, if they use _different_ locale. It's because of the following line in the rename_sent_folder() function (sqwebmail.c file):

if (strftime (buf, sizeof(buf), "." SENT ".%Y.%m-%b", tm) == 0) return;

Sigh… No, it's not because of that.

I thought that I was just doing this the first time I log in each month, but I see that I just cheated here.

This whole thing shouldn't be done at every login, at all.

If the abbreviated month name is so important for you there, you could add it while displaying names of .Sent folders.

That's just going to pile up two hacks on top of each other, in order to cancel out each other's hackery.

I'm certain that without the month names it will just look plain ugly and non-intuitive, but that's not how this should be done.

The way that this should be done is to have another file read/written via read_sqconfig and write_sqconfig.

In rename_sent_folder, something like:

char ymbuf[128];

strftime(ymbuf, sizeof(ymbuf), "%Y%m", tm);

if ((lastym=read_sqconfig(".", "lastrenamesent", NULL)) && strcmp(lastym, ymbuf) == 0) return;

And after renaming the sent folder:

write_sqconfig(".", "lastrenamesent", ymbuf);