Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've setup local mail server on Linux Platform,now I'm able to access within LAN, I've purchased domain from GoDaddy, how can I map local mail server in my domain ?

I know that we need to give mail server IP in MX records of the domain but the issue is with my network architecture,once have a look

Static IP Address from ISP---> Net Gear Router--->eth0 of Linux server;from eth1 of Linux server to LAN.

Now we are able to access mail server by using local IP address as

192.168.x.x/webmail or by configuring SMTP details in Thunderbird.

I want to access webmail outside of local network,how can I do this ?

share|improve this question
up vote 0 down vote accepted

(I Rewrote my post after getting your answers, which were: MTA=postfix, linux distro=ubuntu, currently email from outside does not arrive)

To get you started, I leave out all the fancy anti-virus/ anti-spam setup.

If I understand your questions, what you want is:

  • receive mail directed to addresses like user@your-domain
  • access mail through a webmailer from anywhere

To receive email from outside you need to

  • configure postfix to accept mail for user @your-domain and let it listen on the right interfaces
  • configure your router to forward port 25 to your linux server
  • configure the MX-record at your DNS-provider (GoDaddy in your case) to point to your static IP

Postfix's default configuration should be ok.
Just change the host and domain names it accepts and the interfaces where postfix listens:

Replace by your fully qualified domain name and by your domain.

sudo postconf -e "mydestination =, localhost.localdomain, localhost,"
sudo postconf -e "inet_interfaces = all"
sudo  /etc/init.d/postfix restart

To access mail from outside via webmailer you need to

  • configure your web server to offer HTTPS
  • configure your router to forward port 443 to your linux server

To enable SSL for Apache2 on ubuntu (see

sudo a2enmod ssl
sudo service apache2 restart

This uses self signed test certificates probably issued to localhost or localhost.localdomain. This is good enough to test your setup.

You can create your own self signed certs with e.g. www.your-domain or buy one (which is a waste if you just need encryption IMHO). See Ubuntu-Certificates-Doku for details.

share|improve this answer
Thanks Heiner for spending your valuable to time,below are answers to your questions 1) Currently I'm unable to send mail from outside 2) I'm accessing webmail by using "http" 3) I'm using Debian(Ubuntu server) linux distribution and MTA is postfix and MDA is Dovecot. – Mahesh.D Jan 2 '13 at 8:37
Uh oh! Then there is more than one task: 1. configure an externally accessible email server using postfix (avoid open relay, listen on eth0 + eth1). 2. setup GoDaddy account (MX = your static IP) 3. forward port 25 from your router to your linux server, 4. setup SSL for your web server – Heiner Westphal Jan 2 '13 at 9:16
I'll follow what you have explained above but for now,I just want to access webmail service from outside of local network,for that I've configured router forward port 80 to my server but I'm unable to access webmail service outside of local network. – Mahesh.D Jan 2 '13 at 10:27
Maybe your apache does not listen on eth1. 'netstat -t -l|grep :http' shows for which addresses HTTP is open. Do you get an error msg. BTW? – Heiner Westphal Jan 2 '13 at 11:15
Currently I'm able to access apache server from eth0 and eth1 locally but failed to access outside even though configured port forward.After giving above cmd,it shows tcp 0 0 *:https *:* LISTEN tcp 0 0 *:http *:* LISTEN – Mahesh.D Jan 2 '13 at 11:31

You need to give the mail server a publicly routable address (let it use your ISP-assigned static IP), most likely through Network Address Translation or port forwarding on your router.

How to do that specifically should be documented in the user/administrator guide for your Netgear router, though as a quick warning, SOHO equipment may not be able to handle the number of traffic or connections you'll require for a mail server if you have a respectable volume of mail, so you might run int issues that require a business or enterprise-grade router for this purpose.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.