[Postfix espanol] postfix + Mysql

Wcom christian_conejero en ciudad.com.ar
Mie Mayo 8 21:52:10 CEST 2002


mysql> use mail;
ERROR 1049: Unknown database 'mail'
mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> select * from user;
+-----------+------------------+------------------+-------------+-----------
--+-------------+-------------+-------------+-----------+-------------+-----
----------+--------------+-----------+------------+-----------------+-------
-----+------------+
| Host      | User             | Password         | Select_priv |
Insert_priv | Update_priv | Delete_priv | Create_priv | Drop_priv |
Reload_priv | Shutdown_priv | Process_priv | File_priv | Grant_priv |
References_priv | Index_priv | Alter_priv |
+-----------+------------------+------------------+-------------+-----------
--+-------------+-------------+-------------+-----------+-------------+-----
----------+--------------+-----------+------------+-----------------+-------
-----+------------+
| localhost | root             |                  | Y           | Y
| Y           | Y           | Y           | Y         | Y           | Y
| Y            | Y         | Y          | Y               | Y          | Y
|
| ns1       | root             |                  | Y           | Y
| Y           | Y           | Y           | Y         | Y           | Y
| Y            | Y         | Y          | Y               | Y          | Y
|
| localhost |                  |                  | N           | N
| N           | N           | N           | N         | N           | N
| N            | N         | N          | N               | N          | N
|
| ns1       |                  |                  | N           | N
| N           | N           | N           | N         | N           | N
| N            | N         | N          | N               | N          | N
|
| localhost | debian-sys-maint | 7ac33e31399b76c5 | N           | N
| N           | N           | N           | N         | Y           | Y
| N            | N         | N          | N               | N          | N
|
+-----------+------------------+------------------+-------------+-----------
--+-------------+-------------+-------------+-----------+-------------+-----
----------+--------------+-----------+------------+-----------------+-------
-----+------------+
5 rows in set (0.09 sec)

mysql> insert into user set Host='ns1', User='postfix', Password='postfix';
Query OK, 1 row affected (0.02 sec)

mysql> create database mail;
Query OK, 1 row affected (0.01 sec)

mysql> show databases;
+----------+
| Database |
+----------+
| mail     |
| mysql    |
| postaci  |
| test     |
+----------+
4 rows in set (0.01 sec)

mysql> use mail;
Database changed
mysql> create table passwd(
    -> id char(128)DEFAULT '' NOT NULL,
    -> clear char(128)DEFAULT '' NOT NULL,
    -> name char(128)DEFAULT '' NOT NULL,
    -> uid int(10) unsigned NOT NULL,
    -> gid int(10) unsigned NOT NULL,
    -> home char(255)DEFAULT '' NOT NULL,
    -> maildir char(255)DEFAULT '' NOT NULL,
    -> KEY id (id(128))
    -> );
Query OK, 0 rows affected (0.01 sec)
mysql> describe passwd;
+---------+------------------+------+-----+---------+-------+
| Field   | Type             | Null | Key | Default | Extra |
+---------+------------------+------+-----+---------+-------+
| id      | char(128)        |      | MUL |         |       |
| clear   | char(128)        |      |     |         |       |
| name    | char(128)        |      |     |         |       |
| uid     | int(10) unsigned |      |     | 0       |       |
| gid     | int(10) unsigned |      |     | 0       |       |
| home    | char(255)        |      |     |         |       |
| maildir | char(255)        |      |     |         |       |
+---------+------------------+------+-----+---------+-------+
7 rows in set (0.01 sec)

mysql> grant all on mail.passwd postfix en ns1 identified by "postfix";
ERROR 1064: You have an error in your SQL syntax near 'postfix en ns1
identified by "postfix"' at line 1

Esto es lo que me pedis, te paso los archivos para que mires por las dudas

Archivo gid.cf

#Usuario y password para acceder al servidor MySQL
user = postfix
password = postfix
#Nombre de la Base de Datos y la tabla
dbname = mail
table = passwd
#El campo que elegimos es gid
select_field = gid
where_field = id
#El host que tiene el MySQL
hosts = ns1

ids.cf

#Usuario y password para acceder al servidor MySQL
user = postfix
password = postfix
#Nombre de la Base de Datos y la tabla
dbname = mail
table = passwd
#El campo que elegimos es uid
select_field = uid
where_field = id
#El host que tiene el MySQL
hosts = ns1

