Make virtual_alias_maps function search catchall when no aliases are found v0.6.x
authormartin f. krafft <madduck@madduck.net>
Tue, 10 Apr 2012 00:33:53 +0200
branchv0.6.x
changeset 511 0244f1344b04
parent 510 1fa354bbdb90
child 512 821d3ffaaaca
Make virtual_alias_maps function search catchall when no aliases are found
pgsql/create_tables-dovecot-1.2.x.pgsql
pgsql/create_tables.pgsql
pgsql/update_tables_0.5.x-0.6-dovecot-1.2.x.pgsql
pgsql/update_tables_0.5.x-0.6.pgsql
--- a/pgsql/create_tables-dovecot-1.2.x.pgsql	Tue Apr 10 00:08:12 2012 +0200
+++ b/pgsql/create_tables-dovecot-1.2.x.pgsql	Tue Apr 10 00:33:53 2012 +0200
@@ -598,6 +598,15 @@
             LOOP
                 RETURN NEXT record;
             END LOOP;
+        IF NOT FOUND THEN
+            FOR record IN
+                SELECT recipient, destination
+                  FROM catchall
+                 WHERE gid = did
+                LOOP
+                    RETURN NEXT record;
+                END LOOP;
+        END IF;
         RETURN;
     END;
 $$ LANGUAGE plpgsql STABLE
--- a/pgsql/create_tables.pgsql	Tue Apr 10 00:08:12 2012 +0200
+++ b/pgsql/create_tables.pgsql	Tue Apr 10 00:33:53 2012 +0200
@@ -575,6 +575,15 @@
             LOOP
                 RETURN NEXT record;
             END LOOP;
+        IF NOT FOUND THEN
+            FOR record IN
+                SELECT recipient, destination
+                  FROM catchall
+                 WHERE gid = did
+                LOOP
+                    RETURN NEXT record;
+                END LOOP;
+        END IF;
         RETURN;
     END;
 $$ LANGUAGE plpgsql STABLE
--- a/pgsql/update_tables_0.5.x-0.6-dovecot-1.2.x.pgsql	Tue Apr 10 00:08:12 2012 +0200
+++ b/pgsql/update_tables_0.5.x-0.6-dovecot-1.2.x.pgsql	Tue Apr 10 00:33:53 2012 +0200
@@ -495,6 +495,15 @@
             LOOP
                 RETURN NEXT record;
             END LOOP;
+        IF NOT FOUND THEN
+            FOR record IN
+                SELECT recipient, destination
+                  FROM catchall
+                 WHERE gid = did
+                LOOP
+                    RETURN NEXT record;
+                END LOOP;
+        END IF;
         RETURN;
     END;
 $$ LANGUAGE plpgsql STABLE
--- a/pgsql/update_tables_0.5.x-0.6.pgsql	Tue Apr 10 00:08:12 2012 +0200
+++ b/pgsql/update_tables_0.5.x-0.6.pgsql	Tue Apr 10 00:33:53 2012 +0200
@@ -473,6 +473,15 @@
             LOOP
                 RETURN NEXT record;
             END LOOP;
+        IF NOT FOUND THEN
+            FOR record IN
+                SELECT recipient, destination
+                  FROM catchall
+                 WHERE gid = did
+                LOOP
+                    RETURN NEXT record;
+                END LOOP;
+        END IF;
         RETURN;
     END;
 $$ LANGUAGE plpgsql STABLE