riking 0a09593f3b FIX: Prefer HTML in incoming emails, heavily refactor email receiver
This commit heavily refactors Email::Receiver to both better handle
different emails and improve testability.

A primary focus of the refactor is reducing the usage of class
variables, in favor of actually passing parameters - making it possible
for multiple tests to use the same Receiver instance.

The EmailLog reported when a topic is created is reflected to put the
user's email in the to_address field, instead of the system address.

The discourse_email_parser function is renamed to
discourse_email_trimmer, and additional stopping conditions are added to
make up for EmailReplyParser's inability to deal with html at the start
of a line.

The force_encoding calls are refactored out to a 'fix_charset' method.

parse_body is renamed to select_body, and the scrub_html method is
dropped in favor of the new HtmlCleaner class.

A new parse_body method is added, which performs the job of the removed
lines of code in the 'process' method.

EmailUnparsableError is redefined again, to be encoding errors (when the
declared encoding is not what was delivered).
2014-08-28 14:36:10 -07:00
..
2013-12-24 00:50:36 +01:00
2014-08-20 18:53:58 +02:00
2014-08-25 16:47:54 -07:00
2014-08-19 20:56:25 +10:00
2014-06-18 20:05:18 +02:00
2013-06-27 12:10:43 -04:00
2013-03-06 08:52:24 +01:00
2014-06-16 10:24:54 +10:00
2014-02-17 19:42:08 +01:00
2014-08-11 17:51:55 +10:00
2013-03-06 08:52:24 +01:00
2014-03-11 03:18:57 -04:00
2013-02-26 07:31:35 +03:00
2014-07-17 15:19:58 -07:00
2013-12-16 18:39:49 +01:00
2014-01-20 18:33:40 +01:00
2013-06-03 09:08:34 +10:00
2014-01-29 14:14:07 -05:00
2014-08-26 15:24:07 -04:00