Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
...
Commits on Nov 29, 2012
@kennyj kennyj Fix build on Ruby18. We should specify endian for UTF16/32. 819c476
@kennyj kennyj Remove gsub UTF-8 to UTF8. We should check properly behavior. c9e8d7f
Commits on Dec 04, 2012
@mikel Updating CHANGELOG 470256e
@mikel Version bump to 2.5.3 9c16d9d
Commits on Dec 08, 2012
@amatsuda amatsuda define Object#blank? only if not defined yet b7c29b3
Commits on Dec 19, 2012
Adam Vaughan Do not collapse multiple quoted-printable lines if the line encodings…
… are not the same.

If you have multiple lines where one has an encoding of Q and the other has an encoding of B, the existing logic would collapse these lines together. This change makes it so that only lines with the same encoding are collapsed.
cb81621
Commits on Dec 20, 2012
@bpot bpot Only wrap attachment filenames in double quotes not other params e74bc60
Commits on Dec 22, 2012
@bpot bpot specs: update address field initialization tests to pass in headers c…
…orrectly
51caeee
Commits on Dec 30, 2012
@bpot bpot Clarify parser behavior for funky angle bracket addresses b5dcbdf
Commits on Dec 31, 2012
@bpot bpot Mail::Field: lookup class for fieldname instead of iterating over eac…
…h hash entry
3b5f9f4
@bpot bpot Mail::Field#split: move splitting regexp to Mail::Patterns 05287c4
@bpot bpot Mail::Field use a lookup table for field ordering and memoize field o…
…rder
6363d9e
@bpot bpot Mail::Utilities#match_to_s use casecmp instead of creating downcased …
…strings
75e8efc
Commits on Jan 06, 2013
@JackDanger JackDanger Fixing doc typo in encodings.rb
This patch removes an errant period character.
c6663bb
Commits on Jan 17, 2013
@francois francois Fix markup in Encodings section 033d978
Commits on Jan 19, 2013
@jeremy jeremy Merge pull request #489 from JackDanger/patch-1
Fixing doc typo in encodings.rb
a191118
@jeremy jeremy Merge pull request #495 from francois/patch-1
Fix markup in Encodings section
c6d8af1
@jeremy jeremy Correct line breaks in quoted-printable encoding.
Quoted-printable transfer encoding is intended to be "line break
neutral." It uses CRLF to encode line breaks, whether you prefer
carriage returns, line feeds, or both.

Ruby's builtin #pack and #unpack support quoted-printable encoding,
but expect to see linefeeds (\n) only. So it's our responsibility to
convert to LF before encoding and to CRLF afterward, and to convert
CRLF to LF after decoding.
87bad31
@jeremy jeremy Merge pull request #475 from amatsuda/object_blank_redefine_warning
define Object#blank? only if not defined yet
13d0db0
@jeremy jeremy Merge pull request #471 from kennyj/fix_build_on_ruby18
Fix build on Ruby18. We should specify endian for UTF16/32.
64f4eb5
Commits on Jan 20, 2013
@ndbroadbent ndbroadbent Refactored SSL context code in Mail::SMTP; allow :ca_path or :ca_file…
… to be passed in as settings.
d6e25e5
@bpot bpot Remove references to Treetop parse tree in specs f271deb
@bpot bpot Extract comments from an address when it is part of a group 3a65f9e
Commits on Jan 23, 2013
@jeremy jeremy Update CHANGELOG for #471, #475, #489, #495 a0b88dd
@jeremy jeremy Merge pull request #399 from ndbroadbent/configure_ca_path_or_file
Allow :ca_path or :ca_file to be passed in as settings, for SSL context
1e31ef4
@jeremy jeremy Update CHANGELOG for #399. Refactor to prefer a single expression ove…
…r early-return.
362f628
@jeremy jeremy Merge pull request #484 from bpot/dont_expose_parse_tree
Don't expose the treetop parse tree for envelope.
0a1654d
@jeremy jeremy Merge pull request #487 from bpot/comments_in_group
Extract comments from an address when it is part of a group
330b724
@jeremy jeremy Update CHANGELOG for #484, #487 0213e7f
@jeremy jeremy Merge pull request #482 from bpot/spec_cleanup
Spec Cleanup: use correct syntax for address fields
228d61d
@jeremy jeremy Merge pull request #485 from bpot/clarify_parser_behavior_for_funky_a…
…ddress

