Comments (16)
こちらで検証したのですが、Subject/BodyともにISO-2022-JPで、本文が「日本」のみではエラーにはなりませんでした。
エラーを見ると、Encodingが誤って解釈されたか、来たメールのEncodingが実際とは異なるなどの問題だと思います。エラーになるメールの
- Content-Type
- Subject
- 本文
を教えていただけますか。
from jpmobile.
エラーとなったメールは以下のとおりです。
ドメイン名等は変更しています。
-
Content-Type
Content-Type: multipart/alternative;
boundary=Apple-Mail-453BF7C8-E087-4CEB-A163-18A4B0CBB56C -
Subject
Subject: =?iso-2022-jp?B?RndkOiAbJEIhWhsoQk51cnNlcnlNYWlsGyRCIVtGfEZ8GyhC?=
-
本文
--Apple-Mail-453BF7C8-E087-4CEB-A163-18A4B0CBB56C
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
charset=iso-2022-jpiPhone=1B$B$+$iAw?.=1B(B
Begin forwarded message:
=1B$B:9=3DP?M=1B(B: [email protected]
=1B$BF|;~=1B(B: 2012=1B$BG/=1B(B7=1B$B7n=1B(B30=1B$BF|=1B(B 10:09:12 JST
=1B$B08@h=1B(B: [email protected]
=1B$B7oL>=1B(B: =1B$B!Z=1B(BNurseryMail=1B$B![F|F|=1B(B
Reply-To: [email protected]
=20
=1B$BJ#?t;XDj1;y#1$/$s=1B(B =1B$B$NJ]8n<TMM=1B(B =20 =1B$BMh$k!{!{7n!{!{F|$KJ]0i1
$K$F!"%9%$ %+3d$jBg2q$r3+:ECW$7$^$9!#=1B(B
=1B$B8f;22CD:$1$k>l9g$O=1B(B [email protected] =1B$B$X=1B(=B
=1B$BIT;22C$N>l9g$O=1B(B [email protected] =1B$B$X=1B(B
=1B$B%9%$%+$r;}$C$F$-$F$/$l$kJ}$O=1B(B [email protected] =1B$B$X=1B(B
=1B$B%9%$%+$8$c$J$/!"%a%m%s$r;}$C$F$-$F$/$l$kJ}$O=1B(B [email protected] =1B$B$X=1B(B
=1B$BLlGL$b;22C$7$?$$$H$$$&J}$O=1B(B [email protected] =1B=$B$X=1B(B
=1B$B%9%$%+$K$J$C$F$/$l$k$*Ic$5$s$O=1B(B [email protected]=1B$B$X=1B(B
=1B$B@N=3D$3XN99T$GGc$C$?LZEa$r;}$C$F$-$F$/$l$kJ}$O=1B(B [email protected] =1B$B$X=1B(B
=1B$B$J$s$G$b$$$$$+$i;22C$7$?$$$H$$$&J}$O=1B(B [email protected] =1B$B$X=1B(B
=1B$B0{$5$K~!9$N?M$O=1B(B [email protected] =1B$B$X=1B(B =20 =1B$B6u%a!<%k$rAw?.$/$@$5$$!#=1B(B =20 =1B$B!!!!""""J]0i1
!!!y!yAH!!C4G$!!#x#x#x#x#x=1B(B--Apple-Mail-453BF7C8-E087-4CEB-A163-18A4B0CBB56C
Content-Transfer-Encoding: base64
Content-Type: text/html;
charset=utf-8以下、HTMLの本文が続きます
以上、宜しくお願いしいたします。
from jpmobile.
d5d7802 の lib/jpmobile/util.rb への変更でこの問題は解決すると思いますが、貼りつけてもらった本文ではそもそもquoted-printable の変換が間違っている部分があるため、別のエラーになるかもしれません。
リリースは絵文字関係のオプションを追加してからになるので、必要であればパッチとしてこの変更の部分だけを取り込んでください。
from jpmobile.
上記パッチを当てて試してみたのですが、同様にEncoding::InvalidByteSequenceErrorが発生しました
もし必要でしたら、使用したメールデータを送らせて頂きます。
-
スタックトレース
/usr/lib/ruby/gems/ruby-1.9.3-p194/gems/railties-3.2.1/lib/rails/commands/runner.rb:53:in
'eval': "\xE3" on ISO-2022-JP (Encoding::InvalidByteSequenceError) from /usr/lib/ruby/gems/ruby-1.9.3-p194/gems/jpmobile-3.0.4/lib/jpmobile/util.rb:146:in
jis_to_utf8' from
/usr/lib/ruby/gems/ruby-1.9.3-p194/gems/jpmobile-3.0.4/lib/jpmobile/mobile/au.rb:116:into_mail_internal' from /usr/lib/ruby/gems/ruby-1.9.3-p194/gems/jpmobile-3.0.4/lib/jpmobile/mobile/abstract_mobile.rb:160:in
decode_transfer_encoding' from
/usr/lib/ruby/gems/ruby-1.9.3-p194/gems/jpmobile-3.0.4/lib/jpmobile/mail.rb:371:indecode_transfer_encoding' from /usr/lib/ruby/gems/ruby-1.9.3-p194/gems/jpmobile-3.0.4/lib/jpmobile/mail.rb:123:in
process_body_raw_with_jpmobile' from
/usr/lib/ruby/gems/ruby-1.9.3-p194/gems/mail-2.4.4/lib/mail/message.rb:1155:inbody' from /usr/lib/ruby/gems/ruby-1.9.3-p194/gems/jpmobile-3.0.4/lib/jpmobile/mail.rb:358:in
block in mobile=' from
/usr/lib/ruby/gems/ruby-1.9.3-p194/gems/jpmobile-3.0.4/lib/jpmobile/mail.rb:355:ineach' from /usr/lib/ruby/gems/ruby-1.9.3-p194/gems/jpmobile-3.0.4/lib/jpmobile/mail.rb:355:in
mobile=' from
/usr/lib/ruby/gems/ruby-1.9.3-p194/gems/jpmobile-3.0.4/lib/jpmobile/mail.rb:118:inprocess_body_raw_with_jpmobile' from /usr/lib/ruby/gems/ruby-1.9.3-p194/gems/mail-2.4.4/lib/mail/message.rb:1155:in
body' from
/usr/lib/ruby/gems/ruby-1.9.3-p194/gems/mail-2.4.4/lib/mail/message.rb:1934:inidentify_and_set_transfer_encoding' from /usr/lib/ruby/gems/ruby-1.9.3-p194/gems/mail-2.4.4/lib/mail/message.rb:1689:in
ready_to_send!' from
/usr/lib/ruby/gems/ruby-1.9.3-p194/gems/jpmobile-3.0.4/lib/jpmobile/mail.rb:65:inencoded_with_jpmobile' from /usr/lib/ruby/gems/ruby-1.9.3-p194/gems/actionmailer-3.2.1/lib/action_mailer/base.rb:435:in
set_payload_for_mail' from
/usr/lib/ruby/gems/ruby-1.9.3-p194/gems/jpmobile-3.0.4/lib/jpmobile/mailer.rb:42:inset_payload_for_mail' from /usr/lib/ruby/gems/ruby-1.9.3-p194/gems/actionmailer-3.2.1/lib/action_mailer/base.rb:404:in
block in receive' from
/usr/lib/ruby/gems/ruby-1.9.3-p194/gems/activesupport-3.2.1/lib/active_support/notifications.rb:123:inblock in instrument' from /usr/lib/ruby/gems/ruby-1.9.3-p194/gems/activesupport-3.2.1/lib/active_support/notifications/instrumenter.rb:20:in
instrument' from
/usr/lib/ruby/gems/ruby-1.9.3-p194/gems/activesupport-3.2.1/lib/active_support/notifications.rb:123:ininstrument' from /usr/lib/ruby/gems/ruby-1.9.3-p194/gems/actionmailer-3.2.1/lib/action_mailer/base.rb:402:in
receive' from (eval):1:in<top (required)>' from /usr/lib/ruby/gems/ruby-1.9.3-p194/gems/railties-3.2.1/lib/rails/commands/runner.rb:53:in
eval' from
/usr/lib/ruby/gems/ruby-1.9.3-p194/gems/railties-3.2.1/lib/rails/commands/runner.rb:53:in<top (required)>' from /usr/lib/ruby/gems/ruby-1.9.3-p194/gems/railties-3.2.1/lib/rails/commands.rb:64:in
require' from
/usr/lib/ruby/gems/ruby-1.9.3-p194/gems/railties-3.2.1/lib/rails/commands.rb:64:in<top (required)>' from script/rails:6:in
require' from script/rails:6:in `
宜しくお願いいたします。
from jpmobile.
ここに貼り付けていただいたメールのデータですが、=1B(=B
のようにそもそも不正なデータになっていたので、decode時にエラーになってしまうようです。よろしければメールデータをtarとかzipで圧縮して送っていただけますか?
とは言え、そういう不正なメールが来ないとも限らないので、どこかでrescueしてASCII-8BITで返す必要があるとは思ってますので、そちらはそちらで対処予定です。
from jpmobile.
現象を確認しました。ただ結構根深そうなので、すぐには修正できそうにありません。もう少々お待ちください。
from jpmobile.
742f2a3 で受信時のエラーは大丈夫そうですので、一度試してみていただけますか。
from jpmobile.
受信エラーが無くなりました。
もう少しいろんなパターンで試してみたいと思います。
ありがとうございました。
from jpmobile.
au版iPhoneのMessageアプリでエラーになってしまいました。
/usr/lib/ruby/gems/1.9.1/gems/railties-3.2.1/lib/rails/commands/runner.rb:53:in `eval': "\xE7" on ISO-2022-JP (Encoding::InvalidByteSequenceError) from
/usr/lib/ruby/gems/1.9.1/gems/jpmobile-3.0.4/lib/jpmobile/util.rb:148:in `jis_to_utf8'
送信したメールは以下のとおりです
Subject:=?UTF-8?B?aVBob25lIGF1IOODoeODg+OCu+ODvOOCuA==?=
Message-ID: <212212358846052174@-212212358846052175>
Date: Tue, 22 Aug 2012 01:27:26 +0000
MIME-Version:1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: base64
JVvlnJLlhZDlkI1dJeOBriVb5L+d6K236ICF5ZCNXSUg5qeYCgrmlr3oqK3jgavpgIHkv6HjgIIK
6YG45oqeMeOBryVb44Ki44OJ44Os44K5MV0l44G4CumBuOaKnjLjga8lW+OCouODieODrOOCuTJd
JeOBuArov5Tkv6HjgZfjgabkuIvjgZXjgYTjgIIKCmlQaG9uZSBhdSDjg6Hjg4Pjgrvjg7zjgrg=
宜しくお願いいたします。
from jpmobile.
runner
の実行時のエラーのようですが、メールの受信か送信かのどちらでしょうか。おそらく受信だとは思うのですが、受信時のエラーでしょうか。
上記のメールをそのまま受信->送信ではエラーにはなりませんでした。
from jpmobile.
メール受信時にエラーとなります。
上で貼った部分だけを受信させるとエラーになりませんが、メールヘッダを含めて受信させるとエラーになりました。
メール全文を別途送らせて頂きます。
from jpmobile.
68fbf6e で送ってもらったメールがうまく処理できるように修正しました。こちらでどうでしょうか。
from jpmobile.
受信できるようになりました。
ありがとうございました。
from jpmobile.
また受信時にエラーとなるパターンがでました。
メールにてエラーとなったものを送らせてもらいます。
よろしくお願いします。
from jpmobile.
どんなエラーになりましたか?
from jpmobile.
あと同じissueではないので、別のチケットとしてください。そのときにbacktraceもお願いします。
from jpmobile.
Related Issues (20)
- メール転送エージェントを起動していないとテストで落ちる HOT 2
- README中のサンプルコードがリンクとして解釈されてしまっている HOT 2
- bundle installに--pathを付けるとテスト実行時にGemが見つけられない件 HOT 2
- タイポ? HOT 2
- undefined method `extract_handler_and_format` と出てしまう (Ruby2.2.0 / Rails 4.2.3) HOT 5
- raise error in `fetching from https://rubygems.org/` when bundle install HOT 9
- rails3.2.22.2にて、rails側はActionView::FileSystemResolver#queryメソッドの引数を増やしています HOT 1
- rails-4-2ブランチ で NoMethodError: undefined method `to_crlf' for "":String HOT 1
- Source change broke Rails < 5.1 support HOT 3
- mail 2.7.0でBody#only_us_ascii?が無くなった HOT 4
- Ruby 2.7 support on jpmobile 7.0 HOT 3
- TargetRubyVersion 3.0 対応
- UA-CHに対応する
- 非PC向けテンプレートだけが存在するエンドポイントで、コントローラでのアクション定義を省略できない HOT 9
- Rails 7.0では常にHAMLよりERBのテンプレートが優先されてしまう HOT 1
- 元々_mobileとついているテンプレートファイル名が使えない HOT 3
- Dependency Dashboard
- ApplicationController::Liveがtest_case.rbで定義されたnew_controller_threadを呼ぶ HOT 7
- 7.0.4 のタグとコミットが push されていなさそうです HOT 2
- request.mobile.displayがNilclassになってしまう HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jpmobile.