Postfix SQL tables
Mostly lifted from here.
postfix_alias
This table is only used on local delivery. So it wont work, if you deliver “virtual”. Just have that in mind, when you configure your aliases. Also this is the only table, where can execute scripts directly.
! | Field | Type | Attributes | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
! style=”width: 50px;” | Null | ||||||||||||
! style=”width: 50px;” | Key | ||||||||||||
! | Default | Extra | |||||||||||
id | int(11) | UNSIGNED | PRI | auto_increment | |||||||||
alias | varchar(128) | ||||||||||||
destination | varchar(128) | ||||||||||||
} |
{ | align=”center” border=”1” width=”90%” |
---|---|
+’'’Description:’’’ | |
id | |
This is not necessary, but I also use the id field as an unique identifier in some other places, so it’s up to you, if you want to use it. | |
alias | |
The alias, you wish to redirect, could be postmaster, root or other aliases. | |
destination | |
This field can hold several types of destinations. I can be one or more addresses (delimited by comma), a file for delivery to file, a “pipe” to a command for executing a script handling STDIN or an include, which has several addresses, one on each line. | |
} |
=postfix_relocated=
This table is only used to tell senders, that the user, they tried to contact doesn’t exist on the server anymore, but has moved to a new address. All this does is generating a mailer-daemon message, telling the sender the new address, where this recipient moved to.
{ | border=”1” align=”center” style=”text-align: center” width=”90%” | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
+’'’Overview’’’ | |||||||||||||
! | Field | Type | Attributes | ||||||||||
! style=”width: 50px;” | Null | ||||||||||||
! style=”width: 50px;” | Key | ||||||||||||
! | Default | Extra | |||||||||||
id | int(11) | UNSIGNED | PRI | auto_increment | |||||||||
varchar(128) | |||||||||||||
destination | varchar(128) | ||||||||||||
} |
{ | align=”center” border=”1” width=”90%” |
---|---|
+’'’Description:’’’ | |
id | |
This is not necessary, but I also use the id field as an unique identifier in some other places, so it’s up to you, if you want to use it. | |
The originally used email-address. | |
destination | |
The email-address, where the user can be found now. Eventually you just put “unknown” here, if you don’t want to refer to a new address or you don’t know the users new address. | |
} |
=postfix_transport= See the Postfix manual for transport.
{ | border=”1” align=”center” style=”text-align: center” width=”90%” | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
+’'’Overview’’’ | |||||||||||||
! | Field | Type | Attributes | ||||||||||
! style=”width: 50px;” | Null | ||||||||||||
! style=”width: 50px;” | Key | ||||||||||||
! | Default | Extra | |||||||||||
id | int(11) | UNSIGNED | PRI | auto_increment | |||||||||
domain | varchar(128) | UNI | |||||||||||
destination | varchar(128) | ||||||||||||
} |
{ | align=”center” border=”1” width=”90%” |
---|---|
+’'’Description:’’’ | |
id | |
This is not necessary, but I also use the id field as an unique identifier in some other places, so it’s up to you, if you want to use it. | |
domain | |
The domain field contains the domain names of the domains you host. | |
destination | |
This field is describing the way Postfix should deliver the mail. “local:” would be for local delivery, “virtual:” for delivery to the virtual accounts, we are going to use. You can use ‘‘every’’ transport type you want in this place. “maildrop:” for mails which have to be filtered first or “uucp:” for delivery to UUCP. ‘'’Important:’’’ the host’s primary hostname has to be “local:” delivery!! | |
} |
=postfix_users=
{ | border=”1” align=”center” style=”text-align: center” width=”90%” | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
+’'’Overview’’’ | |||||||||||||
! | Field | Type | Attributes | ||||||||||
! style=”width: 50px;” | Null | ||||||||||||
! style=”width: 50px;” | Key | ||||||||||||
! | Default | Extra | |||||||||||
id | int(11) | UNSIGNED | PRI | auto_increment | |||||||||
varchar(128) | UNI | ||||||||||||
clear | varchar(128) | ||||||||||||
name | tinytext | ||||||||||||
uid | int(11) | UNSIGNED | 1001 | ||||||||||
gid | int(11) | UNSIGNED | 1001 | ||||||||||
homedir | tinytext | ||||||||||||
maildir | tinytext | ||||||||||||
quota | tinytext | ||||||||||||
access | enum(‘y’,’n’) | y | |||||||||||
postfix | enum(‘y’,’n’) | y | |||||||||||
} |
{| align=”center” border=”1” width=”90%” |+’'’Description:’’’ |- | id | This is not necessary, but I also use the id field as an unique identifier in some other places, so it’s up to you, if you want to use it. |- | email | The users email address and username |- | clear | The cleartext password used for smtp-auth, pop3 and imap |- | name | The user’s name. This is only for informational purposes and totally optional. Courier can use it, but won’t need it. |- | uid | The uid (User ID) of the vmail-user that we are going to create. This is the only unix-user that is needed for virtual delivery, since there still must be some kind of ownership on the stored mails. You can also create your local unix-users in this table, if you want to give them the possibility to use CRAM-MD5 challenging and maybe give them another password, than the one used for local access. The fun thing about Courier is that it will check both this and the local password, so that the unix-user will be able to authenticate with both passwords, however CRAM-MD5 challenging cannot be used on already encrypted passwords. |- | gid | The gid (group ID of the vmail-user) |- |homedir |This is the path under which the homedir of the user resides. It’s “home/vmail” for our virtual users and should be the same always for the virtual user. For any local unix-user, Postfix does not look at this field, it gets the homedir from the passwd file. |}
=postfix_virtual=
{ | border=”1” align=”center” style=”text-align: center” width=”90%” | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
+’'’Overview’’’ | |||||||||||||
! | Field | Type | Attributes | ||||||||||
! style=”width: 50px;” | Null | ||||||||||||
! style=”width: 50px;” | Key | ||||||||||||
! | Default | Extra | |||||||||||
id | int(11) | UNSIGNED | PRI | auto_increment | |||||||||
varchar(128) | |||||||||||||
destination | varchar(128) | ||||||||||||
} |
=postfix_access=
{ | border=”1” align=”center” style=”text-align: center” width=”90%” | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
+’'’Overview’’’ | |||||||||||||
! | Field | Type | Attributes | ||||||||||
! style=”width: 50px;” | Null | ||||||||||||
! style=”width: 50px;” | Key | ||||||||||||
! | Default | Extra | |||||||||||
id | int(11) | UNSIGNED | PRI | auto_increment | |||||||||
source | varchar(128) | ||||||||||||
access | varchar(128) | ||||||||||||
type | enum(‘recipient’,’sender’,’client’) | recipient | |||||||||||
} |