1Mail::Message::ConstrucUts:e:rReCpolnyt(r3i)buted Perl DMoaciulm:e:nMteastsiaogne::Construct::Reply(3)
2
3
4

NAME

6       Mail::Message::Construct::Reply - reply to a Mail::Message
7

SYNOPSIS

9        my Mail::Message $reply = $message->reply;
10        my $quoted  = $message->replyPrelude($head->get('From'));
11

DESCRIPTION

13       Complex functionality on Mail::Message objects is implemented in dif‐
14       ferent files which are autoloaded.  This file implements the function‐
15       ality related to creating message replies.
16

METHODS

18       Constructing a message
19
20       $obj->reply(OPTIONS)
21
22           Start a reply to this message.  Some of the header-lines of the
23           original message will be taken.  A message-id will be assigned.
24           Some header lines will be updated to facilitate message-thread
25           detection (see Mail::Box::Thread::Manager).
26
27           You may reply to a whole message or a message part.  You may wish
28           to overrule some of the default header settings for the reply imme‐
29           diately, or you may do that later with "set" on the header.
30
31           ADDRESSES may be specified as string, or a Mail::Address object, or
32           as array of Mail::Address objects.
33
34            Option         --Default
35            Bcc              undef
36            Cc               <'cc' in current>
37            From             <'to' in current>
38            Message-ID       <uniquely generated>
39            Subject          replySubject()
40            To               <sender in current>
41            body             undef
42            group_reply      <true>
43            include          'INLINE'
44            max_signature    10
45            message_type     Mail::Message
46            postlude         undef
47            prelude          undef
48            quote            '> '
49            signature        undef
50            strip_signature  qr/^--\s/
51
52           . Bcc ADDRESSES
53
54               Receivers of blind carbon copies: their names will not be pub‐
55               lished to other message receivers.
56
57           . Cc ADDRESSES
58
59               The carbon-copy receivers, by default a copy of the "Cc" field
60               of the source message.
61
62           . From ADDRESSES
63
64               Your identification, by default taken from the "To" field of
65               the source message.
66
67           . Message-ID STRING
68
69               Supply a STRING as specific message-id for the reply.  By
70               default, one is generated for you.  If there are no angles
71               around your id, they will be added.
72
73           . Subject STRING⎪CODE
74
75               Force the subject line to the specific STRING, or the result of
76               the subroutine specified by CODE.  The subroutine will be
77               called passing the subject of the original message as only
78               argument.  By default, Mail::Message::replySubject() is used.
79
80           . To ADDRESSES
81
82               The destination of your message.  By default taken from the
83               "Reply-To" field in the source message.  If that field is not
84               present as well, the "From" line is scanned.  If they all fail,
85               "undef" is returned by this method: no reply message produced.
86
87           . body BODY
88
89               Usually, the reply method can create a nice, sufficient message
90               from the source message's body.  In case you like more compli‐
91               cated reformatting, you may also create a body yourself first,
92               and pass this on to this "reply" method. Some of the other
93               options to this method will be ingored in this case.
94
95           . group_reply BOOLEAN
96
97               Will the people listed in the "Cc" headers (those who received
98               the message where you reply to now) also receive this message
99               as carbon copy?
100
101           . include 'NO'⎪'INLINE'⎪'ATTACH'
102
103               Must the message where this is a reply to be included in the
104               message?  If "NO" then not.  With "INLINE" a reply body is com‐
105               posed. "ATTACH" will create a multi-part body, where the origi‐
106               nal message is added after the specified body.  It is only pos‐
107               sible to inline textual messages, therefore binary or multipart
108               messages will always be enclosed as attachment.
109
110           . max_signature INTEGER
111
112               Passed to "stripSignature" on the body as parameter
113               "max_lines".  Only effective for single-part messages.
114
115           . message_type CLASS
116
117               Create a message with the requested type.  By default, it will
118               be a Mail::Message.  This is correct, because it will be
119               coerced into the correct folder message type when it is added
120               to that folder.
121
122           . postlude BODY⎪LINES
123
124               The line(s) which to be added after the quoted reply lines.
125               Create a body for it first.  This should not include the signa‐
126               ture, which has its own option.  The signature will be added
127               after the postlude when the reply is INLINEd.
128
129           . prelude BODY⎪LINES
130
131               The line(s) which will be added before the quoted reply lines.
132               If nothing is specified, the result of the replyPrelude()
133               method is taken.  When "undef" is specified, no prelude will be
134               added.
135
136           . quote CODE⎪STRING
137
138               Mangle the lines of an "INLINE"d reply with CODE, or by
139               prepending a STRING to each line.  The routine specified by
140               CODE is called when the line is in $_.
141
142               By default, '> ' is added before each line.  Specify "undef" to
143               disable quoting.  This option is processed after the body has
144               been decoded.
145
146           . signature BODY⎪MESSAGE
147
148               The signature to be added in case of a multi-part reply.  The
149               mime-type of the signature body should indicate this is a used
150               as such.  However, in INLINE mode, the body will be taken, a
151               line containing '-- ' added before it, and added behind the
152               epilogue.
153
154           . strip_signature REGEXP⎪STRING⎪CODE
155
156               Remove the signature of the sender.  The value of this parame‐
157               ter is passed to Mail::Message::Body::stripSignature(pattern)
158               unless the source text is not included.  The signature is
159               stripped from the message before quoting.
160
161               When a multipart body is encountered, and the message is
162               included to ATTACH, the parts which look like signatures will
163               be removed.  If only one message remains, it will be the added
164               as single attachment, otherwise a nested multipart will be the
165               result.  The value of this option does not matter, as long as
166               it is present.  See Mail::Message::Body::Multipart.
167
168           Example:
169
170             my $reply = $msg->reply
171              ( prelude         => "No spam, please!\n\n"
172              , postlude        => "\nGreetings\n"
173              , strip_signature => 1
174              , signature       => $my_pgp_key
175              , group_reply     => 1
176              );
177
178       $obj->replyPrelude([STRING⎪FIELD⎪ADDRESS⎪ARRAY-OF-THINGS])
179
180           Produces a list of lines (usually only one), which will preceded
181           the quoted body of the message.  STRING must comply to the RFC822
182           email address specification, and is usually the content of a "To"
183           or "From" header line.  If a FIELD is specified, the field's body
184           must be compliant.  Without argument -or when the argument is
185           "undef"- a slightly different line is produced.
186
187           An characteristic example of the output is
188
189            On Thu Oct 13 04:54:34 1995, him@example.com wrote:
190
191       $obj->replySubject(STRING)
192
193       Mail::Message->replySubject(STRING)
194
195           Create a subject for a message which is a reply for this one.  This
196           routine tries to count the level of reply in subject field, and
197           transform it into a standard form.  Please contribute improvements.
198
199           Example:
200
201            subject                 --> Re: subject
202            Re: subject             --> Re[2]: subject
203            Re[X]: subject          --> Re[X+1]: subject
204            subject (Re)            --> Re[2]: subject
205            subject (Forw)          --> Re[2]: subject
206            <blank>                 --> Re: your mail
207

DIAGNOSTICS

209       Error: Cannot include reply source as $include.
210
211       Unknown alternative for the "include" option of reply().  Valid choices
212       are "NO", "INLINE", and "ATTACH".
213

SEE ALSO

215       This module is part of Mail-Box distribution version 2.070, built on
216       March 25, 2007. Website: http://perl.overmeer.net/mailbox/
217

LICENSE

219       Copyrights 2001-2007 by Mark Overmeer.For other contributors see
220       ChangeLog.
221
222       This program is free software; you can redistribute it and/or modify it
223       under the same terms as Perl itself.  See
224       http://www.perl.com/perl/misc/Artistic.html
225
226
227
228perl v5.8.8                       2007-03-25Mail::Message::Construct::Reply(3)
Impressum