This howto is based on Ubuntu and its base of debian which uses apt-get.
Therefore this section uses apt packages to its fullest.
Once your server is working come back to this step and open up SMTP and Web access to others.
Ping/ACCEPT net $FW # Permit all ICMP traffic FROM the firewall TO the net zone ACCEPT $FW net icmp # mail lines SMTP/ACCEPT net $FW SMTPS/ACCEPT net $FW Submission/ACCEPT net $FW IMAP/ACCEPT net $FW IMAPS/ACCEPT net $FW #web Web/ACCEPT net $FW This will prompt you for a root password. For purpose of this tutorial I will set it to root PASSWORD Now we will need to create the tables for those lookups just specified.
First you need to create a user to use in My SQL for mail only.
Then you need to create the database, Take note of your chosen mail username and password.
But you may risk more exposure and accidentally be blocked by spam blockers. Also many servers block dynamic dns hosts, so you may find your server gets rejected. I currently restrict my servers to ip4 and avoid ip6 at the moment. if you use a dynamic dns service, then your server address will be a subdomain.
(Or rather avoid flooding my logs with ip6 errors). You may not want outgoing mail to come from [email protected], as you'd prefer [email protected] You can also specify which users not to masquerade. It will also warn you about the certificate location. Please refer to previous edition for more explanations.
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP ON maildb.* TO 'mail'@'localhost' IDENTIFIED by 'mail PASSWORD'; GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP ON maildb.* TO 'mail'@'%' IDENTIFIED by 'mail PASSWORD'; exit; CREATE TABLE `aliases` ( `pkid` smallint(3) NOT NULL auto_increment, `mail` varchar(120) NOT NULL default '', `destination` varchar(120) NOT NULL default '', `enabled` tinyint(1) NOT NULL default '1', PRIMARY KEY (`pkid`), UNIQUE KEY `mail` (`mail`) ) ; CREATE TABLE `domains` ( `pkid` smallint(6) NOT NULL auto_increment, `domain` varchar(120) NOT NULL default '', `transport` varchar(120) NOT NULL default 'virtual:', `enabled` tinyint(1) NOT NULL default '1', PRIMARY KEY (`pkid`) ) ; CREATE TABLE `users` ( `id` varchar(128) NOT NULL default '', `name` varchar(128) NOT NULL default '', `uid` smallint(5) unsigned NOT NULL default '5000', `gid` smallint(5) unsigned NOT NULL default '5000', `home` varchar(255) NOT NULL default '/var/spool/mail/virtual', `maildir` varchar(255) NOT NULL default 'blah/', `enabled` tinyint(1) NOT NULL default '1', `change_password` tinyint(1) NOT NULL default '1', `clear` varchar(128) NOT NULL default 'Change Me', `crypt` varchar(128) NOT NULL default 'sdtrusf X0Jj66', `quota` varchar(255) NOT NULL default '', PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`) ) ; Next you need to decide whether to send all outgoing mail via another SMTP server, or send them yourself.
Easy to follow howto on setting up a mail server with unlimited users and domains, with IMAP access, anti-spam, anti-virus, secure authentication, encrypted traffic, web mail interface and more.
Based on an Ubuntu distribution platform, but instructions are distro generic.
To follow the rest of this howto with another distribution, you need to ensure all your packages have been installed with the same modules, E.g My SQL lookup on postfix and sasl, php in apache etc.
I have set up mail servers using the 32bit and 64bit x86 platforms, and if all the packages are available then other, E.g. With installing Ubuntu you have a choice of which base system to install.