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


Manual Reference Pages  -  MAIL::MESSAGE::REPLACE::MAILINTERNET (3)

.ds Aq ’

NAME

Mail::Message::Replace::MailInternet - fake Mail::Internet

CONTENTS

INHERITANCE



 Mail::Message::Replace::MailInternet
   is a Mail::Message
   is a Mail::Reporter



SYNOPSIS



 !!! BETA !!!

 # change
 use Mail::Internet;
 # into
 use Mail::Message::Replace::MailInternet;
 # in existing code, and the code should still work, but
 # with the Mail::Message features.



DESCRIPTION

This module is a wrapper around a Mail::Message, which simulates a Mail::Internet object. The name-space of that module is hijacked and many methods are added.

Most methods will work without any change, but you may need to have a look at your smtpsend() and send() calls.

See documentation in the base class.

OVERLOADED

METHODS

See documentation in the base class.

    Constructors

See documentation in the base class.
$obj-><B>cloneB>(OPTIONS) See Constructors in Mail::Message
$obj-><B>dupB>() Duplicate the message. The result will again be a Mail::Internet compatible object.
$obj-><B>emptyB>() Remove all data from this object. Very dangerous!
Mail::Message::Replace::MailInternet-><B>newB>([ARG], [OPTIONS])


 -Option    --Defined in     --Default
  Body                         undef
  FoldLength                   79
  Header                       undef
  MailFrom                     KEEP
  Modify                       0
  body        Mail::Message    undef
  body_type   Mail::Message    Mail::Message::Body::Lines
  deleted     Mail::Message    <false>
  field_type  Mail::Message    undef
  head        Mail::Message    undef
  head_type   Mail::Message    Mail::Message::Replace::MailHeader
  labels      Mail::Message    {}
  log         Mail::Reporter   WARNINGS
  messageId   Mail::Message    undef
  modified    Mail::Message    <false>
  trace       Mail::Reporter   WARNINGS
  trusted     Mail::Message    <false>



Body => ARRAY-OF-LINES Array of "\n" terminated lines. If not specified, the lines will be read from ARG.
FoldLength => INTEGER Number of characters permitted on any refolded header line. Passed to Mail::Message::Replace::MailHeader::new(FoldLength).
Header => OBJECT The Mail::Header object, which is passed here, is a fake one as well... It is translated into a new(head). If not given, the header will be parsed from the ARG.
MailFrom => ’IGNORE’|’ERROR’|’COERCE’|’KEEP What to do with leading "From " lines in e-mail data. Passed to Mail::Message::Replace::MailHeader::new(MailFrom).
Modify => BOOLEAN Whether to re-fold all the incoming fields. Passed to Mail::Message::Replace::MailHeader::new(Modify).
body => OBJECT
body_type => CLASS
deleted => BOOLEAN
field_type => CLASS
head => OBJECT
head_type => CLASS
labels => ARRAY|HASH
log => LEVEL
messageId => STRING
modified => BOOLEAN
trace => LEVEL
trusted => BOOLEAN

example: replace traditional Mail::Internet by this wrapper



  # was
  use Mail::Internet;
  my $mi = Mail::Internet->new(@options);

  # becomes
  use Mail::Message::Replace::MailInternet;
  my $mi = Mail::Internet->new(@options);



    Attributes

$obj-><B>MailFromB>([STRING]) Your email address.

    Constructing a message

