1. You are now connected to database "mail".
  2. mail=#
  3. mail=# -- virtual mailboxes
  4. mail=# CREATE TABLE mailbox (
  5. mail(# usernameVARCHAR(128) NOT NULL,
  6. mail(# domain
  7.  
  8. mail(# domainVARCHAR(128) NOT NULL,
  9. mail(# passwordCHAR(32) NOT NULL,
  10. mail(# quota
  11.  
  12. mail(# quotaINTEGER DEFAULT 1024 NOT NULL,
  13. mail(# active
  14.  
  15. mail(# activeBOOLEAN DEFAULT true NOT NULL,
  16. mail(# PRIMARY KEY (username, domain)
  17. mail(# );
  18. ERROR: syntax error at or near "("
  19. LINE 2: usernameVARCHAR(128) NOT NULL,
  20. ^
  21. mail=#
  22. mail=# -- virtual mailbox aliases
  23. mail=# CREATE TABLE mailbox_aliases (
  24. mail(# address
  25.  
  26. mail(# addressVARCHAR(256) PRIMARY KEY,
  27. mail(# dest_usernameVARCHAR(128) NOT NULL,
  28. mail(# dest_domainVARCHAR(128) NOT NULL,
  29. mail(# active
  30.  
  31. mail(# activeBOOLEAN DEFAULT true NOT NULL,
  32. mail(# FOREIGN KEY (dest_username, dest_domain) REFERENCES mailbox (username, domain) ON DELETE CASCADE
  33. mail(# );
  34. ERROR: syntax error at or near "("
  35. LINE 2: addressVARCHAR(256) PRIMARY KEY,
  36. ^
  37. mail=#
  38. mail=# -- relay domains
  39. mail=# CREATE TABLE mailbox_relay_domains (
  40. mail(# domain
  41.  
  42. mail(# domainVARCHAR(256) PRIMARY KEY,
  43. mail(# active
  44.  
  45. mail(# activeBOOLEAN DEFAULT true NOT NULL
  46. mail(# );
  47. ERROR: syntax error at or near "("
  48. LINE 2: domainVARCHAR(256) PRIMARY KEY,
  49. ^
  50. mail=#
  51. mail=#
  52. mail=#
  53. mail=# -- grant permissions
  54. mail=# GRANT SELECT ON mailbox TO dovecot;
  55. ERROR: relation "mailbox" does not exist
  56. mail=# GRANT SELECT ON mailbox,mailbox_aliases,mailbox_relay_domains TO postfix;
  57. ERROR: relation "mailbox" does not exist
  58. mail=#
  59. mail=# -- create virtual domain
  60. mail=# -- currently virtual domains doesn't work for me
  61. mail=# INSERT INTO domains_relay_domains VALUES ('tingletingle.de');
  62. ERROR: relation "domains_relay_domains" does not exist
  63. LINE 1: INSERT INTO domains_relay_domains VALUES ('tingletingle.de')...
  64. ^
  65. mail=#
  66. mail=# -- create user
  67. mail=# INSERT INTO mailbox VALUES ('test','tingletingle.de','MD5 Hash of password');
  68. ERROR: relation "mailbox" does not exist
  69. LINE 1: INSERT INTO mailbox VALUES ('test','tingletingle.de','MD5 Ha...
  70. ^
  71. mail=#
  72. mail=# -- create virtual aliases
  73. mail=# INSERT INTO mailbox_aliases VALUES ('postmaster@tingletingle.de', 'test', 'tingletingle.de');
  74. ERROR: relation "mailbox_aliases" does not exist
  75. LINE 1: INSERT INTO mailbox_aliases VALUES ('postmaster@tingletingle...
  76. ^
  77. mail=# INSERT INTO mailbox_aliases VALUES ('root@tingletingle.de', 'test', 'tingletingle.de');
  78. ERROR: relation "mailbox_aliases" does not exist
  79. LINE 1: INSERT INTO mailbox_aliases VALUES ('root@tingletingle.de', ...
  80. ^
  81. mail=# INSERT INTO mailbox_aliases VALUES ('example@tingletingle.de', 'test', 'tingletingle.de');
  82. ERROR: relation "mailbox_aliases" does not exist
  83. LINE 1: INSERT INTO mailbox_aliases VALUES ('example@tingletingle.de...
  84. ^
  85. mail=# INSERT INTO mailbox_aliases VALUES ('abuse@tingletingle.de', 'test', 'tingletingle.de');
  86. ERROR: relation "mailbox_aliases" does not exist
  87. LINE 1: INSERT INTO mailbox_aliases VALUES ('abuse@tingletingle.de',...
  88. ^
  89. mail=#
  90. mail=# -- create roundcube and database
  91. mail=# CREATE USER roundcube ENCRYPTED password 'RoundcubePassword';
  92. ERROR: role "roundcube" already exists
  93. mail=# CREATE DATABASE webmail WITH OWNER roundcube;
  94. ERROR: database "webmail" already exists
  95. mail=# \c - roundcube
  96. psql (8.4.17)
  97. You are now connected to database "mail" as user "roundcube".
  98. mail=>
  99. mail=> -- create tables etc for roundcube
  100. mail=> \i /usr/local/www/roundcube/SQL/postgres.initial.sql
  101. /usr/local/www/roundcube/SQL/postgres.initial.sql: No such file or directory
  102. mail=>
  103. mail=> -- exit psql
  104. mail=> \q