#1  
Old 14th June 2007, 14:44
satimis satimis is offline
Senior Member
 
Join Date: Oct 2006
Posts: 533
Thanks: 4
Thanked 2 Times in 2 Posts
Default About creating database

Hi folks,


OpenBSD 4.0 x86_64
Postfix-2.4.3
Mysql
($ mysql --version
mysql Ver 14.12 Distrib 5.0.24a, for unknown-openbsd4.0 (x86_64) using readline 4.3)


According to;

http://www.postfixvirtual.net/postfixconf.html#postfix

I issued following SQL commands to create a database named "mail" and a user "vmailuser" with password "password123"

$ mysql -u root -p
Enter password:
Code:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 7 to server version: 5.0.24a-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> CREATE DATABASE mail;
Query OK, 1 row affected (0.03 sec)

mysql> GRANT all privileges on mail.* TO vmailuser@localhost IDENTIFIED BY 'pass
word123' ;
Query OK, 0 rows affected (0.03 sec)

mysql> GRANT all privileges on mail.* TO vmailuser@127.0.0.1 IDENTIFIED BY 'pass
word123' ;
Query OK, 0 rows affected (0.00 sec)

mysql> use mail;
Database changed
mysql> show tables;
Empty set (0.03 sec)

mysql> \q
Bye
No complaint indicated.


Coming to "Create SQL FILE", on which directory shall I create the file "postfix_virtual.sql" so that it can be evoked on running;

# mysql -u root -p < postfix_virtual.sql

What shall be its owner and permission ???

I'll copy the script there on the file. UID and GIU are 2007. Shall I add "use mail" as the first line of the scrip

Please advise. TIA

What other attention I have to pay ???


B.R.
satimis
Reply With Quote
Sponsored Links
  #2  
Old 15th June 2007, 15:22
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,748 Times in 2,579 Posts
Default

Quote:
Originally Posted by satimis
Coming to "Create SQL FILE", on which directory shall I create the file "postfix_virtual.sql" so that it can be evoked on running;

# mysql -u root -p < postfix_virtual.sql
The file postfix_virtual.sql must already exist, and you must run the above command in the directory where postfix_virtual.sql is.

Quote:
Originally Posted by satimis
What shall be its owner and permission ???
Doesn't matter, but the file must be readable.

Quote:
Originally Posted by satimis
Shall I add "use mail" as the first line of the scrip
Depends on what is in the postfix_virtual.sql file. If it begins with
Code:
use mail;
, then you don't have to type it in; otherwise you must type it in.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 15th June 2007, 16:17
satimis satimis is offline
Senior Member
 
Join Date: Oct 2006
Posts: 533
Thanks: 4
Thanked 2 Times in 2 Posts
Default

Quote:
Originally Posted by falko
The file postfix_virtual.sql must already exist, and you must run the above command in the directory where postfix_virtual.sql is.

Doesn't matter, but the file must be readable.

Depends on what is in the postfix_virtual.sql file. If it begins with
Code:
use mail;
, then you don't have to type it in; otherwise you must type it in.
Hi falko,


Your advice noted with tks.


Performed following steps, copying the complete script on mysql shell with uid/gid=2007;

$ mysql -u root -p
Enter Password
Code:
mysql> use mail;
mysql> CREATE TABLE postfix_alias (
    ->   id int(11) unsigned NOT NULL auto_increment,
    ->   alias varchar(128) NOT NULL default '',
    ->   destination varchar(128) NOT NULL default '',
    ->   PRIMARY KEY (id)
    -> ) TYPE=MyISAM;
Query OK, 0 rows affected, 1 warning (0.05 sec)

