Thread: SF.net SVN: postfixadmin:[600] trunk/DOCUMENTS/POSTFIX_CONF.txt
Brought to you by:
christian_boltz,
gingerdog
From: <Gin...@us...> - 2009-03-23 15:31:09
|
Revision: 600 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=600&view=rev Author: GingerDog Date: 2009-03-23 15:31:06 +0000 (Mon, 23 Mar 2009) Log Message: ----------- POSTFIX_CONF.txt: see e.g. https://sourceforge.net/tracker/index.php?func=detail&aid=2693375&group_id=191583&atid=937964 Modified Paths: -------------- trunk/DOCUMENTS/POSTFIX_CONF.txt Modified: trunk/DOCUMENTS/POSTFIX_CONF.txt =================================================================== --- trunk/DOCUMENTS/POSTFIX_CONF.txt 2009-03-21 16:34:29 UTC (rev 599) +++ trunk/DOCUMENTS/POSTFIX_CONF.txt 2009-03-23 15:31:06 UTC (rev 600) @@ -59,6 +59,8 @@ dbname = postfix query = SELECT goto FROM alias,alias_domain WHERE alias_domain.alias_domain = '%d' and alias.address = CONCAT('%u', '@', alias_domain.target_domain) AND alias.active = 1 +(Note: PostgreSQL does not have a concat() function, instead use e.g. .... alias.address = '%u' || '@' || alias_domain.target_domain AND ....) + mysql_virtual_alias_domain_catchall_maps.cf: # handles catch-all settings of target-domain user = postfix @@ -67,6 +69,8 @@ dbname = postfix query = SELECT goto FROM alias,alias_domain WHERE alias_domain.alias_domain = '%d' and alias.address = CONCAT('@', alias_domain.target_domain) AND alias.active = 1 +(See above note re Concat + PostgreSQL) + mysql_virtual_domains_maps.cf: user = postfix password = password @@ -86,6 +90,8 @@ query = SELECT CONCAT(domain,'/',maildir) FROM mailbox WHERE username='%s' AND active = '1' #expansion_limit = 100 +(See above note re Concat + PostgreSQL) + mysql_virtual_alias_domain_mailbox_maps.cf: user = postfix password = password @@ -93,6 +99,8 @@ dbname = postfix query = SELECT CONCAT(domain,'/',maildir) FROM mailbox,alias_domain WHERE alias_domain.alias_domain = '%d' and mailbox.username = CONCAT('%u', '@', alias_domain.target_domain) AND mailbox.active = 1 +(See above note re Concat + PostgreSQL) + # For quota support mysql-virtual-mailbox-limit-maps.cf: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2009-04-09 20:46:54
|
Revision: 620 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=620&view=rev Author: christian_boltz Date: 2009-04-09 20:46:44 +0000 (Thu, 09 Apr 2009) Log Message: ----------- POSTFIX_CONF.txt. - honor alias_domain.active (see mail from Daniel Reichelt in postfixadmin-devel) - fix query for maildir in virtual_mailbox_maps - the maildir field already contains the domain (exact layout depends on the $CONF settings), so there's no need to prepend it again Modified Paths: -------------- trunk/DOCUMENTS/POSTFIX_CONF.txt Modified: trunk/DOCUMENTS/POSTFIX_CONF.txt =================================================================== --- trunk/DOCUMENTS/POSTFIX_CONF.txt 2009-04-09 20:05:45 UTC (rev 619) +++ trunk/DOCUMENTS/POSTFIX_CONF.txt 2009-04-09 20:46:44 UTC (rev 620) @@ -57,7 +57,7 @@ password = password hosts = localhost dbname = postfix -query = SELECT goto FROM alias,alias_domain WHERE alias_domain.alias_domain = '%d' and alias.address = CONCAT('%u', '@', alias_domain.target_domain) AND alias.active = 1 +query = SELECT goto FROM alias,alias_domain WHERE alias_domain.alias_domain = '%d' and alias.address = CONCAT('%u', '@', alias_domain.target_domain) AND alias.active = 1 AND alias_domain.active='1' (Note: PostgreSQL does not have a concat() function, instead use e.g. .... alias.address = '%u' || '@' || alias_domain.target_domain AND ....) @@ -67,7 +67,7 @@ password = password hosts = localhost dbname = postfix -query = SELECT goto FROM alias,alias_domain WHERE alias_domain.alias_domain = '%d' and alias.address = CONCAT('@', alias_domain.target_domain) AND alias.active = 1 +query = SELECT goto FROM alias,alias_domain WHERE alias_domain.alias_domain = '%d' and alias.address = CONCAT('@', alias_domain.target_domain) AND alias.active = 1 AND alias_domain.active='1' (See above note re Concat + PostgreSQL) @@ -87,18 +87,17 @@ password = password hosts = localhost dbname = postfix -query = SELECT CONCAT(domain,'/',maildir) FROM mailbox WHERE username='%s' AND active = '1' +query = SELECT maildir FROM mailbox WHERE username='%s' AND active = '1' #expansion_limit = 100 -(See above note re Concat + PostgreSQL) - mysql_virtual_alias_domain_mailbox_maps.cf: user = postfix password = password hosts = localhost dbname = postfix -query = SELECT CONCAT(domain,'/',maildir) FROM mailbox,alias_domain WHERE alias_domain.alias_domain = '%d' and mailbox.username = CONCAT('%u', '@', alias_domain.target_domain) AND mailbox.active = 1 +query = SELECT maildir FROM mailbox,alias_domain WHERE alias_domain.alias_domain = '%d' and mailbox.username = CONCAT('%u', '@', alias_domain.target_domain) AND mailbox.active = 1 AND alias_domain.active='1' + (See above note re Concat + PostgreSQL) # For quota support This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Gin...@us...> - 2009-11-03 19:40:02
|
Revision: 754 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=754&view=rev Author: GingerDog Date: 2009-11-03 19:39:47 +0000 (Tue, 03 Nov 2009) Log Message: ----------- POSTFIX_CONF.txt: typo fix Modified Paths: -------------- trunk/DOCUMENTS/POSTFIX_CONF.txt Modified: trunk/DOCUMENTS/POSTFIX_CONF.txt =================================================================== --- trunk/DOCUMENTS/POSTFIX_CONF.txt 2009-11-03 12:28:50 UTC (rev 753) +++ trunk/DOCUMENTS/POSTFIX_CONF.txt 2009-11-03 19:39:47 UTC (rev 754) @@ -40,7 +40,7 @@ Contents of the files These are examples only, you will likely have to and want to make some -cumtomizations. You will also want to consider the config.inc.php +customizations. You will also want to consider the config.inc.php settings for domain_path and domain_in_mailbox. These examples use values of domain_path=YES and domain_in_mailbox=NO This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2010-09-11 22:44:57
|
Revision: 863 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=863&view=rev Author: christian_boltz Date: 2010-09-11 22:44:49 +0000 (Sat, 11 Sep 2010) Log Message: ----------- POSTFIX_CONF.TXT: - experimental idea: executable documentation ;-) You can now run sh POSTFIX_CONF.TXT to generate the mysql_*.cf maps for postfix - change path for virtual_mailbox_limit_maps to /etc/postfix/sql/ (it was the only file that was documented to live in /etc/postfix) Modified Paths: -------------- trunk/DOCUMENTS/POSTFIX_CONF.txt Modified: trunk/DOCUMENTS/POSTFIX_CONF.txt =================================================================== --- trunk/DOCUMENTS/POSTFIX_CONF.txt 2010-09-11 21:48:26 UTC (rev 862) +++ trunk/DOCUMENTS/POSTFIX_CONF.txt 2010-09-11 22:44:49 UTC (rev 863) @@ -1,3 +1,5 @@ +#!/bin/bash +content=" Postfix configuration for use with PostfixAdmin @@ -21,10 +23,9 @@ # Additional for quota support virtual_create_maildirsize = yes virtual_mailbox_extended = yes -virtual_mailbox_limit_maps = mysql:/etc/postfix/mysql_virtual_mailbox_limit_maps.cf +virtual_mailbox_limit_maps = mysql:/etc/postfix/sql/mysql_virtual_mailbox_limit_maps.cf virtual_mailbox_limit_override = yes -virtual_maildir_limit_message = Sorry, the user's maildir has overdrawn his -diskspace quota, please try again later. +virtual_maildir_limit_message = Sorry, the user's maildir has overdrawn his diskspace quota, please try again later. virtual_overquota_bounce = yes Where you chose to store the .cf files doesn't really matter, but they will @@ -44,6 +45,11 @@ settings for domain_path and domain_in_mailbox. These examples use values of domain_path=YES and domain_in_mailbox=NO +You can create these files (with your values for user, password, hosts and +dbname) automatically by executing this file (sh POSTFIX_CONF.txt). +Please note that the generated files are for use with MySQL. For PostgreSQL, +you'll have to replace the CONCAT as described below. + mysql_virtual_alias_maps.cf: user = postfix password = password @@ -116,4 +122,47 @@ http://postfix.wiki.xs4all.nl/index.php?title=Virtual_Users_and_Domains_with_Courier-IMAP_and_MySQL http://wiki.dovecot.org/HowTo/DovecotLDAPostfixAdminMySQL +" # end content +# generate config files out of this file +# to do this, run sh POSTFIX_CONF.txt + +POSTFIX_CONF="$0" + +map_files="`sed -n '/^mysql.*cf:/ s/://p' < \"$0\"`" + +tmpdir="`mktemp -d /tmp/postfixadmin-XXXXXX`" || { echo "Error: could not create tempdir" >&2 ; exit 1; } +echo $tmpdir + +echo 'Database host? (often localhost)' +read hosts +test -z "$hosts" && hosts=localhost + +echo 'Database name?' +read dbname +test -z "$dbname" && { echo "Error: you did not enter a database name" >&2 ; exit 1; } + +echo Database user? +read user +test -z "$user" && { echo "Error: you did not enter a database username" >&2 ; exit 1; } + +echo Database password? +read password +test -z "$password" && { echo "Error: you did not enter a database password" >&2 ; exit 1; } + +for file in $map_files ; do + ( + echo "# $file" + sed -n "/$file:/,/^$/ p" < "$POSTFIX_CONF" | sed " + 1d ; # filename + s/^user =.*/user = $user/ ; + s/^password =.*/password = $password/ ; + s/^hosts =.*/hosts = $hosts/ ; + s/^dbname =.*/dbname = $dbname/ ; + " + ) > "$tmpdir/$file" +done + +echo "Config files have been written to $tmpdir. Please check their content and move them to /etc/postfix/sql/." +echo "Do not forget to edit /etc/postfix/main.cf as described in $POSTFIX_CONF." + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2010-10-15 23:59:45
|
Revision: 876 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=876&view=rev Author: christian_boltz Date: 2010-10-15 23:59:39 +0000 (Fri, 15 Oct 2010) Log Message: ----------- POSTFIX_CONF.TXT: - fixed filename for quota Modified Paths: -------------- trunk/DOCUMENTS/POSTFIX_CONF.txt Modified: trunk/DOCUMENTS/POSTFIX_CONF.txt =================================================================== --- trunk/DOCUMENTS/POSTFIX_CONF.txt 2010-10-13 23:51:12 UTC (rev 875) +++ trunk/DOCUMENTS/POSTFIX_CONF.txt 2010-10-15 23:59:39 UTC (rev 876) @@ -108,7 +108,7 @@ # For quota support -mysql-virtual-mailbox-limit-maps.cf: +mysql_virtual_mailbox_limit_maps.cf: user = postfix password = password hosts = localhost This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2013-02-19 12:47:55
|
Revision: 1429 http://sourceforge.net/p/postfixadmin/code/1429 Author: christian_boltz Date: 2013-02-19 12:47:52 +0000 (Tue, 19 Feb 2013) Log Message: ----------- POSTFIX_CONF.txt: - add note about virtual_mailbox_base Modified Paths: -------------- trunk/DOCUMENTS/POSTFIX_CONF.txt Modified: trunk/DOCUMENTS/POSTFIX_CONF.txt =================================================================== --- trunk/DOCUMENTS/POSTFIX_CONF.txt 2013-02-16 20:42:17 UTC (rev 1428) +++ trunk/DOCUMENTS/POSTFIX_CONF.txt 2013-02-19 12:47:52 UTC (rev 1429) @@ -20,6 +20,10 @@ proxy:mysql:/etc/postfix/sql/mysql_virtual_mailbox_maps.cf, proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_domain_mailbox_maps.cf +# if you let postfix store your mails directly (without using maildrop, dovecot deliver etc.) +virtual_mailbox_base = /var/mail/vmail +# or whereever you want to store the mails + # Additional for quota support virtual_create_maildirsize = yes virtual_mailbox_extended = yes This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2014-07-22 20:36:32
|
Revision: 1682 http://sourceforge.net/p/postfixadmin/code/1682 Author: christian_boltz Date: 2014-07-22 20:36:22 +0000 (Tue, 22 Jul 2014) Log Message: ----------- POSTFIX_CONF.txt: - add note that active=1 needs to be changed to active='t' when using PostgreSQL https://sourceforge.net/p/postfixadmin/discussion/676076/thread/016fe62e/ - move around note about concat() vs. PostgreSQL Modified Paths: -------------- trunk/DOCUMENTS/POSTFIX_CONF.txt Modified: trunk/DOCUMENTS/POSTFIX_CONF.txt =================================================================== --- trunk/DOCUMENTS/POSTFIX_CONF.txt 2014-06-21 19:54:24 UTC (rev 1681) +++ trunk/DOCUMENTS/POSTFIX_CONF.txt 2014-07-22 20:36:22 UTC (rev 1682) @@ -51,9 +51,15 @@ You can create these files (with your values for user, password, hosts and dbname) automatically by executing this file (sh POSTFIX_CONF.txt). -Please note that the generated files are for use with MySQL. For PostgreSQL, -you'll have to replace the CONCAT as described below. +Please note that the generated files are for use with MySQL. +If you are using PostgreSQL, you'll need to do some changes to the queries: +- PostgreSQL uses a different implementation for boolean values, which means + you'll need to change active='1' to active='t' in all queries +- PostgreSQL does not have a concat() function, instead use e.g. + .... alias.address = '%u' || '@' || alias_domain.target_domain AND .... + + mysql_virtual_alias_maps.cf: user = postfix password = password @@ -69,8 +75,6 @@ dbname = postfix query = SELECT goto FROM alias,alias_domain WHERE alias_domain.alias_domain = '%d' and alias.address = CONCAT('%u', '@', alias_domain.target_domain) AND alias.active = 1 AND alias_domain.active='1' -(Note: PostgreSQL does not have a concat() function, instead use e.g. .... alias.address = '%u' || '@' || alias_domain.target_domain AND ....) - mysql_virtual_alias_domain_catchall_maps.cf: # handles catch-all settings of target-domain user = postfix This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |