Skip to content
mattpep edited this page Sep 17, 2012 · 8 revisions

Email Dropbox feature

This feature enables attaching emails as asset notes by forwarding or copying emails to dropbox address.

Use cases

  • Write an email to an account, contact or lead, Bcc to the dropbox imap account, and this email will be attached to detected accounts/contacts/leads in the system.
  • Forward an existing contact/lead/account email to dropbox, this will be attached to the detected account/contact/lead in the system (the firsts email address in the body of the email).
  • Entity: Forward or Write an email to the dropbox and in the first line of the body write:
    • Opportunity Name of the opportunity
      • or
    • Campaign Name of the campaign
    • The email will be attached to the Campaign/Opportunity with that name

What happens if the recipients of a BCC mail or first email of a forwarded email are not yet in ffc?

  • A new contact will be created, following the next convention:
    • Create new contact with the email address
    • Search for an account with the domain name of the email, ex: contact => Search account with email ‘’
      • If found, assign the contact to that account
      • Else, create a new account with that domain name

What happens if the entity (Campaign/Opportunity) is not found in ffc?

  • A new Campaign/Opportunity will be created and the mail attached


  • Only plain text emails will be processed, html or multipart will be discarded
  • Only valid users emails will be considered to parse emails (email addresses of valid ffc users)
  • Only will be permitted to attach emails to items that the user has permissions


  • When a valid email is processed by the dropbox, an ack email will be returned to the user with information about the actions taken.


You should copy the email_dropbox configuration settings from config/settings.default.yml to config/settings.yml and fill them in, including the imap account credentials, and the folder to scan/move settings and your hostname for the notifications. Subfolders in imap may be accessed as inbox.folder (ex inbox.processed) in config/settings.yml.

Once you’ve configured the email dropbox, test the connection/folder configuration with:

$ rake ffcrm:dropbox:setup

If the test passed, you are ready! automate the email crawler (dropbox) task:

  • Manual execution
    • $ rake ffcrm:dropbox:run
  • You can setup a cron job
    • */5 * * * * /path/to/script/ > /dev/null 2&>1
      • /path/to/script/
      • cd /path/to/ffc; rake RAILS_ENV=production ffcrm:dropbox:run
      • */5 * * * * bash -c 'cd /path/to/ffc; /pathtorake/rake ffcrm:dropbox:run RAILS_ENV=production' >/dev/null 2&>1

(Remember to check that permissions for appfolder match cronuser)