Hello. I have been given a Perl script that [supposedly] strips extraneous info from emails before they are inserted into a database as comments. The script works GREAT with mail sent from lotus notes, not at all with messages from Outlook 98, and barely with mail sent from Outlook Express.<br>What I am looking for is _any_ information that will explain how the extra info is being removed, so that I can customize the script to format all mail the same way. Included below is the section of script that removes the info from the message, as well as a copy of a 'processed' message sent via Outlook Express.<br>TIA for any help!!<br>Jim<br>-----------Begin Code---------------<br># We need to remove the extraneous information from the <br># addressing fields <br> @tmp=split('"',$message{'From'});<br> $message{'From'}=$tmp[1];<br> <br> if ($message{'To'}=~m"<"
{<br> @tmp=split(',',$message{'To'});<br><br> foreach(@tmp) {<br> @tmp2=split('<',$_,2);<br> @tmp3=split('>',$tmp2[1],2);<br> $_=@tmp3[0];<br> }<br> $message{'To'}=join(',',@tmp);<br> }<br> if ($message{'cc'}) {<br> @tmp=split(',',$message{'cc'});<br> foreach(@tmp) {<br> @tmp2=split('<',$_,2);<br> @tmp3=split('>',$tmp2[1],2);<br> $_=@tmp3[0];<br> }<br> $message{'cc'}=join(',',@tmp);<br> } else {<br> $message{'cc'}=" ";<br> }<br># Date needs to be corrected to the dd-Mon-yyyy format<br> $result=($message{'Date'}=~s"([0-9]) (...) ([0-9])"$1-$2-$3"
;<br> @tmp=split(' ',$message{'Date'});<br> $message{'Date'}=$tmp[1];<br># Contents and subject must be escaped<br> $result=($message{'Subject'}=~s"'"''"g);<br> $result=($message{'Subject'}=~s"`"``"g);<br> $result=($message{'contents'}=~s"'"''"g);<br> $result=($message{'contents'}=~s"`"``"g);<br> $result=($message{'contents'}=~s"\\"\\\\"g);<br> @tmp=split(' ',$message{'Subject'});<br> $catno="";<br> foreach(@tmp) {<br> if ($_=~m"[0-9]-"
{<br> $catno=$_;<br> }<br> }<br>----End Code---------------------<br>Results from a processed Outlook Express message:<br>------Begin results--------------<br>multipart/alternative; boundary="----=_NextPart_000_0005_01BFECC9.1AF66440" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 <br><br>This is a multi-part message in MIME format. <br><br>------=_NextPart_000_0005_01BFECC9.1AF66440 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <br><br>THis test message=20 sent via Outlook Express <br><br>------=_NextPart_000_0005_01BFECC9.1AF66440 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <br><br><br>THis test message sent via Outlook = Express<br>------=_NextPart_000_0005_01BFECC9.1AF66440-- <br>-----End results--------------<br>