The "Noob Link" Technical Reference
Pantz.org Index About Homepage


 ____   ___  ____ _____ _____ _____  __
|  _ \ / _ \/ ___|_   _|  ___|_ _\ \/ /
| |_) | | | \___ \ | | | |_   | | \  / 
|  __/| |_| |___) || | |  _|  | | /  \ 
|_|    \___/|____/ |_| |_|   |___/_/\_\
                                      

Example of Postfix 1.1.x configuration files.
This one was installed on an OpenBSD machine so your directory settings will probally have to change.
If you want to learn how to install Postfix go to the website at Postfix.org.


/etc/postfix/main.cf
### Do not change these directory settings - they are critical to Postfix
### operation.
biff = no
recipient_delimiter = +
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
program_directory = /usr/libexec/postfix

### No one needs to know what we run. So can give them this.
mail_name = Mail Daemon
smtpd_banner = ESMTP $mail_name SpamIsReported

### Who delivers the mail (never root for security).
setgid_group = postdrop

### appending .domain should be the MUA's job.
mydomain = example.com
append_dot_mydomain = yes

### Valid hostname of this system known as the mail server (must be a fqdn !)
myhostname = mail.example.com

### The myorigin parameter specifies the domain that appears in mail that is posted on this machine.
append_at_myorigin = yes
myorigin = example.com

### alias's and such
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
#canonical_maps = hash:/etc/postfix/canonical
#virtual_alias_maps = hash:/etc/postfix/virtual
virtual_maps = hash:/etc/postfix/virtual_maps

### The mydestination parameter specifies what domains this machine will deliver locally, instead
### of forwarding to another machine. The default is to receive mail for the machine itself.
mydestination = $myhostname, localhost.$mydomain, $mydomain, example2.com

### Relay Host this mail server should send its mail to. (NONE)
relayhost =

### External Networks to accept RELAYED mail from.
mynetworks = 192.168.0.0/24, 127.0.0.0/8

### Where to send mail that is delivered locally.
mailbox_command = procmail -a "$EXTENSION"

### How much of the message in bytes will be bounced back to the sender.
bounce_size_limit = 2000

### No limit on mailbox size.
mailbox_size_limit = 0

### Limit sent/recieved emails to 100 Megs "(header+body+attachment)x(mime-encoding) <= 100 meg"
message_size_limit = 102400000

### How long do messages stay in the queue before being sent back to the sender. (in days)
### By default, postfix attempts to resend the message every (1000 secs)x(# attempts)x(days).
maximal_queue_lifetime = 3d

### Parrallel delivery force (local=2 and dest=20 are aggressive)
local_destination_concurrency_limit = 2
default_destination_concurrency_limit = 20

### Max flow rate (1 sec delay per 50 emails/sec over the number of emails delivered/sec)
in_flow_delay = 1s

###Clients must send a HELO (or EHLO) command at the beginning of an SMTP session.
smtpd_helo_required = yes

### No one needs to ask our server who is on it. If you do, you get smacked with the tarpit and then an error.
disable_vrfy_command = yes

### Tarpit those bots/clients/spammers who send errors or scan for accounts
smtpd_error_sleep_time = 10
smtpd_soft_error_limit = 5
smtpd_hard_error_limit = 10

### SMTP Restrictions
## header_checks = regexp:/etc/postfix/header_checks
## smtpd_client_restrictions =

###Rejecting connections that don't give fqdn's or valid hostnames help with spamers and windows virus/worms.
smtpd_helo_restrictions = permit_mynetworks, reject_non_fqdn_hostname, reject_invalid_hostname
## smtpd_sender_restrictions =
smtpd_recipient_restrictions = permit_mynetworks, reject_unauth_destination
/etc/postfix/virtual_maps
#The left hand side are virtual e-mail aliases. The right hand side
are local system login names or names that reference the alias file.
After editing this file run the command: postmap /etc/postfix/virtual_maps

example.com                       DOMAIN
mr.jose@example.com 	          jose@localhost
accounts@example.com              jose@localhost,kyle@locahost
updates@example.com               jose@localhost
support@example.com               jose@localhost,kyle@localhost
dns@example.com	                  kyle@localhost
kyle.lowe@example.com	          kyle@localhost

example2.com			  DOMAIN
bill@example2.com		  billt@localhost