Re: Set up an internal mail server
Quote:
Originally Posted by
kennethconn
Pardon my ignorance, but what is the idea here? Using the local hosts file can help relate hostname with local IP, but wouldn't the email sending require MX record information? How can you implement that without your own DNS server in this case when you are working only with local domain??
Re: Set up an internal mail server
It is dealt with in the Postfix configuration, to the best of my knowledge. Let me see if I can find that particular configuration file (internal mail server scenario) for the OP.
Re: Set up an internal mail server
Quote:
Originally Posted by
kennethconn
It is dealt with in the Postfix configuration, to the best of my knowledge. Let me see if I can find that particular configuration file (internal mail server scenario) for the OP.
That would be great because i've been googling and i've found random threads here and there but not a full postfix tutorial for internal mail server w/o setting up a domain.
Re: Set up an internal mail server
If the DNS part is where you are getting stuck, and if you want to try it, here is a tutorial about quick DNS setup on ubuntu:
http://www.pressbyte.com/4581/setup-...ntu-vps-quick/
I don't think configuring DNS with a local domain should be stopping you.
Re: Set up an internal mail server
Quote:
Originally Posted by
darkod
If Postfix can be configured to deliver mail locally without setting up a DNS server and a domain, I'd like to try that first.
Re: Set up an internal mail server
I installed debian 6 in vmware player, set network to bridge mode. Selected both mail server and dns server during installation. It asked for a domain name during installation which I set to javed.local.
After that I installed postfix and dovecot and selected "local only" during postfix configuration setup.
I followed the debian wiki instructions for postfix and sent a test email from root@localhost to saad@localhost. That worked. Now how do I extend it to send email to other machines on the network (none of which are a part of javed.local domain). Like I want to send an email from saad@debian (machine 1) to saad@ubuntu (machine 2)...
Here is the postfix config file:
Code:
# See /usr/share/postfix/main.cf.dist for a commented, more complete version
# Debian specific: Specifying a file name will cause the first
# line of that file to be used as the name. The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no
# appending .domain is the MUA's job.
append_dot_mydomain = no
# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h
readme_directory = no
# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.
myhostname = debian.javed.local
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = debian.javed.local, localhost.javed.local, localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = loopback-only
default_transport = error
relay_transport = error
Re: Set up an internal mail server
My understanding of internal mail server is that everybody from your organisation can send email internally to each other. So you have two users on your local network like saad@javed.local and user2@javed.local that can send and receive email. I have got this up and running in the past purely as a learning exercise (but it was a long time ago and I thought I had the config files saved for future reference, can't seem to locate them at the moment).
What you wish to do sounds a bit cumbersome going forward. I think you need to research a bit more before you start actually configuring. SeijiSensei and darkod have made relevant points in their posts, and I'd imagine they have a lot more experience with configuring mail servers.
Re: Set up an internal mail server
I still think you can't do this without your own local DNS, which I guess you didn't install yet. But I might be wrong.
It's own thing to select 'local' when installing postfix, but I don't see how that can tell other machines on your network where to find the mailserver. Only DNS service can do that, of any kind. You can use bind9, dnsmasq, or any other similar service, but they need to know where to find the mailserver.
Right now your machines are using public DNS, or the router as DNS which is the same thing, and the public DNS servers have no clue what javed.local is.
Re: Set up an internal mail server
These are postfix config values I collected from google searches about setting up postfix w/o a domain. Since I have no clue what they actually mean...I thought i'd post them here. Would they work?
Code:
myhostname = debian
mydomain = javed.local
myorigin = $mydomain
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mynetworks = 192.168.0.100/24, 127.0.0.0/8
relay_domains =
home_mailbox = Maildir/
append_dot_mydomain = no
disable_dns_lookups = yes
saad@ubuntu <-----------------> saad@debian
(192.168.0.103)--------------------(192.168.0.106)
Laptop--------------------------------Server
Can I specify in postfix config different destination addresses like deliver mail to saad@ubuntu at 192.168.0.103? I have 4 machines on the network so i could easily specify addresses manually.
@darkod If there is any hope to do this w/o setting up a DNS Server, I'll chase it because BIND looks mighty scary. If it doesn't work....I'll set up a DNS Server then :)
Re: Set up an internal mail server
I think the network needs to be specified as 192.168.0.0/24, the whole subnet. The 192.168.0.100 might be the server IP but the whole network definition is 192.168.0.0/24.
In my opinion, you are looking at the domain thing in a wrong way. The point is not whether or not the server is part of a domain.
The point is how will the client computers know where the server is to deliver mail to it?
I see the hostname is debian, so do a quick test. From any of the other machines on the network, try to ping the server:
ping debian.javed.local
I bet it won't find it, because it doesn't know where javed.local is. That's why you need local DNS to tell the other computers:
1. The MX record for the domain javed.local points to debian.javed.local
2. That debian.javed.local is at 192.168.0.100
You don't need a domain network installed, but you do need DNS resolution that is able to identify the MX record and the server IP.