Inbound Email

From Sit
Jump to: navigation, search

The first stable release of Inbound Email is v3.50, this feature is considered experimental for all versions prior to v3.50,

Contents

Configuring Inbound email

SiT is perfectly usable without automatic inclusion of inbound email into the database, but for many, this is an essential feature.

To configure inbound email there are two methods, either using a POP/IMAP mailbox and scheduling mail to be collected (PULL) or by piping mail from an MTA directly into SiT (PUSH).

Prerequisites

Pull method

The preferred inbound email configuration is the Pull method in which the SiT! scheduler action 'CheckIncomingMail' downloads email from a POP or IMAP mailbox. For this method you will need to configure Regular Scheduled Tasks before any mail will be collected.

To configure inbound email via the pull method, follow these steps:

  1. Navigate to SiT! | Control Panel | Configuration and to Email | Inbound
  2. Set Enable incoming mail to SiT to 'POP/IMAP'
  3. Set Incoming email server to be the hostname or IP address of your POP/IMAP mail server
  4. Set Incoming email account server type to be either POP or IMAP depending on your mailbox type
  5. Set Incoming email account username to your mailbox username
  6. Set Incoming email account password to your mailbox password
  7. Set Incoming email account address to the email address of your mailbox

Archive folder

By default SiT will delete mail from the mailbox on the server after it has download it, but you can configure an archive folder instead and SiT will move the mail to this folder instead of deleting it.

  1. Create a folder in your mailbox using your regular mail client software. e.g. archive
  2. Navigate to SiT! | Control Panel | Configuration and to Email | Inbound
  3. Set IMAP Archive folder to the name of your folder e.g. archive

Note: some IMAP servers may require you to specify the archive folder name in the format INBOX.archive or INBOX/archive.

Advanced configuration

Some mail servers will require additional configuration depending on your server and connection type.

  1. Navigate to SiT! | Control Panel | Configuration and to Email | Inbound
  2. Set Incoming email connection options to one or more connection options (See table below)
Option Description
/ssl use the Secure Socket Layer to encrypt the session
/novalidate-cert do not validate certificates from TLS/SSL server, required if server uses self-signed certificates, even if you are not using TLS/SSL
/secure do not transmit a plaintext password over the network

For example:

  • An SSL secured connection with a self-signed certificate would require /ssl/novalidate-cert
  • Gmail always uses a secured connection so needs /ssl
  • If you are using Exchange, be sure to use /novalidate-cert even if you use IMAP/POP used with basic authentication (plain text).

See the full list of optional flags at http://www.php.net/imap_open for more examples. Don't put a space between the options.

Using a non-standard port

SiT will use the default port for IMAP and POP plaintext and secure connections

  • 110 for POP
  • 143 for IMAP
  • 995 for secure POP
  • 993 for secure IMAP

If your server uses a different port you can configure it

  1. Navigate to SiT! | Control Panel | Configuration and to Email | Inbound
  2. Set Incoming email account port according to your mailbox type and connection preferences

Downloading from a folder other than inbox

  1. Navigate to SiT! | Control Panel | Configuration and to Email | Inbound
  2. Set IMAP incoming folder to the folder you would like to collect mail from

Note: some IMAP servers may require you to specify the archive folder name in the format INBOX.alternate or INBOX/alternate.

Push method

The Push method requires configuring your MTA (mail transfer agent) software to pipe emails through the inboundemail.php script included with SiT. This is usually much harder to set up than the Pull method described above.

  1. Navigate to SiT! | Control Panel | Configuration and to Email | Inbound
  2. Set Enable incoming mail to SiT to 'MTA'
  3. Configure your MTA to pipe emails through the inboundemail.php script

Note: inboundemail.php does not include the interpreter directive (#!) this is to allow the file to be called from the scheduler as well so the pipe command should be "php inboundemail.php" or you can add #!/usr/bin/php to the beginning of the file if you prefer.

Some helpful information regarding configuring your MTA to pipe emails to a PHP script is available here http://evolt.org/incoming_mail_and_php

Other Settings

  • Maximum number of incoming emails - The maximum number of incoming emails per incident, per day to allow before a mail-loop is detected
  • Spam Subject - A string to look for in email message subject to determine a message is spam e.g. SPAMASSASSIN

Troubleshooting

If inbound email isn't working it can sometimes be difficult to see why. Here are some tips:

  • Enable Debug mode and error logging
  • Check that Scheduler is running, you can do this by going to by going to SiT! -> Control Panel -> Scheduler and checking that the action CheckIncomingMail has run recently and is coloured blue. Red would indicate an error and Grey would indicate it is disabled.
  • After waiting a few minutes to give the scheduler (auto.php) time to run at least once, check the contents of your error logfile.
    • The log file should show attempts to connect to your mail server along with any errors that might explain why it couldn't collect mail
    • If you see a message similar to 'Certificate failure' you need to add /novalidate-cert to your Incoming email connection options
  • Keeping checking your Holding Queue to see whether emails appear
  • If you have inbound email formatting issues and use a mailserver, be sure to set the MIME type of the mailbox to text. For use with Exchange 2007 and email formatting issues, see this forum thread.

See Also

Personal tools
project