This article explains how to configure Mailtraq to route incoming external mail to the right mailbox. This is the most frequently asked question of all, which is not surprising given the number of methods ISPs use.
Let’s start by looking at POP3 and SMTP as mail delivery protocols. As it travels towards you, mail is routed from machine to machine via SMTP. In most cases it gets as far as your ISP’s mail system, where it waits for you to dial up to make an Internet connection. Some ISPs will then send the mail to Mailtraq using SMTP, in which case Mailtraq will automatically route the mail into mailboxes matching the user part of the email address. However if the ISP keeps the mail in a POP3 mailbox for Mailtraq to collect it, it is a different story all together.
Before we configure Mailtraq to collect and route the mail, make sure you have added all the Users and Mailboxes that the mail will be routed to. You also need to check that your domain is listed in the Options | Server dialog so that Mailtraq knows what mail to accept as local.
Then we need to set up a “Remote POP3 Mailbox” entry in Mailtraq:
From the menu, click Options | Remote POP3.
Make sure the “Enable POP3” checkbox is ticked, and click Add to make a new entry.
Fill in the Account Details tab with the information from the ISP.
If you’re setting up a live system where there is a lot of mail waiting at the ISP for distribution, you may also want to check the “Leave mail on server” entry so mail isn’t lost whilst we configure the system.
Now view the Message Routing tab. What we put in this part of the dialog box depends entirely on your ISP’s setup, and may need a bit of experimentation to get right.
First for a known case, if the ISP is Demon Internet, select Enable Message Routing and click “Use *ENV extension to POP3”. Routing will then be performed as if the mail is being received via SMTP.
For all other ISPs we need to examine a sample email to see what they support. Set the dialog to “Send to listed recipient” and choose a mailbox, say “postmaster”.
Make sure there’s some mail to collect, if needs be by sending a message from a Hotmail™ account to firstname.lastname@example.org (where domain.com is your domain)
Remember you can’t send an internal mail to perform the test, as Mailtraq will catch it and route it to a mailbox without the message going via the ISP.
Now go online and select Actions | Collect POP3 mail.
Open the Remote POP3 Mailboxes dialog and view the properties of your account. At the foot of the Account Details tab it should say “Last collection:” and give a date. If it gives an error instead, correct your POP3 settings and try again.
Back in the Mailtraq console, select the Postmaster mailbox that we asked the mail to be routed to. You should find your test email here. Double click on the message to view it, as we need to examine the headers.
Your headers should look something like the example shown in the box.
Received: from pop3.isp.co.uk by enstar.net with POP3 (Mailtraq/184.108.40.2069)
id BB4479170FC; Sun, 03 Oct 1999 15:43:10 +0100
Received: from punt-2.mail.isp.net by mailstore for email@example.com
id 938901361:20:01050:2; Sat, 02 Oct 99 21:56:01 GMT
Received: from [220.127.116.11] ([18.104.22.168]) by punt-2.mail.isp.net
id aa2000956; 2 Oct 99 21:55 GMT
Subject: Test message
Date: Sat, 02 Oct 1999 21:44:10 GMT
X-Mailer: Forte Agent 1.5/32.451
Content-Type: text/plain; charset=us-ascii
In your headers, identify the “To” header, and look for any other headers which have the same destination email address. In my example, I’ve highlighted X-Envelope-To, but you may find X-Apparently-To, X-Originally-To, or something else. (It will normally start with an X)
If you find anything, note the name of the header, and go back to the Message Routing tab of our Remote POP3 Mailbox. Select “Enable Message Routing”, select “Use these header fields to identify recipients” and in the box remove any existing entries (To, CC etc) and type in the name of your header, exactly as shown in your email. You shouldn’t type the colon at the end. Your routing should now be set up.
If you didn’t find a matching header, look for a “for” clause giving your test email address in the Received headers. If we’re to rely on it being present in all incoming emails, it has to be in a Received header added by your ISP, not by someone earlier in the delivery chain, so it probably has to be in the top two or three Received headers, depending on their set up.
If you found a suitable “for” entry, go back to the Message Routing tab of our Remote POP3 Mailbox. Select “Enable Message Routing”, select “Extract recipient from received fields”. Your routing should now be set up.
No “for” clause either? It may be worth asking the ISP if they can modify their systems to provide one of the above hooks – once the problem is explained to their tech staff they can be surprisingly helpful, particularly since if they can’t help, the best option will be to change ISP. In the meantime, you can get Mailtraq to route based on the To and CC headers, which will work for simple emails sent directly to the recipient, but this won’t work with emails from mailing lists and messages directed via blind copies. To do this, go back to the Message Routing tab of our Remote POP3 Mailbox. Select “Enable Message Routing”, select “Use these header fields to identify recipients”, and make sure To and CC are listed in the box below it.