Composr Tutorial: Advanced forum settings

Written by Chris Graham
This tutorial covers more advanced forum configuration.


Mailing lists

Image

Setting up mailing list settings on a forum

Setting up mailing list settings on a forum

(Click to enlarge)

There is an option to allow people to e-mail in to the forums.

This requires:
  1. The PHP IMAP extension to be installed
  2. The system scheduler must be running (Cron)

Also recommended:
  1. The mail server supports IMAP (not just POP3)
  2. The mail server enforces SPF and DKIM, so that Composr can know that e-mails have legitimately come from where they claim to come from
  3. The mail server enforce a reasonable maximum size for an individual e-mail, e.g. 5MB
  4. The system scheduler be set to run every minute

Each individual forum is configured with its own mailing list settings, on the forum add/edit form. You can inherit settings from the IMAP configuration options, so long as each forum gets its own individual E-mail address and Username.

E-mails are bound to accounts via recognition of e-mail addresses. You can configure how to handle unrecognised addresses:
  • Block the posting
  • Automatically create an account (and e-mail the randomly-generated password back)
  • Post as guest

Forums with a mailing list configured will say so when the forum is viewed.

Members enable/disable the functionality from the notifications tab of their account settings (Notifications tab settings). It is on by default, although you can configure this default via the "Mailing list style" configuration option (in Admin Zone > Setup > Configuration > User/usergroup options > Default settings for new members). Users may wish to disable if they prefer to reduce their e-mail volume using the "Smart topic notification" setting.

For a member to receive mailing list e-mails the following must all be true:
  1. All the requirements above must be met (PHP IMAP extension etc)
  2. The forum involved must have them configured in the forum settings; between the settings for the forum, and the global configuration, it must be fully configured with the mail server details
  3. They must have a configured e-mail address – if you want to force this you can configure e-mail addresses to be required
  4. They must be monitoring the forum or topic where a post is coming in to, specifically with e-mail as the notification type – if you want to force this, you can use the "Lock-down" feature to force all member's to receive e-mail notifications on all forums
  5. They must have enabled them in their account settings (Notification tab settings) – if you want to force this you can configure the default setting

Processing notes

Be aware of the following:
  • Composr makes some attempt to clean up the e-mail text, so that the forum posts are not too much of a mess.
  • Comcode will be processed with guest permissions if the poster would normally have "Use dangerous Comcode" privilege, due to us not being able to perfectly confirm the poster is who they say they are.
  • You may want to assign usergroups the "Subject to a more liberal HTML filter" privilege, so that complicated HTML e-mails don't look too ugly. If an e-mail has both HTML and text versions, the HTML version will only be used if this privilege is present.
  • Attachments provided are not fully protected from unauthorised access, due to the need for them be able to render with guest credentials.
  • Post date/time will reflect the time of the e-mail being picked up, not the e-mail being sent. As long as the system scheduler is running frequently this should not be a problem.

Debugging:
  • Posting is tracked by marking e-mails read. If you mark an e-mail unread (unseen), it will post again. This can be useful for testing.
  • You may make an empty writeable file, data_custom/mail_integration.log, and Composr will write detailed log data into this file.

Specific mail servers

This section covers some advice for specific mail servers we have tested.

Gmail

Gmail can be highly problematic, and we were not able to get it to work reliably during testing due to automated threat detection measures running on Google's servers.
To get it to run you need to do the following:
  • Enable IMAP in the gmail settings of the account
  • Enable less secure apps
  • Either disable 2-step verification, or configure using app-specific passwords rather than the account password
  • You may need to do a CAPTCHA unlock

Zoho

For Zoho to work you just need to enable IMAP in your Zoho Mail account settings.

Default Poll Options

There is an option to set default poll options for topic polls created within the forum. The field takes a special XML markup.

The XML markup is as follows:

Code (XML)

<defaultPollOptions requireTopicPoll="true" confined="true" votingEnabled="false" votingPeriodHours="24" requiresReply="true" resultsHidden="true" viewMemberVotes="false" voteRevocation="false" guestsCanVote="true" minimumSelections="1" maximumSelections="1">
        <option mandatory="true">Foo</option>
        <option mandatory="true">Bar</option>
        <option>Optional</option>
