- If everything is in order in clause 2 but messages still fail to go through:
- Place the script test_email.sh to the catalog / usr / bin / and set execution rights: #! / Bin / bash
export HOME = / home / bitrix
tmp_dir = / tmp / mail
args = $ @
if [[! -d $ tmp_dir]]; then
mkdir $ tmp_dir
chmod 777 $ tmp_dir
fi
message_body = ""
while read line; do
message_body = "$ message_body $ line \ n"
done </ dev / stdin
tmp_file = $ (mktemp $ tmp_dir / $ (date +% Y% m% d_% H% M% S) _XXXXXXXXX)
echo "==== ===================================== "> $ tmp_file
echo" ARGV: / usr / bin / msmtp --debug -t -i $ args ">> $ tmp_file
echo" ============================ == == ==== ">>
echo -e "BODY: $ message_body" >>
echo "================================= == == ">> $ tmp_file
# send message
echo -e" $ message_body "| / usr / bin / msmtp --debug -t -i $ args >> $ tmp_file && 2> & 1 - Change the mail settings in the configuration /etc/php.d/bitrixenv.ini:sendmail_path = /usr/bin/test_mail.sh
- Restart apache.
- This script launches msmtp with the debug option and stores information about sending parameters, body of the message, and command execution results for each message sent.
When a message is created from the web interface, all of the information is stored in the catalog / tmp / mail, and each message will be stored in a separate file.
- Place the script test_email.sh to the catalog / usr / bin / and set execution rights: #! / Bin / bash