Bounces can be directly fed to the bouncehandler API from the MTA using a curl POST request

As a result, users whose address is in error are un-subscribed and they are notified through Echo about this the next time they connect on the wiki. More exactly, their address is un-confirmed, and in case MediaWiki requires confirmed emails no emails will be further sent.

Installazione

Run the update script which will automatically create the necessary database tables that this extension needs.

Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Configurazione

The extension requires the Mail Transfer Agent (MTA) installed in your mail server to HTTP POST the incoming bounce email to the extension API named as bouncehandler. This can be done by adding the corresponding configurations to your MTA configuration.

Adding bouncehandler router and transport configuration to Exim

You can redirect all your bounce emails to the bouncehandler API directly to do the processing. You can edit your Exim configurations to route all bounce emails to a bounce-handler-router and do HTTP POST to the extension API, which is the recommended method.

Save and close this file, and head over to your MediaWiki's LocalSettings.php and make sure add the following line:

$wgJobRunRate=0;

Once that is done, save and close this file. To test if this works, send an email to a invalid email to your server and then run:

php maintenance/runJobs.php

To check if your email bounces were captured, check the bounce_records table in your mediawiki database, and /var/log/mail.log for further testing.

API

The BounceHandler extesnsion installs an API bouncehandler to receive the HTTP POST from the mail server.
The API has a parameter email to which the entire bounce email is url encoded to.
This helps in avoiding the use of a separate bounce collector inbox or other IMAP features for the extension to work.

The string resulting as the concatenation of $prefix,'-',$wikiId,'-',base_convert( $userID, 10, 36),'-' and base_convert( $timestamp, 10, 36)

$algorithm

The hashing php-hmac algorithm used to prepare the hash of $prefix

$key

The key used to prepare the hash using the hmac algorithm

$email_domain

The domain part of the VERP email address

Parametri

Configurazione

Default

Descrizione

$wgVERPalgorithm

'md5'

The PHP hashing algorithm you need to employ to generate the VERP return-path address. Can be md5, sha256 etc. More details at [1]

$wgVERPsecret

'MediaWikiVERP'

The secret key you need to pass to the PHP HMAC function

$wgVERPAcceptTime

259200(3 days)

The threshold time (in seconds) until we are expecting a bounce. Setting it < 3 days will make sure you respond only to the valid bounces.

$wgVERPprefix

'wiki'

The prefix of the bounce addresses.

$wgVERPdomainPart

null

The domain part of the bounce addresses. null is equivalent to $wgServerName

$wgBounceRecordPeriod

604800(1 week)

The Bounce allowed period (in seconds). Setting it to a week makes sure that we consider a weeks bounce frequency before taking un-subscribe actions.

$wgBounceRecordLimit

10

Allowed bounces in the given time period.

$wgBounceHandlerInternalIPs

['127.0.0.1','::1']

The internal IP's that are allowed to use the API. Make sure this is configured correctly, so that no outside user can cause unwanted email un-subscriptions.

$wgBounceHandlerUnconfirmUsers

false

Set to true to enable unsubcriptions when bounces are above the threshold.

$wgBounceRecordMaxAge

5184000(60 days)

The period (in seconds) where are kept the records of bounces. Older bounces records are deleted. false to deactivate deletion.

$wgBounceHandlerSharedDB

false

(to be documented)

$wgBounceHandlerCluster

false

(to be documented)

$wgUnrecognizedBounceNotify

null

Array of email addresses where are sent unrecognized bounces. null to send to $wgNoReplyAddress. (It will change to no one if this change is merged.)

$wgGenerateVERP

true

Activate VERP addresses.

This extension is being used on one or more Wikimedia projects. This probably means that the extension is stable and works well enough to be used by such high-traffic websites. Look for this extension's name in Wikimedia's CommonSettings.php and InitialiseSettings.php configuration files to see where it's installed. A full list of the extensions installed on a particular wiki can be seen on the wiki's Special:Version page.