See documentation in the base class.
$obj-><B>add_signatureB>([FILENAME]) Replaced by sign(), but still usable. FILENAME is the file which contains the signature, which defaults to $ENV{HOME}/.signature.
$obj-><B>bounceB>([RG-OBJECT|OPTIONS]) See Constructing a message in Mail::Message::Construct::Bounce
Mail::Message::Replace::MailInternet-><B>buildB>([MESSAGE|PART|BODY], CONTENT) See Constructing a message in Mail::Message::Construct::Build
Mail::Message::Replace::MailInternet-><B>buildFromBodyB>(BODY, [HEAD], HEADERS) See Constructing a message in Mail::Message::Construct::Build
$obj-><B>extractB>(ARRAY or FILEHANDLE) Read header and body from an ARRAY or FILEHANDLE
$obj-><B>forwardB>(OPTIONS) See Constructing a message in Mail::Message::Construct::Forward
$obj-><B>forwardAttachB>(OPTIONS) See Constructing a message in Mail::Message::Construct::Forward
$obj-><B>forwardEncapsulateB>(OPTIONS) See Constructing a message in Mail::Message::Construct::Forward
$obj-><B>forwardInlineB>(OPTIONS) See Constructing a message in Mail::Message::Construct::Forward
$obj-><B>forwardNoB>(OPTIONS) See Constructing a message in Mail::Message::Construct::Forward
$obj-><B>forwardPostludeB>() See Constructing a message in Mail::Message::Construct::Forward
$obj-><B>forwardPreludeB>() See Constructing a message in Mail::Message::Construct::Forward
$obj-><B>forwardSubjectB>(STRING) See Constructing a message in Mail::Message::Construct::Forward
$obj-><B>readB>(ARRAY|FILEHANDLE, OPTIONS)
Mail::Message::Replace::MailInternet-><B>readB>(ARRAY|FILEHANDLE, OPTIONS) Read header and body from the specified ARRAY or FILEHANDLE. When used as object method, Mail::Message::read() is called, to be MailBox compliant. As class method, the Mail::Internet compatible read is called. OPTIONS are only available in the first case.



 -Option             --Defined in                    --Default
  body_type            Mail::Message::Construct::Read  undef
  strip_status_fields  Mail::Message::Construct::Read  <true>



body_type => CLASS
strip_status_fields => BOOLEAN
$obj-><B>read_bodyB>(ARRAY|FILEHANDLE) Read only the message’s body from the ARRAY or FILEHANDLE.
$obj-><B>read_headerB>(ARRAY|FILEHANDLE) Read only the message’s header from the ARRAY or FILEHANDLE
$obj-><B>rebuildB>(OPTIONS) See Constructing a message in Mail::Message::Construct::Rebuild
$obj-><B>replyB>(OPTIONS) BE WARNED: the main job for creating a reply is done by Mail::Message::reply(), which may produce a result which is compatible, but may be different from Mail::Internet’s version.



 -Option         --Defined in                     --Default
  Bcc              Mail::Message::Construct::Reply  undef
  Cc               Mail::Message::Construct::Reply  <cc in current>
  Exclude                                           []
  From             Mail::Message::Construct::Reply  <to in current>
  Inline                                            >
  Keep                                              []
  Message-ID       Mail::Message::Construct::Reply  <uniquely generated>
  ReplyAll                                          <false>
  Subject          Mail::Message::Construct::Reply  replySubject()
  To               Mail::Message::Construct::Reply  <sender in current>
  body             Mail::Message::Construct::Reply  undef
  group_reply      Mail::Message::Construct::Reply  <true>
  header_template                                   $ENV{HOME}/.mailhdr
  include          Mail::Message::Construct::Reply  INLINE
  max_signature    Mail::Message::Construct::Reply  10
  message_type     Mail::Message::Construct::Reply  Mail::Message
  postlude         Mail::Message::Construct::Reply  undef
  prelude          Mail::Message::Construct::Reply  undef
  quote            Mail::Message::Construct::Reply  > 
  signature        Mail::Message::Construct::Reply  undef
  strip_signature  Mail::Message::Construct::Reply  qr/^--\s/



Bcc => ADDRESSES
Cc => ADDRESSES
Exclude => ARRAY-OF-NAMES Remove the fields witht the specified names from the produced reply message.
From => ADDRESSES
Inline => STRING Quotation STRING, which is translated into reply(quote). The normal default of quote is > , in stead of >.
Keep => ARRAY-OF-NAMES Copy all header fields with the specified NAMES from the source to the reply message.
Message-ID => STRING
ReplyAll => BOOLEAN Reply to the group? Translated into reply(group_reply), which has as default the exact oposite of this option, being true.
Subject => STRING|CODE
To => ADDRESSES
body => BODY
group_reply => BOOLEAN
header_template => FILENAME|undef Read the return header from the template file. When this is explicitly set to undef, or the file does not exist, then a header will be created.
include => ’NO’|’INLINE’|’ATTACH
max_signature => INTEGER
message_type => CLASS
postlude => BODY|LINES
prelude => BODY|LINES
quote => CODE|STRING
signature => BODY|MESSAGE
strip_signature => REGEXP|STRING|CODE
$obj-><B>replyPreludeB>([STRING|FIELD|ADDRESS|ARRAY-OF-THINGS]) See Constructing a message in Mail::Message::Construct::Reply
$obj-><B>replySubjectB>(STRING)
Mail::Message::Replace::MailInternet-><B>replySubjectB>(STRING) See Constructing a message in Mail::Message::Construct::Reply
$obj-><B>signB>(OPTIONS) Add a signature (a few extra lines) to the message.



 -Option   --Default
  File       undef
  Signature  



