LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices



Reply
 
Search this Thread
Old 05-14-2010, 12:26 AM   #1
t-sniper
LQ Newbie
 
Registered: May 2010
Posts: 5

Rep: Reputation: 0
How to setup mail server behind a router?


Hi all, I've just finished installed a mail server with Fedora 12 + postfix + courier. I also have Squirrelmail and ISPConfig3 installed. The mail server is behind a router. I have www.mydomain.com pointed to the static IP at my router. My ISP has opened port 25 & 110 for me and my router has these 2 ports forwarded to my mail server (192.168.0.100). Workstations in local network can connect to my mail server and send emails with no problem but cannot receive emails from outside. I tried an email dossier and it saids connection timed out on smtp session. Do I need to include my static IP somewhere in the configuration so that it communicates to the world properly? Any help is greatly appreciated!

P.S. I already have my firewall disabled during the testing

Last edited by t-sniper; 05-14-2010 at 12:33 AM.
 
Old 05-14-2010, 01:18 AM   #2
EricTRA
Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1291Reputation: 1291Reputation: 1291Reputation: 1291Reputation: 1291Reputation: 1291Reputation: 1291Reputation: 1291Reputation: 1291
Hello,

Have you changed the DNS settings of your domain so that the MX record is pointing to your WAN IP also? You can check to where your MX record(s) are pointing in a terminal using dig:
Code:
dig @8.8.8.8 yourdomain.com MX
(8.8.8.8 is the DNS from Google)

Kind regards,

Eric

Last edited by EricTRA; 05-14-2010 at 01:27 AM.
 
Old 05-14-2010, 01:50 AM   #3
kurwongbah
Member
 
Registered: Apr 2010
Posts: 82

Rep: Reputation: 23
Do you have an account somewhere on the outside where you can get a shell?
If so ssh/telnet into that and try: telnet <your-outside-mail-ip> 25 and see if it connects to your smtp host.
If working try the same but use: telnet <your-outside-mail-url> 25
If not working, use: tcpdump -n -i any tcp port 25 on the smtp server and see if you've got traffic coming in when using the above commands.
 
Old 05-18-2010, 11:58 PM   #4
t-sniper
LQ Newbie
 
Registered: May 2010
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by EricTRA View Post
Hello,

Have you changed the DNS settings of your domain so that the MX record is pointing to your WAN IP also? You can check to where your MX record(s) are pointing in a terminal using dig:
Code:
dig @8.8.8.8 yourdomain.com MX
(8.8.8.8 is the DNS from Google)

Kind regards,

Eric
Here's the result
Code:
; (1 server found)
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 25746
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;mydomain.com.               IN      MX

;; ANSWER SECTION:
mydomain.com.        1801    IN      MX      10 mail.mydomain.com.

;; Query time: 265 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Wed May 19 11:52:18 2010
;; MSG SIZE  rcvd: 54
do I have to name my server as "mail.mydomain.com"?
 
Old 05-19-2010, 12:46 AM   #5
EricTRA
Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1291Reputation: 1291Reputation: 1291Reputation: 1291Reputation: 1291Reputation: 1291Reputation: 1291Reputation: 1291Reputation: 1291
Hello,

That looks OK and no you don't have to rename your server in order to receive mail because that's taken care of in the DNS settings for your domain. If your DNS mail record points to your WAN IP and your router/firewall forwards it correctly to your mailserver, then you should receive mail.

Have you been able to try the commands suggested by kurwongbah to enable a session from outside your domain (for example from your home)? And if so, what where the results?

Kind regards,

Eric
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Debian Mail Server Setup with Postfix + Dovecot + SASL + Squirrel Mail LXer Syndicated Linux News 0 03-12-2008 11:50 PM
Help me guide to setup mail server as a mail-gateway use spamassasin (use sendmail) adcom99 Linux - Newbie 1 11-03-2007 04:47 PM
Mail server now behind linux router: Mail system broken binary1011100 Linux - Server 2 07-02-2007 10:37 AM
Mail server - setup virtual mail boxes satimis Linux - Server 1 02-10-2007 11:40 AM
mail server and mail client setup issues htm Linux - General 1 03-16-2004 10:32 AM


All times are GMT -5. The time now is 01:49 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration