Re: Routing solution on mail servers with all domain pointing at the same externel IP
Stephen Liu <[email protected]>
| Newsgroups | gmane.mail.perdition.user |
|---|---|
| Message-ID | <[email protected]> |
Hi Gustavo,
> The URL I sent you has information about using mysql as lookup
> library:
> http://www.vergenet.net/linux/perdition/perditiondb.5.shtml
I suppose you're referring to following section;
MYSQL
This map library can be used by specifying the full path to the library
using the -M|--map_library command line option or configuration file
option.
E.g.
perdition -M /usr/lib/libperditiondb_mysql.so.0
......
I'll start from there.
I suppose the name of this database is "dbPerdition" to be created on
MySQL
mysql> create database dbPerdition;
mysql> GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP
-> ON dbPerdition.* TO 'perdition' IDENTIFIED by 'perdition';
the 1st "perdition" on above second line is "database user". The 2nd
"perdition" is "database password".
mysql> CREATE TABLE `tblPerdition` (
-> `user` varchar(128), null '' default '',
-> `servername` varchar(255) null '' default '',
-> `port` varchar(8) YES NULL,
-> PRIMARY KEY (`user`),
-> ) ;
Afterwards I'll edit data on 'tblPerdition" table.
> The table you've shown doesn't have information about the
> hostnames/localIPs. Where is it? In the transport table?
Yes.
mysql> SELECT * from transport;
+------+----------------------+--------------------+-----------+---------+
| pkid | domain | hostname | transport |
enabled |
+------+----------------------+--------------------+-----------+---------+
| 1 | satimis.dnsalias.com | smtp:192.168.0.209 | :[] |
1 |
| 2 | satimis.changeip.net | smtp:192.168.0.208 | :[] |
1 |
| 3 | satimis.com | smtp:192.168.0.210 | :[] |
1 |
+------+----------------------+--------------------+-----------+---------+
3 rows in set (0.00 sec)
# cat /etc/postfix/mysql_transport_maps.cf
user=mail
password=mypassword
dbname=maildb
table=transport
select_field=hostname
where_field=domain
hosts=127.0.0.1
additional_conditions = and enabled = 1
* end *
> I've never used mysql to do it, so I don't know the details and how
> flexible it is. Maybe you'll need to create a view in your database
> for the perdition lookup with the domain as key and the localIP as
> value.
>
> Unfortunately I don't have any example. But the two URLs I sent you
> have all information you need. In particular, look at --query_key
> option and mysql database access library.
Whether you meant "--query_key FORMAT[,FORMAT...]:" on;
http://www.vergenet.net/linux/perdition/perdition.8.shtml
Thanks
B.R.
Stephen L
Send instant messages to your online friends http://uk.messenger.yahoo.com
______________________________________________
Perdition-users mailing list
[email protected]
http://lists.vergenet.net/listinfo/perdition-users