Fix SQL query clobbering in PostfixadminMv.
[mailshears.git] / lib / mv / plugins / postfixadmin.rb
index 223c716b082ae8d089973d5316234d07f003d3ee..5cc34e33c6f6134d7512581f639f8da59833639f 100644 (file)
@@ -22,12 +22,12 @@ class PostfixadminMv
                                        local_part=$3
                     WHERE username=$4;']
 
-    sql_queries = ['UPDATE alias SET address=$1,
+    sql_queries << 'UPDATE alias SET address=$1,
                                      domain=$2,
-                                     goto=REPLACE(goto, $4, $1);
-                    WHERE address=$4;']
+                                     goto=REPLACE(goto, $4, $1)
+                    WHERE address=$4;'
 
-    sql_queries = ['UPDATE alias SET goto=REPLACE(GOTO, $4, $1);']
+    sql_queries << 'UPDATE alias SET goto=REPLACE(GOTO, $4, $1);'
 
     begin
       connection = PGconn.connect(@db_host,
@@ -51,6 +51,7 @@ class PostfixadminMv
       # Pretend like we're database-agnostic in case we ever are.
       raise DatabaseError.new(e)
     end
+
   end