Documentation update.

This commit is contained in:
Antoine Nguyen
2013-12-24 18:04:46 +01:00
parent 4fdb7605ff
commit b46fb9c103
4 changed files with 43 additions and 31 deletions
+26 -9
View File
@@ -46,7 +46,7 @@ listing page: *relay domain* and *relay domain alias*.
The extension is compatible with the *amavis* and *limits*
ones. Resellers will be able to create both new objects.
To tell Postfix this feature exists, you must generate two new map
Replace <driver> by the name of the database you use.To tell Postfix this feature exists, you must generate two new map
files and then update your configuration.
To generate the map files, run the following command::
@@ -55,7 +55,24 @@ To generate the map files, run the following command::
Replace values between ``<>`` by yours.
Edit the :file:`/etc/postfix/main.cf` file.
Edit the :file:`/etc/postfix/main.cf` file and copy the following
lines inside::
relay_domains = <driver>:/etc/postfix/maps/sql-relaydomains.cf
transport_maps =
<driver>:/etc/postfix/maps/sql-relaydomains-transport.cf
<driver>:/etc/postfix/maps/sql-relaydomain-aliases-transport.cf
Replace ``<driver>`` by the name of the database you use.
Ensure that ``smtpd_recipient_restrictions`` contains at least the
following options::
smtpd_recipient_restrictions =
permit_mynetworks
reject_unauth_destination
Reload postfix.
.. _amavis_frontend:
@@ -311,12 +328,11 @@ configuration files as follows:
``/etc/postfix/main.cf``::
transport_maps = mysql:/etc/postfix/maps/sql-transport.cf
virtual_alias_maps = mysql:/etc/postfix/maps/sql-aliases.cf
mysql:/etc/postfix/mapfiles/sql-domain-aliases-mailboxes.cf,
mysql:/etc/postfix/mapfiles/sql-email2email.cf,
mysql:/etc/postfix/maps/sql-autoreplies.cf,
mysql:/etc/postfix/mapfiles/sql-catchall-aliases.cf
transport_maps = mysql:/etc/postfix/maps/sql-autoreplies-transport.cf
virtual_alias_maps = <driver>:/etc/postfix/maps/sql-aliases.cf
<driver>:/etc/postfix/mapfiles/sql-domain-aliases-mailboxes.cf,
<driver>:/etc/postfix/maps/sql-autoreplies.cf,
<driver>:/etc/postfix/mapfiles/sql-catchall-aliases.cf
.. note::
@@ -327,7 +343,8 @@ configuration files as follows:
autoreply unix - n n - - pipe
flags= user=vmail:<group> argv=<modoboa_site>/manage.py autoreply $sender $mailbox
``<modoboa_site>`` is the path of your Modoboa instance.
Replace ``<driver>`` by the name of the database you
use. ``<modoboa_site>`` is the path of your Modoboa instance.
Then, create the requested map files::
+2 -2
View File
@@ -50,8 +50,8 @@ Finally, follow the common procedure::
.. _1.1.0:
1.1.0: FIXME
============
1.1.0: relay domains and better passwords encryption
====================================================
Due to code refactoring, some modifications need to be done into
:file:`settings.py`:
-6
View File
@@ -443,15 +443,9 @@ Use the following configuration in the :file:`/etc/postfix/main.cf` file
virtual_transport = dovecot
dovecot_destination_recipient_limit = 1
virtual_minimum_uid = <vmail user id>
virtual_gid_maps = static:<vmail group id>
virtual_uid_maps = static:<vmail user id>
virtual_mailbox_base = /var/vmail
relay_domains =
virtual_mailbox_domains = <driver>:/etc/postfix/sql-domains.cf
virtual_alias_domains = <driver>:/etc/postfix/sql-domain-aliases.cf
virtual_mailbox_maps = <driver>:/etc/postfix/sql-mailboxes.cf
virtual_alias_maps = <driver>:/etc/postfix/sql-aliases.cf,
<driver>:/etc/postfix/sql-domain-aliases-mailboxes.cf,
<driver>:/etc/postfix/sql-catchall-aliases.cf
+15 -14
View File
@@ -104,13 +104,6 @@ class DomainsAliasesMap(MapFile):
sqlite = "SELECT dom.name FROM admin_domain dom INNER JOIN admin_domainalias domal ON dom.id=domal.target_id WHERE domal.name='%s' AND domal.enabled=1 AND dom.enabled=1"
class MailboxesMap(MapFile):
filename = 'sql-mailboxes.cf'
mysql = "SELECT 1 FROM admin_mailbox mb INNER JOIN admin_domain dom ON mb.domain_id=dom.id INNER JOIN core_user user ON mb.user_id=user.id WHERE dom.enabled=1 AND dom.name='%d' AND user.is_active=1 AND mb.address='%u'"
postgres = "SELECT 1 FROM admin_mailbox mb INNER JOIN admin_domain dom ON mb.domain_id=dom.id INNER JOIN core_user u ON mb.user_id=u.id WHERE dom.enabled AND dom.name='%d' AND u.is_active AND mb.address='%u'"
sqlite = "SELECT 1 FROM admin_mailbox mb INNER JOIN admin_domain dom ON mb.domain_id=dom.id INNER JOIN core_user user ON mb.user_id=user.id WHERE dom.enabled=1 AND dom.name='%d' AND user.is_active=1 AND mb.address='%u'"
class AliasesMap(MapFile):
filename = 'sql-aliases.cf'
mysql = "(SELECT concat(mb.address, '@', dom.name) FROM admin_mailbox mb INNER JOIN admin_domain dom ON mb.domain_id=dom.id WHERE mb.id IN (SELECT al_mb.mailbox_id FROM admin_alias_mboxes al_mb INNER JOIN admin_alias al ON al_mb.alias_id=al.id INNER JOIN admin_domain dom ON al.domain_id=dom.id WHERE dom.name='%d' AND dom.enabled=1 AND al.address='%u' AND al.enabled=1)) UNION (SELECT concat(al.address, '@', dom.name) FROM admin_alias al INNER JOIN admin_domain dom ON al.domain_id=dom.id WHERE al.id IN (SELECT al_al.to_alias_id FROM admin_alias_aliases al_al INNER JOIN admin_alias al ON al_al.from_alias_id=al.id INNER JOIN admin_domain dom ON al.domain_id=dom.id WHERE dom.name='%d' AND dom.enabled=1 AND al.address='%u' AND al.enabled=1)) UNION (SELECT al.extmboxes FROM admin_alias al INNER JOIN admin_domain dom ON al.domain_id=dom.id WHERE dom.name='%d' AND dom.enabled=1 AND al.address='%u' AND al.enabled=1 AND al.extmboxes<>'')"
@@ -141,7 +134,7 @@ class MaintainMap(MapFile):
class TransportMap(MapFile):
category = "autoreply"
filename = 'sql-transport.cf'
filename = 'sql-autoreplies-transport.cf'
mysql = "SELECT method FROM postfix_autoreply_transport WHERE domain='%s'"
postgres = "SELECT method FROM postfix_autoreply_transport WHERE domain='%s'"
sqlite = "SELECT method FROM postfix_autoreply_transport WHERE domain='%s'"
@@ -155,20 +148,28 @@ class AutoRepliesMap(MapFile):
sqlite = "SELECT full_address, autoreply_address FROM postfix_autoreply_alias WHERE full_address='%s'"
class RelayDomainsMap(MapFile):
category = "relaydomains"
filename = "sql-relaydomains.cf"
mysql = "SELECT name FROM postfix_relay_domains_domain WHERE name='%s' AND enabled=1"
postgres = "SELECT name FROM postfix_relay_domains_domain WHERE name='%s' AND enabled"
sqlite = "SELECT name FROM postfix_relay_domains_domain WHERE name='%s' AND enabled=1"
class RelayDomainsTransportMap(MapFile):
category = "relaydomains"
filename = "sql-relaydomains-transport.cf"
mysql = "SELECT CONCAT(srv.name, ':') FROM postfix_relay_domains_service AS srv INNER JOIN postfix_relay_domains_relaydomain AS rdom ON rdom.service_id=srv.id WHERE rdom.enabled=1 AND rdom.name='%s'"
postgres = "SELECT srv.name || ':' FROM postfix_relay_domains_service AS srv INNER JOIN postfix_relay_domains_relaydomain AS rdom ON rdom.service_id=srv.id WHERE rdom.enabled AND rdom.name='%s'"
sqlite = "SELECT srv.name || ':' FROM postfix_relay_domains_service AS srv INNER JOIN postfix_relay_domains_relaydomain AS rdom ON rdom.service_id=srv.id WHERE rdom.enabled=1 AND rdom.name='%s'"
mysql = "SELECT CONCAT(srv.name, ':[', rdom.target_host, ']') FROM postfix_relay_domains_service AS srv INNER JOIN postfix_relay_domains_relaydomain AS rdom ON rdom.service_id=srv.id WHERE rdom.enabled=1 AND rdom.name='%s'"
postgres = "SELECT srv.name || ':[' || rdom.target_host || ']' FROM postfix_relay_domains_service AS srv INNER JOIN postfix_relay_domains_relaydomain AS rdom ON rdom.service_id=srv.id WHERE rdom.enabled AND rdom.name='%s'"
sqlite = "SELECT srv.name || ':[' || rdom.target_host || ']' FROM postfix_relay_domains_service AS srv INNER JOIN postfix_relay_domains_relaydomain AS rdom ON rdom.service_id=srv.id WHERE rdom.enabled=1 AND rdom.name='%s'"
class RelayDomainAliasesTransportMap(MapFile):
category = "relaydomains"
filename = "sql-relaydomain-aliases-transport.cf"
mysql = "SELECT CONCAT(srv.name, ':') FROM postfix_relay_domains_service AS srv INNER JOIN postfix_relay_domains_relaydomain AS rdom ON rdom.service_id=srv.id INNER JOIN postfix_relay_domains_relaydomainalias AS rdomalias ON rdom.id=rdomalias.target_id WHERE rdom.enabled=1 AND rdomalias.enabled=1 AND rdomalias.name='%s'"
postgres = "SELECT srv.name || ':' FROM postfix_relay_domains_service AS srv INNER JOIN postfix_relay_domains_relaydomain AS rdom ON rdom.service_id=srv.id INNER JOIN postfix_relay_domains_relaydomainalias AS rdomalias ON rdom.id=rdomalias.target_id WHERE rdom.enabled AND rdomalias.enabled AND rdomalias.name='%s'"
sqlite = "SELECT srv.name || ':' FROM postfix_relay_domains_service AS srv INNER JOIN postfix_relay_domains_relaydomain AS rdom ON rdom.service_id=srv.id INNER JOIN postfix_relay_domains_relaydomainalias AS rdomalias ON rdom.id=rdomalias.target_id WHERE rdom.enabled=1 AND rdomalias.enabled=1 AND rdomalias.name='%s'"
mysql = "SELECT CONCAT(srv.name, ':[', rdom.target_host, ']') FROM postfix_relay_domains_service AS srv INNER JOIN postfix_relay_domains_relaydomain AS rdom ON rdom.service_id=srv.id INNER JOIN postfix_relay_domains_relaydomainalias AS rdomalias ON rdom.id=rdomalias.target_id WHERE rdom.enabled=1 AND rdomalias.enabled=1 AND rdomalias.name='%s'"
postgres = "SELECT srv.name || ':[' || rdom.target_host || ']' FROM postfix_relay_domains_service AS srv INNER JOIN postfix_relay_domains_relaydomain AS rdom ON rdom.service_id=srv.id INNER JOIN postfix_relay_domains_relaydomainalias AS rdomalias ON rdom.id=rdomalias.target_id WHERE rdom.enabled AND rdomalias.enabled AND rdomalias.name='%s'"
sqlite = "SELECT srv.name || ':[' || rdom.target_host || ']' FROM postfix_relay_domains_service AS srv INNER JOIN postfix_relay_domains_relaydomain AS rdom ON rdom.service_id=srv.id INNER JOIN postfix_relay_domains_relaydomainalias AS rdomalias ON rdom.id=rdomalias.target_id WHERE rdom.enabled=1 AND rdomalias.enabled=1 AND rdomalias.name='%s'"
class PostfixMapsCommand(Command):