Difference between revisions of "Managing Emails"

From Opentaps Wiki
Jump to navigationJump to search
(Processing Inbound Emails)
(Processing Inbound Emails)
Line 8: Line 8:
  
 
opentaps can listen on one email address of your server.  To set this up, edit framework/base/config/ofbiz-containers.xml and set “mail.host”, “mail.user”, “mail.pass” for “javamail-container” to your server.  Both IMAP and POP3 are supported for “mail.store.protocol”.  If you set “delete-mail” to true, then the messages will be deleted after they are retrieved, even if they do not match any of the MCA conditions.  If you set “delete-mail” to false, then messages will be marked “seen.” If you have an IMAP server, then they won’t be downloaded the next time.  If you have a POP3 server, however, “seen” is not supported, so if the messages are not deleted, they will be downloaded over and over again.  Finally, the "maxSize" property is used to control the largest size of emails received.  You should set it to a larger value than the default of 100000 (100 KB).
 
opentaps can listen on one email address of your server.  To set this up, edit framework/base/config/ofbiz-containers.xml and set “mail.host”, “mail.user”, “mail.pass” for “javamail-container” to your server.  Both IMAP and POP3 are supported for “mail.store.protocol”.  If you set “delete-mail” to true, then the messages will be deleted after they are retrieved, even if they do not match any of the MCA conditions.  If you set “delete-mail” to false, then messages will be marked “seen.” If you have an IMAP server, then they won’t be downloaded the next time.  If you have a POP3 server, however, “seen” is not supported, so if the messages are not deleted, they will be downloaded over and over again.  Finally, the "maxSize" property is used to control the largest size of emails received.  You should set it to a larger value than the default of 100000 (100 KB).
 +
 +
Once you have set up your listener, you need to set up a processing service for your incoming emails.  This can be set up by configuring an MCA or Mail-Condition-Action in any of your applications.  By default, the opentaps CRMSFA application has MCA configured to process both incoming emails and outgoing emails which are being BCC'd to a mailbox for opentaps to archive.  An MCA can be configured by adding the following to your ofbiz-component.xml:
 +
    <service-resource type="mca" loader="main" location="servicedef/smcas.xml"/>
 +
 +
The smcas.xml file should have a definition of how to process the incoming email, such as the following from CRMSFA:
 +
<pre>
 +
</pre>
 +
 +
Note that regular expressions can be used to identify which emails should be processed by which MCA.  The MCA invokes a service which must implement the mailProcessInterface to process emails.  The service will be given a [http://www.opentaps.org/javadocs/version-1.0/framework/api/org/ofbiz/service/mail/MimeMessageWrapper.html MimeMessageWrapper] to process emails with.  For more information about the default email processing in opentaps, see [[Handling Emails]].
  
 
==Setting up Event Notifications==
 
==Setting up Event Notifications==

Revision as of 01:18, 16 November 2007

Setting up Outbound Emails

To send outgoing emails from the system, turn on your mail server by editing framework/common/config/general.properties and setting mail.notifications.enabled=Y. You can also configure a special SMTP host, user, and password here.

Processing Inbound Emails

opentaps can listen on one email address of your server. To set this up, edit framework/base/config/ofbiz-containers.xml and set “mail.host”, “mail.user”, “mail.pass” for “javamail-container” to your server. Both IMAP and POP3 are supported for “mail.store.protocol”. If you set “delete-mail” to true, then the messages will be deleted after they are retrieved, even if they do not match any of the MCA conditions. If you set “delete-mail” to false, then messages will be marked “seen.” If you have an IMAP server, then they won’t be downloaded the next time. If you have a POP3 server, however, “seen” is not supported, so if the messages are not deleted, they will be downloaded over and over again. Finally, the "maxSize" property is used to control the largest size of emails received. You should set it to a larger value than the default of 100000 (100 KB).

Once you have set up your listener, you need to set up a processing service for your incoming emails. This can be set up by configuring an MCA or Mail-Condition-Action in any of your applications. By default, the opentaps CRMSFA application has MCA configured to process both incoming emails and outgoing emails which are being BCC'd to a mailbox for opentaps to archive. An MCA can be configured by adding the following to your ofbiz-component.xml:

   <service-resource type="mca" loader="main" location="servicedef/smcas.xml"/>

The smcas.xml file should have a definition of how to process the incoming email, such as the following from CRMSFA:


Note that regular expressions can be used to identify which emails should be processed by which MCA. The MCA invokes a service which must implement the mailProcessInterface to process emails. The service will be given a MimeMessageWrapper to process emails with. For more information about the default email processing in opentaps, see Handling Emails.

Setting up Event Notifications