From 99990c11cd0e48afe6f28962905e4856ce556753 Mon Sep 17 00:00:00 2001 From: Antoine Nguyen Date: Fri, 27 Dec 2013 16:05:00 +0100 Subject: [PATCH] Documentation added. see #469 --- doc/getting_started/plugins.rst | 9 ++++----- modoboa/core/commands/postfix_maps.py | 8 ++++++++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/doc/getting_started/plugins.rst b/doc/getting_started/plugins.rst index 6f70f0d57..0cfd93378 100644 --- a/doc/getting_started/plugins.rst +++ b/doc/getting_started/plugins.rst @@ -63,14 +63,13 @@ lines inside:: :/etc/postfix/maps/sql-relaydomains-transport.cf :/etc/postfix/maps/sql-relaydomain-aliases-transport.cf -Replace ```` 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 + check_recipient_access + :/etc/postfix/maps/sql-relay-recipient-verification.cf + +Replace ```` by the name of the database you use. Reload postfix. diff --git a/modoboa/core/commands/postfix_maps.py b/modoboa/core/commands/postfix_maps.py index d5f4968af..e7e39476d 100644 --- a/modoboa/core/commands/postfix_maps.py +++ b/modoboa/core/commands/postfix_maps.py @@ -172,6 +172,14 @@ class RelayDomainAliasesTransportMap(MapFile): 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 RelayRecipientVerification(Mapfile): + category = "relaydomains" + filename = "sql-relay-recipient-verification.cf" + mysql = "SELECT 'reject_unverified_recipient' FROM postfix_relay_domains_relaydomain WHERE verify_recipients=1 AND name='%d'" + postgres = "SELECT 'reject_unverified_recipient' FROM postfix_relay_domains_relaydomain WHERE verify_recipients AND name='%d'" + sqlite = "SELECT 'reject_unverified_recipient' FROM postfix_relay_domains_relaydomain WHERE verify_recipients=1 AND name='%d'" + + class PostfixMapsCommand(Command): help = "Generate ready-to-use postfix map files"