|
NAMEtable_redis —
format description for smtpd redis tables
DESCRIPTIONThis manual page documents the file format of redis tables used by the smtpd(8) mail daemon.The format described here applies to tables as defined in smtpd.conf(5). REDIS TABLEA Redis table allows the storing of usernames, passwords, aliases, and domains in a redis server.The table is used by smtpd(8) when authenticating a user, when user information such as user-id and/or home directory is required for a delivery, when a domain lookup may be required, and/or when looking for an alias. A Redis table consists of one Redis Databases with one or more keys. If the table is used for authentication, the password should be encrypted using the crypt(3) function. Such passwords can be generated using the encrypt(1) utility or smtpctl(8) encrypt command. REDIS TABLE CONFIG FILEmaster
This is the IP of the master redis
server. To connect via an unix socket use
unix:/path/to/sock The default is 127.0.0.1
This is the port used to connect to
the master redis server. The default is 6379
This is the IP of the slave redis
server, if any. To connect via an unix socket use
unix:/path/to/sock
This is the port used to connect to
the slave redis server if any.
The database number to
use. The default is 0.
The password to use to authenticate
to the redis server if any.
This is used to provide a query for a
domain query call. All the '%s' are replaced with the appropriate data, in this
case it would be the right hand side of the SMTP address. This expects one string to be
returned with a matching domain name.
This is used to provide a query for
looking up user information. All the '%s' are replaced with the
appropriate data, in this case it would be the left hand side of the
SMTP address. This expects three fields to be
returned an int containing a UID, an int containing a GID and a string containing the home
directory for the user.
This is used to provide a query for
looking up credentials. All the '%s' are replaced with the appropriate data, in this
case it would be the left hand side of the SMTP address. the query expects that there are two
strings returned one with a user name one with a password in
encrypted format.
This is used to provide a query to
look up aliases. All the '%s' are replaced with the appropriate data, in this
case it would be the left hand side of the SMTP address. This expects one string to be
returned with the user name the alias resolves to. If the query returns an array, all
the data will be concatenated into one string with ',' as a
separator
This is used to provide a query to
check if a mail address exists. All the '%s' are replaced with the
appropriate data, in this case it would be the SMTP address. This expects an integer as a reply, 0
= false and 1 = true EXAMPLESDue to the nature of redis, multiple schemas can be used. Those provided here a known to work.
# redis-cli sadd domains
example.net in the redis table configuration
file: query_domain SISMEMBER domains
%s
Hash works well for
users # redis-cli HSET user:foo uid
1001 # redis-cli HSET user:foo gid
1001 # redis-cli HSET user:foo maildir
/mail/foo in the redis table configuration
file: query_userinfo HMGET user:%s uid gid
maildir
We can extend the hash for our user
to put credential in it # redis-cli HSET user:foo login
foo # redis-cli HSET user:foo passwd
encrypted_password in the redis table configuration
file: query_credentials HMGET user:%s login
passwd
Using redis sorted list: # redis-cli LPUSH
aliases:foo@example.net foo # redis-cli LPUSH
aliases:bar@example.net foo in the redis table configuration
file: query_alias LRANGE aliases:%s 0
-1
# redis-cli sadd mailaddr
foo@example.net in the redis table configuration
file: query_mailaddr SISMEMBER mailaddr
%s SEE ALSOencrypt(1), smtpd.conf(5), smtpctl(8), smtpd(8)
Visit the GSP FreeBSD Man Page Interface. |