Forum Moderators: coopster & phranque

Message Too Old, No Replies

Sendmail cutting off text after line break

         

jjohnstn

5:17 am on Apr 28, 2004 (gmt 0)

10+ Year Member



In user-completed forms text is being cut off after a line break in the
form text. I've tried various command line switches for $mailprog but they
seem to have no
effect. Here's what I'm using:

$mailprog = '/usr/sbin/sendmail -oi -t -oem';

open(MAIL,"¦$mailprog");

print MAIL "To: $recipient\n";
print MAIL "From: $Config{'email'} ($Config{'realname'})\n";
print MAIL "Subject: $Config{'subject'}\n\n" }
foreach $field (@Field_Order) {
print MAIL "$field: $Form{$field}\n\n";
}
close (MAIL);

...etc... (it's a secured variation of formmail.pl)

This used to work fine on a different server. I've moved to a new server and
now this error has cropped up.
Any ideas?

MichaelBluejay

6:17 am on Apr 28, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Just some wild ideas....

How do we know it's the script mangling it, rather than that the script never got all the data to begin with?

Do you get all the data if you output to the screen rather than to MAIL?

There are three choices for wrap in the HTML for a text area field: Virtual, Physical, and Off. Have you tried each of those?

String substition might help, if you could replace the bad newline character with a good newline character:

$text =~ s/badchar/\n/;

But of course the trick would be knowing what the bad newline character is....

Let us know how it turns out.

jjohnstn

3:06 pm on Apr 28, 2004 (gmt 0)

10+ Year Member



Thanks, the text is outputted to screen correctly, so the script is getting out. I may try substituting out the "bad" character as you suggest, but my concern is that it worked before on a different server.

I may also install an unmodified formmail.pl to see what it does, since they should work "out of the box".

I'll post my findings here, and thanks again for your suggestions.

jjohnstn

8:43 pm on Apr 28, 2004 (gmt 0)

10+ Year Member



Well I just installed the original verision of formmail 1.92, set it to the sendmail path using

$mailprog = '/usr/sbin/sendmail -i -t';

and it does the same thing - dropping text after the first return in the text box. No other changes were made to the script. The "thank you for filling out this form" output to screen does show the entire text:
"skldjfskljfsjsdfsdfjs sdf sdf sd fsdf sdf end"

But in the email it is cut off after "skldjfskljfsjsdfsdfjs"

I'm now wondering if the server's sendmail is messed up somehow. Replacing a return with some other character might likely fix it, but I'm worried something larger is the cause.

jjohnstn

6:12 am on Apr 29, 2004 (gmt 0)

10+ Year Member



Well, after much experimentation I discovered that it was my email app (Eudora) that was trunating the messages. Retrieving email in both Outlook Express and Thunderbird showed the entire message. I have no idea whay it's doing this, but I'm glad it's not a server config.