email attachement



Hi all,

I'm trying to save attachment from emails with a specific subject. but i can't find the right module...

thank you for your help.

My script :

# Duh
use Net::IMAP::Simple;
use Email::Simple;

# Create the object
my $imap = Net::IMAP::Simple->new('xxx.xxx.xxx.xxx') ||
die "Unable to connect to IMAP: $Net::IMAP::Simple::errstr\n";

# Log on
if(!$imap->login('xxx@xxxxxx','xxxxx')){
print STDERR "Login failed: " . $imap->errstr . "\n";
exit(64);
}
my $nm = $imap->select('INBOX');

for(my $i = 1; $i <= $nm; $i++){
my $test_sub = Email::Simple->new(join '', @{ $imap->top($i) } );
my $subject = substr($test_sub->header('Subject'),0,25);

if($subject=="xxxxxxxxxxxxxxxxxxxxxxxxx"){
my $es = $imap->get($i);

##################################################################
# I want to use @{$es} and extract all attachment from it and save them somewhere # ##################################################################
}
}

$imap->quit;

.



Relevant Pages

  • Re: how to extract attachments from an email?
    ... > I need a script to extract all attachments from emails and do an action an ...
    (Debian-User)
  • Re: OT: spammers are using my domain again
    ... our virtual hosting servers and boom 150 returned emails from the ... Server load wasn't jumping ... Its a simple script that is written in php and can use a DB to retrieve ... they do anything) and the other hosting company that the file was ...
    (Fedora)
  • Re: Reading remote Session ID
    ... require that the IP that makes the request for the page be the same ... capability of the user, if it's a script the js will fail, so require ... I am using the free version of SPAMfighter for private users. ... It has removed 1384 spam emails to date. ...
    (alt.php)
  • Re: [PHP] limiting the amount of emails sent at a time in a batch send
    ... I want to limit these script two send 100 email and then pause for a few ... all the emails that are dated for today. ... I am using swift ... used for many unique mails. ...
    (php.general)
  • Re: Reading remote Session ID
    ... Perhaps you can just make it harder for the script by ... require that the IP that makes the request for the page be the same ... Using a session i nice here. ... It has removed 1384 spam emails to date. ...
    (alt.php)