[Postfixadmin-devel] domian-wide sender_bcc_maps and recipient_bcc_maps admin patch
Brought to you by:
christian_boltz,
gingerdog
From: Max G. <ma...@ne...> - 2011-04-29 19:42:14
|
Hi all, i developed a simple/small patch against trunk which allows enabling domain-wide (NOT per user) BCC setting (http://www.postfix.org/ADDRESS_REWRITING_README.html#auto_bcc) The patch adds "BCC Recipient" and "BCC Sender" columns to the domain list, and adds 2 text inputs for the functionality in domain edit screens. When either field is set, an apropriate wildcard BCC entry is created in bcc_recipients/bcc_senders tables Here's an example db entry to forward all incoming email for example.com to eve...@ex... mysql> select * from bcc_senders; +--------------+------------------------+-------------+---------------------+---------------------+--------+ | user | bcc | domain | created | modified | active | +--------------+------------------------+-------------+---------------------+---------------------+--------+ | @example.com | eve...@ex... | example.com | 2011-04-29 12:02:11 | 2011-04-29 18:48:41 | 1 | +--------------+------------------------+-------------+---------------------+---------------------+--------+ Is there interest in this kind of functionality? The patch is attached, as im not sure how to go about submitting it?.. Also, i've never seen PA code before today, so of course the patch may not comply with PA coding standards, but i will happily change whatever is needed. Postfix configs: main.cf: recipient_bcc_maps = proxy:mysql:/etc/postfix/mysql/mysql_virtual_bcc_recipients_maps.cf sender_bcc_maps = proxy:mysql:/etc/postfix/mysql/mysql_virtual_bcc_senders_maps.cf mysql_virtual_bcc_recipients_maps.cf: hosts = 127.0.0.1 user = postfix password = password dbname = email query = select bcc from bcc_recipients where user = '%s' and active=1; mysql_virtual_bcc_senders_maps.cf: hosts = 127.0.0.1 user = postfix password = password dbname = email query = select bcc from bcc_senders where user = '%s' and active=1; DB tables: CREATE TABLE `bcc_recipients` ( `user` varchar(255) NOT NULL, `bcc` varchar(255) NOT NULL, `domain` varchar(255) NOT NULL, `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `modified` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `active` tinyint(1) NOT NULL DEFAULT '1' ); CREATE TABLE `bcc_senders` ( `user` varchar(255) NOT NULL, `bcc` varchar(255) NOT NULL, `domain` varchar(255) NOT NULL, `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `modified` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `active` tinyint(1) NOT NULL DEFAULT '1' ); |