Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

new confused and bogged down.

new confused and bogged down.

new confused and bogged down.

Hello All.
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)

You wrote:

>This is a multi-part message in MIME format.
>Content-Type: text/plain;
> charset="utf-7"
>Content-Transfer-Encoding: 7bit
>Content-Type: text/html;
> charset="utf-7"
>Content-Transfer-Encoding: quoted-printable
><META content=text/html;charset=utf-7 =
><META content='"MSHTML 4.72.3110.7"' =
><BODY bgColor=#ffffff>
><DIV><FONT color=#000000 =

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

Can't modify concatenation in scalar assignment at /usr/local/mailback/mailback.pl line 100, near ");"
Execution of /usr/local/mailback/mailback.pl aborted due to compilation errors.
554 "¦ perl /usr/local/mailback/mailback.pl"... unknown mailer error 255

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
Thanks in advance for any help

RE: new confused and bogged down.

Sounds like a syntax problem but without seeing line 100 in context it's difficult to say.
You can hunt around at perl.com, webmonkey.com, devshed.com.

RE: new confused and bogged down.

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:

$MyScalar . = $ThingToConcat;

ie, a space between the "." and "=". Like robman says, without seeing it, it's a bit difficult to say. Post the section of code if you're still having problems.

RE: new confused and bogged down.

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..

#/usr/bin/perl -w

#get the data from the message and store it for use.

$header = ''; #store header content
$body = ''; #store body content

#parse each line in the header

while (<>) {
last if /^$/;
$header.= $_;
($field, $value) = /^(\S*)\s*(.*)/;
if (length($field) > 1) { $fields($field) = $value; }
else { $fields($field) .= " $value"; }

while (<>) { $body.= $_; } #body is stored here

#reply to mail

open (MAIL, "¦usr/bin/sendmail);
print MAIL "From: $fields{'To:'}\n";
print MAIL "To: $fields{'From:'}\n;
print MAIL "Subject: Re: $fields{'Subject:'}\n;
print MAIL "\n\n";
#print MAIL "$body"; #this causes the message to return in #html format
print MAIL "Thank you for contacting mycompany,\n"
print MAIL "Your mail has been recieved and\n";
print MAIL "automatically forwarded to our technical\n"; print MAIL "dept. You will be contacted by one of \n";
print MAIL "our staff as soon as possible.\n";
close MAIL;

I also tried to store the reply message seperately with

open MESSAGE, "usr/local/mailback/message-$id";
$mail{'Message'} = <MESSAGE>;
close MESSAGE;

and placing it into the script but this too returned a html format mail to my non web email programs.

Thanks for any help

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close