|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
Re: Forwards with MySQL
From: Kai Fürstenberg (postfix
fuerstenberg.ws)
Date: Fri Sep 01 2006 - 05:15:47 CDT
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Alvaro Marín wrote:
> Kai Fürstenberg wrote:
>
> Hello,
>
>
>> You can use transport_maps. Forward otheruser
otherdomain.com via smtp
>> to the other MX. Anyhow you should/must add this user to the table:
>> "otheruser","otherdomain.com","otheruser
otherdomain.com". Postfix
>> always looks in the table but the alias mapping is the same. It then can
>> take the transport_maps to forward the message to a different server.
>>
>
> I've tried with that (configuring transport table too):
>
> mysql> select * from email_domains;
> +---------------------------+
> | domain |
> +---------------------------+
> | gmail.com |
> | pruebas.domain.com |
> +---------------------------+
>
> mysql> select * from email_transports;
> +-----------+----------------+
> | domain | transport |
> +-----------+----------------+
> | gmail.com | smtp:gmail.com |
> +-----------+----------------+
>
You need to specify the correct Mail-Server. gmail.com is no server,
it's a domain.
> mysql> select * from email_aliases;
> +------------+---------------------------+----------------------+
> | alias_user | alias_domain | alias_dest |
> +------------+---------------------------+----------------------+
> | user | pruebas.domain.com | oneuser
gmail.com |
> | oneuser | gmail.com | oneuser
gmail.com |
> +------------+---------------------------+----------------------+
>
> If I send an email to "user
pruebas.domain.com":
>
> to=<oneuser
gmail.com>, orig_to=<user
pruebas.domain.com>, relay=none,
> delay=0.11, delays=0.08/0.01/0/0.03, dsn=5.0.0, status=bounced (User
> unknown in virtual alias table)
>
> MySQL log:
>
> select alias_dest from email_aliases where alias_user="user" and
> alias_domain="pruebas.domain.com"
> select domain from email_domains where domain="gmail.com"
> select alias_dest from email_aliases where alias_user="oneuser" and
> alias_domain="gmail.com"
>
> and then, only queries (included transport table) to bounce message to root.
>
See above. Your postfix is unable to establish a connection to the
server gmail.com.
And.. Sorry, but that doesn't make any sense to me. Why do you want
gmail.com to be a virtual domain for your system, when mail to this
domain is going to be sent to a different server (gmail)?
>> This should have something to do with how you specify the MySQL-query
>> and how you created the table. For MySQL it is a difference if you have
>> an empty string for alias_user or if you have NULL.
>>
>
> I've tried with NULL, ""... and nothing :(
> The table is:
>
> mysql> desc email_aliases;
> +--------------+-----------+------+-----+---------+-------+
> | Field | Type | Null | Key | Default | Extra |
> +--------------+-----------+------+-----+---------+-------+
> | alias_user | char(250) | YES | | NULL | |
> | alias_domain | char(250) | | | | |
> | alias_dest | char(250) | | | | |
> +--------------+-----------+------+-----+---------+-------+
>
The queries for "
otherdomain.com" are also logged. Please post them.
Kai
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]