Opened 10 years ago

Closed 10 years ago

#2461 closed defect (fixed)

ROR error because of wrong encoding when sending mail

Reported by: Jochen Topf Owned by: Tom Hughes
Priority: major Milestone:
Component: api Version:
Keywords: Cc:

Description

Somebody send me a mail through the OSM web interface. I answered from my mail client using the new reply functionality. I got the following error back:

A message that you sent could not be delivered to one or more of its recipients. This is a permanent error. The following address(es) failed:

m-79366-365371@…

local delivery failed

The following text was generated during the delivery attempt:


/var/lib/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract_adapter.rb:219:in `old_log': PGError: ERROR: invalid byte sequence for encoding "UTF8": 0xe47265 (ActiveRecord::StatementInvalid?) HINT: This error can also happen if the byte sequence does not match the encoding expected by the server, which is controlled by "client_encoding". : INSERT INTO "messages" ("title", "body", "to_user_visible", "message_read", "to_user_id", "sent_on", "from_user_id", "from_user_visible") VALUES(E'Re: [OpenStreetMap] woodpeck hat dir eine Nachricht gesendet', E'On Mon, Nov 09, 2009 a t 08:21:36AM +0000, woodpeck wrote:

=======

and later in the mail the follwing:

', 't', 'f', 5164, '2009-11-09 08:49:36.610367', 4499, 't') RETURNING "id" from /home/rails/config/initializers/abstract_adapter.rb:9:in `log'

from /var/lib/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/postgresql_adapter.rb:550:in `execute' from /var/lib/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/postgresql_adapter.rb:1037:in `select_raw' from /var/lib/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/postgresql_adapter.rb:1024:in `select' from /var/lib/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/database_statements.rb:7:in `select_all_without_query_cache' from /var/lib/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/query_cache.rb:62:in `select_all' from /var/lib/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/database_statements.rb:13:in `select_one' from /var/lib/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/database_statements.rb:19:in `select_value'

... 13 levels...

from /var/lib/gems/1.8/gems/activerecord-2.3.4/lib/active_record/transactions.rb:200:in `save!' from /var/lib/gems/1.8/gems/activerecord-2.3.4/lib/active_record/transactions.rb:208:in `rollback_active_record_state!' from /var/lib/gems/1.8/gems/activerecord-2.3.4/lib/active_record/transactions.rb:200:in `save!' from /home/rails/script/deliver-message:28

======

The encoding in my email might be wrong. But in any case it shouldn't lead to this error.

Change History (1)

comment:1 Changed 10 years ago by tomhughes

Resolution: fixed
Status: newclosed

(In [18641]) Use TMail to parse messages so that character set conversions are done correctly. Fixes #2461.

Note: See TracTickets for help on using tickets.