splitbrain / dokuwiki-plugin-smtp

Send DokuWiki mails via a configured SMTP server
https://www.dokuwiki.org/plugin:smtp
12 stars 14 forks source link

Message-ID header missing #59

Open jejust opened 1 year ago

jejust commented 1 year ago

Hello, The emails sent by Dokuwiki are missing the Message-ID header. This is supposed to be a minor problem, and should be solved by the first SMTP server who detects it, but in fact that causes some rejections by Gmail (among others):

<xxx@gmail.com>: host gmail-smtp-in.l.google.com[173.194.76.26]
    said: 550-5.7.1 [212.27.42.5] Messages missing a valid messageId header are
    not 550 5.7.1 accepted. 12-20020a05600c228c00b003ed23773cd2si3370291wmf.136
    - gsmtp (in reply to end of DATA command)

The txthinking/Mailer library, used by Dokuwiki, is supposed to generate the Message-ID, here:

$this->header['Message-ID'] = '<' . md5('TX'.md5(time()).uniqid()) . '@' . $this->fromEmail . '>';

but I cannot understand the way Dokuwiki calls it (part of the methods are re-implemented in Dokuwiki).

As SMTP server are getting stricter and stricter about emails formatting, that would be nice if Dokuwiki could respect current standards about emails!

Thanks for your help!