Topic: Mailing doesn't work if the header contains "&"
I've struggled hours for figuring out the reason why my mails won't appear in target. It turned out that after installing and configuring "Postfix", "FrontAccounting" told me that the mail was sent but nothing really was sent. So I dug into the files and started to debug. After many hours, it turned out that mails containing a header containing "&" weren't sent and other mails were. So I started to look for the file where the company name that contains that stuff is being read out and couldn't find it. I decided to make the following modification replacing lines 149-150 in the file reporting/includes/class.mail.inc:
if (mail($mail, $this->subject, $this->body, $this->header, $this->add_params))
$ret++;
with
if (mail($mail, $this->subject, htmlspecialchars_decode($this->body, ENT_NOQUOTES), htmlspecialchars_decode($this->header, ENT_NOQUOTES), $this->add_params))
$ret++;
}
Please notice that I decided to convert both the header and body for that purpose. The company name is "Tegusad Õpilased & Tudengid" and in the database, it's "Tegusad Õpilased & Tudengid". Now, it works. Maybe, it's just a hack but I couldn't find any other way to solve this problem.
And before that, I had to make one more important change: into the file "/etc/php/7.2/apache2/php.ini":
SMTP = test.tennis24.ee
Before that, the value was localhost. I changed the host name for the sake of Postfix. Why localhost isn't recognized anymore, I don't know.