Chapter 5. First Ticket

How can somebody write e-mails to the OpenTRS?

The default installation will accept e-mails to the local user otrs (e-mail address ). This is good to start a little playing. Use your favourite e-mail client and send an e-mail to this address (of course you have to be on this system). Or you can have a look in the admin section of OpenTRS to add different e-mail addresses like . But please take care that these e-mails will be delivered to the local otrs account (to the ~otrs/.procmailrc)! In case you are not familiar with the configuration of your sendmail or postfix have a look in the man-pages or send an e-mail to the mailinglist .

Ok, ok, ... we show you two simple examples.

Config of fetchmail

In order to get e-mails from your mail server via a pop3 mailbox to the OpenTRS machine/local otrs account use fetchmail. Note: a working SMTP configuration on the OpenTRS machine is condition.

Example 5-1. .fetchmailrc

#poll (mailserver) protocol POP3 user (user) password (password) is (localuser)
poll mail.example.com protocol POP3 user joe password mama is otrs

Don't forget to set the .fetchmailrc to 710 ("chmod 710 .fetchmailrc")!

So if "fetchmail -a" is executed (maybe via cron), all e-mails will be forwarded to the local otrs account.

Config of sendmail in SuSE Linux

If the machine (where OpenTRS is running) is you mail server, you can work directly with the virtusertable or aliases.

Lets presume you have a plain SuSE Linux installation with sendmail as a default Mail Transfer Agent and you want to set up a OpenTRS e-mail account for the e-mail address . All you have to do is to add a line to your /etc/mail/virtusertable file.

Example 5-2. /etc/mail/virtusertable

# /etc/mail/virtusertable
#
# Description:
#
#  A domain-specific form of aliasing, allowing multiple virtual
#  domains to be hosted on one machine.
#
# Examples:
#
#info@foo.com            foo-info
#info@bar.com            bar-info
#joe@bar.com             error:nouser No such user here
#jax@bar.com             error:D.S.N:unavailable Address invalid
#@baz.org                jane@example.net
#

# deliver this e-mails to the local user otrs!
info@example.com         otrs
support@example.com      otrs

That's it (we actually added a second e-mail address with the name ! You have to run SuSEconfig.

skywalker:~ # SuSEconfig
Starting SuSEconfig, the SuSE Configuration Tool...
Running in quick mode.
Reading /etc/rc.config and updating the system...
Executing /sbin/conf.d/SuSEconfig.aaa_at_first...
Executing /sbin/conf.d/SuSEconfig.hostname...
Executing /sbin/conf.d/SuSEconfig.inittab...
Executing /sbin/conf.d/SuSEconfig.pam...
Executing /sbin/conf.d/SuSEconfig.sendmail...
Rebuilding /etc/mail/virtusertable.db.
Executing /sbin/conf.d/SuSEconfig.ypclient...
Finished.

Reload sendmail (just to be sure).

skywalker:~ # rcsendmail reload
Reload service sendmail                                done

Now all incoming e-mail to info@example.com will be delivered to the local user otrs.

Every e-mail message to the user otrs will be handled by the procmail-rule of otrs which pipes the e-mail to the system. You will find the e-mail in the RAW queue.