Postfix
From AdminWiki
(Difference between revisions)
		
		
|  (better directories) |  (re-order some steps) | ||
| (5 intermediate revisions not shown) | |||
| Line 6: | Line 6: | ||
|   rsync -av /etc/postfix/ /data/postfix/conf |   rsync -av /etc/postfix/ /data/postfix/conf | ||
| * Create an additional spool directory | * Create an additional spool directory | ||
| - |   mkdir /data/postfix/spool | + |   mkdir /data/postfix/spool && rsync -av /var/spool/postfix/{dev,etc,lib} /data/postfix/spool/ | 
| * Create an additional data directory | * Create an additional data directory | ||
|   mkdir /data/postfix/data; chown postfix.postfix /data/postfix/data |   mkdir /data/postfix/data; chown postfix.postfix /data/postfix/data | ||
| * Edit the config files | * Edit the config files | ||
| ** /data/postfix/conf/main.cf | ** /data/postfix/conf/main.cf | ||
| - |   inet_interfaces =1.2.3.4 | + |   inet_interfaces = 1.2.3.4 | 
|   smtp_bind_address = 1.2.3.4 |   smtp_bind_address = 1.2.3.4 | ||
|   queue_directory = /data/postfix/spool/ |   queue_directory = /data/postfix/spool/ | ||
| - |   data_directory = /data/postfix/data | + |   data_directory = /data/postfix/data/ | 
| ** /etc/postfix/main.cf (default configuration file) | ** /etc/postfix/main.cf (default configuration file) | ||
|   alternate_config_directories = /data/postfix/conf/ |   alternate_config_directories = /data/postfix/conf/ | ||
| + | * use postfix-install to create missing files and set/update the permissions | ||
| + |  postfix post-install config_directory=/data/postfix/conf/ set-permissions upgrade-configuration create-missing | ||
| * check & start | * check & start | ||
|   postfix -c /data/postfix/conf/ check |   postfix -c /data/postfix/conf/ check | ||
|   postfix -c /data/postfix/conf/ start |   postfix -c /data/postfix/conf/ start | ||
Latest revision as of 17:17, 15 July 2010
Adding a Second Postfix Instance on one Server
Base reference: http://advosys.ca/papers/email/58-postfix-instance.html
- Add an ip address to the server (e.g. 1.2.3.4)
ip addr add 1.2.3.4/8 dev eth0 # or see /etc/network/interfaces
- Copy the /etc/postfix directory and all files
rsync -av /etc/postfix/ /data/postfix/conf
- Create an additional spool directory
mkdir /data/postfix/spool && rsync -av /var/spool/postfix/{dev,etc,lib} /data/postfix/spool/
- Create an additional data directory
mkdir /data/postfix/data; chown postfix.postfix /data/postfix/data
-  Edit the config files
- /data/postfix/conf/main.cf
 
inet_interfaces = 1.2.3.4 smtp_bind_address = 1.2.3.4 queue_directory = /data/postfix/spool/ data_directory = /data/postfix/data/
- /etc/postfix/main.cf (default configuration file)
 
alternate_config_directories = /data/postfix/conf/
- use postfix-install to create missing files and set/update the permissions
postfix post-install config_directory=/data/postfix/conf/ set-permissions upgrade-configuration create-missing
- check & start
postfix -c /data/postfix/conf/ check postfix -c /data/postfix/conf/ start
