MailTools reviews

cpanratings
 

RSS | Module Info | Add a review of MailTools

MailTools (2.12) *

Mail::Header->unfold and Mail::Header->fold just don't work (see RT#91309) while this module is almost 20 years old. So you can expect many bugs everywhere else.

MailTools (2.06) *

This is mostly regarding Mail::Send/Mail::Mailer. As Jos mentioned, it's just full of inconsistencies, the API is awful and under-documented and the default behavior is weird at best and harmful at worst.

It might have been a good idea back in the day when everyone were running all programs as their own user on the system where they also read email; but it's 10 years later now and we should use something better (the APIs etc here are just too convoluted and awful to fix).

MailTools (2.04) ****

I use mail::send in a number of projects and it makes sending email from a perl script about as easy as can be. However, when needs get more elaborate, such as HTML and other attachments, I reach for MIME::Lite.

MailTools (1.74) **

[Original review at: cpanratings.perl.org/dist/Mail-Box but for the wrong distribution. Copied for convenience]

This bit of review is specifically about Mail::Mailer (read the docs here: search.cpan.org/~markov/MailTools-1.6....

Mail::Mailer has 'interesting' ideas about how to determine the from address of an email you try to send.

Assume the following code:

$mailer = Mail::Mailer->new( 'smtp', Server => 'smtp.mydomain.com');

$mailer->open({ From => 'user@mydomain.com', ... });

Here's what it does.
* The user your mailing from is the user running the program

* .... unless you set $ENV{USER}, then that is used (undocumented in Mail::Mailer)
* The domain your mailing from is determined with clever heuristics:

* Look for a sendmail.cf file and extract DH parameter

* Look for a smail config file and usr the first host defined in hostname(s)

* Try an SMTP connect (if Net::SMTP exists) first to mailhost then localhost

* Use value from Net::Domain::domainname (if Net::Domain exists)

Which goes spectacularly wrong in most cases, especially if you're using 'mybox.mydomain.com' and using 'smtp.mydomain.com' for outgoing mail.

Of course all this could have been avoided if you set the proper environment variables,
which again are NOT DOCUMENTED anywhere in Mail::Mailer.

Turns out however that Mail::Mailer uses Mail::Util (not referenced in either the documentation or even the /source/ of Mail::Mailer). Had you found this pod, it would have told you could have set the environment variables 'MAILDOMAIN' and 'MAILADDRESS',
and then it would have used those to construct the 'from' address.

But /why/? I already provided the From in the arguments to 'open', which tells me i can pass all email-headers in! As from the Mail::Mailer documentation:

$mailer->open(\%headers);

Anyone looking at Mail::Mailer for sending mail, may I suggest Email::Send, Net::SMTP or even Mail::Sendmail?

MailTools (1.74) *

Um, no.

Mail::Field::names() does not work as documented. It returns "From : name1 ... nameN" instead of just a list of the names.

You have to pass separately created descendent objects into parent class constructors.

The Mail::Field->new() constructor does not actually properly parse headers when passed a tag, instead it interleaves the headers and gives you random (at best) results. wtf?!

Just say no. The amount of outside extra hackery with this module makes you want to die.

MailTools (1.59) *****

This has some indispensible utilities for handling mail data. You should have this.