7. Email Gateway

Mail parsing process :

  - The email gateway processes periodically using the cron every email account configured and activated

  - The magento cron check each mail box every 15 mins and download all the new emails

  - The number of mails imported on each cron pass can be limited using the option

System -> configuration > CRM Express -> Ticket Email account -> Max message download

  - All mails are saved in database

  - a cron can clean old emails every month. This option is optional and configurable into

System -> configuration > CRM Express -> Ticket Email account -> Number of month

  - When you initialize an email account in CRM Express, perhaps you just want to get the “last mails”. But Crm Express can’t consider a mail as “new” if the email have not been downloaded before in database.

To avoid this limitation, you can define to import email “after a  date” in  System -> configuration > CRM Express -> Ticket Email account -> Download message from this date

1. Email parsing

CRM Express is designed to parse the received mails and to link the answer to an existing ticket

Very Important :

When you configure the email template there are 2 important flags

  • in the mail body : “[Response:”, which enable to insert into ticket tool only the response from customer (and not the complete mail)
  • in the subject : “(Ticket1), which enable to link the mail response to an existing ticket

they are identified in the email template as”{{var_response}}” and “{{hashtag}}”

It’s mandatory to let these 2 flag in the template, else the system will not work anymore and each mail response will be added as “new Ticket”.

7.1.2 Attachment limitations

When CRM express download an email and get its attachments,  they are some limitations :

  • .php and .js file are forbidden to avoid code injection avoid security risk on your server
  • the file type are limited to all document relative to work (all office documents, images, zip, csv, pdf …)
  • Sound and videos attachment are blocked.


  • Mailer daemon are not imported in tickets

2. Spam management

Spam management :

   - Some e-mail are received already flagged as spam ( with the flag X-Spam : YES is detected in the mails headers) That will not be processed and kept in the Mailbox :  You can check emails in CRM > Tools > Email management -> Mailbox. This screen is described in 7.4)

   - a mail flagged as Spam by the spam filter  will not be converted into a new ticket or a ticket response, he will stay in the Mailbox

   - There is a status for each mail, you can check if a mail is flagged as Spam on this screen.

   - Using the mass action you can select the email you want to not flag as spam and use it to link them to a ticket

Spam filter:

  • You can configure the spam filter in** System > Configuration > CRM > Ticket > Spam**

        -> You can define 4 types of rules based on :

  • domain detection ( a domain is the @domain.com part of the email address that send the mail)

          - One domain list to accept all email with this domain

          - One domain list to refuse all email with this domain

           -> ex : if you define @gmail.com as an accepted domain, all email like joe@gmail.com will never be flagged as Spam.

  • E-mail detection

          - One e-mail list to accept all email from this

          - One e-mail list to exclude all email from this

           -> ex : if you define joe@gmail.com as an accepted email, all email from joe@gmail.com will never be flagged as Spam.

3. Email routing rules

You can access this screen using

CRM -> Tools -> Email management-> Email to ticket management

To begin, Let take some examples :

You want that all tickets :

  • from the account “support@myshop.com” are directly assigned to the the category “support”
  • with “order” in the subject are directly assigned to the the manager “Joe”
  • from the email “john@customer.com” are directly set with to the status “closed”

etc …

You have understood, you can define here some rules to assign automatically some information of the ticket depending of the email content.

Please note this functionality is active only on a ticket creation from an email, not when the e-mail gateway will import the responses.

In this screen, you have a grid where you can see all rules. The good way to read it is to filter by active rules and to order by priority.

Indeed, actives rules will be applied in a specific order, from the lowest priority to the highest : the last rules executed - the one with the highest priority - potentially override the changes made by the previous rules.

You can create a new rule using the button “Add a new rule” and edit any rule clicking on a row of the grid on deleting a rule using the button delete available from the edit form.

1. Rules creation and edition

A routing rule has :

 - A name, to identify it in the grid

 - A priority, to define an order of execution of the rules between each others. (there are 100 levels of priority)

 - Active : only actives rules will be executed

 - A set of parsing rules : they are the criteria that will be matched on the mail received

 - A set of changes to apply to the ticket


2. Pattern rules

The rules criteria relative to the email’s Subject, From and Body are using “pattern”.

To make it simple, you just have to type in the field a word or a part of a word you want to be seek into of this field.

examples :

you want to route all the email with a domain like yahoo.com.

So, in “Email’s from pattern” : just set @yahoo.com’ (without the quote)

you want to route all the email with the word “order” in the subject

So, in “Email’s subject pattern” : just set ‘order’ (without the quote)

etc ..

Please note the pattern are not case sensitive.

4. Mailbox

In the screen

CRM > Tools > E-mail Management > mailbox

You can check the list of all emails imported.

You can see if a mail have been linked to a ticket of not.

If a mail is in

  • error : you can click on the line to check why (require code knowledge (you nee dto add /dbg/1 at the end of URL)
  • spam : else

  - you want it to stay as spam and it’s ok

  - you want to process it and imported it into ticket tool : to do that you need to check the email and use the grid action : associate to ticket : this will force to re-import the email and avoid the spam filter.

Please think to configure the Spam filter in System > Configuration > CRM Express > Ticket > Spam