On 2014-06-10, 8:59 PM, John wrote:
There is zero reason that this shouldnt be in an extension.
Basically a few users want to install a shinny new toy called swiftmailer into core, just because its shiny. In doing so they add a complexity and headache. Such a addition should be done as an extension
Sorry but these strawmen are quite annoying, and frankly disrespectful to the developers trying to improve core.
SwiftMailer is not some toy or shiny trinket, it is a serious and well maintained library dedicated to sending email from PHP.
Adding it to core is not some new feature that would be better in an extension. It is a serious improvement to our core handling of email within PHP that replaces our crude UserMailer code.
Our current UserMailer code is ridiculous when you look at it.
By default our UserMailer code will just use php's creaky mail() function. Which has some 'features' like: - Unpredictable message headers - Lack of feedback regarding delivery failures - And this beautiful comment in our codebase: # PHP's mail() implementation under Windows is somewhat shite, and # can't handle "Joe Bloggs joe@bloggs.com" format email addresses, # so don't bother generating them
If you want to send email a different way, you could of course instead use $wgSMTP which: - First requires you to install PEAR Mail. - Who the hell uses PEAR anymore! - And don't forget, PEAR is a tool that installs modules globally and is difficult to impossible to use without shell and even admin access. - ;) And this is the hell we put tarball users through, not devs. - This PEAR Mail library we're relying on to handle all users who can't use mail() or don't want it's features, here's the dev page: - http://pear.php.net/package/Mail - Current stable 1.2.0, released in March of 2010 - Next release, 1.2.1 scheduled release date in January of 2011, never released. - ((In other words, the library we're entrusting all our SMTP handling to is practically dead and no longer maintained, Whoops.)) - Admittedly if you hunt down PEAR Mail's github repo there has been a bit of activity: - https://github.com/pear/Mail/commits/trunk - But none of this will be installed by pear, it'll only install old code from 2010 missing fixes for a number of bugs in PEAR Mail - The majority of changes in 2014 have been minor/trivial things (adding travis builds, whitespace fixes) - And, ;) making PEAR Mail installable via Composer *snicker*
And to sprinkle this all off, because mail() and PEAR Mail are so different, half the code in UserMailer::send() is split into two different large code paths, which is a recipe for maintenance headaches.
Using Swift Mailer on the other hand: - The library has ample development and maintenance going on: https://github.com/swiftmailer/swiftmailer/commits/master - SMTP and mail() are abstracted away into transports, so instead of two large (unmaintained?) code paths we just craft and send an email in one code path, a well maintained library takes care of the difference between transports. - In the future we can move away from using mail() and add the ability to use sendmail as a transport directly, without the bugs (in theory I think it would even be possible to try swapping a different transport in place of mail() automatically). - All this gets bundled into the tarball directly, so $wgSMTP now works out of the box and doesn't require installation of something that in some situations is impossible to install.
~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://danielfriesen.name/]