mysql> CREATE TABLE postfix_relocated (
    ->   id int(11) unsigned NOT NULL auto_increment,
    ->   email varchar(128) NOT NULL default '',
    ->   destination varchar(128) NOT NULL default '',
    ->   PRIMARY KEY (id)
    -> ) TYPE=MyISAM;
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> CREATE TABLE postfix_transport (
    ->   id int(11) unsigned NOT NULL auto_increment,
    ->   domain varchar(128) NOT NULL default '',
    ->   destination varchar(128) NOT NULL default '',
    ->   PRIMARY KEY (id),
    ->   UNIQUE KEY domain (domain)
    -> ) TYPE=MyISAM;
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> CREATE TABLE postfix_virtual_domains (
    ->   id int(11) unsigned NOT NULL auto_increment,
    ->   domain varchar(128) NOT NULL default '',
    ->   destination varchar(128) NOT NULL default '',
    ->   PRIMARY KEY (id),
    ->   UNIQUE KEY domain (domain)
    -> ) TYPE=MyISAM;
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> CREATE TABLE postfix_users (
    ->   id int(11) unsigned NOT NULL auto_increment,
    ->   email varchar(128) NOT NULL default '',
    ->   clear varchar(128) NOT NULL default '',
    ->   crypt varchar(128) NOT NULL default '',
    ->   name tinytext NOT NULL,
    ->   uid int(11) unsigned NOT NULL default '2007',
    ->   gid int(11) unsigned NOT NULL default '2007',
    ->   homedir tinytext NOT NULL,
    ->   maildir tinytext NOT NULL,
    ->   quota tinytext NOT NULL,
    ->   access enum('Y','N') NOT NULL default 'Y',
    ->   postfix enum('Y','N') NOT NULL default 'Y',
    -> disablepop3 char(1) NOT NULL default '0',
    -> disableimap char(1) NOT NULL default '0',
    -> disablewebmail char(1) NOT NULL default '0',
    -> sharedgroup varchar(128) NOT NULL default '0',
    ->   smtpaccess enum('Y','N') NOT NULL default 'Y',
    ->
    ->   PRIMARY KEY (id),
    ->   UNIQUE KEY email (email)
    -> ) TYPE=MyISAM;
Query OK, 0 rows affected, 1 warning (0.03 sec)

mysql> CREATE TABLE postfix_virtual (
    ->   id int(11) unsigned NOT NULL auto_increment,
    ->   email varchar(128) NOT NULL default '',
    ->   destination varchar(128) NOT NULL default '',
    ->   PRIMARY KEY (id)
    -> ) TYPE=MyISAM;
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql>  CREATE TABLE postfix_access (
    ->   id int(10) unsigned NOT NULL auto_increment,
    ->   source varchar(128) NOT NULL default '',
    ->   access varchar(128) NOT NULL default '',
    ->   type enum('recipient','sender','client') NOT NULL default
'recipient',
    ->   PRIMARY KEY (id)
    -> ) TYPE=MyISAM ;
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> \q
Bye
Tables created


$ mysql -u root -p
Enter password:
Code:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3 to server version: 5.0.24a-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> use mail;
Database changed
mysql> show tables;
+-------------------------+
| Tables_in_mail          |
+-------------------------+
| postfix_access          |
| postfix_alias           |
| postfix_relocated       |
| postfix_transport       |
| postfix_users           |
| postfix_virtual         |
| postfix_virtual_domains |
+-------------------------+
7 rows in set (0.00 sec)

mysql> \q
Bye

Tks


How to test the tables are functioning properly ???


B.R.
satimis
Reply With Quote
  #4  
Old 16th June 2007, 15:06
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,748 Times in 2,579 Posts
Default

Quote:
Originally Posted by satimis
How to test the tables are functioning properly ???
Create some email accounts and try to send from/to these email accounts.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #5  
Old 22nd June 2007, 17:34
satimis satimis is offline
Senior Member
 
Join Date: Oct 2006
Posts: 533
Thanks: 4
Thanked 2 Times in 2 Posts
 
Default

Quote:
Originally Posted by falko
Create some email accounts and try to send from/to these email accounts.
Hi falko


I have following account created

/var/mail/vmail/satimis.com/albert

Made following tests without result;

1) send mail from albert@satimis.com
$ telnet localhost 25
ehlo satimis.com
mail from: albert@satimis.com
etc.
..

The mail was queueing only not sent out. Whether I should run;
$ telnet albert@satimis.com 25
etc.
...
???


2) Send mail to albert@satimis.com from ISP website. The mail was rejected
Code:
----- The following addresses had permanent fatal errors -----
<albert@satimis.com>
(reason: 550 5.1.1 <albert@satimis.com>: Recipient address rejected: User
unknown in local recipient table)

----- Transcript of session follows -----
... while talking to smtp.satimis.com.:
>>> DATA
<<< 550 5.1.1 <albert@satimis.com>: Recipient address rejected: User unknown in
local recipient table
550 5.1.1 <albert@satimis.com>... User unknown
<<< 554 5.5.1 Error: no valid recipients
Pls shed me some light. Tks.


B.R.
satimis
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
sending e-mail using mail() function linuxuser1 HOWTO-Related Questions 38 21st April 2009 13:20
Mail System doesnt work! crichton Installation/Configuration 3 18th September 2007 00:49
Custom database names and usernames kcackler Feature Requests 5 18th March 2007 21:59
Recreating ISPConfig database retran Installation/Configuration 2 16th April 2006 00:22


All times are GMT +2. The time now is 10:46.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.