rjbs / Email-Simple

the Email-Simple perl distribution
9 stars 9 forks source link

too much undocumented and too simple #21

Open jazzkutya opened 5 years ago

jazzkutya commented 5 years ago

The documentation carefully avoids to mention the whole lot of stuff it does not do, like properly encoding headers (using utf8 for example, as modern perl is unicode perl) or even encoding the body using quoted-printable by default. Unless I'm drawing the wrong conclusions from the output of Email::Sender::Transport::SMTP's debug output. I don't even know if these features are there hidden somewhere in this module or not - they are undocumented.

pali commented 5 years ago

Heh, it is written directly in the description of the Email::Simple module: simple parsing of RFC2822 message format and headers

But I understand that people are not familiar with RFC2822 nor with the fact that RFC2822 is pure 7bit ASCII without quoted-printable, base64 or Unicode support. This should be probably mentioned in the documentation.

On the other hand, to support MIME quoted-printable & Unicode, there is module Email::MIME which you should use (if you are not interested in plain & simple 7bit RFC2822).

jazzkutya commented 5 years ago

yeah, i've just switched to Email::Stuffer. Only thing annoying was that I could not tell from the docs if the module is good for me or not. I don't read rfcs unless I want to implement them but then I don't need a module that implements that rfc :). And (speaking of annoying stuff) that the symptom of not supporting text encodings was a 5 minute timeout in the transport module. Maybe it would be wise for Email::Simple to die/croak if one gives it something not 7 bit ascii. Otherwise it just does not conform to the rfc :)

pali commented 5 years ago

In reality, Email::Simple support 8bit and treat everything as sequence of bytes. Basically same what all SMTP servers see on raw network socket. Email::MIME is based on Email::Simple and does all Unicode <--> bytes encoding. Email::Stuffer is then another module based on Email::MIME which has decorator OOP orientated API, but supports less functionality as Email::MIME. If it is enough for you, use it!

About die/croak. Last year I opened pull request https://github.com/rjbs/Email-Simple/pull/17 which do that. After long time @rjbs wrote that it rather should throw warning and not die/croak. I updated it in Feb 11 and since then there is no answer from @rjbs, pull request is still open.

So it looks like that my pull request https://github.com/rjbs/Email-Simple/pull/17 can be really useful!

jidanni commented 3 years ago

Yes the man page should warn that unless one is using pure ASCII, this module will create illegal mail.