Email Archiving

Starting with the Zurmo 0.6.80 release, the email archiving feature has been integrated in the system. The aim of this tutorial is to give you enough information so you can start to use or hack email archiving.

The idea behind this feature is to allow users to archive emails into Zurmo CRM. This can be done by sending emails to the Zurmo Dropbox email account. The Zurmo Dropbox email account is same for all users of the system. The system links the email to a user (as well as contact/lead/account) by parsing the email address that was sent to the Zurmo Dropbox. If there is no email match in the system, the email will be returned to the user, with a message explaining the issue.

We can consider two cases here:
1. When a user sends an email to another user, and wants to archive it, you just need to add the Zurmo Dropbox email address to the BCC field.
2. When a user wants to archive an email from another user into Zurmo, you need to forward the email to the Zurmo Dropbox.

Cronjob must be set up to pull new emails from the Zurmo Dropbox IMAP server. During every run, Zurmo will try to match the email to existing contacts, leads, accounts and users. In case #1, this will be done by parsing the To and CC fields from the email message. In case #2, this will be done by parsing the text that is prepended to the email message, when you hit the forward button in your email client.

Zurmo Email Archiving settings can be set up via the admin area (Settings->Email Configurations->Email Archiving Configuration):

You must have access to the system settings in order to configure this system-wide setting. Once you enter your IMAP settings, click the Test button to ensure they are correct and working. If so, hit “Save” to store the settings.

We paid a good amount of attention to the unit tests for the email archiving feature, in order to ensure that the server is able to send emails and retrieve them from the IMAP server. Therefore, after you run your unit test for the first time, the perInstanceTest.php file will be created, and you will need to create three email accounts on your email server for test purposes. Here is example how these settings should look like:

    $emailTestAccounts = array(
        'smtpSettings' => array(
            'outboundHost' => 'mail.example.com',
            'outboundPort' => '25',
            'outboundUsername' => 'dropbox@example.com',
            'outboundPassword' => 'yourPassword',
            'outboundSecurity' => false,
        ),
        'dropboxImapSettings' => array(
            'imapHost' => 'mail.example.com',
            'imapUsername' => 'dropbox@example.com',
            'imapPassword' => 'yourPassword',
            'imapPort' => '143',
            'imapSSL' => '',
            'imapFolder' => 'INBOX',
        ),
        'userImapSettings' => array(
            'imapHost' => 'mail.example.com',
            'imapUsername' => 'steve@example.com',
            'imapPassword' => 'yourPassword',
            'imapPort' => '143',
            'imapSSL' => '',
             'imapFolder' => 'INBOX',
        ),
        'userSmtpSettings' => array(
            'outboundHost' => 'mail.example.com',
            'outboundPort' => '25',
            'outboundUsername' => 'steve@example.com',
            'outboundPassword' => 'yourPassword',
            'outboundSecurity' => false
        ),
        'testEmailAddress' => 'john@example.com',
    );

If you want to run tests with Gmail account, your settings need to look like(please note that you will need 4 Gmail accounts):

    $emailTestAccounts = array(
        'smtpSettings' => array(
            'outboundHost' => 'smtp.gmail.com',
            'outboundPort' => '465',
            'outboundUsername' => 'TEST_EMAIL_1@gmail.com',
            'outboundPassword' => '********',
            'outboundSecurity' => 'ssl',
        ),
        'dropboxImapSettings' => array(
            'imapHost' => 'imap.gmail.com',
            'imapUsername' => 'TEST_EMAIL_2@gmail.com',
            'imapPassword' => '********',
            'imapPort' => '993',
            'imapSSL' => true,
            'imapFolder' => 'INBOX',
        ),
        'userImapSettings' => array(
            'imapHost' => 'imap.gmail.com',
            'imapUsername' => 'TEST_EMAIL_3@gmail.com',
            'imapPassword' => '********',
            'imapPort' => '993',
            'imapSSL' => true,
            'imapFolder' => 'INBOX',
        ),
        'userSmtpSettings' => array(
            'outboundHost' => 'smtp.gmail.com',
            'outboundPort' => '465',
            'outboundUsername' => 'TEST_EMAIL_3@gmail.com',
            'outboundPassword' => '********',
            'outboundSecurity' => 'ssl',
        ),
        'testEmailAddress' => 'TEST_EMAIL_4@gmail.com',
    );

