One of the main functionalitys in Request tracker is to send and recive emails. To be able to do this two systems are used, the first is postfix. Postfix is a self contained mailserver that will take care of the sending of emails. Fetchmail is a utility that will collect the emails from your external mail server and pipe them into RT’s mailgateway which will intern either create or update a ticket.

The first step is to install postfix.

apt-get install postfix

During the setup you will be asked a few questions. to the first question you will want to answer “Internet Site”

Next you will need to enter the FQDN of your RT server

That is all the configutation we are going to do with postfix at the moment

Make sure you update the SPF records for your domain name to ensure mail is sucessfuly delivered. Also your server must has the correct reverse DNS setup

Next we will install Fetchmail

apt-get install fetchmail

Now we need to create a file for fetchmails configuration

nano /etc/fetchmailrc

Fianlly we will enter the infomation of where we want to pull the emails from.

Tip: If you have multiple queues and want to use diffrent emails you can just duplicate the last line of this file as many times as you like! Just don’t forget to edit the queue name
set invisibleset
no bouncemailset
no syslog
set logfile /var/log/fetchmail.log
poll mail.samtechblog.co.uk protocol pop3 username "support" password "password" mda "/opt/rt4/bin/rt-mailgate--queue general --action correspond --url http://localhost/" no keep

Next we will create the log file and change the ownership to the fetchmail service

touch /var/log/fetchmail.log
chown fetchmail /var/log/fetchmail.log

That’s is it fetchmail will now be able to pull emails from your mail server, remeber if you are using office 365 or GSuite you will need to enable pop3 for the account you wish to pull the emails from