Closed ldidry closed 3 years ago
I wonder if the subject shouldn’t be mimeword encoded by Email::Mailer too :thinking:
Good suggestions. Thanks. I've added both via 8643e84. Let me know if you want any help with your plugin. I use Email::Mailer inside Log::Dispatch::Email::Mailer, so I'd love to learn about what you're doing and see if there's anything I should copy.
My plugin, still unpublished, is on https://framagit.org/fiat-tux/mojolicious/mojolicious-plugin-emailmailer.
I think it may be a good idea to have Email::Mailer automatically creating the Message-ID
header too.
This is how I do it on my plugin (it may not be the best way to do it, but it works):
$args{'Message-ID'} = md5_sum(''.\%args).'@mojo-plugin-emailmailer'
unless defined _header_key('Message-ID', %args);
Message-ID
is being generated by Email::MIME below Email::Mailer. But of course, users can specify their own like you have if they want something different.
I’ll retest that, but I remember having no Message-ID :thinking:
Email::MIME does not generate a Message-ID
header.
My test script:
use Email::Mailer;
use Email::Sender::Transport::SMTP;
Email::Mailer->send(
from => 'foo@1.example.org',
to => 'bar@2.example.org',
subject => 'test',
text => 'voyons s’il y a un message-id'
);
And here the result of
use Data::Dumper;
print Dumper $email_mime;
inserted in Email::Mailer just before the sendmail
call:
When sending the mail with sendmail
transport, the local mail agent adds a Message-ID
before sending the mail to the recipient server, but if I send the mail with a SMTP, only the recipient server adds a Message-ID
(not the SMTP server), and that’s added after the antispam scan (and the lacks of Message-ID
increases the spam score (MISSING_MID
on rspamd)).
Could you run some tests and confirm (or infirm) my diagnostic, please?
Hm. OK. I've included Message-Id auto-generation in Email::Mailer (if it's not explicitly set).
:+1:
My plugin is now published: https://metacpan.org/pod/Mojolicious::Plugin::EmailMailer
Hello,
I’m working on a Mojolicious plugin to send mail with Email::Mailer and my anti-spam, rspamd, complains about missing charset (symbol
R_MISSING_CHARSET
) and missing content-type (symbolBROKEN_CONTENT_TYPE
) when sending a text-only mail.My workaround is quite simple:
I think that should be done at Email::Mailer’s level, don’t you?
For html + text mails, this could be done with
text_body_attributes
.