Leave a Comment

  • Tiur

    I think you need to inform the setting sample for Gmail based email. I believe many of us use GMAIL, and the setting for SMTP and IMAP for GMAIL based email would be slight different.

    • Ivica Nedeljkovic

      I added email sample settings for email unit tests using Gmail accounts. Thanks for suggestion.

  • David Saldana

    I have setup the SMTP email server information and if I do a test from the setup screen it works and send emails but if I sign off as supper user then sign in as a regular user and try to send an email to any of the contacts then it does not work. any ideas? there is not errors at the screen and it gets register on Zurmo dashboard as if it went out.
    Thanks
    David

    • http://www.facebook.com/people/Ray-Stoeckicht/100001473956853 Ray Stoeckicht

      Have you checked the Forums on email archiving? Might be able to find a post about the same issue: http://zurmo.org/?s=email+archiving

      Also, we have Developer Sessions every Tuesday at 10:00AM Chicago Time (http://zurmo.org/forums/index.php?/calendar/). You can always join an upcoming
      session and ask any questions to our technical team.

  • Jose Javier

    is Email Archiving available to open source version? and also i can’t seem to find the (Settings->Email Configurations->Email Archiving Configuration) inside “super” account.

    • Jose Javier

      sorry i just figured out i dont belong to the super user role. thanks.

      • Ray Stoeckicht

        Yes, email archiving is available in the open source version. It requires you to configure all the settings. Glad you were able to see it when logged in as ‘super’ user

  • Jose Javier

    hi Ray thanks for the quick reply. im having a hard time making the imap gmail work. i tested by clicking the test connection and iworks fine. but when i tried adding in cron. i get a message in the job manager for inbound email process stuck. any way to fix it?

    • Jose Javier

      uh oh, zurmo just mass email my clients with Subject : “Invalid email address” body: “Email address does not exist in system” . i killed the process in the server. i think Email Archiving is not solid yet or lacks documentation.

      • Ray Stoeckicht

        Looks like there was something mis-configured or someone did not archive properly (possibly the user cc’d instead of bcc’ing the email archival address and when the recipient replied all, it triggered the mass email “invalid email address”). We provide support for email archival in our commercial versions: http://www.zurmo.com/pricing. We have not seen any issues like this.

  • Dmitry

    hello. zurmo is great. but i have a problem with my Inbox. i’ve configured IMAP in settings and it tested ok. but my Inbox is empty. What should i do? and SMTP doesnt work for me, but when i send from raw telnet it is alright. thanks

    • Ray Stoeckicht

      Is the cron running? Are you using a local installation or one of our trials?

      • Dmitry

        I’m using current stable build from site on my dedicated server. i have a few sites, which work fine with email (wordpress for example), also my mail() works fine too.
        thanks

  • Juan Carlos Bauza Ogazón

    Hi,
    I am having issues as the email I sent get input into the system as a bunch of random letters. The contacts and subject line are perfectly readable but the body of the email is just a bunch of letters as if the email was encrypted or something. Accesing the email on gmail shows all of them perfectly readable so I am not sure what is going on. Not sure if it has something to do with the codeset or what. Any help would be greatly appreciated it. Thanks!

  • CaptSaltyJack

    Why are no details on the cron job given in this article? What kind of cron job? What does the script look like?

  • Pasquale Ciccio Ciccio Carfora

    Good evening, I have a problem, I can not set up a personalized email for an user. example: I had an appointment and half an hour before I get an email from zurmo preset. I managed to set up a standard email but I would like zurmo standard instead of the email to send me an email with the details of the appointment (exp. who to call and the phone number)

  • http://www.roamler.com Wiggert de Haan

    Does anyone know how set the rights for “Who can read and write” to everybody? while importing the emails. Standard it is set to Owner

  • http://leanitsupport.com Val Lusis

    “In case #2, this will be done by parsing the text that is prepended to
    the email message, when you hit the forward button in your email client.”

    The case #2 is failing in Outlook 2013 connected to Exchange. Names are just that, names, no email address, and cronjob finishes with error.

    • http://www.cerberon.co.uk Stuart Ford

      Has there been a fix for this?