[mel-base-devel] closing imap folder handles

Jochen Schmidt js at codeartist.org
Fri Jul 18 04:55:58 UTC 2008


Yes I think thats the best way to do it.

Thanks for the patch,
Jochen



--
Jochen Schmidt
CRISPYLOGICS
Julienstr. 1, 90419 Nürnberg

Fon: +49 (0)911 517 999-82
Fax: +49 (0)911 517 999-83

mailto:info at crispylogics.com
http://www.crispylogics.com

Am 18.07.2008 um 05:37 schrieb Kevin Raison <raison at chatsubo.net>:

> In folders/imap/folder.lisp, I have modified close-mailbox as such:
>
> (defun close-mailbox (folder)
>  (when (eq (state folder) :connected)
>    (send-command folder "c1 close")
>    (process-response folder)
>    (setf (state folder) :disconnected)
>    ;; Added by KTR on 07/17/2008 to close the network connection.
>    (close (connection folder))))
>
> Looking through the rest of the imap-specific code, I cannot see a  
> reason not to do this.  Does anyone else here know a better way to  
> handle my issue?
>
> Thanks,
> Kevin Raison
>
>
> Kevin Raison wrote:
>> First, I wanted to thank the developers for this package.  I have  
>> been using it to write a voicemail processing agent for a client  
>> and could not have done it without mel.  I do have one question:   
>> it seems that imap folder connections don't actually get closed by  
>> the (close-folder) function.  I have a long-running process that  
>> eventually runs out of file descriptors because of too many open  
>> imap connections.  I have been careful to call close-folder on each  
>> connection when I am done.  I am using SBCL 1.0.17 and have not  
>> seen any other problems.  The function that gets called on a  
>> periodic basis follows:
>> (defmethod process-user-mail ((user user))
>>  (handler-case
>>      (let ((mbox (mel:make-imap-folder :host (server user)
>>                                        :username (username user)
>>                                        :password (password user)
>>                                        :mailbox "inbox")))
>>        (dolist (msg (mel:messages mbox))
>>          ;; do some interesting things with msg
>>          )
>>        (mel:close-folder mbox))
>>    (error (condition)
>>      (logger :warning "mail check for ~a failed: ~a~%" (username  
>> user) condition))))
>> Am I missing something?
>> Thanks.
>> Kevin Raison
>> _______________________________________________
>> mel-base-devel mailing list
>> mel-base-devel at common-lisp.net
>> http://common-lisp.net/cgi-bin/mailman/listinfo/mel-base-devel
> _______________________________________________
> mel-base-devel mailing list
> mel-base-devel at common-lisp.net
> http://common-lisp.net/cgi-bin/mailman/listinfo/mel-base-devel



More information about the mel-base-devel mailing list