Clarify parser behavior for funky angle bracket addresses
278e3b1
@jeremy jeremy Update CHANGELOG for #482, #485 8fd9272
@jeremy jeremy Merge pull request #488 from bpot/field_cleanup_and_performance
Field cleanup and performance improvements
2433698
@jeremy jeremy Update CHANGELOG for #488 4836faf
@jeremy jeremy Merge pull request #481 from bpot/ensure_filename
Only wrap attachment filenames in double quotes not other params
8925d37
@jeremy jeremy Update CHANGELOG for #481 6db5ed4
@jeremy jeremy Update CONTRIBUTING to request running specs on 1.9.3 instead of 1.9.…
…2. Soon, Ruby 2.0.0 is coming and 1.8.7 reaches end of life.
2f0ea18
@jeremy jeremy Clean up filename attribute quoting a17eb5b
@jeremy jeremy Disable 1.9-mode rbx in Travis since it's segfaulting on String#ascii…
…_only?
a0dfa69
Commits on Jan 25, 2013
@ConradIrwin ConradIrwin Remove confusing no-op
This line previously always set the (unused) local variable body to nil.

I assume it meant to read `self.body = nil if body.nil?` however
`body.nil?` cannot happen as the previous line would crash.

Closer inspection reveals that the initialize method calls either
init_with_string or init_with_hash, both of which eventually set the
body to non-nil.
eb3f1ab
@jeremy jeremy Fix inadvertently no-opped test on Ruby 1.8 e9f1307
@jeremy jeremy Fix the bogus '=' at the end of some quoted-printable messages.
Trailing CRLF is significant in Quoted-Printable transfer encoding.
Stripping trailing whitespace corrupts the encoding, resulting in
odd '=' chars showing up at the end of decoded emails. Fixed by only
stripping leading whitespace.

Closes #440
e6238bc
Commits on Jan 26, 2013
@jeremy jeremy Merge pull request #499 from ConradIrwin/remove-no-op
Remove confusing no-op
568acbe
@jeremy jeremy Update CHANGELOG for #499. Group pull requests by category: feature/p…
…erf/bugfix/housekeeping.
cd9e584
@jeremy jeremy Setting the html_ or text_part to nil removes it. 39a4805
@jeremy jeremy Fix that declaring an html_part but no text_part would use multipart/…
…alternative anyway.
3c8de1f
@jeremy jeremy Assigning html_ or text_part sets a default content type.
Fixes #116
9a902b3
@jeremy jeremy Addresses without a parsable email or display name still format as th…
…eir raw text.

Fixes #112
3fb6143
@jeremy jeremy Fix that setting an attachment with a :mime_type and :encoding would …
…override the :encoding

Fixes #123
832cfcc
@jeremy jeremy Allow assigning arrays of Message-IDs to References and In-Reply-To. …
…Closes #85.
c62f550
@jeremy jeremy Remove misleading references to fully-qualified domain names in Messa…
…ge-IDs
eeb9209
Commits on Jan 27, 2013
@jeremy jeremy Parse multipart boundary from Content-Type headers containing extra s…
…emicolons.

Fixes #412
64f3e43
@jeremy jeremy The Received header may contain zero name/value pairs, qmail-style
Fixes #202
e1d624f
@jeremy jeremy Missed the compiled parser for 3a65f9e 80ccb5f
@jeremy jeremy Calling #to_s on a field with a nil value returns an empty string ins…
…tead of nil

