Message ID generation Issue #5

Closed
dj2 opened this Issue Nov 10, 2009 · 2 comments

Projects

None yet

2 participants

@dj2

I'm attempting to use the mail gem but am running into an issue. It seems that the autogenerated Message id that is assigned is invalid.

/usr/local/lib/ruby/gems/1.8/gems/mail-1.2.1/lib/mail/elements/message_ids_element.rb:12:in initialize': MessageIdsElement can not parse |4af86a8e36961_52be..fdbf130dc94d5@Titania.mail| (Mail::Field::ParseError) Reason was: Expected one of ", !, #, $, %, &, ', *, +, -, /, =, ?, ^, _,, {, |, }, ~, @ at line 1, column 21 (byte 21) after <4af86a8e36961_52be.

This seems to be an issue with the %x encoding of Thread.current.object_id on this version of ruby.

[dj2@Titania:~] ruby -v ruby 1.8.7 (2008-06-09 patchlevel 17) [i686-linux]

irb(main):014:0> Thread.current.object_id
=> -605320998

irb(main):015:0> sprintf("%x", (Thread.current.object_id))
=> "..fdbeb88da"

Changing it to make the object_id a positive number seems to fix the issue

irb(main):003:0> sprintf("%x", (Thread.current.object_id).abs)
=> "24120f22"

@mikel
Owner

Can't think of an easy way to spec this, fix looks harmless enough, so added it in 300202f. Resolved from what I can see, please let me know.

@mikel
Owner

closing issue

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment