.\" Automatically generated by Pod::Man 2.1801 (Pod::Simple 3.05) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Debbugs::Mail 3pm" .TH Debbugs::Mail 3pm "2010-08-06" "perl v5.10.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Debbugs::Mail \-\- Outgoing Mail Handling .SH "SYNOPSIS" .IX Header "SYNOPSIS" use Debbugs::Mail qw(send_mail_message get_addresses); .PP my \f(CW@addresses\fR = get_addresses('blah blah blah foo@bar.com') send_mail_message(message => <<\s-1END\s0, recipients=>[@addresses]); To: \f(CW$addresses\fR[0] Subject: Testing .PP Testing 1 2 3 \&\s-1END\s0 .SH "EXPORT TAGS" .IX Header "EXPORT TAGS" .IP ":all \*(-- all functions that can be exported" 4 .IX Item ":all all functions that can be exported" .SH "FUNCTIONS" .IX Header "FUNCTIONS" .SS "get_addresses" .IX Subsection "get_addresses" .Vb 2 \& my @addresses = get_addresses(\*(Aqdon@debian.org blars@debian.org \& kamion@debian.org ajt@debian.org\*(Aq); .Ve .PP Given a string containing some e\-mail addresses, parses the string using Mail::Address\->parse and returns a list of the addresses. .SS "default_headers" .IX Subsection "default_headers" .Vb 9 \& my @head = default_headers(queue_file => \*(Aqfoo\*(Aq, \& data => $data, \& msgid => $header{\*(Aqmessage\-id\*(Aq}, \& msgtype => \*(Aqerror\*(Aq, \& headers => [...], \& ); \& create_mime_message(\e@headers, \& ... \& ); .Ve .PP This function is generally called to generate the headers for create_mime_message (and anything else that needs a set of default headers.) .PP In list context, returns an array of headers. In scalar context, returns headers for shoving in a mail message after encoding using encode_headers. .PP \fIoptions\fR .IX Subsection "options" .ie n .IP "queue_file \*(-- the queue file which will generate this set of headers (refered to as $nn in lots of the code)" 4 .el .IP "queue_file \*(-- the queue file which will generate this set of headers (refered to as \f(CW$nn\fR in lots of the code)" 4 .IX Item "queue_file the queue file which will generate this set of headers (refered to as $nn in lots of the code)" .PD 0 .IP "data \*(-- the data of the bug which this message involves; can be undefined if there is no bug involved." 4 .IX Item "data the data of the bug which this message involves; can be undefined if there is no bug involved." .IP "msgid \*(-- the Message-ID: of the message which will generate this set of headers" 4 .IX Item "msgid the Message-ID: of the message which will generate this set of headers" .IP "msgtype \*(-- the type of message that this is." 4 .IX Item "msgtype the type of message that this is." .IP "pr_msg \*(-- the pr message field" 4 .IX Item "pr_msg the pr message field" .IP "headers \*(-- a set of headers which will override the default headers; these headers will be passed through (and may be reordered.) If a particular header is undef, it overrides the default, but isn't passed through." 4 .IX Item "headers a set of headers which will override the default headers; these headers will be passed through (and may be reordered.) If a particular header is undef, it overrides the default, but isn't passed through." .PD .PP \fIdefault headers\fR .IX Subsection "default headers" .IP "X\-Loop \*(-- set to the maintainer e\-mail" 4 .IX Item "X-Loop set to the maintainer e-mail" .PD 0 .IP "From \*(-- set to the maintainer e\-mail" 4 .IX Item "From set to the maintainer e-mail" .IP "To \*(-- set to Unknown recipients" 4 .IX Item "To set to Unknown recipients" .IP "Subject \*(-- set to Unknown subject" 4 .IX Item "Subject set to Unknown subject" .IP "Message-ID \*(-- set appropriately (see code)" 4 .IX Item "Message-ID set appropriately (see code)" .IP "Precedence \*(-- set to bulk" 4 .IX Item "Precedence set to bulk" .IP "References \*(-- set to the full set of message ids that are known (from data and the msgid option)" 4 .IX Item "References set to the full set of message ids that are known (from data and the msgid option)" .IP "In-Reply-To \*(-- set to msg id or the msgid from data" 4 .IX Item "In-Reply-To set to msg id or the msgid from data" .IP "X\-Project-PR-Message \*(-- set to pr_msg with the bug number appended" 4 .IX Item "X-Project-PR-Message set to pr_msg with the bug number appended" .IP "X\-Project-PR-Package \*(-- set to the package of the bug" 4 .IX Item "X-Project-PR-Package set to the package of the bug" .IP "X\-Project-PR-Keywords \*(-- set to the keywords of the bug" 4 .IX Item "X-Project-PR-Keywords set to the keywords of the bug" .IP "X\-Project-PR-Source \*(-- set to the source of the bug" 4 .IX Item "X-Project-PR-Source set to the source of the bug" .PD .SS "send_mail_message" .IX Subsection "send_mail_message" .Vb 4 \& send_mail_message(message => $message, \& recipients => [@recipients], \& envelope_from => \*(Aqdon@debian.org\*(Aq, \& ); .Ve .IP "message \*(-- message to send out" 4 .IX Item "message message to send out" .PD 0 .IP "recipients \*(-- recipients to send the message to. If undefed or an empty arrayref, will use '\-t' to parse the message for recipients." 4 .IX Item "recipients recipients to send the message to. If undefed or an empty arrayref, will use '-t' to parse the message for recipients." .IP "envelope_from \*(-- envelope_from for outgoing messages" 4 .IX Item "envelope_from envelope_from for outgoing messages" .IP "encode_headers \*(-- encode headers using \s-1RFC1522\s0 (default)" 4 .IX Item "encode_headers encode headers using RFC1522 (default)" .IP "parse_for_recipients \*(-- use \-t to parse the message for recipients in addition to those specified. [Can be used to set Bcc recipients, for example.]" 4 .IX Item "parse_for_recipients use -t to parse the message for recipients in addition to those specified. [Can be used to set Bcc recipients, for example.]" .PD .PP Returns true on success, false on failures. All errors are indicated using warn. .SS "encode_headers" .IX Subsection "encode_headers" .Vb 1 \& $message = encode_heeaders($message); .Ve .PP \&\s-1RFC\s0 1522 encodes the headers of a message .SS "rfc822_date" .IX Subsection "rfc822_date" .Vb 1 \& rfc822_date .Ve .PP Return the current date in \s-1RFC822\s0 format in the \s-1UTC\s0 timezone .SH "PRIVATE FUNCTIONS" .IX Header "PRIVATE FUNCTIONS" .SS "_send_message" .IX Subsection "_send_message" .Vb 1 \& _send_message($message,@sendmail_args); .Ve .PP Private function that actually calls sendmail with \f(CW@sendmail_args\fR and sends message \f(CW$message\fR. .PP dies with errors, so calls to this function in send_mail_message should be wrapped in eval.