Email server
| tbd @ |
|---|
Background
It is possible to run a MediaWiki without configuring Email, but there are a number of functionalities which will not be available:
If emails are activated, there are three ways to configure the system:
- Just use the php email function. Many email providers will consider mails send this way to be spam though.
- Use an external email provider via $wgSMTP. This should be easy to configure.
- But if MediaWiki is running on a dedicated (virtual) server - why not install an email server?
This page contains instructions on how to achieve the third option.
Installing an email server
These instructions focus on Plesk running on Ubuntu, because that is what we use.
Services
- Plesk -> Tools & Settings -> Plesk -> Updates (opens in new tab)
- Add/Remove Components -> Webmail Services: "Horde" deactivated, "Roundcube" activated
- Add/Remove Components -> Mail hosting: "SpamAssassin", "Postfix" and "Dovecot" activated
Activate email for domain
- Plesk -> Mail -> Mail Settings -> (domain)
- "Mail service on this domain" enabled
- "Webmail": "Roundcube"
- "SSL/TLS certificate": "Lets Encrypt"
- "Use DKIM spam protection system to sign outgoing email messages": activated
- use button "How to configure external DNS", take note of the information given
- "Enable mail autodiscover" activated
Create new email account
- Plesk -> Mail -> Email Adresses
- create new email account; we use it for our wiki, so we call it
admin@wiki-aventurica.de.
- create new email account; we use it for our wiki, so we call it
Change DNS configuration
(STRATO Server als Mailserver: Was kann ich tun, wenn meine E-Mails von anderen Providern abgelehnt werden?, So legen Sie ein individuelles DNS-Reverse für Ihre IP-Adressen fest)
- use Strato client login
- Strato -> Domains -> Domainverwaltung -> gear -> DNS
- MX-Record: Eigener Mailserver, Hostname: (domain); in our case:
wiki-aventurica.de - TXT und CNAME Records inklusive SPF- und DKIM-Einstellungen -> Weiteren Record erstellen; fill in the "external DNS" information as TXT.
- MX-Record: Eigener Mailserver, Hostname: (domain); in our case:
- Strato -> Domains -> Reverse DNS: Die IP auf die eigene domain zeigen lassen; in our case
wiki-aventurica.de. Should be pre-configured, one needs to press "save" though to create the record.
- Strato -> Domains -> Domainverwaltung -> gear -> DNS
Localsettings
Add the variable $wgSMTP with your information to LocalSettings.php. In our case:
$wgSMTP = [
'host' => 'ssl://wiki-aventurica.de', // could also be an IP address. Where the SMTP server is located. If using SSL or TLS, add the prefix "ssl://" or "tls://".
'IDHost' => 'wiki-aventurica.de', // Generally this will be the domain name of your website (aka mywiki.org)
'localhost' => 'wiki-aventurica.de', // Same as IDHost above; required by some mail servers
'port' => 465, // Port to use when connecting to the SMTP server
'auth' => true, // Should we use SMTP authentication (true or false)
'username' => 'admin@wiki-aventurica.de', // Username to use for SMTP authentication (if being used)
'password' => '(password)' // Password to use for SMTP authentication (if being used)
];
Notes
- Another advantage of installing an email server: It is possible to create more email accounts for regular users of your wiki, who can then use the web UI to access their mails (Roundcube:
webmail.(domain), in our casehttps://webmail.wiki-aventurica.de/). - Do not install "Dr. Web"-Antivirus (maybe it is called "Plesk Premium Antivirus"), or uninstall it if it was installed automatically. It is a russian program, loading files from russia and sending information to russia, and thus in no way to be trusted monitoring your system.