Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

new confused and bogged down.

Status
Not open for further replies.

deadpan

MIS
Sep 1, 1999
11
TT
Hello All.<br>
I am new to perl and have been trying to get an autoresponding script with sendmail on a Linux box at first i got the script to work but it would only work with web-based mail and kept sending the emails back in an unreadable html format on non-web based mail (see below)<br>
<br>
You wrote:<br>
<br>
&gt;This is a multi-part message in MIME format.<br>
&gt;<br>
&gt;------=_NextPart_000_0099_01BF09C2.F1DF9390<br>
&gt;Content-Type: text/plain;<br>
&gt; charset=&quot;utf-7&quot;<br>
&gt;Content-Transfer-Encoding: 7bit<br>
&gt;<br>
&gt;test<br>
&gt;<br>
&gt;------=_NextPart_000_0099_01BF09C2.F1DF9390<br>
&gt;Content-Type: text/html;<br>
&gt; charset=&quot;utf-7&quot;<br>
&gt;Content-Transfer-Encoding: quoted-printable<br>
&gt;<br>
&gt;&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD W3 HTML//EN&quot;&gt;<br>
&gt;&lt;HTML&gt;<br>
&gt;&lt;HEAD&gt;<br>
&gt;<br>
&gt;&lt;META content=text/html;charset=utf-7 =<br>
&gt;http-equiv=Content-Type&gt;<br>
&gt;&lt;META content='&quot;MSHTML 4.72.3110.7&quot;' =<br>
&gt;name=GENERATOR&gt;<br>
&gt;&lt;/HEAD&gt;<br>
&gt;&lt;BODY bgColor=#ffffff&gt;<br>
&gt;&lt;DIV&gt;&lt;FONT color=#000000 =<br>
&gt;size=2&gt;test&lt;/FONT&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;<br>
&gt;<br>
&gt;------=_NextPart_000_0099_01BF09C2.F1DF9390--<br>
<br>
the problem here being it would send back what the sender had written but the respond message was not there. So after much searching i found a module that would allow me to create email messages in MIME format i thought great problem solved. I managed to install the module after bumbling about and then set to work on trying to mdify the script. Firstly i perl could not find the object method which i managed to solve through trial and error, but once again i have run into a brick wall with this error<br>
<br>
Can't modify concatenation in scalar assignment at /usr/local/mailback/mailback.pl line 100, near &quot;);&quot;<br>
Execution of /usr/local/mailback/mailback.pl aborted due to compilation errors.<br>
554 &quot;¦ perl /usr/local/mailback/mailback.pl&quot;... unknown mailer error 255<br>
<br>
can anyone help me with this or at least point me in the direction of something on the web that might help me with writing an autoresponder of my own<br>
Thanks in advance for any help<br>
<br>
<br>

 
Sounds like a syntax problem but without seeing line 100 in context it's difficult to say.<br>
You can hunt around at perl.com, webmonkey.com, devshed.com.
 
Sounds like you're getting two errors, the second one (554 error) from sendmail being caused by the perl syntax error. It sounds like line 100 (or 99, 98, 97...) may look something like:<br>
<br>
$MyScalar . = $ThingToConcat;<br>
<br>
ie, a space between the &quot;.&quot; and &quot;=&quot;. Like robman says, without seeing it, it's a bit difficult to say. Post the section of code if you're still having problems.
 
Ok this is what i was originally working on its a script called mailback.pl by Derek Vadala it worked well on its own for web-based mail but would not work for other mail interfaces like outlook express so i hunted around and found a module and tried to arrange it so it would. I am using a primitive script in which i do not return the senders message and print out each line so every response has to have a seperate script.. i tried to include the orignal message but again kept getting it scrambled into a html format.. what im using now servers its purpose but id like to be able to extend its use.. heres what i came up with..<br>
<br>
#/usr/bin/perl -w<br>
<br>
#get the data from the message and store it for use.<br>
<br>
$header = ''; #store header content<br>
$body = ''; #store body content<br>
<br>
#parse each line in the header <br>
<br>
while (&lt;&gt;) {<br>
last if /^$/;<br>
$header.= $_;<br>
($field, $value) = /^(\S*)\s*(.*)/;<br>
if (length($field) &gt; 1) { $fields($field) = $value; }<br>
else { $fields($field) .= &quot; $value&quot;; }<br>
}<br>
<br>
while (&lt;&gt;) { $body.= $_; } #body is stored here<br>
<br>
#reply to mail<br>
<br>
open (MAIL, &quot;¦usr/bin/sendmail);<br>
print MAIL &quot;From: $fields{'To:'}\n&quot;;<br>
print MAIL &quot;To: $fields{'From:'}\n;<br>
print MAIL &quot;Subject: Re: $fields{'Subject:'}\n;<br>
print MAIL &quot;\n\n&quot;;<br>
#print MAIL &quot;$body&quot;; #this causes the message to return in #html format<br>
print MAIL &quot;Thank you for contacting mycompany,\n&quot;<br>
print MAIL &quot;Your mail has been recieved and\n&quot;; <br>
print MAIL &quot;automatically forwarded to our technical\n&quot;; print MAIL &quot;dept. You will be contacted by one of \n&quot;;<br>
print MAIL &quot;our staff as soon as possible.\n&quot;;<br>
close MAIL;<br>
}<br>
<br>
I also tried to store the reply message seperately with<br>
<br>
<br>
open MESSAGE, &quot;usr/local/mailback/message-$id&quot;;<br>
$mail{'Message'} = &lt;MESSAGE&gt;;<br>
close MESSAGE;<br>
<br>
and placing it into the script but this too returned a html format mail to my non web email programs.<br>
<br>
Thanks for any help<br>
kelly<br>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top