# \[ANN\] TMail 1.2.0

**URL:** <https://www.ruby-forum.com/t/ann-tmail-1-2-0/121872>\
**Category:** Ruby\
**Created:** [December 2, 2007, 8:50am UTC](https://www.ruby-forum.com/t/ann-tmail-1-2-0/121872 "2007-12-02T08:50:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mikel\_L](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/2bfe46/32.png) [@Mikel\_L](https://www.ruby-forum.com/u/Mikel_L)\
**Post date:** [December 2, 2007, 8:50am UTC](https://www.ruby-forum.com/t/ann-tmail-1-2-0/121872/1 "2007-12-02T08:50:45Z")

</div>

TMail - The Mail Handling Library for Ruby!

TMail is the Ruby Mail handler used in the  
Ruby on Rails and Nitro web frame works as  
well as many others (now including, the Ruby  
Talk mail gateway!).

TMail is now a gem. You can install it on any  
platform via:

# gem install tmail

Alternatively you can download the source code  
or view extra documentation at the website:

[http://tmail.rubyforge.org/](http://tmail.rubyforge.org/)

Note for Ruby on Rails Users - as of Rails 2.0 RC1,  
ActionMailer has a patch applied which will make  
it use the installed Gem version of TMail if the  
gem version is higher than the bundled TMail  
inside of ActionMailer. So installing this gem  
will also patch ActionMailer automagically.

## Release Summary:

New release handles three tickets in the TMail  
tracker as well as a lot more documentation and  
removes an unnecessary c-library.

One of the tickets was a scanner bug and is fairly critical  
to anyone who is not using the C version of the scanner  
routines (read, anyone using TMail in ActionMailer or  
on Windows etc.)

## Release Update Details:

Closed 16025 - TMail scanner.rb would not parse ATOM  
chars correctly making it fail tests where the C version  
passed them. Fixed this by updating the Scanner.rb  
version to be in step with the C version (there was  
an extra @ symbol in the ATOM CHARS definition  
that was not in the C version.)

Closed 15445 - TMail::Mail#create\_forward now returns  
a new Mail object that has the original mail as an  
encoded 7 bit multipart attachment. Also moved  
create\_forward and create\_reply from tmail/net  
into tmail/interface as it makes more sense to have  
it there.

Closed 15643 - TMail::Mail#reply\_addresses was  
returning an empty array if reply\_to was set to nil  
(ie, the header field existed but was empty) instead  
of returning the from address or default.

Removed base64.c after doing profiling on several  
platforms and finding out that the Ruby inbuilt  
version is just as fast (varies per platform but  
all in all about the same speed.)

Renamed the Scanner\_C extension to MailScanner.

New release adds extensive new documentation to  
mainly the TMail::Mail class, approximately 500  
lines of examples have been included in the RDoc.

Added a default value to TMail::Mail#sender method  
to allow arbitrary defaults to be passed into the  
method in alignment with all the other mail interface  
methods.

Made base64\_decode and base64\_encode into ! versions  
as they are destructive on the mail body (encodes the  
body to base64 or decodes it), made aliases for  
base64\_decode and base64\_encode to point back to the  
bang versions. Doing this with a view to change  
base64\_encode to a non destructive version  
(returns the encoded body) in future versions.

See the changelog for previous changes.

## Bug Reports / Fixes:

As always, we really welcome any bug reports or code  
for patches you have created. Please submit anything  
you find through our RubyForge tracker project which  
you can get to from our website:

[http://tmail.rubyforge.org/](http://tmail.rubyforge.org/)

We hope you enjoy this release!

Mikel & Trans  
The TMail Team.

---

<div class="post-metadata">

**Author:** ![Mikel\_L](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/2bfe46/32.png) [@Mikel\_L](https://www.ruby-forum.com/u/Mikel_L)\
**Post date:** [December 2, 2007, 5:31pm UTC](https://www.ruby-forum.com/t/ann-tmail-1-2-0/121872/2 "2007-12-02T17:31:11Z")

</div>

So does TMail take remote emails and make them into Ruby objects?

On Dec 2, 2007, at 2:50 AM, Mikel L. wrote:

> TMail - The Mail Handling Library for Ruby!
> 
> TMail is the Ruby Mail handler used in the  
> Ruby on Rails and Nitro web frame works as  
> well as many others (now including, the Ruby  
> Talk mail gateway!).

-------------------------------------------------------|  
~ Ari  
crap my sig won’t fit

---

<div class="post-metadata">

**Author:** ![Mikel\_L](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/2bfe46/32.png) [@Mikel\_L](https://www.ruby-forum.com/u/Mikel_L)\
**Post date:** [December 2, 2007, 6:17pm UTC](https://www.ruby-forum.com/t/ann-tmail-1-2-0/121872/3 "2007-12-02T18:17:27Z")

</div>

On Dec 2, 2007 8:30 AM, thefed [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > 
> 
> -------------------------------------------------------|  
> ~ Ari  
> crap my sig won’t fit

Yes, and its an easy interface, from the manual  
[http://tmail.rubyforge.org/manual/index.html](http://tmail.rubyforge.org/manual/index.html)

require ‘tmail’  
mail = TMail::Mail.parse(string) # from String  
mail = TMail::Mail.load(filename) # from file

# access from, first to, subject, and body

mail.from.first  
mail.to.first  
mail.subject  
mail.body

---

<div class="post-metadata">

**Author:** ![Mikel\_L](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/2bfe46/32.png) [@Mikel\_L](https://www.ruby-forum.com/u/Mikel_L)\
**Post date:** [December 14, 2007, 2:07pm UTC](https://www.ruby-forum.com/t/ann-tmail-1-2-0/121872/4 "2007-12-14T14:07:00Z")

</div>

It did not work for me:

$ sudo gem install tmail  
Need to update 43 gems from [http://gems.rubyforge.org](http://gems.rubyforge.org)  
…  
complete  
Successfully installed tmail-1.2.0  
$ script/console  
Loading development environment (Rails 2.0.1)

> > TMail::VERSION::STRING  
> > =\> “1.1.1”

How can I trace the problem?

---

<div class="post-metadata">

**Author:** ![Mikel\_L](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/2bfe46/32.png) [@Mikel\_L](https://www.ruby-forum.com/u/Mikel_L)\
**Post date:** [December 26, 2007, 3:09am UTC](https://www.ruby-forum.com/t/ann-tmail-1-2-0/121872/5 "2007-12-26T03:09:52Z")

</div>

On Dec 15, 2007 12:06 AM, Eider Silva de Oliveira  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> It did not work for me:
> 
> > > TMail::VERSION::STRING  
> > > =\> “1.1.1”  
> > > How can I trace the problem?

The problem is that I released 1.2.0 just before 2.0 of rails was  
released. 2.0 of rails will take any version of TMail that is in the  
1.1.x series.

I will be submitting a patch to ActionMailer to bump it up to 1.2.x  
soon and then will keep the next releases in the 1.2.x range.

Regards

Mikel.

---

<div class="post-metadata">

**Author:** ![Mikel\_L](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/2bfe46/32.png) [@Mikel\_L](https://www.ruby-forum.com/u/Mikel_L)\
**Post date:** [December 3, 2007, 3:53am UTC](https://www.ruby-forum.com/t/ann-tmail-1-2-0/121872/6 "2007-12-03T03:53:20Z")

</div>

On Dec 3, 2007 4:16 AM, Mike M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> On Dec 2, 2007 8:30 AM, thefed [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > So does TMail take remote emails and make them into Ruby objects?
> 
> Yes, and its an easy interface, from the manual  
> [http://tmail.rubyforge.org/manual/index.html](http://tmail.rubyforge.org/manual/index.html)

That’s right, and you can also parse it in from say Net::POP3 directly  
into  
a TMail object, modify it and send it back out Net::SMTP.

It also handles character sets, attachments etc.

If you are using ActionMailer 2.0 RC2, you are already using TMail  
version  
1.1.0. Installing the Gem will override the bundled copy of TMail in  
ActionMailer and you get the extra bug fixes.

Regards

Mikel  
(TMail Maintainer)
