View Single Post
Old 23rd March 2007, 20:12
nenad nenad is offline
Senior Member
Join Date: Nov 2005
Location: Novi Sad, Serbia
Posts: 416
Thanks: 13
Thanked 5 Times in 5 Posts

One of the Developers of Hylafax sent to my email solution to this:

> while ($_ = shift(@entities))
> {
> my @p;
> if (@p = $_->parts)
> {
> unshift @entities, @p;
> } else
> {
> push @parts, $_;
> }
> }

> What I need is limiting to extracting only attachement component out of
> email, or parsing just a attachement to sendfax, withouth text and html
> components.

You have to decide "how" you will determine if a part is given to
sendfax. That will depend on what types of emails you feed into it, and
what results you want.

It could be as simple as changing the one line.

If you want to only fax the PostScript documents:

push @parts, $_ if $_->mime_type eq 'applicatin/postscript';

or if you want to fax everything *except* text/plain or text/html:
next if $_->mime_type eq 'text/plain';
next if $_->mime_type eq 'text/html';
push @parts, $_;
Nenad Bulatovic
Debian Lenny & ISPConfig 3
Reply With Quote