The following issue has been ACKNOWLEDGED. 
====================================================================== 
http://www.dbmail.org/mantis/view.php?id=542 
====================================================================== 
Reported By:                lkneschke
Assigned To:                paul
====================================================================== 
Project:                    DBMail
Issue ID:                   542
Category:                   installation scripts
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     acknowledged
target:                      
====================================================================== 
Date Submitted:             19-Mar-07 08:00 CET
Last Modified:              19-Mar-07 09:06 CET
====================================================================== 
Summary:                    postinst script for dbmail-mysql
Description: 
This patch modifies the dbmail.conf as needed, when the dbmail-mysql
package got installed. 
[EMAIL PROTECTED]:~/src/dbmail-2.2/debian# svn diff dbmail-mysql.postinst
Index: dbmail-mysql.postinst
===================================================================
--- dbmail-mysql.postinst       (revision 2472)
+++ dbmail-mysql.postinst       (working copy)
@@ -32,6 +32,45 @@
     upgrade)
     ;;
     configure)
+
+       . /usr/share/debconf/confmodule
+       db_get dbmail/do_debconf || true; DO_DEBCONF=$RET
+
+       if [ "$DO_DEBCONF" = "true" ]; then
+               # fetch debconf values
+               db_get dbmail/dbmail/host || true; DB_HOST=$RET
+               db_get dbmail/dbmail/db || true; DB_DATABASE=$RET
+               db_get dbmail/dbmail/user || true; DB_USER=$RET
+               db_get dbmail/dbmail/pass || true; DB_PASS=$RET
+
+               if [ -z "$DB_PASS" ]; then
+                       if [ -x /usr/bin/pwgen ]; then
+                               DB_PASS=`pwgen -n`
+                               db_set dbmail/dbmail/pass "$DB_PASS"
+                       fi
+               fi
+       fi
+
+       # protect the config-file
+       oldmask=`umask`
+       umask 026
+
+       if [ "$DO_DEBCONF" = "true" ] && [ -e "$CONFIG" ]; then
+               # edit the configs
+               sed -i -e "s,\(^host\W*=\)\(.*\$\),\1 $DB_HOST,i" \
+                       -e "s,\(^user\W*=\)\(.*\$\),\1 $DB_USER,i" \
+                       -e "s/\(^pass\W*=\)\(.*\$\)/\1 $DB_PASS/i" \
+                       -e "s,\(^db\W*=\)\(.*\$\),\1 $DB_DATABASE,i" \
+                       -e "s,\(^driver\W*=\)\(.*\$\),\1 mysql,i" \
+                        $CONFIG
+
+               umask $oldmask
+
+       fi
+
+       db_stop
+       chmod 0600 $CONFIG
+
     ;;
     abort-upgrade)
     ;;


====================================================================== 

---------------------------------------------------------------------- 
 paul - 19-Mar-07 09:06  
---------------------------------------------------------------------- 
Lars,

This won't roll. The postinst files for postgres and mysql should never
touch the dbmail.conf file. That was a delibirate decision. It is
perfectly valid to install dbmail-pgsql on a running dbmail-mysql or
dbmail-sqlite system and vice versa. You don't want a silent change of the
production backend under those circumstances. 
 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
19-Mar-07 08:00 lkneschke      New Issue                                    
19-Mar-07 09:06 paul           Note Added: 0001921                          
19-Mar-07 09:06 paul           Assigned To               => paul            
19-Mar-07 09:06 paul           Status                   new => acknowledged 
19-Mar-07 09:06 paul           Resolution               open => won't fix   
======================================================================

_______________________________________________
Dbmail-dev mailing list
Dbmail-dev@dbmail.org
http://twister.fastxs.net/mailman/listinfo/dbmail-dev

Reply via email to