aboutsummaryrefslogtreecommitdiffstats
path: root/lib/mail_handler
Commit message (Collapse)AuthorAgeLines
* Address#to_s changes the input passed to it - dup before calling.Louise Crow2015-05-28-3/+3
| | | | Otherwise UTF-8 encoded strings will be returned as ASCII-8BIT.
* Handle invalid 'to' addresses.Louise Crow2015-05-22-1/+1
|
* Add a default timeout of 20 mins to external commands.Louise Crow2015-03-23-1/+3
|
* Add fix for Apple Mail with attachments Gareth Rees2014-11-04-0/+4
|
* Rename XXX comments with TODO:Gareth Rees2014-06-10-3/+3
| | | | Picks these up in `rake notes` and adds semantic meaning
* Make sure mail/part is loaded.hotfix/0.17.0.1Louise Crow2014-04-25-0/+2
|
* Fix for badly-formed content-disposition header.Louise Crow2014-04-25-0/+6
| | | | Taken from https://github.com/mikel/mail/pull/602
* Treat any document/pdf attachment as if it were application/pdfMark Longair2013-12-03-1/+1
| | | | | | | | | | | | | | | | | This is a fix for issue #1232. Richard Taylor pointed out that some PDF attachments had the non-standard content-type document/pdf, and that these weren't being treated as PDFs. (Ganesh Sittampalam discovered that all of these PDFs were generated by a Lexmark X945e, according to the PDF metadata.) This commit adds an extra case to normalise_content_type to map document/pdf to application/pdf. In fact, since the upgrade of the Mail gem in ccebe3c3d6d4dc5f81 the behaviour when handling the non-standard content-type document/pdf was much better, but this commit also means that you get the right icon for the attachment, and can be cherry-picked onto older versions to fix #1232.
* Update method name in patched method.Louise Crow2013-11-12-2/+3
|
* Remove obsolete patches.Louise Crow2013-11-12-61/+0
|
* Change class for newer version of mail gem.Louise Crow2013-11-12-2/+2
|
* Add a timeout to document conversion with wvtext - it can hang.0.13.0.2hotfix/0.13.0.2Louise Crow2013-09-04-1/+1
|
* Merge branch 'hotfix/0.12.0.1' into rails-3-developLouise Crow2013-07-29-0/+9
|\ | | | | | | | | | | Conflicts: locale/he_IL/app.po locale/nb_NO/app.po
| * Backport https://github.com/mikel/mail/pull/405 to prevent stack overflow ↵0.12.0.1hotfix/0.12.0.1Louise Crow2013-07-26-0/+9
| | | | | | | | errors when parsing large mails with envelopes on memory limited systems.
* | Add test case and fix for unrecognized encoding in subject lineLouise Crow2013-06-25-0/+15
| |
* | Handle the case where an encoding is extracted that iconv doesn't handle.Louise Crow2013-06-25-1/+4
|/
* Fix a security vulnerability: eval used in quoting display name0.11.0.12Mark Longair2013-06-17-1/+1
| | | | | | | | | This use of eval allows arbitrary remote code execution on parsing of a maliciously formed email. Two tests are updated to match the behaviour of the new code to return the display name - these introduce extra escaping, so should be innocous.
* Backport ruby 1.9 fix for trailing = sign in message headers from mail 2.5release/0.11Louise Crow2013-06-04-0/+16
|
* Parse the 'to' address as if on a real mail to trigger quoted string encoding.Louise Crow2013-06-03-1/+3
|
* Fix for subject lines with invalid UTF-8 as the last characterMark Longair2013-06-03-2/+12
| | | | | | | | | | | | | | | This seems to be the bug mentioned here: http://po-ru.com/diary/fixing-invalid-utf-8-in-ruby-revisited/ That explains that some versions of Iconv don't ignore invalid characters when converting to UTF-8 even with //IGNORE if that invalid character happens to be at the end of the string. In fact, as Matthew Somerville pointed out, with some versions of iconv (e.g. 1.14 on Mac OS, apparently) it's necessary to add and remove more than one space at the end, in case the first character of the byte sequence indicates a long sequence. We add and remove 4 to be on the safe side.
* Merge branch 'tmail-to-mail-tests' into rails-3-developMark Longair2013-05-28-12/+67
|\ | | | | | | | | | | | | | | This merge brings in a number of tests and fixes for the handling of mail under Mail / Rails 3 instead of TMail / Rails 2. Conflicts: config/initializers/alaveteli.rb
| * Suppress STDERR noise from the tnef binaryMark Longair2013-05-22-1/+1
| |
| * Move the mapi requires to where they're really neededMark Longair2013-05-22-0/+2
| | | | | | | | | | | | | | Handling of outlook-packed attachments would fail from rake tasks or in the console without requiring 'mapi/msg' and 'mapi/convert' beforehand. Instead, require them in the source file where they're actually used.
| * Retain old handling of malformed addresses in To and Cc linesMark Longair2013-05-21-0/+29
| | | | | | | | | | | | | | | | | | | | The behaviour of the TMail backend's 'to' and 'cc' methods where there was a malformed To: or Cc: line was to return nil, whereas Mail returns a version of the string anyway. We'd have to change quite a lot of code to deal with an extra possible class of returned objects, so it's simplest for the moment to monkey-patch Mail::Message's 'to' and 'cc' methods to restore the old behaviour.
| * Cope with emails with a missing final MIME boundaryMark Longair2013-05-17-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Mail gem deals with multipart messages that look as if they should have 1 part but are missing the final MIME boundary, by make the parts list empty and setting part.body to the text of the email. Rather than throwing an exception in this case, we just pretend that part is text/plain and return it, so that the page doesn't error and we still have a chance of some useful text being displayed. Note that we haven't investigated yet the case of emails that have more than one start boundary, but no final boundary. Fixes #921
| * Only set original_charset when a charset has been defined for the mail part. ↵Louise Crow2013-05-16-3/+8
| | | | | | | | Fixes #942.
| * Make efforts to ensure that we're usually dealing with UTF-8 stringsMark Longair2013-05-16-1/+5
| | | | | | | | | | | | | | | | | | One of these changes is to make sure that the Mail backend, like the TMail backend it replaces, will return text parts encoded in UTF-8 if possible. The other change is to ensure that when text attachments are reloaded from disk, we attempt to convert them to UTF-8.
| * Ignore common TNEF attachment parsing errorsMark Longair2013-05-16-5/+13
| | | | | | | | | | | | | | This also introduces a custom error class so that we don't accidentally catch other problems. Fixes #920
| * Remove an unnecessary use of 'which' in backticksMark Longair2013-05-16-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The use of backticks in `which tnef` means that which(1) is invoked under /bin/sh, and returns the first executable matching 'tnef' in the default PATH for /bin/sh. In this usage, however, Popen also uses /bin/sh to execute the command, which would run that same executable if just a bare 'tnef' were used. In summary, I can't see any reason for the convolution of: IO.popen("#{`which tnef`.chomp} -K -C #{dir}", "wb") do |f| ... over just: IO.popen("tnef -K -C #{dir}", "wb") do |f| ... so switch to the latter.
* | Merge remote-tracking branch 'origin/hotfix/0.9.0.3' into rails-3-developLouise Crow2013-05-16-1/+2
|\ \ | |/ |/| | | | | | | | | Conflicts: Rakefile app/models/contact_mailer.rb spec/models/contact_mailer_spec.rb
| * Limit memory available to wvText, which calls elinksIan Chard2013-05-15-1/+2
| |
| * Calling TMail::Mail#base64_decode does not modify the mail object so doesn't ↵Matthew Landauer2013-01-28-8/+5
| | | | | | | | do anything as used here
* | Rails security updateMatthew Landauer2013-03-19-67/+0
| | | | | | | | | | The rails upgrade also forces a mail gem upgrade. To make things work again we need to remove part of the monkeypatched backporting of encoding fixes.
* | Backport Mail's encoding code from 2.5 for Ruby 1.9Henare Degan2013-03-07-0/+45
| | | | | | | | Decoding messages in Ruby 1.9 was screwing up but not dying like 1.8. Backporting this fixes the problem.
* | Revert "Update this to match the older version of the mail gem we're using"Henare Degan2013-03-03-1/+2
| | | | | | | | This reverts commit b9a2d996408c1ef703aa78311f8c2a0f6e0d7afc.
* | Backport Mail 2.5's to_yaml to prevent an exception with Ruby 1.8Henare Degan2013-03-02-0/+22
| |
* | Backport newer Mail code to fix decoding problems. #850Henare Degan2013-03-02-0/+38
| |
* | Remove Tmail and use the Mail gem under Ruby 1.8.7 as wellHenare Degan2013-02-27-437/+4
| |
* | Our older version of Mail returns a different class so cast it to a StringHenare Degan2013-02-21-1/+1
| |
* | We're using an older version of Mail that returns a different classHenare Degan2013-02-21-3/+3
| |
* | Update this to match the older version of the mail gem we're usingHenare Degan2013-02-10-3/+2
| |
* | Calling TMail::Mail#base64_decode does not modify the mail object so doesn't ↵Matthew Landauer2013-01-28-8/+5
|/ | | | do anything as used here
* Patch the parameter hash used in Mail to handle nil values.Louise Crow2012-12-06-0/+19
|
* Convert url in comment to spec.Louise Crow2012-12-06-0/+1
| | | | | | Conflicts: lib/mail_handler/backends/tmail_backend.rb
* Explicitly require the mail gem when using it as a backend.Louise Crow2012-12-06-0/+1
|
* Add functions for basic mail handling to the mail backend of mail handler.Louise Crow2012-12-06-0/+199
|
* Remove url in comment - has been converted to spec.Louise Crow2012-12-06-2/+0
|
* Convert example URL to spec.Louise Crow2012-12-06-3/+1
|
* Rename _get_attachment_text_internal_one_file to ↵Louise Crow2012-12-06-2/+2
| | | | get_attachment_text_one_file as it is now an externally-accessed method of the mail handler module.
* No real need for this to be an internal function.Louise Crow2012-12-06-2/+2
|