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

Already on GitHub? Sign in to your account

NoMethodError when adding a file with umlauts (åäö) which has umlauts in its content #78

ba opened this Issue Jun 24, 2010 · 3 comments


None yet
5 participants

ba commented Jun 24, 2010

This is basically me trying to re-open issue #52.

I'm running the same test code with 2.2.5 and getting an error adding a file named with umlauts which contains umlauts. This last part I just noticed. My test files didn't work between the versions so I moved things around and noticed this.

I noted that if I tried to add an empty file named 'åäö.txt' the mail got sent no problems. And if the file had text in it with only 0-9 and a-z it went through without a problem. But If I added an umlaut in the content of the file Mail blew up with:

/usr/lib/ruby/gems/1.8/gems/mail-2.2.5/lib/mail/field.rb:122:in `send': undefined method `filename' for #<Mail::UnstructuredField:0xb7431cac> (NoMethodError)
    from /usr/lib/ruby/gems/1.8/gems/mail-2.2.5/lib/mail/field.rb:122:in `method_missing'
    from /usr/lib/ruby/gems/1.8/gems/mail-2.2.5/lib/mail/message.rb:1849:in `find_attachment'
    from /usr/lib/ruby/gems/1.8/gems/mail-2.2.5/lib/mail/message.rb:1706:in `attachment?'
    from /usr/lib/ruby/gems/1.8/gems/mail-2.2.5/lib/mail/message.rb:1341:in `add_charset'
    from /usr/lib/ruby/gems/1.8/gems/mail-2.2.5/lib/mail/message.rb:1781:in `add_required_fields'
    from /usr/lib/ruby/gems/1.8/gems/mail-2.2.5/lib/mail/part.rb:42:in `add_required_fields'
    from /usr/lib/ruby/gems/1.8/gems/mail-2.2.5/lib/mail/message.rb:1654:in `ready_to_send!'
    from /usr/lib/ruby/gems/1.8/gems/mail-2.2.5/lib/mail/message.rb:1652:in `ready_to_send!'
    from /usr/lib/ruby/gems/1.8/gems/mail-2.2.5/lib/mail/message.rb:1650:in `each'
    from /usr/lib/ruby/gems/1.8/gems/mail-2.2.5/lib/mail/message.rb:1650:in `ready_to_send!'
    from /usr/lib/ruby/gems/1.8/gems/mail-2.2.5/lib/mail/message.rb:1666:in `encoded'
    from /usr/lib/ruby/gems/1.8/gems/mail-2.2.5/lib/mail/network/delivery_methods/smtp.rb:91:in `deliver!'
    from /usr/lib/ruby/gems/1.8/gems/mail-2.2.5/lib/mail/message.rb:1862:in `do_delivery'
    from /usr/lib/ruby/gems/1.8/gems/mail-2.2.5/lib/mail/message.rb:225:in `deliver'
    from /usr/lib/ruby/gems/1.8/gems/mail-2.2.5/lib/mail/mail.rb:140:in `deliver'
    from /home/ba/mail-test.rb:30

A file not named with umlauts and with umlauts in the content went through without a problem.

Weird. :)


mikel commented Sep 11, 2010

I think you will find this is because of the content-type problem. Could you please install mail and try again?

bennibu commented Oct 20, 2010

I can confirm this bug with rails 3.0.1 and mail 2.2.7. German umlauts (maybe other special characters too) in filename result in to the "no method 'filename'" error, whenn adding an attachment.
Any ideas, how to fix this?


amatsuda commented Dec 2, 2010

I made a fix with this problem: #158

As I tested only in Japanese, I'm happy if you guys verify that this works properly for your languages (Swedish, German or whatever) as well.

Bira pushed a commit to Bira/mail that referenced this issue Jul 8, 2011

@jeremy jeremy closed this Jan 26, 2013

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