• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

MTA qmail, different email handling

C

cyrus1u1

Guest
Hi guys

I wrote a script which sends email from a form --> formmailer.

PHP:
<?php
$mdpass = "c003a894e29e413e42e1ac51527abc76";
if($_POST['sent'] == 2){
	if(md5($_POST['key']) == $mdpass){
		$emailsubject = stripslashes($_POST['emailsubject']);
		$emailmessage = stripslashes($_POST['emailmessage']);
		$emailheader = "From: ".$_POST['emailfromshowname']." < ".$_POST['emailfromaddress']." >\n"; 
		$emailheader .= "Reply-to: ".$_POST['emailfromshowname']." <".$_POST['emailfromaddress'].">\n"; 
		$emailheader .= "Reply-path: ".$_POST['emailfromshowname']." <".$_POST['emailfromaddress'].">\n"; 
		$emailheader .= "MIME-Version: 1.0\n"; 
		$emailheader .= "Content-Type: text/plain\n"; 
		$emailheader .= "X-Sender: ".$_POST['emailfromaddress']."\n"; 
		$emailheader .= "X-Mailer: PHP/".phpversion()."\n"; 
		$emailheader .= "X-Priority: 3";
		
		mail($_POST['emailto'], $_POST['emailsubject'], $emailmessage, $emailheader);
		echo "email has been sent!";
	}else{
		echo "email could not be sent!";
	}
}else{
?>
<form action="<? echo $php_self; ?>" method="POST">
to:<br />
<input type="text" name="emailto" size="20" /><br />
<br />

from address:<br />
<input type="text" name="emailfromaddress" size="20" /><br />
<br />

from showname:<br />
<input type="text" name="emailfromshowname" size="20" /><br />
<br />

subject:<br />
<input type="text" name="emailsubject" size="20" /><br />
<br />

message:<br />
<textarea rows="10" name="emailmessage" cols="30"></textarea><br />
<br />
<br />
<br />
key:<br />
<input type="password" name="key" size="20" /><br />
<br />
<input type="hidden" name="sent" value="2" />
<input type="submit" name="submit" value="send" />
</form>
<?
} ?>

Unfortunatly, only email adresses which aren't on the same server, receive the email correclty. E-Mail adresses which are configured in plesk/qmail on the same server as this formmail-script is, I get double-blank lines.

e.g. entered text in form:
Test 1

Test 2

--> received text on a email adress which is located on the same server:
Test 1



Test 2

--> received text on a email adress which is located on a other server:
Test 1

Test 2

Why is the MTA handling the outgoing email different? Or how can I fix the double blanklines?

Thanks in advance for your help!
 
We are investigating a similar issue for a client. A form to email script build by Sitebuilder corrupts the email when sending to a local account. The email contents come through but they are in HTML code. When sent to a remote account they are handled properly.
 
Back
Top