Are you facing DirectAdmin error "Invalid characters in mail autoresponder" ?
This guide is for you.
DirectAdmin invalid characters in mail autoresponder error occurs because no character encoding is specified for auto-replies or vacation messages by default.
Here at Ibmi Media, as part of our Server Management Services, we regularly help our Customers to fix errors relating to DirectAdmin.
In this context, we shall look into how to fix invalid characters in the mail autoresponder.
How to resolve DirectAdmin error: Invalid characters in mail autoresponder ?
Recently, one of our customers approached us saying to us that his clients were getting invalid characters on the mail autoreply message.
The mail was wrongly formatted because of the special characters.
The wrong characters display when we try and enter the correct text in autoresponder form and then save and opened again.
This happens because, by default, no character encoding is specified for auto-replies or vacation messages.
Apply the tips given below to resolve it.
1. For the Directadmin theme that is used, we have to set the correct encoding.
For instance, in our case, we used the default "enhanced" theme.
So, we edit it as below:
$ vi /usr/local/directadmin/data/skins/enhanced/lang/en/lf_standard.html
Then we find the variable "LANG_ENCODING" and correct it to our needs.
In our case, we corrected it to UTF-8:
LANG_ENCODING=UTF-8
2. Another option is to add the following code in the uservacation and userautoreply transport sections of /etc/exim.conf.
headers = Content-Type: text/plain; charset="UTF-8"
Here, we adjust the charset value for the header as required.
Note: for the subject line, try this:
subject = "${if def:h_Subject: {Autoreply: \"${escape:${length_50:$rh_Subject:}}\"} {I am on vacation}}"
There are also reports of the use of $rh_Subject instead of $h_Subject working.
Another possible subject line:
subject = ${if def:h_subject: \
{Autoreply: ${rfc2047:${quote:${escape:${length_60:$h_subject:}} }} }\
{Autoreply Message} \
}
3. Another option is to change the default encoding to UTF-8 by editing exim.cfg by typing:
headers = MIME-Version: 1.0\nContent-Type: text/plain; charset=UTF-8\nContent-Transfer-Encoding: 8bit
subject = ${if def:h_Subject: {Autoreply: ${quote:${escape:${length_50:$h_Subject:}}}} {Autoreply Message}}