Thanks Brian Raven and Bill Luebkert, MIME::Lite solved the problem.
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Brian
Raven
Sent: Monday, October 31, 2005 1:14 PM
To: [email protected]
Subject: RE: MIME warning sending attachments with Mail::Sendmail
Jason Rice <> wrote:
> We are using Mail::Sendmail to generate emails with attachments and
> sending them to clients. The generation and sending work fine, but we
> are running into some issues sending to some mail servers due to the
> following warning: MIME segment in MIME postamble vulnerability.
> Looking up the error message I have found the following descriptions
> of it:
>
> Error Description:
> Outlook 'MIME segment in MIME postamble' Vulnerability:
>
> Mail Server
>
> This vulnerability occurs when it appears as though a MIME segment is
> occurring after the end of the MIME body (specifically, a MIME
> segment with a boundary other than the one specified appears in the
> MIME postamble). Outlook may see this as an attachment. Although
> technically valid, there is no legitimate reason for an E-mail to be
> sent like this.
>
>
> Code Snippet:
> my $rc;
> $rc = &LoadVariables($data[0]);
> return 0 unless($rc);
> $rc = &GenerateWordDoc(@data);
> return 0 unless($rc);
> if ($supplierID ne "NA")
> {
> # Assemble subject
> $subject = "Subject";
> # Assemble from address
> $replyTo = $personEmail;
> }
> else
> {
> # Assemble subject
> $subject = "Subject";
> # Assemble from address
> $replyTo = $personEmail;
> }
>
> $body = <<END_OF_BODY;
> Sample body text. This is not what is actually sent.
>
> END_OF_BODY
>
> $body = $emailHeader . $body;
>
> # Open pipe to blat
> #Added -cc option 11/25/2003 by mw to handle group notification
> if ($cc)
> {
> %mail = ( To => $toEmail,
> From => $fromAddress,
> Cc => $cc,
> Bcc => $bccAddress,
> 'Reply-To' => $replyTo,
> 'X-Reply' => $replyEmail,
> Subject => $subject,
> smtp => $smtpServer
> );
> }
> else
> {
> %mail = ( To => $toAddress,
> From => $fromAddress,
> Bcc => $bccAddress,
> 'Reply-To' => $replyTo,
> 'X-Reply' => $replyEmail,
> Subject => $subject,
> smtp => $smtpServer
> );
> }
> $boundary = "====" . time() . "====";
> $mail{'content-type'} = "multipart/mixed; boundary =
\"$boundary\"";
> $message = $body;
> $file = "$filename.doc";
> open (F, "$outFax\\docs\\". $file) ||
> &ErrorHandler("WARNING", "$errorEmail", "Error from $0
on
> $hostName", "Cannot open file $file for binmode input: $!\n");
> binmode F; my $tmpSep = $/;
> undef $/;
> $mail{body} = encode_base64(<F>);
> close F;
> $/ = $tmpSep;
>
> $boundary = '--'.$boundary;
> $mail{body} = <<END_OF_BODY;
> $boundary
> Content-Type: text/plain; charset="iso-8859-1"
> Conect-Transfer-Encoding: quoted-printable
>
> $message
> $boundary
> Content-Type: application/octet-stream; name="$file"
> Content-Transfer-Encoding: base64
> Content-Disposition: attachement; filename="$file"
>
> $mail{body}
> $boundary--
> END_OF_BODY
>
> sendmail(%mail);
>
>
> Any help would be appreciated.
Wouldn't it be easier, and possibly less error-prone, to use something
like MIME::Lite to generate your messages?
HTH
--
Brian Raven
=================================
Atos Euronext Market Solutions Disclaimer
=================================
The information contained in this e-mail is confidential and solely for
the intended addressee(s). Unauthorised reproduction, disclosure,
modification, and/or distribution of this email may be unlawful.
If you have received this email in error, please notify the sender
immediately and delete it from your system. The views expressed in this
message do not necessarily reflect those of Atos Euronext Market
Solutions.
L'information contenue dans cet e-mail est confidentielle et uniquement
destinee a la (aux) personnes a laquelle (auxquelle(s)) elle est
adressee. Toute copie, publication ou diffusion de cet email est
interdite. Si cet e-mail vous parvient par erreur, nous vous prions de
bien vouloir prevenir l'expediteur immediatement et d'effacer le e-mail
et annexes jointes de votre systeme. Le contenu de ce message
electronique ne represente pas necessairement la position ou le point de
vue d'Atos Euronext Market Solutions.
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs