Opened 7 years ago

Closed 7 years ago

#4207 closed defect (fixed)

Private message by mail and latin-1

Reported by: emj Owned by: rails-dev@…
Priority: trivial Milestone:
Component: website Version:
Keywords: mail private message ruby Cc:

Description

I get this when trying to reply to a private message, basically I'm using "Content-Type: text/plain; charset=ISO-8859-1" and it seems like Ruby isn't decoding that correctly

This message was created automatically by mail delivery software.

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-246057-b9cec0@messages.openstreetmap.org
   local delivery failed

The following text was generated during the delivery attempt:

------ m-246057-b9cec0@messages.openstreetmap.org ------

/var/lib/gems/1.8/gems/activerecord-3.1.3/lib/active_record/connection_adapters/postgresql_adapter.rb:1034:in `get_last_result': PGError: ERROR:  invalid byte sequence for encoding "UTF8": 0xf6722066 (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" ("body", "from_user_id", "from_user_visible", "message_read", "sent_on", "title", "to_user_id", "to_user_visible") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"
       from /var/lib/gems/1.8/gems/activerecord-3.1.3/lib/active_record/connection_adapters/postgresql_adapter.rb:1034:in `exec_cache'
       from /var/lib/gems/1.8/gems/activerecord-3.1.3/lib/active_record/connection_adapters/postgresql_adapter.rb:603:in `exec_query'
       from /var/lib/gems/1.8/gems/activerecord-3.1.3/lib/active_record/connection_adapters/abstract_adapter.rb:244:in `log'
       from /var/lib/gems/1.8/gems/activesupport-3.1.3/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
       from /var/lib/gems/1.8/gems/activerecord-3.1.3/lib/active_record/connection_adapters/abstract_adapter.rb:239:in `log'
       from /var/lib/gems/1.8/gems/activerecord-3.1.3/lib/active_record/connection_adapters/postgresql_adapter.rb:601:in `exec_query'
       from /var/lib/gems/1.8/gems/activerecord-3.1.3/lib/active_record/connection_adapters/abstract/database_statements.rb:63:in `exec_insert'
       from /var/lib/gems/1.8/gems/activerecord-3.1.3/lib/active_record/connection_adapters/abstract/database_statements.rb:90:in `insert'
       from /var/lib/gems/1.8/gems/activerecord-3.1.3/lib/active_record/connection_adapters/abstract/query_cache.rb:14:in `insert'
       from /var/lib/gems/1.8/gems/activerecord-3.1.3/lib/active_record/relation.rb:70:in `insert'
       from /var/lib/gems/1.8/gems/activerecord-3.1.3/lib/active_record/persistence.rb:313:in `create'
       from /var/lib/gems/1.8/gems/activerecord-3.1.3/lib/active_record/timestamp.rb:51:in `create'
       from /var/lib/gems/1.8/gems/activerecord-3.1.3/lib/active_record/callbacks.rb:268:in `create'
       from /var/lib/gems/1.8/gems/activesupport-3.1.3/lib/active_support/callbacks.rb:390:in `_run_create_callbacks'
       from /var/lib/gems/1.8/gems/activesupport-3.1.3/lib/active_support/callbacks.rb:81:in `send'
       from /var/lib/gems/1.8/gems/activesupport-3.1.3/lib/active_support/callbacks.rb:81:in `run_callbacks'
       from /var/lib/gems/1.8/gems/activerecord-3.1.3/lib/active_record/callbacks.rb:268:in `create'
       from /var/lib/gems/1.8/gems/activerecord-3.1.3/lib/active_record/persistence.rb:294:in `create_or_update'
       from /var/lib/gems/1.8/gems/activerecord-3.1.3/lib/active_record/callbacks.rb:264:in `create_or_update'
       from /var/lib/gems/1.8/gems/activesupport-3.1.3/lib/active_support/callbacks.rb:408:in `_run_save_callbacks'
       from /var/lib/gems/1.8/gems/activesupport-3.1.3/lib/active_support/callbacks.rb:81:in `send'
       from /var/lib/gems/1.8/gems/activesupport-3.1.3/lib/active_support/callbacks.rb:81:in `run_callbacks'
       from /var/lib/gems/1.8/gems/activerecord-3.1.3/lib/active_record/callbacks.rb:264:in `create_or_update'
       from /var/lib/gems/1.8/gems/activerecord-3.1.3/lib/active_record/persistence.rb:57:in `save!'
       from /var/lib/gems/1.8/gems/activerecord-3.1.3/lib/active_record/validations.rb:56:in `save!'
       from /var/lib/gems/1.8/gems/activerecord-3.1.3/lib/active_record/attribute_methods/dirty.rb:33:in `save!'
       from /var/lib/gems/1.8/gems/activerecord-3.1.3/lib/active_record/transactions.rb:246:in `save!'
       from /var/lib/gems/1.8/gems/activerecord-3.1.3/lib/active_record/transactions.rb:295:in `with_transaction_returning_status'
       from /var/lib/gems/1.8/gems/activerecord-3.1.3/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'
       from /var/lib/gems/1.8/gems/activerecord-3.1.3/lib/active_record/transactions.rb:208:in `transaction_without_deadlock_handling'
       from /srv/www.openstreetmap.org/rails/vendor/plugins/deadlock_retry/lib/deadlock_retry.rb:46:in `transaction'
       from /var/lib/gems/1.8/gems/activerecord-3.1.3/lib/active_record/transactions.rb:293:in `with_transaction_returning_status'
       from /var/lib/gems/1.8/gems/activerecord-3.1.3/lib/active_record/transactions.rb:246:in `save!'
       from /srv/www.openstreetmap.org/rails/script/deliver-message:33

SNIPP SNIPP this is the mail:

Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hej Bo

Tack f=F6r f=F6rslaget, jag fick just ett mail fr=E5n Stellan om samma sak,
hur kommer det sig tror du? :-)?

Om du kollar p=E5 Wikin s=E5 finns  det en f=F6rklaring p=E5 en annan versi=
on

Change History (2)

comment:1 Changed 7 years ago by Tom Hughes

Can you tell me when this was sent? Only I thought I had fixed this the other day...

comment:2 Changed 7 years ago by Tom Hughes

Resolution: fixed
Status: newclosed

Fixed - turns out my previous fix only worked for multipart mails and not for text only ones.

Note: See TracTickets for help on using tickets.