Mailing List CGatePro@mail.stalker.com Message #93445
From: Nicolas Hatier <nicolas.hatier@niversoft.com>
Subject: Re: How to extract attachments automatically and store it's in a folder
Date: Wed, 12 Dec 2007 13:54:45 -0500
To: CommuniGate Pro Discussions <CGatePro@mail.stalker.com>
Sorry - on my system, ActiveState PPM has an easy to use graphical interface. Never used command-line ppm. (perl v5.8.8)
Try ppm3 if you have it, or cpan, but usually cpan is not available on ActiveState perl installations.

Nicolas

Alexander Lázaro Gómez Valdivia wrote:
Sorry!...but the answer was too short.

C:\>ppm
PPM interactive shell (2.2.0) - type 'help' for available commands.
PPM> install     ¿ .... ?

Example:
    PPM> install MIME
    Install package 'MIME?' (y/N): y
    Installing package 'MIME'...
    Error installing package 'MIME': Could not locate a PPD file for package MIME




El Wed, 12 Dec 2007 12:16:31 -0500
  Nicolas Hatier  escribió:
use the ActivePerl Package Manager (command: ppm) or CPAN to install it.

Nicolas

Alexander Lázaro Gómez Valdivia wrote:
Im getting the following error:
D:\>perl "D:\ExtractAttachments\ExtractAttachments.pl"
Can't locate MIME/Parser.pm in @INC (@INC contains: C:/Perl/lib C:/Perl/site/lib.)

Where can I found Parser.pm?

Any ideas.
Thanks.



El Wed, 12 Dec 2007 18:47:17 +0300
 "Alex Goncharov - DSV"  escribió:
Update:

Sorry, it doesn't overwrite the file (just checked). It does generate unique filenames:-)



Best regards,
Alex Goncharov,
DSV Russia,
+7 (916) 920 8913
Alex.Goncharov@ru.dsv.com
-----Original Message-----
From: CommuniGate Pro Discussions [mailto:CGatePro@mail.stalker.com] On Behalf Of Alex Goncharov - DSV
Sent: Wednesday, December 12, 2007 6:33 PM
To: CommuniGate Pro Discussions
Subject: Re: How to extract attachments automatically and store it's in a folder

You could use perl script for this (in my Windows enviroment it starts from CGP-Helpers each 5 minutes):
It downloads the message, detaches attachement and puts it to a folder.

---
#!/usr/bin/perl -w
use strict;
use Net::POP3;
use MIME::Parser;

my $server_name = "127.0.0.1";
my $pop3 = Net::POP3->new($server_name, Timeout => 10) ||    &errexit("Unable to connect...");
my $user_name = "test";
my $user_pass = "test";
$pop3->login($user_name, $user_pass) or &errexit("Authorization error");

my $pars = new MIME::Parser;
$pars->output_dir("C:/Att/");

my $msgs = $pop3->list;
my $mail=$pop3->get($msgs);

foreach my $msgid (keys %$msgs)
    {
        my $mail=$pop3->get($msgid);
        my $entity=$pars->parse_data($mail);
        $pop3->delete($msgid);
    }

$pop3->quit;
unlink ;
---

The only problem is that it does not generate unique file names (my Perl knowlege is too low, sorry) and if you have the same filename each time, script will overwrite the file.


Best regards,
Alex Goncharov,
DSV Russia,
+7 (916) 920 8913
Alex.Goncharov@ru.dsv.com
-----Original Message-----
From: CommuniGate Pro Discussions [mailto:CGatePro@mail.stalker.com] On Behalf Of Alexander Lazaro Gomez Valdivia
Sent: Wednesday, December 12, 2007 6:16 PM
To: CommuniGate Pro Discussions
Subject: How to extract attachments automatically and store it's in a folder

Some body know how to Extract Attachments from the message for a selected account, and store it in some folder.
I guess MDaemon do something like that or I'm not sure.
There are some kind of plugin or script to do this?


Thanks!

#############################################################
This message is sent to you because you are subscribed to
 the mailing list .
To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to
To switch to the INDEX mode, E-mail to  Send administrative queries to 

*********************************************************************
The information is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material.
Any review, transmission, dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact postmaster@ru.dsv.com and delete the material from any computer.
*********************************************************************



#############################################################
This message is sent to you because you are subscribed to
 the mailing list .
To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to
To switch to the INDEX mode, E-mail to  Send administrative queries to 

*********************************************************************
The information is intended only for the person or entity to which it is
addressed and may contain confidential and/or privileged material.
Any review, transmission, dissemination or other use of or taking of any
action in reliance upon this information by persons or entities other
than the intended recipient is prohibited. If you received this in
error, please contact postmaster@ru.dsv.com and delete the material from any
computer.
*********************************************************************



#############################################################
This message is sent to you because you are subscribed to
 the mailing list .
To unsubscribe, E-mail to:
To switch to the DIGEST mode, E-mail to
To switch to the INDEX mode, E-mail to
Send administrative queries to

Ing. Alexander Lázaro Gómez Valdivia
Sucursal Emprestur s.a. Villa Clara

Carretera Central 117 e/ Eufemia y Caneyes. Santa Clara
Telefonos: (53) 42 208204, (53) 42 208205
E-mail: alexandergv@esvc.co.cu

#############################################################
This message is sent to you because you are subscribed to
 the mailing list .
To unsubscribe, E-mail to:
To switch to the DIGEST mode, E-mail to
To switch to the INDEX mode, E-mail to
Send administrative queries to

-- 

*Nicolas Hatier* /Niversoft idées logicielles/
/http://www.niversoft.com/



Ing. Alexander Lázaro Gómez Valdivia
Sucursal Emprestur s.a. Villa Clara

Carretera Central 117 e/ Eufemia y Caneyes. Santa Clara
Telefonos: (53) 42 208204, (53) 42 208205
E-mail: alexandergv@esvc.co.cu

#############################################################
This message is sent to you because you are subscribed to
 the mailing list <CGatePro@mail.stalker.com>.
To unsubscribe, E-mail to: <CGatePro-off@mail.stalker.com>
To switch to the DIGEST mode, E-mail to <CGatePro-digest@mail.stalker.com>
To switch to the INDEX mode, E-mail to <CGatePro-index@mail.stalker.com>
Send administrative queries to  <CGatePro-request@mail.stalker.com>

--

Nicolas Hatier
Niversoft idées logicielles
http://www.niversoft.com


Subscribe (FEED) Subscribe (DIGEST) Subscribe (INDEX) Unsubscribe Mail to Listmaster