mando.stathaki@gmail.com
2016-10-17 08:05:33 UTC
Hello,
My setup consists of a centos 6.8 machine with postfix 2.6.6 installed. I have a PHP 5.5.38 application which sends mails. The php application creates an .sh file with the following content:
#!/bin/ksh
(
export MAILFROM="Some_Greek_Mailfrom<***@yyyyy.gr>"
export MAILTO="***@yyyyy.gr, ***@gmail.com"
export BCC="***@gmail.com"
export SUBJECT="Some_Greek_Subject"
export BODY="BIG HTML BODY"
export MAILPART_BODY=`uuidgen`
(
echo "From: $MAILFROM";
echo "To: $MAILTO";
echo "Bcc: $BCC";
echo "Subject: $SUBJECT";
echo "MIME-Version: 1.0";
echo "Content-Type: multipart/alternative; boundary=\"$MAILPART_BODY\"";
echo "";
echo "--$MAILPART_BODY";
echo "Content-Type: text/plain; charset=utf-8";
echo "";
echo "You need to enable HTML option for email";
echo "--$MAILPART_BODY";
echo "Content-Type: text/html; charset=utf-8";
echo "Content-Transfer-Encoding: 8bit";
echo "Content-Disposition: inline";
echo "";
echo $BODY;
echo "--$MAILPART_BODY--";
) | /usr/sbin/sendmail $MAILTO, $BCC
)
Then I call another function from php which executes the .sh file and the mail is sent.
I must mention that the BODY that is produced by the php application is very large (>1000) and is always html.
I must also mention that I had no problems until 2 weeks ago where the problem with the random special characters in the mail body started appearing.
Until the problem appears, there was no authentication with the relay (openrelay). This changed when the guys that administer the relay server configured it to always use authentication.
I use SASL to authenticate to the relay.
Now in ALL the messages that are sent by postfix (postfix is configured only to send) there are random special characters inserted like this:
"Το όÏ �ι μέχρι τώρα μας απαντάει η Facebook, εξηγείται στο γεγονός "
I have tried almost everything (changed content-transfer-encoding, postfix configuration options etc) but same problem.
Also I have run a network trace and confirmed that the problem is in my side. The characters are displayed in the trace.
I think it's postfix's behavior but I have no clue how to deal with this issue of large line length in the mail body.
Any help?
Thanks.
My setup consists of a centos 6.8 machine with postfix 2.6.6 installed. I have a PHP 5.5.38 application which sends mails. The php application creates an .sh file with the following content:
#!/bin/ksh
(
export MAILFROM="Some_Greek_Mailfrom<***@yyyyy.gr>"
export MAILTO="***@yyyyy.gr, ***@gmail.com"
export BCC="***@gmail.com"
export SUBJECT="Some_Greek_Subject"
export BODY="BIG HTML BODY"
export MAILPART_BODY=`uuidgen`
(
echo "From: $MAILFROM";
echo "To: $MAILTO";
echo "Bcc: $BCC";
echo "Subject: $SUBJECT";
echo "MIME-Version: 1.0";
echo "Content-Type: multipart/alternative; boundary=\"$MAILPART_BODY\"";
echo "";
echo "--$MAILPART_BODY";
echo "Content-Type: text/plain; charset=utf-8";
echo "";
echo "You need to enable HTML option for email";
echo "--$MAILPART_BODY";
echo "Content-Type: text/html; charset=utf-8";
echo "Content-Transfer-Encoding: 8bit";
echo "Content-Disposition: inline";
echo "";
echo $BODY;
echo "--$MAILPART_BODY--";
) | /usr/sbin/sendmail $MAILTO, $BCC
)
Then I call another function from php which executes the .sh file and the mail is sent.
I must mention that the BODY that is produced by the php application is very large (>1000) and is always html.
I must also mention that I had no problems until 2 weeks ago where the problem with the random special characters in the mail body started appearing.
Until the problem appears, there was no authentication with the relay (openrelay). This changed when the guys that administer the relay server configured it to always use authentication.
I use SASL to authenticate to the relay.
Now in ALL the messages that are sent by postfix (postfix is configured only to send) there are random special characters inserted like this:
"Το όÏ �ι μέχρι τώρα μας απαντάει η Facebook, εξηγείται στο γεγονός "
I have tried almost everything (changed content-transfer-encoding, postfix configuration options etc) but same problem.
Also I have run a network trace and confirmed that the problem is in my side. The characters are displayed in the trace.
I think it's postfix's behavior but I have no clue how to deal with this issue of large line length in the mail body.
Any help?
Thanks.