Skip Menu |

This queue is for tickets about the Net-IMAP-Simple CPAN distribution.

Report information
The Basics
Id: 32818
Status: resolved
Priority: 0/
Queue: Net-IMAP-Simple

People
Owner: Nobody in particular
Requestors: jettero [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: get() is fine, but put() is noticibly absent
The whole point of using this module is to do everything really simply (I assume). I wanted to really simply save messages to an SSL IMAP server. Get() is fine, but sometimes you need to put.
Subject: put.patch
--- /usr/local/share/perl/5.8.8/Net/IMAP/Simple.pm 2006-10-11 12:23:45.000000000 -0400 +++ ./Simple.pm 2008-01-30 21:52:24.000000000 -0500 @@ -433,6 +433,33 @@ } +=item put + + $imap->put( $mailbox_name, $message ) or warn $imap->errstr; + +Save a message to the server under the folder named $mailbox_name. + +=cut + +sub put { + my ( $self, $mailbox_name, $msg ) = @_; + + my $size = length $msg; + + $self->_process_cmd( + cmd => [APPEND => "$mailbox_name (\\Seen) {$size}"], + final => sub { 1 }, + process => sub { + if( $size ) { + my $sock = $self->_sock; + print $sock $msg; + $size = undef; + print $sock "\r\n"; + } + }, + ); +} + =pod =item getfh
This is one of the patches I included in the 1.18 release -- If riding in an airplane is flying, then riding in a boat is swimming. 107 jumps, 43.5 minutes of freefall, 83.4 freefall miles.