Inbound Email
From Sit
| SiT! Manual | Configuration → Inbound Email | Appendix A2 |
This feature is considered experimental for all versions prior to v3.50, The first stable release of Inbound Email is v3.50
Contents |
[edit] 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).
[edit] Prerequisites
[edit] Pull method
The preferred inbound email configuration is the Pull method which the SiT! scheduler action 'CheckIncomingMail' to download email from a POP or IMAP mailbox, so you will need to configure Regular Scheduled Tasks before mail will be collected.
To configure inbound email via the pull method, follow these steps:
- Navigate to SiT! | Control Panel | Configuration and to Email | Inbound
- Set Enable incoming mail to SiT to 'POP/IMAP'
- Set Incoming email server to be the hostname or IP address of your POP/IMAP mail server
- Set Incoming email account server type to be either POP or IMAP depending on your mailbox type
- Set Incoming email account username to your mailbox username
- Set Incoming email account password to your mailbox password
- Set Incoming email account address to the email address of your mailbox
[edit] 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.
- Create a folder in your mailbox using your regular mail client software. e.g.
archive - Navigate to SiT! | Control Panel | Configuration and to Email | Inbound
- 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.
[edit] Advanced configuration
Some mail servers will require additional configuration depending on your server and connection type.
- Navigate to SiT! | Control Panel | Configuration and to Email | Inbound
- 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, needed if server uses self-signed certificates |
/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
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.
[edit] 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
- Navigate to SiT! | Control Panel | Configuration and to Email | Inbound
- Set Incoming email account port according to your mailbox type and connection preferences
[edit] Downloading from a folder other than inbox
- Navigate to SiT! | Control Panel | Configuration and to Email | Inbound
- 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.
[edit] 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.
- Navigate to SiT! | Control Panel | Configuration and to Email | Inbound
- Set Enable incoming mail to SiT to 'MTA'
- Configure your MTA to pipe emails through the
inboundemail.phpscript
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
[edit] 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
[edit] 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.
- If the scheduler actions aren't being run, make sure you have configured the crontab or Windows scheduler correctly.
- 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-certto your Incoming email connection options
- Keeping checking your Holding Queue to see whether emails appear

