Historique de la page
| Sommaire |
|---|
Les propriétés de The properties of /properties/config.properties de configuration de l'alimentation par courrier électronique (cf Configuration de l'alimentation par courrier électronique) sont utilisées dans le fichier de configuration /properties/domain/feed.xml.
Lecture de plusieurs comptes IMAP
for the configuration of email feeding (cf Configuring email feeding) are used in the configuration file /properties/domain/feed.xml.
SPAM filtering
It is possible to filter the SPAM in order to prevent from unwanted emails to create unwanted tickets, or to create tickets but close them automatically just after their creation.
Using predefined filters
Two beans implementing predefined filters are available in the distribution:
- subjectStartsWithSpamFilter, which considers an email as spam if it the subject starts with a given string
- subjectContainsSpamFilter, which considers an email as spam if it the subject contains a given string
In order to consider as spam all the messages starting with [SPAM] and delete them, set the following properties:
| Bloc de code |
|---|
feed.imap.spamFilterBean=subjectStartsWithSpamFilter
feed.imap.spamFilterPattern=[SPAM]
feed.imap.deleteSpam=true
|
In order to consider as spam all the messages that contains the string *SPAM*, transfer them to category #5 and close them, set the following properties:
| Bloc de code |
|---|
feed.imap.spamFilterBean=subjectContainsSpamFilter
feed.imap.spamFilterPattern=*SPAM*
feed.imap.deleteSpam=false
feed.imap.spamCategoryId=5
|
Using several filters
In order to use several (predefined or added) filters, declare the filters in the configuration file /properties/domain/feed.xml, for instance:
| Bloc de code |
|---|
<bean id="subjectStartsWithSpamFilter"
class="org.esupportail.helpdesk.services.feed.imap.SubjectStartsWithSpamFilterImpl"
lazy-init="true" >
<property name="pattern" value="SPAM" />
</bean>
<bean id="mySpamFilter"
class="edu.domain.helpdesk.services.feed.imap.MySpamFilterImpl"
lazy-init="true" />
|
Declare the filter delegatingSpamFilter of class org.esupportail.helpdesk.services.feed.imap.DelegatingSpamFilterImpl that delegates to the previously declared filters:
| Bloc de code |
|---|
<bean id="delegatingSpamFilter"
class="org.esupportail.helpdesk.services.feed.imap.DelegatingSpamFilterImpl"
lazy-init="true" >
<property name="filters" >
<list>
<ref bean="subjectStartsWithSpamFilter" />
<ref bean="mySpamFilter" />
</list>
</bean>
|
Tell the application that the filter bean is delegatingSpamFilter in the configuration file /properties/config.properties:
| Bloc de code |
|---|
#feed.imap.spamFilterBean=delegatingSpamFilter
|
| Astuce |
|---|
Remember to allow the automatic recovering of the configuration file /properties/feed/feed.xml when upgrading (see Recovering previous configuration and customizations when upgrading). |
Adding a new filter
Write a new class implementing the interface org.esupportail.helpdesk.services.feed.imap.SpamFilter and declare a bean of this class in /properties/domain/feed.xml.
| Astuce |
|---|
Remember to allow the automatic recovering of the new class and the configuration file /properties/feed/feed.xml when upgrading (see Recovering previous configuration and customizations when upgrading). |
Reading several IMAP accounts
In order to read several IMAP accounts, that may feed different categories, deployers must declare in the configuration file Pour lire plusieurs comptes IMAP, qui peuvent par exemple être dirigés dans des catégories différentes, il faudra déclarer dans le fichier /properties/domain/feed.xml autant de beans correspondants semblables au bean accountReader, et les insérer dans l'attribut mailReaders du as many as necessary beans looking like the bean accountReader, and add them to the attribute mailReaders of the bean feeder.
Pour des comptes IMAP situés sur le meêm serveur, on trouvera par exemple For IMAP accounts on the same server, one may use:
| Bloc de code |
|---|
<bean id="feeder" class="org.esupportail.helpdesk.services.imapFeedingfeed.FeederImpl" lazy-init="true" > <property name="mailReaders" > <list> <ref bean="accountReader1" /> <ref bean="accountReader2" /> </list> </property> </bean> <bean id="abstractAccountReader" abstract="true" > <property name="server" value="${feed.imap.server}" /> <property name="folder" value="${feed.imap.folder}" /> <property name="messageReader" ref="messageReader" /> <property name="domainService" ref="domainService" /> </bean> <bean id="accountReader1" class="org.esupportail.helpdesk.services.feed.imapFeedingimap.ImapAccountReaderImpl" lazy-init="true" > <property name="address" value="${feed.imap.address1}" /> <property name="account" value="${feed.imap.account1}" /> <property name="password" value="${feed.imap.password1}" /> <property name="categoryId" value="${feed.imap.categoryId1}" /> </bean> <bean id="accountReader2" class="org.esupportail.helpdesk.services.feed.imapFeedingimap.ImapAccountReaderImpl" lazy-init="true" > <property name="address" value="${feed.imap.address2}" /> <property name="account" value="${feed.imap.account2}" /> <property name="password" value="${feed.imap.password2}" /> <property name="categoryId" value="${feed.imap.categoryId2}" /> </bean> <bean id="messageReader" class="org.esupportail.helpdesk.services.feed.imapFeedingimap.MessageReaderImpl" lazy-init="true" > <property name="domainService" ref="domainService" /> <property name="i18nService" ref="i18nService" /> </bean> |
Les propriétés d'accès aux comptes pourront ainsi être gérées dans le fichier This way, the credentials can be set in the configuration file /properties/config.properties:
| Bloc de code |
|---|
feed.imap.server=imap.domain.edu feed.imap.address1=support1@domain.edu feed.imap.account1=support1 feed.imap.password1=secret1 feed.imap.categoryId1=45 feed.imap.address1=support2@domain.edu feed.imap.account1=support2 feed.imap.password1=secret2 feed.imap.categoryId1=63 |
Autres modes d'alimentation
| Astuce |
|---|
Remember to allow the automatic recovering of the configuration file /properties/feed/feed.xml when upgrading (see Recovering previous configuration and customizations when upgrading). |
Other feed modes
IMAP account readers provided by default are of class Les lecteurs de boites à lettres IMAP fournis par défaut sont de la classe org.esupportail.helpdesk.services.feed.imap.ImapAccountReaderImpl.
L'ajout d'un autre mode d'alimentation se fait de la manière suivante :
The steps to add new feed modes are:
- write a new class implementing the développer une classe implémentant l' interface org.esupportail.helpdesk.services.feed.AccountReader
- déclarer un bean de cette classe dans le fichier declare a bean of this class in the configuration file /properties/domain/feed.xmlpermettre la récupération de la nouvelle classe et du fichier
- Allow the automatic recovering of the new class and the configuration file /properties/domainfeed/feed.xml lors de la prochaine mise à jour (cf Conservation des personnalisations lors des mises à jour). when upgrading (see Recovering previous configuration and customizations when upgrading).
See also: Using the web serviceVoir également : Web services