Postfix admin-Tips

-------

#   vi /var/www/html/postfixadmin/config.inc.php

$CONF['generate_password'] = 'NO';     [ YES  - Auto Generate Password ]

// Always show password after adding a mailbox or admin.

// If you want to always see what password was set set this to 'YES'.

$CONF['show_password'] = 'NO';

$CONF['page_size'] = '100';   [ Display per page Mail ID ]

$CONF['theme_logo'] = 'images/logo-default.png';       [Specify your own logo] 

//  the footer information 

$CONF['show_footer_text'] = 'YES';

$CONF['footer_text'] = 'Return to change-this-to-your.domain.tld';      [ write Company Name ]

$CONF['footer_link'] = 'http://change-this-to-your.domain.tld';            [ write Domain Name ]

$CONF['default_aliases'] = array (   'abuse'      => 'abuse@worldcm.net',   'hostmaster' => 'hostmaster@worldcm.net',   'postmaster' => 'postmaster@worldcm.net',   'webmaster'  => 'webmaster@worldcm.net');$CONF['fetchmail'] = 'NO';$CONF['show_footer_text'] = 'NO';$CONF['quota'] = 'YES';$CONF['domain_quota'] = 'YES';$CONF['quota_multiplier'] = '1024000';$CONF['used_quotas'] = 'YES';$CONF['new_quota_table'] = 'YES';$CONF['aliases'] = '0';$CONF['mailboxes'] = '0';$CONF['maxquota'] = '0';$CONF['domain_quota_default'] = '0';

postfixadmin -BCC

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 everything@... mysql> select * from bcc_senders; +--------------+------------------------+-------------+---------------------+---------------------+--------+ | user         | bcc                    | domain      | created             | modified            | active | +--------------+------------------------+-------------+---------------------+---------------------+--------+ | @example.com | everything@... | 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' );

Re: [Postfixadmin-devel] domian-wide sender_bcc_maps and recipient_bcc_maps admin patch

From: Tanstaafl <tanstaafl@li...> - 2011-05-03 12:31:31

On 2011-04-29 3:44 PM, Max Gribov wrote: > 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 everything@... > mysql> select * from bcc_senders; > +--------------+------------------------+-------------+---------------------+---------------------+--------+ > | user         | bcc                    | domain      | created             | modified            | active | > +--------------+------------------------+-------------+---------------------+---------------------+--------+ > | @example.com | everything@... | 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.  Very nice, and definitely should be considered for addition to the core code, but I wonder if it is possible to adjust this so that it adds a plus delimeter with the original users local address part?  Ie, instead of aliasing to 'everything@', alias to 'everything+user@'... where 'user' is the original recipients local address part?  This would make it easy to file these in folders, rather than dumping everyone's messages in a single folder.  To expand on this... could it be made to differentiate between outbound and inbound?  Ie, everything-in+user@, and everything-out+user@ ?  I know, I like to complicate things.  

Re: [Postfixadmin-devel] domian-wide sender_bcc_maps and recipient_bcc_maps admin patch

From: Max Gribov <max@ne...> - 2011-05-03 14:11:08

On Tue, May 03, 2011 at 08:31:25AM -0400, Tanstaafl wrote: > Very nice, and definitely should be considered for addition to the core > code, but I wonder if it is possible to adjust this so that it adds a > plus delimeter with the original users local address part? >  > Ie, instead of aliasing to 'everything@', alias to 'everything+user@'... > where 'user' is the original recipients local address part? Yes, definetely possible, once i get to it : ) Should be pretty trivial, just need to make sure when the setting is changed/added or when a user is added, a new entry is made in that table. Postfix will automatically create the maildir on delivery for whatever is in the bcc column.  On other hand, once you have access to that inbox, you could filter by the To/From within a MUA, but yes, that would be less desirable.  > To expand on this... could it be made to differentiate between outbound > and inbound? Well, right now there are 2 tabeles - bcc_senders and bcc_recipients, so different mailboxes can be used for incoming vs outgoing mail, although it will not be per user.  > I know, I like to complicate things. Hehe, features are awesome!   

vim /etc/postfix/master.cf


sender_bcc_maps = proxy:mysql:/etc/postfix/sender_bcc_sqlrecipient_bcc_maps = proxy:mysql:/etc/postfix/sender_bcc_sql

"sender_bcc_sql":

hosts = 127.0.0.1user = postfixadminpassword = postfixadmindbname = postfixquery = SELECT goto FROM sender_bcc WHERE sender = _cp1251'%s' COLLATE cp1251_general_ci







---------