Hello Nikolas,
There are other alternatives to SMTP but you would need to write a Moodle Message provider as others have said.
Although Moodle does send an e-mail notification to all forum members one-by-one, it would categorically not be possible to convert this to use a service like Mandrill. There are many parts to the sending process and each e-mail is unique to the user.
At the very minimum, different users receive different e-mail notifications:
- obviously some users are members of different courses
- some users are subscribed to different forums
- some users are subscribed to different discussions
In addition, each user will receive different versions of the notification:
- some users have different mail digest settings
- some users prefer plain-text mails over HTML (and vice-versa)
- some users use a different language, and therefore parts of the notification will be in that alternative language
- we include an access token on any inline images and attachments which are hosted within Moodle so that they are visible to the user if that user is not logged into the site (MDL-36754)
Furthermore if the site has e-mail replies enabled then a unique reply address is inserted into each e-mail. That token is per-user/per-message and must be unique.
Therefore I do not think it will be practical to send Mandrill a template and tell it to send that template to a list of participants. You could only really do so where users make use of the same language, and mail format, and probably where mail replies are disabled.
Whilst you could convert many of these to variables, the complexity to do so dynamically for every notification would be extremely high. You'd probably only want to do so for the access tokens and some of the links, and possibly the reply address,. You would therefore still have to batch notifications by language (there would just be too many variables for this to make sense), mail type (HTML vs Plain, though post prefer HTML these days), and forum digests would need to continue to be treated completely separately.
The complexity of this set of restrictions would likely make this far less worthwhile.
Instead, I would recommend that you run a local Mail Transfer Agent (MTA) -- this can utilise SMTP, or it can be via the sendmail socket. A local MTA queues the mails and sends them for you, rather than having Moodle connect to a remote SMTP server. This is preferential because the latency for a local MTA is far lower than connecting to a remote SMTP server, and an MTA is far more efficient at sending mails to the next hop (this is literally its entire job). Use of a local MTA will also help to smooth out load concerns because it will automatically (well, when configured correctly) reduce the speed at which it sends mail under high load, and increase it under lower load.
I will also point you at MDL-46881 where we have completely rewritten the way in which we queue forum notifications to be more efficient. Unfortunately this change also has the effect of making your proposal even harder, but it will allow generally faster delivery of forum notifications.
Please note that the "X-MC-PreserveRecipients" header is a Mandrill-specific header.
Hope this helps,
Andrew