Mailing List Archive

Multiple servers , same mysql DB
Hi all
i need a simple advice
I have 3 mail servers that shares the same mysql with email accounts,
aliases and so on.

Not all servers need to handle the full address list, in example,
domain "test1.it" is handled by server1, domain test2.com is handled
by server4 and so on.

Usually, i set the server ip address in a column on the domain table
and I change the lookup accordingly, filtering by $received_ip_address

BUT this breaks any command line debugging, like exim -bt
info@test2.com because the $received_ip_address is not set

Previously, as workaround, i've forced a variable set to the IP
address, but this is a manual method and I would like to keep it
automated.

Any idea ?

--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-users-unsubscribe@lists.exim.org
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: Multiple servers , same mysql DB [ In reply to ]
On 12/9/23 10:24, Gandalf Corvotempesta via Exim-users wrote:
> I have 3 mail servers that shares the same mysql with email accounts,
> aliases and so on.
>
> Not all servers need to handle the full address list, in example,
> domain "test1.it" is handled by server1, domain test2.com is handled
> by server4 and so on.

> Any idea ?

Have your config pull in a server-number by .include of
a file which is different on each, setting a macro with the number.
Include this value in your mysql queries, using it to select
the required set of info.

--
Cheers,
Jeremy


--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-users-unsubscribe@lists.exim.org
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: Multiple servers , same mysql DB [ In reply to ]
Il giorno sab 9 dic 2023 alle ore 14:48 Jeremy Harris via Exim-users
<exim-users@lists.exim.org> ha scritto:
> Have your config pull in a server-number by .include of
> a file which is different on each, setting a macro with the number.
> Include this value in your mysql queries, using it to select
> the required set of info.

this is more or less what i did previously, setting a value bound to a
single server
but that's exactly what i would like to avoid.

i think i need a variable that is set even with a tcp connection and
even with an "exim -bt" command

--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-users-unsubscribe@lists.exim.org
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: Multiple servers , same mysql DB [ In reply to ]
On 12/9/23 14:39, Gandalf Corvotempesta wrote:
> i think i need a variable that is set even with a tcp connection and
> even with an "exim -bt" command

Doing what I said would be.
--
Cheers,
Jeremy


--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-users-unsubscribe@lists.exim.org
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: Multiple servers , same mysql DB [ In reply to ]
Il giorno sab 9 dic 2023 alle ore 15:44 Jeremy Harris
<jgh@wizmail.org> ha scritto:
> Doing what I said would be.

$primary_hostname seems to work.
I can use that in the lookup query and at the same time, setting the
value on DB to the proper hostname.
In this way, the imap server knows which mailbox has to handle, based
on it's hostname, and the MXs
knows were to relay the emails, based on the imap hostname wrote in DB.

--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-users-unsubscribe@lists.exim.org
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: Multiple servers , same mysql DB [ In reply to ]
On 2023-12-09, Gandalf Corvotempesta via Exim-users <exim-users@lists.exim.org> wrote:
> Hi all
> i need a simple advice
> I have 3 mail servers that shares the same mysql with email accounts,
> aliases and so on.
>
> Not all servers need to handle the full address list, in example,
> domain "test1.it" is handled by server1, domain test2.com is handled
> by server4 and so on.
>
> Usually, i set the server ip address in a column on the domain table
> and I change the lookup accordingly, filtering by $received_ip_address
>
> BUT this breaks any command line debugging, like exim -bt
> info@test2.com because the $received_ip_address is not set
>
> Previously, as workaround, i've forced a variable set to the IP
> address, but this is a manual method and I would like to keep it
> automated.
>
> Any idea ?

see manual:

-oMi <interface address>
See -oMa above for general remarks about the -oM options.
The -oMi option sets the IP interface address value. A
port number may be included, using the same syntax as for -oMa.
The interface address is placed in $received_ip_address
and the port number, if present, in $received_port.


--
Jasen.
???????? ????? ???????

--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-users-unsubscribe@lists.exim.org
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/