Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Wrong adresses in headers #7

Open
zuf opened this Issue · 6 comments

5 participants

@zuf

Hello.

I discover strange issue with TMail version 1.2.6 - 1.2.7.1.
TMail adds unnecessary line breaks to headers with multiple email adresses.

For example this code:

m=TMail::Mail.new
m.to = ["a.user@example.com", "v.user2@example.com", "e.smith@example.com", "info@example.com", "v.pupkin@example.com"]
puts m.encoded

Produces string with empty lines (double line breaks: "\r\n\t\r\n\"):

=> "To: a.user@example.com,\r\n\t v.user2@example.com,\r\n\t e.smith@example.com,\r\n\t\r\n\tinfo@example.com,\r\n\t v.pupkin@example.com\r\n\r\n"

This mean end of headers part of email (and broke some clients like Outlook 2003).

TMail 1.2.3.1 produces another string:
=> "To: a.user@example.com, v.user2@example.com, e.smith@example.com,\r\n\tinfo@example.com, v.pupkin@example.com\r\n\r\n"

This string hasn't double line breaks in adress list.

P.S.

git bisect show me this information:

c5b9bb9e864c4aae882a68b8702a3389d2e8079a is the first bad commit
commit c5b9bb9e864c4aae882a68b8702a3389d2e8079a
Author: mikel <raasdnil@gmail.com>
Date:   Sun Aug 3 00:33:22 2008 +0000

    Update on getting tests passing.  Ready for patches now

:100644 100644 6bdcf74982a1f9c5a3faf4a7c88fc26bc7d38722 e8597730d36c49f860a9008a08e6779e89a06efe M  CHANGES
:100644 100644 e8b9ab9abcbd5481ab32362202e2f667552311b4 6e1e73ba0107c0fd0defe69c88281aedaf1252d4 M  NOTES
:040000 040000 2232eaa10b7d2dea0451e4501f329032eb449125 f4a17ab02c7b89a32630cb74e0209b3f93b4f0f4 M  ext
:040000 040000 cdba83fd6a982d04a77215da555274b66e84f09a fdf749e688299cd36d102bb102051463de805bc8 M  lib
:040000 040000 e723af64c7e60ceebede1349a59a158c59e627ca 1ee12541234a8e5817c6eb7468ea73f47c707f25 M  log
:040000 040000 7e2106036e3db4f8fd21018b8bf6427276f6d883 ef8f3c0b716b65128ad5c0d472c106885dceabd3 M  meta
:040000 040000 b1d38fd44b70fb3feef29a5c28d85834a673b4c4 14a89a5400061904f3132730816d88efd1880439 M  test
@zuf

I fount that problem is in commit c5b9bb9 in files:
lib/tmail/encode.rb
lib/tmail/header.rb

Here the "reverse" patch (use patch -p1 -R): http://pastebin.com/XQCVJvWG

@eac

This was causing quite a few complaints. Appears that Exchange 2003 can't parse these messages, resulting in them getting displaying in their raw format. Reverting c5b9bb9 does resolve this issue.

@eac

The root cause was in Encode#fold_the_string. The fix is here:
eac@05940a3. This commit has run in production for a month without any error reports.

@blindninja

We are having the same problem. It started to happen when we upgraded Rails from 2.3.5 to 2.3.8. After reading the documentation, Rails 2.3.8 uses TMail 1.2.7 and Rails 2.3.5 uses TMail 1.2.3.

The problem is the extra line space which causes our Exchange server to not send the E-mail to everyone but to display them as raw text. I tested it on Rails 2.3.11 and it was doing the same thing.

@minter

I'm running into this issue as well - it'd be good to see eac's patch pulled in.

@gildegoma

I've the same problem (problem found with Outlook 2007, but also with gmail webapp).
This was after an upgrade to Redmine 1.2.0 (and hence from Rails 2.3.5 to 2.3.11).
For interested ones, this Integration issue with Redmine has been reported there: http://www.redmine.org/issues/8751

eac, won't you open a Pull Request to merge eac/tmail@05940a3 ? This issue is quite critical (unless you send to multiple recipients only in BCC field). I would appreciate a 1.2.7.2 bug fix release... instead long-term patching my production systems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.