The _process_command() routine processes its 'cmd' arguments in order, so
you should be able to simply reverse it. So, instead of
  cmd => [EXPUNGE => $box],
use
  cmd => [$box, 'EXPUNGE'],

looks like this has already been reported as a bug:
http://rt.cpan.org/NoAuth/Bug.html?id=8035

Consider submitting a patch with the above change. It's easy to do and
module authors love it.

- Mark.


> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of Ben Conrad
> Sent: Wednesday, November 03, 2004 4:36 PM
> To: [EMAIL PROTECTED]
> Subject: RFC Expunge issue with Net::IMAP::Simple .95
> 
> 
> Folks,
> 
> I'm just about done writing a script that deletes messages 
> older than "x" days in IMAP mailboxes.  When I do a 
> $imap->expunge_mailbox( "$box" ) the server (via network 
> sniff) spits out:
> 
> 14 EXPUNGE "Ben"              >>> Net::IMAP::Simple
> 14 BAD EXPUNGE Invalid Syntax   >>> Ipswitch Imail server 7.04
> 15 EXPUNGE            >>> Net::IMAP::Simple
> 16 LOGOUT             >>> Net::IMAP::Simple
> 15 BAD EXPUNGE Invalid Syntax  >>> Ipswitch Imail server 7.04
> 
> I looked at RFC 1730 (IMAP 4) and it looks like EXPUNGE is 
> supposed to be formatted "mbox EXPUNGE", not "EXPUNGE mbox".  
> I tried that in a telnet window and it worked:
> 
> Ben EXPUNGE
> * 3 EXPUNGE
> * 2 EXPUNGE
> * 1 EXPUNGE
> Ben OK Expunge completed
> 
> I'm not sure why the expunge on logout is failing.
> 
> Microsoft Exchange seems to act in the same way.  Is there a 
> way I can modify simple.pm to reorder the commands, I'm not 
> too familiar with modifying perl modules.
> 
> >> from simple.pm  $VERSION = '0.95';
> sub expunge_mailbox {
>     my ( $self, $box ) = @_;
>     _escape( $box );
>     
>     return $self->_process_cmd(
>         cmd     => [EXPUNGE => $box],
>         final   => sub { 1 },
>         process => sub { },
>     );
> }
> 
> Help!
> 
> 
> 
> Ben Conrad
> Sr. Network Administrator
> 180 Old Colony Avenue
> Quincy, MA  02170
> Passkey International, Inc.
> [T] 617.237.8225
> [M] 617.852.6206
> [F] 617.328.1461
> http://www.passkey.com
> 
> *The Key to Optimizing Your Group Performance* 
> _______________________________________________
> Perl-Win32-Users mailing list 
> [EMAIL PROTECTED]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
> 

_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to