Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix accented queue name (en)coding if not utf8 #171

Open
wants to merge 2 commits into
base: stable
Choose a base branch
from

Conversation

atus42
Copy link

@atus42 atus42 commented Jan 12, 2016

this little fix corrects queue name (en)coding if it contains accented but not necessary utf8 character(s).

The queue name is 'UKK üzemeltetés'.
The line in the (utf8 encoded) aliases file is
ukkuzemeltetes: "|/usr/bin/rt-mailgate --ca-file /etc/ssl/certs/mithrandir.ca.crt --queue 'UKK üzemeltetés' --action correspond --url https://rt.mithrandir.hu/"

Without the fix, we got the below error in syslog, and the mail waits in the mail queue with a temporary error.

Jan 12 10:44:23 mail RT: [23963] Could not record email: RT couldn't find the queue: UKK üzemeltetés
Jan 12 10:44:23 mail postfix/local[25018]: 0BF9B1060: to=ukkuzemeltetes@mithrandir.hu, relay=local, delay=0.35, delays=0.01/0.01/0/0.33, dsn=4
.3.0, status=deferred (temporary failure. Command output: RT server error. The RT server which handled your email did not behave as expected. I
t said: temporary failure - RT couldn't find the queue: UKK __zemeltet__s )

The fix should apply to the upcoming 4.4 too, as the file appears to be the same.

@netsandbox
Copy link
Contributor

@atus42 you can also use the queue id instead of the queue name to workaround your problem.
This also have the benefit that you don't have to change the alias file if you change a queue name.

@atus42
Copy link
Author

atus42 commented Jan 12, 2016

Thanks for the reply. Queue ID-s are not as 'readable' as queue names, but it is good to know that we can use id-s too.

@atus42
Copy link
Author

atus42 commented Jan 13, 2016

We tested the utf8 / non utf8 part, and indeed it was not necessary. None of them. (we saw this code elsewhere and just used it)

We tried the Encode::decode("utf-8", ...) method, but it didn't even code the queue name to utf8.

We did more tests to see what happens in case of real utf8 characters, like ő, and found out that our initial 'solution' failed this test. On the other hand it showed that lwp::useragend didn't handle utf8 characters in queue name form-data and searched another solution.

Our tests shows that encoding/decoding queue name with HTML::Entities solves all problems (we know about).

I committed the new code. We tested it with letters áé, ő and 'english only' in queue names and éáűőúöüóíÉÁŰŐÚÖÜÓÍ letters in the mail body. The ticket(s) got created in every case and the mail body contained all the letters with proper coding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants