Project

General

Profile

Autoassign new tickets from email with 2 byte letters like Japanese

Added by Ryoko Naito over 9 years ago

I installed Ruby 2.1.2 and Rails, and operate Redmine 2.5.2 on a server with CentOS 6.
I set up postfix and edited the 'aliases' file in order to directly assign tickets to Redmine from email.

/etc/aliases
support: "|/usr/local/bin/ruby /XXXXX/redmine-2.5.2/extra/mail_handler/rdm-mailhandler.rb --url https://XXXXXXXX/ --key XXXXXXXXXX --project=inbox --unknown-user=accept --tracker=なる早 --no-permission-check"

Setting only a project attribute, it works.
However, when I set 2 byte letter like Japanese in tracker name attribute, an error occurs:

production.log
ArgumentError (invalid byte sequence in UTF-8):
app/models/mail_handler.rb:316:in `get_keyword'
app/models/mail_handler.rb:368:in `issue_attributes_from_keywords'
app/models/mail_handler.rb:186:in `receive_issue'
app/models/mail_handler.rb:174:in `dispatch_to_default'
app/models/mail_handler.rb:159:in `dispatch'
app/models/mail_handler.rb:134:in `receive'
app/models/mail_handler.rb:46:in `receive'
app/controllers/mail_handler_controller.rb:25:in `index'

I edited the mail_handler.rb file in Redmine in order I set tracker attribute with its ID.

However, I need to use Japanese letters in certain require custom fields, and as a result I am awfully annoyed.
I wonder if someone help me.


Replies (1)

RE: Autoassign new tickets from email with 2 byte letters like Japanese - Added by Ryoko Naito over 9 years ago

すみません、大騒ぎしていたredmineのメール日本語attributeチケット登録ですが、単にサーバのロケールを日本語にしてなかったのが原因でした。ごめんなさい。

Dear All,

Thank you for all your kindness, and I should apologize for my easy mistakes on my server settings.

I forgot setting the server locale to Japanese.
I solute this problem the following way:

  1. vi /etc/sysconfig/i18n
    ------------------------
    #LANG="en_US.UTF-8"
    LANG="ja_JP.UTF-8"
    SYSFONT="latarcyrheb-sun16"
    ------------------------
  1. vi ~/.vimrc
    ------------------------
    #add Japanese Encoding
    set encoding=utf-8
    set fileencodings=utf8,iso-2022-jp,euc-jp,sjis
    ------------------------
  1. reboot

I deeply appreciate all your kind advice, and I could learn Redmine a little bit more.
I am terribly sorry for taking your precious time.

All the best,
Ryoko Naito

    (1-1/1)