File => FILENAME Specifies a filename where the signature is in.
Signature => STRING|ARRAY-OF-LINES The signature in memory.

    The message

See documentation in the base class.
$obj-><B>containerB>() See The message in Mail::Message
$obj-><B>isDummyB>() See The message in Mail::Message
$obj-><B>isPartB>() See The message in Mail::Message
$obj-><B>messageIdB>() See The message in Mail::Message
$obj-><B>nntppostB>(OPTIONS) Send an NNTP message (newsgroup message), which is equivalent to Mail::Transport::NNTP or Mail::Message::send() with via nntp.



 -Option--Default
  Debug   <false>
  Host    <from Net::Config>
  Port    119



Debug => BOOLEAN
Host => HOSTNAME
Port => INTEGER
$obj-><B>partNumberB>() See The message in Mail::Message
$obj-><B>printB>([FILEHANDLE]) Prints the whole message to the specified FILEHANDLE, which default to STDOUT. This calls Mail::Message::print().
$obj-><B>sendB>(TYPE, OPTIONS) Send via Mail Transfer Agents (MUA). These will be handled by various Mail::Transport::Send extensions. The test TYPE is not supported.
$obj-><B>sizeB>() See The message in Mail::Message
$obj-><B>toplevelB>() See The message in Mail::Message
$obj-><B>writeB>([FILEHANDLE]) See The message in Mail::Message

    The header

See documentation in the base class.
$obj-><B>addB>(LINES) Add header lines, which simply calls Mail::Message::Head::add() on the header for each specified LINE. The last added LINE is returned.
$obj-><B>bccB>() See The header in Mail::Message
$obj-><B>ccB>() See The header in Mail::Message
$obj-><B>clean_headerB>() Not to be used, replaced by header().
$obj-><B>combineB>(TAG, [WITH]) Not implemented, because I see no use for it.
$obj-><B>dateB>() See The header in Mail::Message
$obj-><B>deleteB>(NAME, [INDEX]]) Delete the fields with the specified NAME. The deleted fields are returned.

BE WARNED: if no NAME is specified, the delete is interpreted as the deletion of the message in a folder, so Mail::Box::Message::delete() will be called. This may have no negative effect at all...

Calls Mail::Message::Replace::MailHeader::delete()

$obj-><B>destinationsB>() See The header in Mail::Message
$obj-><B>foldB>([LENGTH]) Fold all the fields to a certain maximum LENGTH. Implemented by Mail::Message::Replace::MailHeader::fold()
$obj-><B>fold_lengthB>([[TAG], LENGTH]) Set the maximum line LENGTH. TAG is ignored. Implemented by Mail::Message::Replace::MailHeader::fold_length()
$obj-><B>fromB>() See The header in Mail::Message
$obj-><B>getB>(NAME, [INDEX]) Get all the header fields with the specified NAME. In scalar context, only the first fitting NAME is returned. Even when only one NAME is specified, multiple lines may be returned: some fields appear more than once in a header. Calls Mail::Message::Replace::MailHeader::get()
$obj-><B>guessTimestampB>() See The header in Mail::Message
$obj-><B>headB>([HEAD]) Returns the head of the message, or creates an empty one if none is defined. The HEAD argument, which sets the header, is not available for Mail::Internet, but is there to be compatible with the head method of Mail::Message.
$obj-><B>headerB>([ARRAY]) Optionally reads a header from the ARRAY, and then returns those fields as array-ref nicely folded. Implemented by Mail::Message::Replace::MailHeader::header()
$obj-><B>nrLinesB>() See The header in Mail::Message
$obj-><B>print_headerB>(FILEHANDLE) Calls Mail::Message::Head::Complete::print().
$obj-><B>replaceB>(TAG, LINE, [INDEX]) Adds LINES to the header, but removes fields with the same name if they already exist. Calls Mail::Message::Replace::MailHeader::replace()
$obj-><B>senderB>() See The header in Mail::Message
$obj-><B>studyB>(FIELDNAME) See The header in Mail::Message
$obj-><B>subjectB>() See The header in Mail::Message
$obj-><B>tidy_headersB>() No effect anymore (always performed).
$obj-><B>timestampB>() See The header in Mail::Message
$obj-><B>toB>() See The header in Mail::Message

    The body

See documentation in the base class.
$obj-><B>bodyB>([ARRAY-OF-LINES|LIST-OF-LINES]) Returns an array of lines, representing the body. With arguments, a new body will be created. In Mail::Internet, the body is not an object but a simple array.

BE WARNED: this overrules the Mail::Message::body() method, which may cause some confusion. Use bodyObject() to get access to that body’s data.

$obj-><B>bodyObjectB>([BODY]) Calls Mail::Message::body(), because that body method is overruled by the one which has a Mail::Internet compatible interface.
$obj-><B>contentTypeB>() See The body in Mail::Message
$obj-><B>decodedB>(OPTIONS) See The body in Mail::Message
$obj-><B>encodeB>(OPTIONS) See The body in Mail::Message
$obj-><B>isMultipartB>() See The body in Mail::Message
$obj-><B>isNestedB>() See The body in Mail::Message
$obj-><B>partsB>([’ALL’|’ACTIVE’|’DELETED’|’RECURSE’|FILTER]) See The body in Mail::Message
$obj-><B>print_bodyB>([FILEHANDLE]) Prints the body to the specified FILEHANDLE, which defaults to STDOUT. This calls Mail::Message::Body::print().
$obj-><B>remove_sigB>([NRLINES]) Remove the signature of a message with a maximum of NRLINES lines, which defaults to 10. The work is done on the decoded body content, by Mail::Message::Body::stripSignature().
$obj-><B>smtpsendB>(OPTIONS) This method is calling Mail::Message::send() via smtp, which is implemented in Mail::Transport::SMTP. The implementation is slightly different, so this method is not 100% compliant.



 -Option  --Default
  Debug     <false>
  Hello     <helo_domain from Net::Config>
  Host      $ENV{SMTPHOSTS} or from Net::Config
  MailFrom  $ENV{MAILADDRESS} or $ENV{USER}
  Port      25



Debug => BOOLEAN
Hello => STRING
Host => HOSTNAME Only the first detected HOSTNAME is taken, so differs from the original implementation.
MailFrom => STRING Your e-mail address. This simulated Mail::Internet object does not try to create an e-mail address from the sendmail configuration file, because that is generally a bad idea in environments with virtual hosts, as we have now-adays.
Port => INTEGER
$obj-><B>tidy_bodyB>() Removes blank lines from begin and end of the body.

    Flags

See documentation in the base class.
$obj-><B>deletedB>([BOOLEAN]) See Flags in Mail::Message
$obj-><B>isDeletedB>() See Flags in Mail::Message
$obj-><B>isModifiedB>() See Flags in Mail::Message
$obj-><B>labelB>(LABEL|PAIRS) See Flags in Mail::Message
$obj-><B>labelsB>() See Flags in Mail::Message
$obj-><B>labelsToStatusB>() See Flags in Mail::Message
$obj-><B>modifiedB>([BOOLEAN]) See Flags in Mail::Message
$obj-><B>statusToLabelsB>() See Flags in Mail::Message

    The whole message as text

See documentation in the base class.
$obj-><B>as_mbox_stringB>() Returns the whole message as one string, which can be included in an MBOX folder (while not using Mail::Box::Mbox). Lines in the body which start with From are escaped with an >.
$obj-><B>fileB>() See The whole message as text in Mail::Message::Construct::Text
$obj-><B>linesB>() See The whole message as text in Mail::Message::Construct::Text
$obj-><B>printStructureB>([FILEHANDLE|undef],[INDENT]) See The whole message as text in Mail::Message::Construct::Text
$obj-><B>stringB>() See The whole message as text in Mail::Message::Construct::Text

    The nasty bits

$obj-><B>isaB>(CLASS)
Mail::Message::Replace::MailInternet-><B>isaB>(CLASS) Of course, the isa() class inheritance check should not see our nasty trick.

    Internals