Fixes #194
83b97d2
@jeremy jeremy Add MIT-LICENSE and extend copyright to 2013
Closes #190
2babe56
@jeremy jeremy Clarify that Sender is a single address, not an address list
Closes #303
1bfb0af
@jeremy jeremy Allow rbx failures. rbx-18mode seems to be running 1.9 mode, which is…
… segfaulting.
cae6838
@jeremy jeremy Enable more Travis builds
  * ree (green)
  * ruby-2.0.0-rc1 (green)
  * ruby-head (green, but future failures allowed)
  * jruby-19mode (unknown)
  * jruby-head (unknown, and future failures allowed)
aa60036
@jeremy jeremy Travis: jruby 1.9 mode and head are both green. Leave jruby-head in a…
…llowed failures list since it's unstable.
eb0c818
@jeremy jeremy Travis: ree build dying with unreported error 8d70f76
@jeremy jeremy Add Ruby 2.0.0-rc1 to tested build list 62fd723
@jeremy jeremy Travis: put the build status right up top eb83845
@jeremy jeremy Remove i18n dependency and last vestiges of activesupport dependency …
…in specs

Closes #300
766f73c
@jeremy jeremy Refresh Bundler dependencies & setup eeb7c58
@jeremy jeremy RFC2822 quoted_string content may be empty b1b1796
@jeremy jeremy Capture stderr from Sendmail and Exim deliveries
Fixes #215
22e4c0a
@jeremy jeremy Fix up tests that depend on utf-8 external encoding. Read fixtures as…
… binary.

Fixes #392
74d1207
@jeremy jeremy Verify that empty email display names can be parsed
Closes #354
6475840
@jeremy jeremy Don't allow colons in header names. Closes #377 2bf27fb
@jeremy jeremy Address elements should return decoded display names by default
Fixes #359
cc47626
@jeremy jeremy Add development gem dependency on rdoc ece27b6
@jeremy jeremy Header encoding should be US-ASCII, not the default external encoding e20f93a
@jeremy jeremy Add a spec demonstrating that encoding a header in a given charset wi…
…ll raise encoding errors if fields have incompatible junk in them
8b3f4e2
@jeremy jeremy Shouldn't be fooled into encoding strings on 1.8 by unrelated Encodin…
…g constant

Fixes #478
6f12f7e
@jeremy jeremy Ruby19.fix_encoding -> Ruby19.pick_encoding for charset. Clean up and…
… clarify its responsibility.
80d8557
@jeremy jeremy Add support for ks_c_5601-1987 charset, aliased to CP949 Ruby encoding
Fixes #436
88457e6
@jeremy jeremy Alias shift-jis charset to Shift_JIS Ruby encoding
Closes #466
02bb613
@jeremy jeremy Merge pull request #479 from jeremy/fix-quoted-printable-equals-sign
Fix trailing equals signs mysteriously showing up on quoted-printable emails
b4c8cd2
@jeremy jeremy Update CHANGELOG for #479 7548347
@jeremy jeremy Correctly format mbox From headers per RFC4155
Fixes #483
47f1c31
@jeremy jeremy Merge pull request #472 from kennyj/properly_check
Remove "gsub UTF-8 to UTF8". We should check properly behavior.
4b44d19
@jeremy jeremy Update CHANGELOG for #472 37958c4
@jeremy jeremy Accept other IETF/IANA-registered Content-Types and Content-Transfer-…
…Encodings

Fixes #470
ba06563
Commits on Jan 28, 2013
@jeremy jeremy Merge pull request #480 from adamvaughan/encoding-bug
Do not collapse multiple quoted-printable lines if the line encodings are not the same.
58f1aba
@jeremy jeremy Update CHANGELOG for #480 1f44d88
@jeremy jeremy Merge pull request #496 from jeremy/quoted-printable-line-break-neutr…
…ality

