mikel / mikel/tmail

Wrong adresses in headers

Open
#7 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Ruby
Stars
74
Forks
32
PR merge metrics
No merged PRs in 30d

Description

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
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
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Run the provided TMail::Mail reproduction and compare its encoded output with the TMail 1.2.3.1 example. Inspect the header-encoding code under lib and related tests under test, using commit c5b9bb9e864c4aae882a68b8702a3389d2e8079a as the bisect boundary. Done means multiple addresses no longer produce an empty folded header line and the behavior is covered by a test.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.