GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Email::MIME::Attachment::Stripper(3) User Contributed Perl Documentation Email::MIME::Attachment::Stripper(3)

Email::MIME::Attachment::Stripper - strip the attachments from an email

version 1.317

  my $stripper = Email::MIME::Attachment::Stripper->new($mail);

  my $msg = $stripper->message;
  my @attachments = $stripper->attachments;

Given a Email::MIME object, detach all attachments from the message and make them available separately.

The message you're left with might still be multipart, but it should only be multipart/alternative or multipart/related.

Given this message:

  + multipart/mixed
    - text/plain
    - application/pdf; disposition=attachment

The PDF will be stripped. Whether the returned message is a single text/plain part or a multipart/mixed message with only the text/plain part remaining in it is not yet guaranteed one way or the other.

  my $stripper = Email::MIME::Attachment::Stripper->new($email, %args);

The constructor may be passed an Email::MIME object, a reference to a string, or any other value that Email::Abstract (if available) can cast to an Email::MIME object.

Valid arguments include:

  force_filename - try harder to get a filename, making one up if necessary

  my $email_mime = $stripper->message;

This returns the message with all the attachments detached. This will alter both the body and the header of the message.

  my @attachments = $stripper->attachments;

This returns a list of all the attachments we found in the message, as a hash of { filename, content_type, payload }.

This may contain parts that might not normally be considered attachments, like text/html or multipart/alternative.

This module's behavior has never been very clearly spelled out, and it has led to misunderstandings and bug reports, which may or may not be actual bugs. I plan to take some significant action to address this. To read more or comment, please see <https://github.com/rjbs/Email-MIME-Attachment-Stripper/issues/2>

This module is incredibly closely derived from Tony Bowden's Mail::Message::Attachment::Stripper; this derivation was done by Simon Cozens ("simon@cpan.org"), and you receive this under the same terms as Tony's original module.

Simon Cozens

This software is copyright (c) 2004 by Simon Cozens.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

2013-09-01 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.