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.
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}}
This article covers tips to resolve invalid character error in mail-in DirectAdmin.
The reason for this error is that Oracle sees a character that it considers invalid.
If you use a special character in a table or column name, then try putting double quotation-marks around the name.
If you use a special character in a value, put quotation marks around it.
If you look closely, you'll notice a punctuation mark of some sort between "Character" and "Invalid."
This means you have included punctuation marks in the information you typed into that field.
Remove all punctuation marks, symbols, or other special characters and you will be able to proceed.
To fix #DirectAdmin #error: Invalid characters in mail autoresponder:
1. You have to set correct encoding for Directadmin theme that is used. In this case, default “enhanced” theme was used so I edited accordingly:
vi /usr/local/directadmin/data/skins/enhanced/lang/en/lf_standard.html
2. Then find variable “LANG_ENCODING” and correct it to your needs. In my case:
LANG_ENCODING=UTF-8