mysql_virt.cf

#Usuario y password para acceder al servidor MySQL
user = postfix
password = postfix
#Nombre de la Base de Datos y la tabla
dbname = mail
table = passwd
#El campo que elegimos es maildir (lugar donde está el buzón), donde el id
del usuario coincida con el destinatario del mensaje
select_field = maildir
where_field = id
#El host que tiene el MySQL
hosts = ns1

Main.cf

#virtual_mailbox_base = /
#virtual_uid_maps = mysql:/etc/postfix/ids.cf
#virtual_gid_maps = mysql:/etc/postfix/gids.cf
#virtual_mailbox_maps = mysql:/etc/postfix/mysql_virt.cf
#local_transport = virtual

esta con # por que como me da error el mysql no quiero que arranque con el
postfix, como el servidor funciona para unos cuantos usuarios y dominios, si
no me suena el telefono y es un infierno.

saludos y muchas gracias, si me falta algo decimelo.

----- Original Message -----
From: "Alberto" <aalberto en euskalnet.net>
To: "espapost español" <postfix-espanol en WL0.org>
Sent: Wednesday, May 08, 2002 5:36 PM
Subject: RE: [Postfix espanol] postfix + Mysql


> pega aqui el contenido de la tabla user de la base de datos mysql.
>
> en otro orden de cosas, recordarte que en este baile son 3 los que bailan,
y
> no hemos mencionado el IMAP Server (Courier en el caso del Howto aquel).
>
> saludos,
>
>
> ----- Mensaje original -----
> De: "Wcom" <christian_conejero en ciudad.com.ar>
> Para: "espapost español" <postfix-espanol en WL0.org>
> Enviado: martes, 07 de mayo de 2002 21:21
> Asunto: Fw: [Postfix espanol] postfix + Mysql
>
>
> > Alberto me hace lo mismo el error me pasa aca en el mysql, mire los
> archivos
> > y estan puesto como me pasaste en el mail, tenes idea cual puede ser el
> > error, primero quiero hacer que funcione con un dominio y despues veo el
> > tema de local o virtual.
> >
> > Saludos
> >
> > ns1:~# mysql -h localhost -u root -p
> > Enter password:
> > Welcome to the MySQL monitor.  Commands end with ; or \g.
> > Your MySQL connection id is 18 to server version: 3.23.47-log
> >
> > Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
> >
> > mysql> use mysql;
> > Reading table information for completion of table and column names
> > You can turn off this feature to get a quicker startup with -A
> >
> > Database changed
> > mysql> insert into user set Host='ns1', User='postfix',
> Password='postfix';
> > Query OK, 1 row affected (0.01 sec)
> >
> > mysql> create database mail;
> > Query OK, 1 row affected (0.01 sec)
> >
> > mysql> show databases;
> > +----------+
> > | Database |
> > +----------+
> > | mail     |
> > | mysql    |
> > | postaci  |
> > | test     |
> > +----------+
> > 4 rows in set (0.00 sec)
> >
> > mysql> use mail;
> > Database changed
> > mysql> create table passwd(
> >     -> id char(128)DEFAULT '' NOT NULL,
> >     -> clear char(128)DEFAULT '' NOT NULL,
> >     -> name char(128)DEFAULT '' NOT NULL,
> >     -> uid int(10) unsigned NOT NULL,
> >     -> gid int(10) unsigned NOT NULL,
> >     -> home char(255)DEFAULT '' NOT NULL,
> >     -> maildir char(255)DEFAULT '' NOT NULL,
> >     -> KEY id (id(128))
> >     -> );
> > Query OK, 0 rows affected (0.01 sec)
> > mysql> grant all on mail.passwd postfix en ns1 identified by "postfix";
> > ERROR 1064: You have an error in your SQL syntax near 'postfix en ns1
> > identified by "postfix"' at line 1
> >
> >
> >
> > -
> > Para quitarte de la lista enviar la linea "unsubscribe postfix-espanol"
en
> > el cuerpo de un mensaje a majordomo en WL0.org
> >
> >
>
> -
> Para quitarte de la lista enviar la linea "unsubscribe postfix-espanol" en
> el cuerpo de un mensaje a majordomo en WL0.org
>


-
Para quitarte de la lista enviar la linea "unsubscribe postfix-espanol" en
el cuerpo de un mensaje a majordomo en WL0.org



Más información sobre la lista de distribución Postfix-es