Difference between revisions of "Developer Area/Specifications in Development/VERP Mail Bounces"

From Mahara Wiki
Jump to navigation Jump to search
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
===Variable Envelope Return Path Mail Bounce Detection===
 
 
 
This feature allows administrators to set up an email system to
 
This feature allows administrators to set up an email system to
 
detect bounced emails and disable outgoing emails for accounts
 
detect bounced emails and disable outgoing emails for accounts
 
that get large numbers of bounces.
 
that get large numbers of bounces.
  
The feature was introduced in commit id [https://gitorious.org/mahara/mahara/commit/9b9b2a5c25a078d0c6aab0e4fb6bed1c5eb112d2 9b9b2a5c25a078d0c6aab0e4fb6bed1c5eb112d2].
+
The feature was introduced in commit id [https://gitorious.org/mahara/mahara/commit/9b9b2a5c25a078d0c6aab0e4fb6bed1c5eb112d2 9b9b2a5c25a078d0c6aab0e4fb6bed1c5eb112d2]. This has been present since Mahara 1.3.
 +
 
 +
Some users may need the bug patch in review [https://reviews.mahara.org/1184 1184]
  
 
There is also a new addition to this feature in gerrit as change [https://reviews.mahara.org/1181 1181] to allow polling of imap mailboxes for the returned bounces.
 
There is also a new addition to this feature in gerrit as change [https://reviews.mahara.org/1181 1181] to allow polling of imap mailboxes for the returned bounces.
Line 11: Line 11:
 
This feature requires setting up some config.php settings and some settings in the mail server. The examples below are based on a postfix and procmail installation on the server.
 
This feature requires setting up some config.php settings and some settings in the mail server. The examples below are based on a postfix and procmail installation on the server.
  
 +
=Standard setup=
 
== config.php settings ==
 
== config.php settings ==
  
Line 16: Line 17:
 
  $cfg->bounceprefix    = 'AAA+';  // config-defaults has 'AAA-'
 
  $cfg->bounceprefix    = 'AAA+';  // config-defaults has 'AAA-'
 
  $cfg->bouncedomain    = 'mahara.example.com';
 
  $cfg->bouncedomain    = 'mahara.example.com';
 
 
 
== Postfix setup ==
 
== Postfix setup ==
  
= /etc/postfix/main.cf =
+
=== /etc/postfix/main.cf ===
  
 
Need the following in addition to any setup, note that if these lines exist, the values need to be added to existing lines
 
Need the following in addition to any setup, note that if these lines exist, the values need to be added to existing lines
Line 29: Line 28:
 
Then run the following as root
 
Then run the following as root
 
  postfix reload
 
  postfix reload
 
+
=== /etc/aliases ===
= /etc/aliases =
 
 
  AAA: www-data
 
  AAA: www-data
  
 
Then run the following as root
 
Then run the following as root
 
  newaliases
 
  newaliases
 
+
=== /etc/procmailrc ===
= /etc/procmailrc =
 
 
  :0
 
  :0
 
  * ^TO_AAA+.*@mahara.example.com
 
  * ^TO_AAA+.*@mahara.example.com
 
  |"/usr/bin/php /var/www/mahara/lib/processemail.php"
 
  |"/usr/bin/php /var/www/mahara/lib/processemail.php"
 +
 +
=IMAP Setup=
 +
This setup requires the setup of an imap server as well. The setup of that is out of scope of this document.
 +
 +
It is assumed that your mail server or the delivery filter puts the bounce emails into a seperate IMAP mailbox (POP3 can also be used).
 +
 +
== config.php settings ==
 +
 +
$cfg->bounces_handle  = true;
 +
$cfg->bounceprefix    = 'AAA+';  // config-defaults has 'AAA-'
 +
$cfg->bouncedomain    = 'mahara.example.com';
 +
$cfg->imapserver      = 'mail.mahara.example.com';
 +
$cfg->imapuser        = 'bouncechecker';
 +
$cfg->imappass        = 'supersecret';
 +
 +
For more settings, like using mailboxes other than INBOX, or using POP3, see lib/config-defaults.php

Latest revision as of 15:40, 3 May 2012

This feature allows administrators to set up an email system to detect bounced emails and disable outgoing emails for accounts that get large numbers of bounces.

The feature was introduced in commit id 9b9b2a5c25a078d0c6aab0e4fb6bed1c5eb112d2. This has been present since Mahara 1.3.

Some users may need the bug patch in review 1184

There is also a new addition to this feature in gerrit as change 1181 to allow polling of imap mailboxes for the returned bounces.

This feature requires setting up some config.php settings and some settings in the mail server. The examples below are based on a postfix and procmail installation on the server.

Standard setup

config.php settings

$cfg->bounces_handle  = true;
$cfg->bounceprefix    = 'AAA+';  // config-defaults has 'AAA-'
$cfg->bouncedomain    = 'mahara.example.com';

Postfix setup

/etc/postfix/main.cf

Need the following in addition to any setup, note that if these lines exist, the values need to be added to existing lines

mydestination = mahara.example.com
mailbox_command = /usr/bin/procmail RECIPIENT=$ORIGINAL_RECIPIENT

Then run the following as root

postfix reload

/etc/aliases

AAA: www-data

Then run the following as root

newaliases

/etc/procmailrc

:0
* ^TO_AAA+.*@mahara.example.com
|"/usr/bin/php /var/www/mahara/lib/processemail.php"

IMAP Setup

This setup requires the setup of an imap server as well. The setup of that is out of scope of this document.

It is assumed that your mail server or the delivery filter puts the bounce emails into a seperate IMAP mailbox (POP3 can also be used).

config.php settings

$cfg->bounces_handle  = true;
$cfg->bounceprefix    = 'AAA+';  // config-defaults has 'AAA-'
$cfg->bouncedomain    = 'mahara.example.com';
$cfg->imapserver      = 'mail.mahara.example.com';
$cfg->imapuser        = 'bouncechecker';
$cfg->imappass        = 'supersecret';

For more settings, like using mailboxes other than INBOX, or using POP3, see lib/config-defaults.php