bug-mailutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-mailutils] problem with folder object


From: Sergey Poznyakoff
Subject: Re: [bug-mailutils] problem with folder object
Date: Fri, 12 Dec 2003 11:27:32 +0200

Hi Stephen,

> $ ./fc-bad-imap imap://ajit:address@hidden
> Creating folder object with url [imap://ajit:address@hidden
> creating mailbox [imap://ajit:address@hidden/oldname]
> 
> I get no error from mailbox_open() and no mailbox is created!

I've tested your code with my working copy of mailutils and both
variants of it worked OK. Unfortunately, CVS is still not available,
but I'll try to make the snapshot available soon.

A couple of notes, though:

>       if ( ( status = folder_create ( &folder, foldername ) ) )
>               myexit ( "folder_create error: %s\n", status );
> 
>       printf ( "creating mailbox [%s]\n", new_mailbox_name );
>       if ( ( status = mailbox_create ( &mbox, new_mailbox_name ) ) )
>               myexit ( "mailbox_create error: %s\n", status );

Generally speaking, there is no use creating a folder independently
of mailbox. You should always use mailbox_get_folder.

>       mailbox_destroy ( &mbox ); 
>       folder_destroy ( &folder );

That is a severe error if mailbox_get_folder was used. It will lead
to coredump, since mailbox_destroy releases all the resources allocated
for the mailbox in question. As a rule of thumb, you should never
explicitely destroy any objects that were obtained using some
<object>_get_... function.

Regards,
Sergey




reply via email to

[Prev in Thread] Current Thread [Next in Thread]