The Mail In Tool allows receiving mail messages from the outside source and
passing them into Zope and ERP5 Site.
Table of Contents
To make the Tool work you need to add it to ERP5 Site. It's included among other
tools. After adding it, in the Configure tab of the Tool you need to specify
the name of the script which will process the received mail messages. You can
click the 'Setup the Skins for Mail_In Tool' button, but then you have to create
the 'mailin' skin folder manually. Alternatively you might NOT click that button
and put the processing script in any custom skin folder as long as it's included
in the Skin Layers. The script that will be created has to have one parameter eg.
'Mail' which will be passed to it by the Tool and it will contain the dictionary
with all the email content.
For testing purposes it's possible to pipe the mail messages (saved as files)
to Zope 'by hand'. The postMailToERP5 script handles the delivery of the mail
message to ERP5. It's located in $INSTANCE_HOME/Products/ERP5/bin directory.
We can send the mail by manually calling the postMailToERP5 script with
appropriate address. For example like that:
cat mail_message.eml | python postMailToERP5 http://zope:zope@localhost:9080/erp5/portal_mailin
As mentioned above 'Mail' parameter is a dictionary. It contains following keys:
The body and headers are all recoded to 'utf-8' so should be readable and ready-to-use.
Create an alias in /etc/postfix/aliases (or in /etc/aliases, depends on the
postfix configuration) an alias which would look like this:
or even better like this:
where above script 'sendMailToLocalProject.py' calls the sendMailToERP5.py
script passing login and password. Since password has to be given here in
plain, in above way it won't get displayed/logged in case of any error.
Then run command:
(restarting postfix is not enough, and actually not needed).