Details
Description
EmailProcessor.php script serves two purposes – bounce processing and email-to-activity processing. In the current structure, placing "&emailtoactivity=1" in the url triggers the latter. Absent that url variable, the script processes mailboxes as bounces. There are several problems with the current structure:
- you cannot call the script to perform both actions at once – if the &emailtoactivity=1 is present, it does not processes bounces, and absent, it does not process actvities
- if you choose to process as activities, yet are using one of the accounts to collect bounces, the bounces are processed as activities
- the admin interface has the option of selecting a default account, but it is unclear what that does
The attached patches offer an incremental improvement. More could be done. It does the following:
- alters the admin interface so we ask how the account will be used for. this does not alter the schema – the is_default field is used, and a value of 1 = bounce processing (should be most backwards compatible with existing usage). this also assume standard is_default behavior, where only one option can be selected as the default.
- alters the EmailProcessor.php script to reflect these explicit usage selections
Further suggested improvements:
- enable the ability to select a mailbox as used for both bounce and activity processing. this would involve some changes to make sure a single email is not processed for both functions, and we would probably need a new field in the civicrm_mail_settings table, as is_default is also used to determine the envelope email for sending mailings. so additional additional value options could be problematic.
- create additional options for activity processing (should contacts be created, or only match to existing, etc.)