See documentation in the base class.
$obj-><B>clonedFromB>() See Internals in Mail::Message
Mail::Message::Replace::MailInternet-><B>coerceB>(MESSAGE) Coerce (adapt type) of the specified MESSAGE (anything Mail::Message::coerce() accepts) into an Mail::Internet simulating object.
$obj-><B>isDelayedB>() See Internals in Mail::Message
$obj-><B>readBodyB>(PARSER, HEAD [, BODYTYPE]) See Internals in Mail::Message
$obj-><B>readFromParserB>(PARSER, [BODYTYPE]) See Internals in Mail::Message
$obj-><B>readHeadB>(PARSER [,CLASS]) See Internals in Mail::Message
$obj-><B>recursiveRebuildPartB>(PART, OPTIONS) See Internals in Mail::Message::Construct::Rebuild
$obj-><B>storeBodyB>(BODY) See Internals in Mail::Message
$obj-><B>takeMessageIdB>([STRING]) See Internals in Mail::Message

    Error handling

See documentation in the base class.
$obj-><B>AUTOLOADB>() See METHODS in Mail::Message::Construct
$obj-><B>addReportB>(OBJECT) See Error handling in Mail::Reporter
$obj-><B>defaultTraceB>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
Mail::Message::Replace::MailInternet-><B>defaultTraceB>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK]) See Error handling in Mail::Reporter
$obj-><B>errorsB>() See Error handling in Mail::Reporter
$obj-><B>logB>([LEVEL [,STRINGS]])
Mail::Message::Replace::MailInternet-><B>logB>([LEVEL [,STRINGS]]) See Error handling in Mail::Reporter
$obj-><B>logPriorityB>(LEVEL)
Mail::Message::Replace::MailInternet-><B>logPriorityB>(LEVEL) See Error handling in Mail::Reporter
$obj-><B>logSettingsB>() See Error handling in Mail::Reporter
$obj-><B>notImplementedB>() See Error handling in Mail::Reporter
$obj-><B>reportB>([LEVEL]) See Error handling in Mail::Reporter
$obj-><B>reportAllB>([LEVEL]) See Error handling in Mail::Reporter
$obj-><B>shortSizeB>([VALUE])
Mail::Message::Replace::MailInternet-><B>shortSizeB>([VALUE]) See Error handling in Mail::Message
$obj-><B>shortStringB>() See Error handling in Mail::Message
$obj-><B>traceB>([LEVEL]) See Error handling in Mail::Reporter
$obj-><B>warningsB>() See Error handling in Mail::Reporter

    Cleanup

See documentation in the base class.
$obj-><B>DESTROYB>() See Cleanup in Mail::Message
$obj-><B>destructB>() See Cleanup in Mail::Message

DETAILS

See documentation in the base class.

DIAGNOSTICS

Error: Cannot include forward source as $include. Unknown alternative for the forward(include). Valid choices are NO, INLINE, ATTACH, and ENCAPSULATE.
Error: Mail::Internet does not support this kind of data The ARGS data can only be a file handle or an ARRAY. Other data types are not supported (see read() if you want to have more).
Error: Method bounce requires To, Cc, or Bcc The message bounce() method forwards a received message off to someone else without modification; you must specified it’s new destination. If you have the urge not to specify any destination, you probably are looking for reply(). When you wish to modify the content, use forward().
Error: Method forwardAttach requires a preamble
Error: Method forwardEncapsulate requires a preamble
Error: No address to create forwarded to. If a forward message is created, a destination address must be specified.
Error: No rebuild rule $name defined.
Error: Only build() Mail::Message’s; they are not in a folder yet You may wish to construct a message to be stored in a some kind of folder, but you need to do that in two steps. First, create a normal Mail::Message, and then add it to the folder. During this Mail::Box::addMessage() process, the message will get coerce()-d into the right message type, adding storage information and the like.
Error: Package $package does not implement $method. Fatal error: the specific package (or one of its superclasses) does not implement this method where it should. This message means that some other related classes do implement this method however the class at hand does not. Probably you should investigate this and probably inform the author of the package.

SEE ALSO

This module is part of Mail-Box distribution version 2.109, built on August 19, 2013. Website: http://perl.overmeer.net/mailbox/

LICENSE

Copyrights 2001-2013 by [Mark Overmeer]. For other contributors see ChangeLog.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://www.perl.com/perl/misc/Artistic.html

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


perl v5.20.3 MAIL::MESSAGE::REPLACE::MAILINTERNET (3) 2013-08-19

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