Use the Mail Server
From OpenFSG
Contents |
Intro
Using or enabling the mailserver are two different things. Everybody can enable the mailserver in the WebIF, however it took me a long time to figure out how to use it. Since there wasn't any Wiki text until now, i would like to make a start...
In the forum you will find various posts about using the mailserver. Before getting frustrated, you have to be aware that proper use of the mail server depends on various aspects. Confusing is the fact that people have different reasons why they want to run a mail server. Do you just want to fetch another mailbox, or do you really want to host your own domain mail server.... The checklist below helps you figuring out how to setup an domain mail server.
Did you register an No-ip or Dyndns domain?
Certain firmware releases need to have an domain set in the WebIF under Services | Dynamic DNS. You can ask a free domain address from e.g. Free New Dynamic DNSSM Host title. Lets say mymail.dyndns.com..
Is the FSG your main router?
If your FSG is behind another router, there are more parameters to take in account, for instance you have to pass traffic from internet, through your first router (and firewall) and pass it on to your FSG.
When your FSG is behind another router, you might want to put your FSG in switch mode (beta 3.2.3), just to eliminate possible problems, if everything goes well, you can switch back ;-).
Did you adjust your Firewall?
Normally a firewall would be blocking an internal mailserver from talking to the internet. Therefore you have to open some ports on your (ADSL)router and map it to your FSG. First of all, your FSG should have a permanent internal IP address on your router, to be able to pass on mail to your FSG.
- enter the WebIF of your first router (not FSG!) and reserve an permanent IP-address for your FSG. (e.g. 192.168.1.100)
- write down this address!
- So when in switch mode (FSG WebIF, connections, basic setup), choose use fixed ip address'", and fill in the ip-address you just wrote down. (192.168.1.100)
- Now enter the WebIF of your first router (not FSG!) and look for portforwarding, map the ports 25, 110 and 143 to the ip-address you wrote down (192.168.1.100).
.
To check if everything is ok, you might want to visit Portscan, if you see red or yellow pictures for POP3, IMAP and SMTP you are on the right track.
- Red pictures: traffic is allowed and a mail server is found,
- yellow pictures: traffic ia allowed, however no mail server is found.
- Green pictures: traffic is blocked!
Does your ISP allow sending mail?
In my case problems with mail were caused by my ISP. Using Portscan i realised that although i had mapped all mail ports from my router to my FSG, still a green picture appeared at SMTP, after further investigation it turned out that my ISP was blocking all SMTP traffic! However there is light at the end of the tunnel: Bypass the SMTP ISP mailproblem
Beta firmware releases
Old accounts like Admin, can have suffered from certain old beta firmware releases, best is to create a new account (lowercase!!) to test with. Lets say jdoe If you get a new account working, you might even want to empty all messages in the admin mailbox, to start with a fresh start. You could use webadmin (php tool) for that.
Everything seems allright, but how to be sure?
You can check Mail Server with the following Telnet commands (dosprompt).
Sending mail
Open a dosbox and
type: telnet 192.168.1.100 25 ( use the permanent IP address of your FSG)
Wait a while...If your server is online a connection will be established on port 25 (SMTP). An Exchange Server answers with the following output:
220 mymail.dyndns.com ESMTP
Try the following to send an eMail from the command line:
type: helo mymail.dyndns.com (your own dyndns.com address)
response: 250 mymail.dyndns.com
type: mail from:jdoe@mymail.dyndns.com
response: 250 Ok
type: rcpt to:recipientname@mymail.dyndns.com ( try an internal, and an hotmail address!)
response: 250 Ok
type: data
response: 354 end data with <CR><LF>.<CR><LF>
type: subject: This is a test mail
type: to: recipientname@mymail.dyndns.com
type: This is the text of my test mail.
type: . (press enter)
response 250 Ok: queued as ....
type: quit
reading mail
First send a mail from your ISP or Hotmail to your mail server (e.g. jdoe@mymail.dyndns.com). If it doesn't come back, you can start reading your jdoe account.
Check your mail settings for the pop-server-name and port#. Most POP3 servers use port 110.
type: telnet 192.168.1.100 110 ( use the permanent IP address of your FSG)
This will connect to the mail server.
Type: USER jdoe
Type: PASS password
Type: LIST
The response to this lists a line for each message with its number and size in bytes, ending with a period on a line by itself. Sample response: +OK 3 messages 1 1205 2 305 3 344400 .
Type: RETR 1
This sends message number 1 to you (displays on the Telnet screen).
Type: QUIT This deletes any messages marked for deletion, and then logs you off of the mail server. This is the last command to use.
Mailclient or Webmail
Now you are sure your mail server is working, you can use your favorite mailclient to read your mail messages, however, in my case at home i have to use the ip-address instead of the domainname, and at work i must use the domain name.
At home i also managed to get IlohaMail webmail (php) working. (also using the ip-address), haven't figured out why using my domainname ends up with: Could not connect to vonder.dyndns.info at port 110.
One alternative (and there are many) to IlohaMail is RoundCube, see the HOWTO Install and setup RoundCube WebMail .
SPAM
Spam is unwanted bulk email, and it's a real pain. Having anti-spam measures in place is an essential sanity-saver. Setup SpamAssassin anti-spam
