Sergiu Dumitriu wrote:
Lilianne E. Blaze wrote:
Hello, Here's the newest version.
Basically it bridges XWiki.sendMessage to MailSenderPlugin.
It uses Reflection, so no circulars, but it's not exactly pretty.
The patch cannot be applied yet, since it introduces a regression I'd like to fix first.
The old sendMessage allowed indeed to set a Subject inside the content (as a mail header), which is extracted (when found) and passed to the plugin's sendTextMessage method.
The old sendMessage passed headers+body as-is to SMTPClient.
The problem is that ALL kinds of headers were allowed inside the text content, not just the subject, and with this patch these headers are discarded.
Ok. Here's what I'm thinking - remove subject extraction from the patch, instead add a new method to MailSender plugin, like sendRawMessage(String from, String to, String rawData), which acts more like old SMTPClient, and add header extraction/handling logic there. Would that be ok? Greetings, Lilianne