Bypass the SMTP ISP mailproblem
From OpenFSG
Contents |
How to bypass the SMTP ISP mail problem?
Like many others you might have problems with your mailserver. Although you are sure you have done all the right things concerning portforwarding, etc. But somehow your mail does not arrive at friends and family.
Finding the problem
Some Internet Server Providers (ISP) block all traffic on port 25. So did mine (planet.nl)however, often they allow what they call relaying mail. Also, some mail systems (notably AOL and MSN) refuse to accept messages from "residential" servers, and the easiest solution to this is to have your messages sent via your ISP's servers. Therefore you have to tell your FSG what to do with outgoing mail. In the present version's (3.1.27) of FSG there is no place to enter a relay address. However, with some help of the Forum, i managed to bypass the system.
Edit in SSH
In order to define a relay smtp server on your FSG, you have to make some changes using SSH.
- go to http://fsg/
- enter the services area
- enter the SSH menu
- enable SSH (if you are behind a router you might want to select the WAN option also)
- open putty.exe and login as admin
- type su, then enter the root password (loginasrootisrisky)
Make changes to main.cf
On the internet i found the following text about the FSG postfix mailserver:
What delivery method: direct or indirect By default, Postfix tries to deliver mail directly to the Internet. Depending on your local conditions this may not be possible or desirable. For example, your system may be turned off outside office hours, it may be behind a firewall, or it may be connected via a provider who does not allow direct mail to the Internet. In those cases you need to configure Postfix to deliver mail indirectly via a relay host.
Examples (specify only one of the following): /etc/postfix/main.cf: relayhost = (default: direct delivery to Internet) relayhost = $mydomain (deliver via local mailhub) relayhost = [mail.$mydomain] (deliver via local mailhub) relayhost = [mail.isp.tld] (deliver via provider mailhub)
The form enclosed with [] eliminates DNS MX lookups. Don't worry if you don't know what that means. Just be sure to specify the [] around the mailhub hostname that your ISP gave to you, otherwise mail may be mis-delivered.
I changed the main.cf using SSH and VI
- type vi etc/postfix/main.cf
- find relayhost=,
- type i
- then type e.g.
[mail.planet.nl]
- exit vi with esc, followed with ZZ
- reboot your FSG
SMTP Check Port 25 with the Telnet Command
You can check your SMTP Server on SMTP port 25 with the following Telnet commands.
Open a dosbox and type:
telnet mailserver.domain.com 25
If your server is online a connection will be established on port 25 (SMTP).
An Exchange Server answers with the following output:
220 mailserver.domain.com Microsoft ESMTP MAIL Service, Version: 5.0.2195.5329 ready at Sat, 22 May 2004 08:34:14 +0200
Try the following to send an eMail from the command line:
type: helo myserver.domain.com
response: 250 mailserver.domain.com Hello [10.1.11.133]
type: mail from:myname@mydomain.com
response: 250 2.1.0 myname@mydomain.com....Sender OK
type: rcpt to:recipientname@mydomain.com
response: 250 2.1.5 recipientname@mydomain.com
type: data
response: 354 Start mail input; end with <CRLF>.<CRLF>
type: subject: This is a test mail
type: to: recipientname@mydomain.com
type: This is the text of my test mail.
type: .
250 2.6.0 <exchange.domain.com> Queued mail for delivery
type: quit
Ovonder 22:51, 21 June 2006 (CEST)
