Multisite Activesync configuration

In a multisite installation where all sites are reading email accounts on the same email server, you may wish to control the polling process and the delivery process to manage mail server work load.

WP Issues CRM includes a mechanism for managing server work load that is especially tailored for ActiveSync on Exchange. It involves replacing the random WordPress cron cycles of the various sites with a single cron job that runs periodically to do read and send for all sites. The process divides the requests of each user into manageable chunks and maximizes the chances that all users make read and send progress in every cycle.

The steps for configuring this mechanism are as follows:

(1) place the following lines in wp-config.php above the line that reads /* That’s all, stop editing! Happy blogging.

  • WP_ISSUES_CRM_GET_REQUEST_PAGE_SIZE sets the number of messages batched in single request for message bodies — recommended value is 10 ( will get a singe page per batch cycle)
  • WP_ISSUES_CRM_MESSAGES_SENT_PER_ROTATION sets the number of messages that will be sent each time the user gets a turn in the rotation generated by this function
  • WP_ISSUES_CRM_CRON_CLEARANCE_SECONDS is an estimated safe number number of seconds that should suffice to complete a page of get or send requests
  • WP_ISSUES_CRM_CRON_INTERVAL is max number of seconds that the cron job will keep working for — should correspond to timing of cron interval
  • WP_ISSUES_CRM_MESSAGE_SEND_DELAY is the number of milliseconds to wait between send events

(2)add an additional define line below those, replacing ‘some_long_random_string’ with a 64 character string of letters and numbers (not spaces or special characters)

define('WP_ISSUES_CRM_RUN_CRON_KEY', 'some_long_random_string');

(3) through CPanel, set up a cron tab to trigger at your desired cron interval — recommended starting point: 2 minutes

(4) in that cron tab, place the following instruction (on a single line)

wget -q -O - http://yoursiteurl/?wp_issues_crm_run_cron_key='the_same_long_random_string_you_inserted_in_step_two' >/dev/null 2>&1

(5) You may wish to also add a line to config.php limiting the size of list sends — example to limit to 500


Leave a comment

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