Cleaning up e-mail content#

Purpose#

When item-related e-mails are sent from Allegra, they include the item history (configurable). The history also contains all e-mails that a recipient has sent back in reply to the Allegra e-mail. Such a reply e-mail frequently contains the preceding e-mail traffic, which in turn is then added as part of the entry to the history. As a result, the history entries contain redundant content that grows exponentially.

To clean up this problem, Allegra must be able to recognize, upon receiving an e-mail, where the new reply ends and where the history begins. Allegra can then write only the actual reply into the history.

Allegra sends two kinds of item-specific e-mails:

  • automatic notifications when an item changes

  • e-mails sent explicitly from within an item

Both e-mail types may require content cleanup.

Setting an item delimiter in the signature#

To enable the content cleanup of reply e-mails to e-mails sent by Allegra from within an item, make sure that all e-mail templates of type “Sent from item” contain the following code at the beginning:

<div class="answerDelimiter" id="answerDelimiter"
     style="color:#b5b5b5">${answerDelimiter}</div>

You must add this code in the source-text mode of the HTML editor for the templates. The standard templates already include this code.

${answerDelimiter} is dynamically replaced with the localized text for the key item.mail.answerDelimiter.

The value can be overridden in the translation editor for each available language. In German, the default text is “Bitte geben Sie Ihre Antwort über dieser Zeile ein”.

Configuring the cleanup#

The cleanup of e-mail content is controlled via properties under Administration > Server administration > Other settings > Edit advanced settings.

There are two kinds of cleanup:

  • Removing the entire quoted part of the e-mail

  • Removing only known item-specific content

To enable cleanup of the quoted part, add or set the following entry:

# Whether to clean the quoted content of the e-mail by processing
item.emailReceived.removeQuotedPart=true

If this value is set to false, cleanup still takes place, but only for known item-specific content:

  • content delimiters

  • item details from notification e-mails

  • item details, history or item links from e-mails sent explicitly from within an item

If this flag is set to true, an attempt is made to clean up the entire quoted content.

# Whether to include the delimiter in the "Item change"-type
# E-Mail templates (notification E-Mails)
# on the standard "Item change"-type E-Mail templates the
# delimiter is added only if this is set on true.

# item.emailSend.includeDelimiterInAutomail=false

Determines whether the delimiter is inserted into e-mail templates of type “Item change” (notification e-mails).

For the standard templates, the delimiter is added only if this setting is set to true.

# Whether to validate the delimiter in the quoted part.
# If false the quoted part will be removed
# (according to item.emailReceived.removeQuotedPart flag)
# without validating that it includes the delimiter.
# If true the quoted part will be removed only if
# delimiter is found within the quoted part.
# Could be useful if delimiter is not added to the mails at all

item.emailReceived.validateDelimiterInQuote=true

Determines whether the delimiter in the quoted part should be checked.

  • If false, the quoted part is removed (depending on item.emailReceived.removeQuotedPart) without checking whether it contains the delimiter.

  • If true, the quoted part is removed only if a delimiter is found within the quoted region.

This can be helpful when delimiters are generally not added to the e-mails.