</defaultPollOptions>

The defaultPollOptions root tag supports the following attributes:
  • requireTopicPoll (boolean): If true, then every new topic in the forum must have a poll on creation. This also prevents anyone regardless of their permissions from deleting polls from topics in the forum (instead, the entire topic must be deleted).
  • confined (boolean): If true, then only the defined poll options in the XML are allowed; members may not add their own custom poll options.
  • votingEnabled (boolean): If true, then all polls must have voting enabled upon creation. Otherwise, the topic author may decide.
  • votingPeriodHours (number|false):
    • If defined as a number, then all polls created in the forum will close voting after the defined number of hours.
      • If a topic scheduled time was provided, this will be the number of hours from the scheduled time. Otherwise, it is the number of hours from when the topic was created.
    • If defined as false, then setting a date to close voting will not be allowed.
    • If not defined, then the topic author may define their own date to close voting if they wish.
  • requiresReply (boolean): If true, then every poll created in the forum will require a topic reply. If false, then every poll created in the forum will not require a topic reply. If not defined, then the topic author may decide.
  • resultsHidden (boolean): If true, then every poll created in the forum will require results be hidden (until a moderator unhides them) from members who voted. Otherwise, the topic author may decide.
  • viewMemberVotes (boolean): If true, then every poll created in the forum will require the ability to see which members voted for each option on the results. If false, then every poll created is not allowed to reveal which specific members voted for each option. If not defined, then the topic author may decide.
  • voteRevocation (boolean): If true, then every poll created in the forum will require allowing voters to revoke their vote while voting is still open. If false, then every poll created in the forum will not allow voters to revoke their vote. If not defined, then the topic author may decide.
  • guestsCanVote (boolean): If true, then every poll created in the forum will require allowing guests to vote without logging in. If false, then every poll created in the forum must require guests to log in to vote. If not defined, then the topic author may decide.
  • pointWeighting (boolean): If true, then every poll created in the forum will weigh votes based on voter points. If false, then the votes of every poll in the forum will have the same weight. If not defined, then the topic author may decide. This attribute has no effect if the points addon is not installed or point-weighting is disabled site-wide.
  • minimumSelections (number): If defined, then all polls created in the forum will require the provided minimum number of selections when someone votes. If confined is also true, then you must define at least this many option children in the XML.
  • maximumSelections (number): If defined, then all polls created in the forum will require the provided maximum number of selections when someone votes.

The defaultPollOptions accepts any number of option children (but at least one must be provided if confined is true). Options define which poll answers / options are filled in by default when adding a poll in this forum. The value of each option is the name of the poll option. Each option also supports the following attributes:
  • mandatory (boolean): If true, then every poll created in the forum must have this option in it (the option cannot be removed / changed).

Nuances of which to be aware:
  • Changing the default poll options XML affects the creation of polls in the future. While it does not affect current polls, any attempts to edit current polls will be subject to the restrictions of the newly defined options except for these attributes:
    • votingEnabled: This setting can be changed when editing a poll. It is assumed at some point that moderators will want to enable (or disable) voting.
    • resultsHidden: This setting can be changed when editing a poll. It is assumed at some point that moderators will want the results to be public.
    • votingPeriodHours: The poll will keep its set voting close time instead of being enforced by the XML, but the setting can no longer be changed on the poll.
  • Default poll options are not enforced on polls moved from one forum topic to another.
  • Restrictions defined in the XML apply to everyone regardless of privileges.

Custom Fields

You may add custom fields to forums, topics, and posts (which utilise the catalogues). Note however that custom post fields will not show up on the quick reply form (which will continue to function even if there were required custom fields). You may therefore choose to disable the quick reply form, unless you actually want this behaviour (do not have them on quick reply, but force them for if that post is subsequently edited). You can remove the "Use quick reply" privilege from members to disable quick reply, although this will not disable it for administrators. If you need to also disable quick reply for administrators you would need to remove it from the CNS_TOPIC_SCREEN.tpl template.

See also


Feedback

Please rate this tutorial:

Have a suggestion? Report an issue on the tracker.