roundcube howto
$rcmail_config['db_dsnw'] = 'mysql://roundcube:somepassword@localhost/roundcube';
$rcmail_config['virtuser_file'] = '/etc/postfix/virtual';
$rcmail_config['default_host'] = 'localhost';
logs ve tmp idiznlerinin haklarını ayarla tmp yi777 filan yap eklentiler gitsin
posta:/var/www/roundcubemail-0.2.1/SQL# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 119
Server version: 5.0.51a-24+lenny1 (Debian)
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> create database roundcube
-> ;
Query OK, 1 row affected (0.02 sec)
mysql> GRANT ALL ON roundcube.* TO roundcube@localhost IDENTIFIED BY "somepassword"
-> ;
Query OK, 0 rows affected (0.07 sec)
mysql> GRANT ALL ON roundcube.* TO roundcube IDENTIFIED BY "somepassword";
Query OK, 0 rows affected (0.00 sec)
mysql> Bye
posta:/var/www/roundcubemail-0.2.1/SQL# mysql roundcube < mysql.initial.sql
postgresql deki eposta adres ve hesap isimlerini csv formatında alıyoruz
o export PostgreSQL data to csv file using psql interactive terminal.
open terminal
su postgres
psql
\f ','
\a
\t
\o outputfile.csv
select ..... (your sql select statement)
\o
\q
Additional notes: If you want a TAB delimited file instead of comma, use \f 'Ctrl-V TAB'. \f sets the field separator. \a echo all. \t tuples(rows) only. \q quit.
http://www.randrinc.com/jforum/posts/list/13.page
adres ihtiva etmeyen satırları ayıklıyoruz.
grep @ outputfile.csv > outputfile1.csv
mysqldeki virtuser tablosuna atıyoruz.
log:/# mysqlshow -u user -p roundcubemail virtuser
log:/# mysqlshow -u user -p roundcubemail virtuser
Enter password:
Database: roundcubemail Table: virtuser
+-------+------------------+-----------------+------+-----+---------+----------------+---------------------------------+---------+
| Field | Type | Collation | Null | Key | Default | Extra | Privileges | Comment |
+-------+------------------+-----------------+------+-----+---------+----------------+---------------------------------+---------+
| id | int(10) unsigned | | NO | PRI | | auto_increment | select,insert,update,references | |
| adres | varchar(128) | utf8_general_ci | NO | | | | select,insert,update,references | |
| ad | varchar(128) | utf8_general_ci | NO | | | | select,insert,update,references | |
+-------+------------------+-----------------+------+-----+---------+----------------+---------------------------------+---------+
log:/#
log:/# mysql -u user -p roundcubemail
mysql> truncate table virtuser;
mysql> load data LOCAL infile 'outputfile1.csv' into table virtuser fields terminated by ',' lines terminated by '\n'(adres,ad);
mysql> select * from virtuser;
roundcube ın mysql başka sunucudaysa;
$rcmail_config['db_dsnw'] = 'mysql://user:12345678@10.0.100.252/roundcubemail';
// Query to resolve user names and e-mail addresses from the database
// %u will be replaced with the current username for login.
// The query should select the user's e-mail address as first col
$rcmail_config['virtuser_query'] = 'select adres from virtuser where ad = "%u" ';
roundcube hizmetine veritabanındaki adresleri ve hesapları sunmuş olduk bu query ile
cyrusimap için
// add this user-agent to message headers when sending
$rcmail_config['useragent'] = 'Hehe Webmail/0.1';
// use this name to compose page titles
$rcmail_config['product_name'] = 'TEKB Webmail';
// only list folders within this path
$rcmail_config['imap_root'] = 'ileti';
// store draft message is this mailbox
// leave blank if draft messages should not be stored
$rcmail_config['drafts_mbox'] = 'Drafts';
// store spam messages in this mailbox
$rcmail_config['junk_mbox'] = 'Junk';
// store sent message is this mailbox
// leave blank if sent messages should not be stored
$rcmail_config['sent_mbox'] = '';
// move messages to this folder when deleting them
// leave blank if they should be deleted directly
$rcmail_config['trash_mbox'] = '';
// display these folders separately in the mailbox list.
// these folders will also be displayed with localized names
$rcmail_config['default_imap_folders'] = array('INBOX', 'Drafts', 'Sent', 'Junk', 'Trash');
//$rcmail_config['default_imap_folders'] = array('INBOX', 'Drafts', 'Sent', 'Trash');
uygulama
[root@posta root]# psql -U mail -W -h 127.0.0.1 mail
Password:
mail=# \f ','
Field separator is ','.
mail=# \a
Output format is unaligned.
mail=# \t
Showing only tuples.
mail=# \o outooo.csv
mail=# select alias, username from virtual;
mail=# \o
mail=# \q
[root@posta root]# grep @ outooo.csv > outooo1.csv
csv ve sql dosyası / de olacak şekilde
log#cd /
log#mysql -u user -p roundcubemail
mysql> drop table cache;drop table contacts; drop table identities;drop table messages;drop table session;drop table users;truncate table virtuser; load data LOCAL infile 'outooo1.csv' into table virtuser fields terminated by ',' lines terminated by '\n'(adres,ad);
log:/# mysql -u user -p roundcubemail < mysql.initial.sql
insert into virtuser (adres,ad) values ('meltem.bayazit@teb.org.tr', 'meltem.bayazit');
No comments:
Post a Comment