MailCapture est un module de MaarchCapture permettant de récupérer les courriels d'un dossier de votre boite mail via le protocole IMAP.
Depuis le fichier de paramétrage général : ./config/Capture.xml.
<step function="CaptureMails" module="MailCapture" name="CAPTURE_MAIL_1">
<input name="account">account_1</input>
<input name="Action">none</input>
<input name="configFile">MailCapture_standard_sample.xml</input>
<input name="folder">maarch/purge</input>
<input name="attachmentsOutputDir"></input>
<input name="addHeaderInMailContent">false</input>
<input name="folderError">incidents</input>
</step>
La déclaration du module comporte les attributs suivants :
Depuis le fichier de paramétrage de la boite mail à capturer : ./modules/MailCapture/MailCapture_standard_sample.xml.
<?xml version="1.0" encoding="UTF-8"?>
<MailCapture>
<formatters>
<formatter name="date" script="scripts/formatters.php" func="format_mail_date"/>
</formatters>
<accounts>
<account name="account_1" >
<mailbox>{imap.gmail.com:993/imap/ssl/novalidate-cert}INBOX</mailbox>
<username>testmail@gmail.com</username>
<password>********</password>
</account>
</accounts>
<messagerules>
<messagerule name="from_maarch" info="fromaddress" action="delete">false</messagerule>
</messagerules>
<messageoutputs >
<messageoutput name="doc_date" info="date" formatter="date"/>
<messageoutput name="type_id">108</messageoutput>
<messageoutput name="destination">COU</messageoutput>
<messageoutput name="subject" info="subject" />
<messageoutput name="fromaddress" info="fromaddress"/>
<messageoutput name="frompersonal" info="from[0]/personal" />
<messageoutput name="toaddress" info="toaddress" />
<messageoutput name="xpriority" info="xpriority" />
<messageoutput name="message_id" info="message_id" />
<messageoutput name="ccaddress" info="ccaddress" />
</messageoutputs>
<attachmentrules>
<attachmentrule name="extFilter" info="extension" op="notin">pdf</attachmentrule>
<attachmentrule name="mimetypeFilter" info="mimetype" op="notin">application/pdf</attachmentrule>
</attachmentrules>
<attachmentoutputs mode="attachment">
<attachmentoutput name="filename" info="dparameters[filename]"/>
<attachmentoutput name="description" info="description"/>
</attachmentoutputs>
</MailCapture>
La déclaration de la boite mail à capturer comporte les attributs suivants :