7.2. Receiving emails

From open-support.info

(Difference between revisions)
Jump to: navigation, search
m (Via command line program and procmail (otrs.PostMaster.pl))
m (Via command line program and procmail (otrs.PostMaster.pl))
Line 73: Line 73:
All email sent to the local OTRS user will be piped into bin/otrs.PostMaster.pl and then shown in your QueueView.
All email sent to the local OTRS user will be piped into bin/otrs.PostMaster.pl and then shown in your QueueView.
-
<br />
+
<br /><br />
== Fetching emails via POP3 or IMAP and fetchmail for otrs.PostMaster.pl ==
== Fetching emails via POP3 or IMAP and fetchmail for otrs.PostMaster.pl ==
== Filtering/dispatching by OTRS/PostMaster modules (for more complex dispatching) ==</onlyinclude>
== Filtering/dispatching by OTRS/PostMaster modules (for more complex dispatching) ==</onlyinclude>

Revision as of 20:12, 22 April 2011

Contents

Mail accounts configured via the OTRS GUI

OTRS is able to receive emails from POP3, POP3S, IMAP, and IMAPS mail accounts.

Configure your mail accounts via the PostMaster Mail Accounts link on the Admin page.

If a new mail account is to be created (see Figure 7.1 below), then it's mail server name, login name and password must be specified. Also, you need to select the mail server type, which can be POP3, POP3S, IMAP or IMAPS. If you don't see your server type available as an option, the required Perl modules are missing on your system. In that case, please refer to "Installation of Perl modules required for OTRS" for instructions.


Figure 7.1. Adding a mail account.


If you select Yes for the value of the Trusted option, any X-OTRS headers attached to an incoming message are evaluated and executed. Because the X-OTRS header can execute some actions in the ticket system, you should set the Trusted option to Yes only for known senders. X-OTRS-Headers are used by the filter module in OTRS. The X-OTRS headers are explained in this table in more detail. Any postmaster filter rules created are executed, irrespective of the Trusted option's setting.

The distribution of incoming messages can be controlled if they need to be sorted by queue or by the content of the "To:" field. For the Dispatching field, if "Dispatching by selected queue" is selected, all incoming messages will be sorted into the specified queue. The address where the mail was sent to is disregarded in this case. If "Dispatching by email To: field" is selected, the system checks if a queue is linked with the address in the To: field of the incoming mail. You can link an address to a queue in the E-mail address management section of the Admin page. If the address in the To: field is linked with a queue, the new message will be sorted into the linked queue. If no link is found between the address in the To: field and any queue, then the message flows into the "Raw" queue in the system, which is the PostmasterDefaultQueue after a default installation.

All data for the mail accounts are saved in the OTRS database. The otrs.PostMasterMailbox.pl script, which is located in the bin directory of your OTRS installation, uses the settings in the database and fetches the mail. You can execute ./bin/otrs.PostMasterMailbox.pl manually to check if all your mail settings are working properly.

On a normal installation, the mail will be fetched every 10 minutes by the postmaster_mailbox cron job. For further information about modifying cron jobs, please refer to the "Setting up the cron jobs for OTRS" section.



Via command line program and procmail (otrs.PostMaster.pl)

If you cannot use mail accounts to get the email into OTRS, the command line program bin/otrs.PostMaster.pl might be a way around the problem. It takes the mails via STDIN and pipes them directly into OTRS. That means email will be available in your OTRS system if the MDA (mail delivery agent, e.g. procmail) executes this program.

To test bin/otrs.PostMaster.pl without an MDA, execute the command of the Script 7.1.

linux:/opt/otrs# cd bin
linux:/opt/otrs/bin# cat ../doc/sample_mails/test-email-1.box | ./otrs.PostMaster.pl
linux:/opt/otrs/bin#
Script 7.1. Testing PostMaster without the MDA.


If the email is shown in the QueueView, then your setup is working. Procmail is a very common e-mail filter in Linux environments. It is installed on most systems. If not, have a look at the procmail homepage.

To configure procmail for OTRS (based upon a procmail configured MTA such as sendmail, postfix, exim or qmail), use the ~otrs/.procmailrc.dist file and copy it to .procmailrc and add the lines of the Script 7.2.

SYS_HOME=$HOME
PATH=/bin:/usr/bin:/usr/local/bin
# --
# Pipe all email into the PostMaster process.
# --
:0 :
| $SYS_HOME/bin/otrs.PostMaster.pl
Script 7.2. Configuring procmail for OTRS.


All email sent to the local OTRS user will be piped into bin/otrs.PostMaster.pl and then shown in your QueueView.

Fetching emails via POP3 or IMAP and fetchmail for otrs.PostMaster.pl

Filtering/dispatching by OTRS/PostMaster modules (for more complex dispatching)

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox