Postfix mailer configuration: Difference between revisions
New page: <nowiki>Postfix mailer configuration</nowiki> <nowiki>__ _</nowiki> <nowiki> -o)/ / (_)__ __ ____ __ Derek Winterstien</nowiki> <nowiki> /\\ /__/ / _ \/ // /\ \/ / r.o... |
mNo edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 6: | Line 6: | ||
<nowiki>..............................................................................</nowiki> | <nowiki>..............................................................................</nowiki> | ||
<nowiki></nowiki> | <nowiki></nowiki> | ||
Postfix should be configured to start up on boot | |||
chkconfig Postfix on | |||
Make some configuration changes in postfix | |||
vi /etc/postfix/main.cf | |||
Add / Modify the following | |||
inet_interfaces = all | |||
mydestination = $myhostname, localhost.$mydomain, $mydomain | |||
myorigin = $mydomain | |||
Logs: (var/log/mail) | |||
debug | |||
errors | |||
info - mail delivery attempts | |||
notice | |||
warnings - such as hostname verification | |||
=== Hosting Domains === | |||
---------- | |||
#. canonical hostname and/or domain of machine | |||
#. virtual alias domain virtual domain uses unix passwd system accounts | |||
#. virtual mailbox domain virtual domain and independent accounts | |||
=== Configuration: mailbox format === | |||
---------- | |||
Choose a mailbox format. This guide will cover mbox as opposed to MailDir. | |||
<nowiki>#!! home_mailbox = Mailbox <- delete or remark out this line. Do not specify</nowiki> | <nowiki>#!! home_mailbox = Mailbox <- delete or remark out this line. Do not specify</nowiki> | ||
<nowiki> the home_mailbox parameter for mbox style delivery.</nowiki> | <nowiki> the home_mailbox parameter for mbox style delivery.</nowiki> | ||
<nowiki></nowiki> | <nowiki></nowiki> | ||
<nowiki> mail_spool_directory = /var/spool/mail</nowiki> | <nowiki> mail_spool_directory = /var/spool/mail</nowiki> | ||
=== Configuration: main.cf === | |||
---------- | |||
Edit main.cf | |||
<nowiki> myorigin</nowiki> | <nowiki> myorigin</nowiki> | ||
<nowiki></nowiki> | <nowiki></nowiki> | ||
Line 58: | Line 56: | ||
<nowiki></nowiki> | <nowiki></nowiki> | ||
<nowiki> mynetworks you can specify a plain text file to contain valid</nowiki> | <nowiki> mynetworks you can specify a plain text file to contain valid</nowiki> | ||
=== Example a10: mynetworks === | |||
---------- | |||
You can list the relays in the main.cf file: | |||
mynetworks = 168.100.189.0/28, 127.0.0.0/8 | |||
Or refer to a hash file: | |||
mynetworks = hash:/etc/postfix/relay_table | |||
Or a flat text file: | |||
mynetworks = /etc/postfix/relay_table | |||
In the flat text file, # comments a line, an IP specifies a single host | |||
allowed relay. The sendmail format of a partial IP, X.X.X does NOT work. To | |||
specify a network use network metrics X.X.X.X/24 | |||
=== Example a20: virtual_alias_maps === | |||
---------- | |||
You can specify a hash table file for virtual_alias_maps, which is simular to | |||
sendmail's 'virtusertable' file with one important difference: postfix virtual | |||
domains do not automatically map to unix system accounts. | |||
*Specify in main.cf: | |||
virtual_alias_maps = hash:/etc/postfix/virtusers | |||
*Format: | |||
username@virtualdomain.com unixmailbox | |||
*Hash it: | |||
postmap virtusers | |||
*Explained: | |||
:The addess username@virtualdomain.com will be directed to the unix system | |||
mailbox named unixmailbox. | |||
=== Postfix Lookup Table Types: type:name === | |||
---------- | |||
Not all of them, but on Linux here are a few important ones... | |||
<nowiki>regexp regular expressions lookup table</nowiki> | <nowiki>regexp regular expressions lookup table</nowiki> | ||
<nowiki>hash standard hash index file</nowiki> | <nowiki>hash standard hash index file</nowiki> | ||
<nowiki>sdbm sdbm supported hash index file</nowiki> | <nowiki>sdbm sdbm supported hash index file</nowiki> | ||
<nowiki>pcre perl style regular expressions table</nowiki> | <nowiki>pcre perl style regular expressions table</nowiki> | ||
=== Virtual Mailbox Domains and Non-UNIX Accounts === | |||
---------- | |||
You must use a pop or imap server that is compatible with every recipient | |||
address having its own virtual mailbox. For example, popa3d is a great pop | |||
server known for simplicity and security, but it will not recognize your | |||
virtual, non system mailboxes. | |||
=== Graylisting and spamd === | |||
----------- | |||
*http://www.elwood.net/greyspamd.html | |||
*http://www.greylisting.org/implementations/postfix.shtml | |||
== Visit these updated and related pages == | |||
* [[Dovecot and Postfix Hybrid Authentication Example]] | |||
* [[Understand Postfix Account Types]] | |||
[[Category:Computer_Technology]] | [[Category:Computer_Technology]] | ||
[[Category:Linux]] | [[Category:Linux]] |
Latest revision as of 19:35, 13 February 2014
Postfix mailer configuration __ _ -o)/ / (_)__ __ ____ __ Derek Winterstien /\\ /__/ / _ \/ // /\ \/ / r.o.a.c.h.@.r.o.b.o.t.z...c.o.m _\_v __/_/_//_/\_,_/ /_/\_\ Trustix Secure Linux ..............................................................................
Postfix should be configured to start up on boot
chkconfig Postfix on
Make some configuration changes in postfix
vi /etc/postfix/main.cf
Add / Modify the following
inet_interfaces = all mydestination = $myhostname, localhost.$mydomain, $mydomain myorigin = $mydomain
Logs: (var/log/mail)
debug errors info - mail delivery attempts notice warnings - such as hostname verification
Hosting Domains
- . canonical hostname and/or domain of machine
- . virtual alias domain virtual domain uses unix passwd system accounts
- . virtual mailbox domain virtual domain and independent accounts
Configuration: mailbox format
Choose a mailbox format. This guide will cover mbox as opposed to MailDir.
#!! home_mailbox = Mailbox <- delete or remark out this line. Do not specify the home_mailbox parameter for mbox style delivery. mail_spool_directory = /var/spool/mail
Configuration: main.cf
Edit main.cf
myorigin mydestination mynetworks_style ignord if mynetworks list specified mynetworks you can specify a plain text file to contain valid
Example a10: mynetworks
You can list the relays in the main.cf file:
mynetworks = 168.100.189.0/28, 127.0.0.0/8
Or refer to a hash file:
mynetworks = hash:/etc/postfix/relay_table
Or a flat text file:
mynetworks = /etc/postfix/relay_table
In the flat text file, # comments a line, an IP specifies a single host allowed relay. The sendmail format of a partial IP, X.X.X does NOT work. To specify a network use network metrics X.X.X.X/24
Example a20: virtual_alias_maps
You can specify a hash table file for virtual_alias_maps, which is simular to sendmail's 'virtusertable' file with one important difference: postfix virtual domains do not automatically map to unix system accounts.
- Specify in main.cf:
virtual_alias_maps = hash:/etc/postfix/virtusers
- Format:
username@virtualdomain.com unixmailbox
- Hash it:
postmap virtusers
- Explained:
- The addess username@virtualdomain.com will be directed to the unix system
mailbox named unixmailbox.
Postfix Lookup Table Types: type:name
Not all of them, but on Linux here are a few important ones...
regexp regular expressions lookup table hash standard hash index file sdbm sdbm supported hash index file pcre perl style regular expressions table
Virtual Mailbox Domains and Non-UNIX Accounts
You must use a pop or imap server that is compatible with every recipient address having its own virtual mailbox. For example, popa3d is a great pop server known for simplicity and security, but it will not recognize your virtual, non system mailboxes.