[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Perdition-mysql-select based on port?



Hi folks,

does anybody happen to know if one can configure the MySQL select
statement Perdition uses to query the database as follows?

We'd like to include the port users connect to our perdtion proxy in the
select (110 or 143) so we can decide wether the login should be
forwarded to the real mail host based on per-user settings.
Our MySQL table has been updated to

+-------------+--------------+------+-----+---------+
| Field       | Type         | Null | Key | Default |
+-------------+--------------+------+-----+---------+
| user        | varchar(128) | NO   | PRI |         |
| servername  | varchar(255) | NO   |     |         |
| port        | varchar(8)   | YES  |     | NULL    |
| allow_pop3  | int(11)      | NO   |     | 0       |
| allow_imap  | int(11)      | NO   |     | 0       |
| allow_pop3s | int(11)      | NO   |     | 0       |
| allow_imaps | int(11)      | NO   |     | 0       |
+-------------+--------------+------+-----+---------+

The select statement we like to use is
SELECT servername,user,port FROM perdition WHERE user='<user>' AND (
allow_pop3=<port> or allow_imap=<port> or allow_pop3=<port> or
allow_imaps=<port>);

<user> is the pop3/imap user as usual and <port> should be 110, 995, 143
and 993 if the user connects by POP3, POP3S, IMAP4 and IMAP4S respectively.

(DB values for allow_pop3 are either 0 or 110, for allow_imap 0 or 143
etc. so we either have a match or not)

Thanks for any hints,
Norbert


Reply to: