Skip to content

Obviate.io

To anticipate and prevent

  • Home
  • About Us
  • History
  • Privacy Policy
  • Toggle search form

Configuring MediaWiki to use external SMTP

Posted on 2011-08-30 By Jon No Comments on Configuring MediaWiki to use external SMTP

At my new company, I setup a copy of MediaWiki and wanted to make sure that all the notifications work. One kink was that the mail needed to be sent through an external service called SendGrid. Since I setup MediaWiki and it is for internal use only, I could probably have skipped the email service but it seemed like a good exercise. Fortunately, MediaWiki has the capability to do this and it isn’t terribly difficult.

First thing you want to do is install PHP’s

PEAR Mail. If you’re on Ubuntu/Debian, it’s super simple:

  • sudo -s
  • apt-get install php-pear
  • pear install mail
  • pear install Net_SMTP
  • pear install Auth_SASL
  • pear install mail_mime
  • /etc/init.d/apache2 restart

Now you need to add/configure MediaWiki’s $wgSMTP variable in your wiki’s LocalSettings.php file, an example is show here:

<br />
$wgSMTP = array(<br />
'host' => "mail.example.com", //could also be an IP address<br />
'IDHost' => "example.com",<br />
'port' => 25,<br />
'auth' => true,<br />
'username' => "my_user_name",<br />
'password' => "my_password"<br />
);<br />

If you don’t need to authenticate yourself, change ‘auth’ to false and drop the username/password options. Otherwise you should be able to get right onto the wiki and start emailing yourself through your 3rd party mail system. If you have any issues, just set $wgShowExceptionDetails = true; in your LocalSettings.php file and try your request again. As for myself, the configuration to SendGrid (which offers a “free plan” with 200 messages a month) was painless and works flawlessly. Now I know my messages will get delivered and have DKIM and DomainKeys!

Tech, Wiki World Tags:dkim, domainkeys, mail, mediawiki, sendgrid, smtp

Post navigation

Previous Post: Solution for Blank HTML Pages on Windows Server 2008 R2 IIS
Next Post: Promise Pegasus Daemon Cannot Start

More Related Articles

AWS SES + Postfix + DKIM Cloud
Gmail thinks “This message may not have been sent by…” you Apple
MediaWiki spam is such a headache Tech

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

August 2011
S M T W T F S
 123456
78910111213
14151617181920
21222324252627
28293031  
« Jul   Sep »

Copyright © 2022 Obviate.io

Powered by PressBook Premium theme