Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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 have a fixed LAN IP, but no domain name. I'd like to be able to send emails within the LAN, and receive mails sent to my IP (user needs to send an email to username@10.xx.xx.xx). I've tried the stuff in this post -- the "easy" one gives me an IMAP error in squirrelmail (IMAP is open and listening, but not working), and the "hard" one seems to be outdated.

Is it possible to set up an email server (preferably on 12.04) without having a domain name?

share|improve this question

You can use gmail as relay.

Ubuntu postfix. Using gmail as SMTP relay

Gmail as SMTP-service.

Install postfix.

sudo apt-get install postfix

Select the settings during installation according to your needs.

If you ever need to redo the configuration run:

sudo dpkg-reconfigure postfix

Edit /etc/postfix/ by adding the following rows:

relayhost =

smtp_sasl_auth_enable = yes

smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd

smtp_sasl_security_options = noanonymous

smtp_use_tls = yes

Create the file /etc/postfix/sasl_passwd with the following content:

When done run and restart postfix afterwards:

sudo postmap /etc/postfix/sasl_passwd

sudo service postfix restart

share|improve this answer
Yes, but then Gmail won't let me send the mail as xyz@ipaddress. Gmail's SMTP removes header spoofing, so this won't work. I'd like full control on the email being sent. – Manishearth Nov 17 '12 at 19:16

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.