| Commit message (Collapse) | Author | Age | Lines |
| |
|
| |
|
|\ |
|
| | |
|
| |
| |
| |
| | |
points out, the case where the initial character is a space is somewhat confusing), just grab the first character of the whole string and check it against expected values.
|
| | |
|
| | |
|
|/
|
|
| |
we expect it to be.
|
|\ |
|
| |
| |
| |
| | |
outside initialization e.g. in tests.
|
| | |
|
| |
| |
| |
| | |
118n.locale in the handling of locales with underscores. Fixes #999.
|
| | |
|
|\ \
| |/
|/|
| |
| |
| | |
Conflicts:
locale/he_IL/app.po
locale/nb_NO/app.po
|
| |
| |
| |
| | |
errors when parsing large mails with envelopes on memory limited systems.
|
| | |
|
|/ |
|
|\
| |
| |
| |
| | |
Conflicts:
spec/mailers/outgoing_mailer_spec.rb
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
You can see the number of emails that would be reparsed
by doing:
bundle exec rake temp:reextract_missing_attachments
To actually reparse the incoming emails and rextract
attachments for any that were missing, you would do:
bundle exec rake temp:reextract_missing_attachments[commit]
(In fact, the 'commit' can be any non-empty string.)
|
|\|
| |
| |
| |
| | |
Conflicts:
spec/models/info_request_spec.rb
|
| | |
|
| | |
|
| |
| |
| |
| | |
the email address.
|
| | |
|
| | |
|
|\ \
| | |
| | |
| | | |
rails-3-develop
|
| | | |
|
|\ \ \
| | |/
| |/| |
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
|\ \ \
| |/ /
|/| |
| | | |
'openaustralia_github/inline_search_method_refactor' into rails-3-develop
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We believe that this customization is no longer needed, and
in any case would need to be rewritten for will_paginate 3.0.4.
If any pagination bugs do arise, a test should be added that
reproduces that problem, since currently the tests pass without
this extension.
|
|\ \ \
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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
|
| | | |
| | | |
| | | |
| | | | |
Fixes #942.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This function is useful for investigating problems with
handling of emails, attachments and the related character
encoding issues. It can safely be removed later, but is
currently useful to have for debugging purposes.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Throughout the codebase it is simplest and most consistent
if we could assume that all text/* attachments are represented
by UTF-8 strings, and this was largely true with the TMail
backend which ensured that all returned text parts were in
UTF-8. We have to change the replacement Mail-backed to
similarly attempt to convert text parts to UTF-8. This commit
introduces two functions which are useful for this.
The normalize_string_to_utf8 function will try various
encodings, either suggested or guessed (with charlock_holmes)
to convert the passed string to UTF-8, and if it can't find a
suitable encoding will throw an exception.
Unfortunately, the current behaviour of the site is that
uninterpretable text/* attachments are still passed around and
mangled to UTF-8 just before display. To mimic this it's also
useful to have the convert_string_to_utf8_or_binary function,
which tries to convert the string to UTF-8 with
normalize_string_to_utf8, but if that's not possible just
returns the original string. (In Ruby 1.9, encoding will be
set to UTF-8 or ASCII-8BIT appropriately.)
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This also introduces a custom error class so that we don't
accidentally catch other problems.
Fixes #920
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
For the upgrade from Rails 2 to Rails 3, we want to check that
existing emails are parsed correctly. One of these tasks
(temp:random_attachments_hexdigests) is for dumping a CVS file
of details about each attachment, and its hexdigest, and a list
of the randomly selected raw emails. (It's intended that you
run this on an old Rails 2 install of Alaveteli. The other task
(temp:recompute_attachments_hexdigests) is intended to be run
on a Rails 3 install of Alaveteli, with the previous files as
input, to check that the same results are obtained.
|
| |_|/
|/| |
| | |
| | | |
param 'constraint_disabling' is set to false in the test section of database.yml, and pay attention to the order in which fixtures are defined when deleting and loading them.
|
|\ \ \
| |/ /
|/| |
| | |
| | |
| | |
| | | |
Conflicts:
Rakefile
app/models/contact_mailer.rb
spec/models/contact_mailer_spec.rb
|
| | | |
|