Correct line breaks in quoted-printable encoding
ed88098
@jeremy jeremy Update CHANGELOG for #496 30dfbb2
@jeremy jeremy Decode quoted-printable with bad line breaks.
Many many clients hex-encode the \r, \n, or \r\n line break when they're
supposed to use a literal CRLF (quoted-printable had the idea that
they'd be line break agnostic). To make matters worse, they also include
the CRLF after the encoded line break, so decoding it results in a
double line break. If anything, they should use a soft line break.

"=0D\r\n" should decode as "\n" not "\r\r\n"
"=0A\r\n" should decode as "\n" not "\n\r\n"
"=0A=0D\r\n" should decode as "\n" not "\r\n\r\n"

Clients using hex-encoded line breaks along with quoted-printable soft
line breaks still work as expected.
e8f42b2
@jeremy jeremy Merge pull request #493 from jeremy/quoted-printable-line-breaks
Decode quoted-printable with bad line breaks
af770e2
@jeremy jeremy Update CHANGELOG for #493 83c0321
@jeremy jeremy Organize .gitignore, qualify toplevel ignores, add .ruby-version and …
…/bin ignores
66ba02e
@jeremy jeremy Fix that Outlook and Windows Phone treat all our MIME parts as inline…
… attachments since they include unused, unreferenced Content-IDs.

Closes #389
aa394d0
@jeremy jeremy Fix that Content-Type and Content-Disposition filename quoting should…
…n't suck in trailing parameters
33140d9
@jeremy jeremy Yank a regexp constant out of String#ascii_only? 6570033
@jeremy jeremy Shush warning: 'character class has duplicated range' e941c62
@jeremy jeremy Shush warning about redefined Net::SMTP#tolsconnect. Implement it as …
…a failsafe wrapper around existing #tlsconnect rather than reimplementing.
57a9165
@jeremy jeremy Bump to patch version 2.5.4 to distiguish pending release from curren…
…t release
a5b36f5
@jeremy jeremy it's -> its d91de3c
@jeremy jeremy Add a CommonField#to_s spec to supplement 83b97d2 3f2ae4b
@jeremy jeremy Travis: stop building ree due to unknown errors 41a4bae
@jeremy jeremy Fix mismatched indentation 8e455b9
@jeremy jeremy Fix sendmail delivery to addresses with a leading hyphen 81e9940
@jeremy jeremy Better fix for 81e9940, sending to addresses with a leading hyphen, w…
…hich confuses the sendmail command line into thinking the addresses are config options. Using '--' as an options terminator is supported by every sendmail implementation I found.
a944f31
@jeremy jeremy Expose the SMTP envelope From and To addresses and allow them to be o…
…verridden.

Envelope From address defaults to return_path || sender || from_addrs.first.
Envelope To address defaults to destinations (to + cc + bcc).

Updates all delivery methods to rely on the SMTP envelope.

References #421 and rails/rails#5985
4875bc2
Commits on Jan 30, 2013
@bpot bpot Treat GB2312 encodings as GB18030 93f4771
Commits on Feb 02, 2013
@ConradIrwin ConradIrwin Parse fields lazily.
This is a substantial performance improvement for people who are parsing
emails but do not need access to all the headers.

In particular I am doing: Mail::Header.new(<str>)['From'].to_s
on this example: https://gist.github.com/5901bbd810c08ed3d0b1
72f3e80
@ConradIrwin ConradIrwin Micro-optimize regexes
This corresponds to about a 10% time-saving when running the specs with
bpot/ragel merged, and a bigger performance improvement for parsing
workloads.
2bd6dac
@ConradIrwin ConradIrwin Also unfold and split lazily
This has little effect on the specs, but on my header reading example it
makes about a 10x performance difference, finally bringing it within one
order of magnitude of the "fast hacky solution" at
https://gist.github.com/5901bbd810c08ed3d0b1
72befdc
@ConradIrwin ConradIrwin Binary search on Fields#<< 2ff5318
Commits on Feb 04, 2013
@ConradIrwin ConradIrwin Improve handling of backslashes in quoted strings. [Fixes #450]
The relevant part of RFC-822 says that '\' '"' and "\r" should be
escaped in quoted strings.

I have added escaping for '\', but not for '\r' as we already use
quoted-printable form for those (and if we allow raw newlines in headers
we have to be much more careful to avoid header-injection).

I've also fixed unquote() to remove backslash-escaping from the string
as RFC-822 suggests.
32e697c
@jordimassaguerpla jordimassaguerpla add license information
This way it can be used with the rubygems.org API
0d8cc12
Commits on Feb 08, 2013
@Aalanar Aalanar fix bug that was causing an extra line feed to be appended to ALL 7bi…
…t encoded attachments
2119335
@Aalanar Aalanar fix parser to not associate extra new lines with attachment bodies 4743882
@ConradIrwin ConradIrwin Fix code when ActiveSupport is required
Mail::Multibyte is not defined in that case, so we just force everything
to be a string.
ed25868
Commits on Feb 10, 2013
@javan javan Fix decoding strings that contain '=?', but are not actually encoded. 700ba21
@jeremy jeremy Merge pull request #507 from jordimassaguerpla/master
add license information to the gemspec
230552f
@jeremy jeremy Merge pull request #508 from Aalanar/master
fix for extra trailing new lines on attachments
e9b0043
@jeremy jeremy Update CHANGELOG for #508. Massage spec style to match the others. e10b7e7
@jeremy jeremy Merge pull request #506 from ConradIrwin/450-backslash
Improve handling of backslashes in quoted strings. [Fixes #450]
feacb87
@jeremy jeremy Update CHANGELOG for #506 de16b19
@jeremy jeremy Merge pull request #504 from bpot/treat_gb2312_as_gb18030
Treat GB2312 encodings as GB18030
c299cda
@jeremy jeremy Update CHANGELOG for #504. Clarify charset alias comment. 66efb32
@ConradIrwin ConradIrwin Split on an exact \r\n\r\n sequence if it exists
This has been broken since 17783f8
a2a4559
Commits on Feb 12, 2013
@jeremy jeremy Merge pull request #501 from ConradIrwin/split-on-crlfcrlf
Split on an exact \r\n\r\n sequence if it exists
1d515f7
@jeremy jeremy Update CHANGELOG for #501 2cf92b8
@jeremy jeremy Shush warning about == in void context 2e8cdbb
Commits on Feb 15, 2013
@drasch drasch Fix fencepost encoding problem with binhex strings and only one token 3c39857
Commits on Feb 17, 2013
@bpot bpot Don't include separating semicolon in paramter value when sanitizing 49b9d87
Commits on Feb 20, 2013
@svanderbleek svanderbleek Save settings passed to TestMailer new 25eeda0
Commits on Feb 26, 2013
@RKushnir RKushnir Fix code example for Message#resent_sender=
The code example for Message#resent_sender= contains the wrong method name
ffed85c
@jeremy jeremy Merge pull request #520 from RKushnir/patch-1
Fix code example for Message#resent_sender=
977ad6b
Commits on Mar 16, 2013
@taketin taketin added feature to find the mail in uid 034f132
Commits on Apr 02, 2013
@jeremy jeremy Docs: mail.from/to/bcc/etc return emails only. Closes #529. ff34d38
Commits on Apr 15, 2013
@jpmckinney jpmckinney Correct example calls to preamble and epilogue in README 3508a53
@jeremy jeremy Merge pull request #537 from jpmckinney/master
preamble and epilogue correction in README
ac02a2e
Commits on May 13, 2013
@bpot bpot Replace Treetop parser with a Ragel based parser 2da7c79
@bpot bpot AddressListsParser: Don't add an extra address to the address list wh…
…en it ends with a space.
c6b656c
@bpot bpot ReceivedParser: don't error out on quoted strings in a received header 1f49764
@bpot bpot common.rl: use clearer .* in dot_atom_text, instead of (.+)? ab2af8c
@bpot bpot Correctly parse addresses that begin with a comment. 1505198
Commits on May 14, 2013
@mikel Merge branch 'smtp-envelope' of git://github.com/jeremy/mail into jer…
…emy-smtp-envelope
1d14122
@mikel Update changelog for commit ac02a2e e7f1ba6
@mikel Merge branch 'encoding_fencepost' of git://github.com/drasch/mail int…
…o drasch-encoding_fencepost
1971cec
@ConradIrwin ConradIrwin Fix warnings 0f7e762
@mikel Updating CHANGELOG 34a80d3
@mikel Merge branch 'improve_content_type_sanitize' of git://github.com/bpot…
…/mail into bpot-improve_content_type_sanitize
29a7c76
@mikel Updating CHANGELOG 83fa6b6
@mikel Merge branch 'master' of git://github.com/svanderbleek/mail into svan…
…derbleek-master
8f5b2e0
@mikel Use older Ruby Hash syntax for compatibility 92573bb
@mikel Changelog updates 0227973
@mikel Merge branch 'feature/find-by-uid' of git://github.com/taketin/mail i…
…nto taketin-feature/find-by-uid
6d7532e
@mikel Updating CHANGELOG 5aac893
@mikel Merge branch 'pure_ruby_ragel_parser' of git://github.com/bpot/mail i…
…nto bpot-pure_ruby_ragel_parser
aaaac21
@mikel Updating CHANGELOG 875f0b0
@mikel Updating VERSION to reference edge for master 0a11c71
@mikel Merge branch 'lazy-fields' of git://github.com/ConradIrwin/mail into …
…ConradIrwin-lazy-fields
6f95d5d
@mikel Updating CHANGELOG dd89a6f
Commits on May 15, 2013
@vipulnsward vipulnsward Rename variable to fix overshadow 3470363
@ConradIrwin ConradIrwin Merge pull request #545 from vipulnsward/fix_overshadow
Rename variable to fix overshadow
9f01ba9
Commits on May 29, 2013
@yinquanteo yinquanteo fix charset getting reset to nil unintentionally 4cb3db2
Commits on Jun 10, 2013
@ConradIrwin ConradIrwin Collapse adjacent =??B? words losslessly
Before this change the code assumed you could concatenate two Base64
strings, which is not true.

This fix relies on non-standard behaviour of our parser: RFC 2047 says
that encoded-words MUST be separated by at least a space, but we happily
parse two unseparated encoded-words.

Fixes: #560
Fixes: #561
Broken-since: 2.5.4 (cb81621)
b832faf
@ConradIrwin ConradIrwin Add a spec for non-space-separated encoded-words
RFC-2047 says that encoded-words MUST be space separated, but Gmail and
iOS mail also parse directly adjacent words; so we should too.
beb8fc5
@ConradIrwin ConradIrwin Merge pull request #552 from yinquanteo/master
fix header's charset getting reset to nil unintentionally
9e323f4
Commits on Jun 12, 2013
@gauteh gauteh Accept utf_8 as utf-8 f3b7bbf
Commits on Jun 27, 2013
@ConradIrwin ConradIrwin An inspect function for Mail::Field
Before this, Mail::Fields just defaulted to .to_s, which was
both confusing to read and potentially side-effecty.
f29d0b7
@ConradIrwin ConradIrwin Fix 8bit decoding on jruby-1.7.4 [Fixes #570] ba88268
@ConradIrwin ConradIrwin Merge branch 'accept_utf_8-as-utf-8' of github.com:gauteh/mail 01b0aac
@ConradIrwin ConradIrwin Add ruby-1.8 support to Pull request #562 1d09b6b
@ConradIrwin ConradIrwin Move tasks out of lib/ to avoid namespace pollution Issue #566 91205d6
@ConradIrwin ConradIrwin Move VERSION out of lib/, [Fixes #566] 39d546b
@ConradIrwin ConradIrwin Always use an SSL context. [Fixes #548]
This reverts commit 9890b19, as latest
patch releases of 1.8.7 do accept an OpenSSL context object.

This has been broken since the refactoring d6e25e5,
which increased the scope of the original breakage.
c7318a6
Commits on Jul 08, 2013
@bpot bpot Do not attempt to collapse broken encodings in fields c4194c5
Commits on Jul 19, 2013
@ConradIrwin ConradIrwin Value decoding fixes
c4194c5 identified some serious flaws
in the approach taken bycollapse_adjacent_encoding, so I've removed that
at the expense of making the scan regexp a little more complicated.
abe1721