Mailing List Archive

Dynamic local_domains
Hi, all,

I saw a similar post on this server from last June but no solution as
far as i could tell. The only difference is I'm using MySQL instead of
PGSql and Debian instead of Ubuntu (although both use similar
configurations). Exim version is 4.96.

In my local configuration file I have

MAIN_LOCAL_DOMAINS=${lookup MySQL{SELECT GROUP_CONCAT(DISTINCT domain
SEPARATOR ' : ') FROM emailtable}

(one line)

The Debian configuration file has a line

local_domains = MAIN_LOCAL_DOMAINS

There are 5 domains in the emailtable.

Executing

exim4 -bP +local_domains

and it comes back with the lookup statement, not the domains. Database
connection information is defined and correct.

Starting the MySQL General Log and restarting Exim shows no requests to
MySQL.

Is this too early for Exim to connect to the database? Or am I doing
something else wrong?

TIA,
Jerry

--
## 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: Dynamic local_domains [ In reply to ]
On 2024-01-28 Jerry Stuckle via Exim-users <exim-users@lists.exim.org> wrote:
[...]
> In my local configuration file I have

> MAIN_LOCAL_DOMAINS=${lookup MySQL{SELECT GROUP_CONCAT(DISTINCT domain
> SEPARATOR ' : ') FROM emailtable}

> (one line)

> The Debian configuration file has a line

> local_domains = MAIN_LOCAL_DOMAINS
[...]
> Executing

> exim4 -bP +local_domains

> and it comes back with the lookup statement, not the domains. Database
> connection information is defined and correct.
[...]
> Is this too early for Exim to connect to the database? Or am I doing
> something else wrong?

Goo monrning,

-bP does macro replacement, it does not do string expansions, you would
want to either use -be or run in debug mode.

cu Andreas
--
`What a good friend you are to him, Dr. Maturin. His other friends are
so grateful to you.'
`I sew his ears on from time to time, sure'

--
## 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: Dynamic local_domains [ In reply to ]
On 1/28/24 05:22, Jerry Stuckle via Exim-users wrote:
> Is this too early for Exim to connect to the database?

Yes. Options are evaluated when needed; this one will probobly
only be needed when an inbound mail arrives.
--
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: Dynamic local_domains [ In reply to ]
Hi, Andreas,

Hopefully I did this correctly.

I tried running exim with -bd -d+all. I started it then ran it with the
option -d+all -bP +local_domains and redirected stderr to files for both.

Neither debug outputs showed any attempt to make a call to MySQL I had
the MySQL General log running at the same time - it showed no calls to
the database.

As this is on a local machine, I don't have an MX entry for it in the
DNS, so I can't try to send an email to it. The output from the -bP
option still shows the mysql command, not the results of execution.

I just don't know how to determine if the domain list is working or not.
Any other ideas?

Thanks.
Jerry

On 2024-01-28 06:48m, Andreas Metzler wrote:
> On 2024-01-28 Jerry Stuckle via Exim-users <exim-users@???> wrote:
> [...]
> > In my local configuration file I have
>
> > MAIN_LOCAL_DOMAINS=${lookup MySQL{SELECT GROUP_CONCAT(DISTINCT domain
> > SEPARATOR ' : ') FROM emailtable}
>
> > (one line)
>
> > The Debian configuration file has a line
>
> > local_domains = MAIN_LOCAL_DOMAINS
> [...]
> > Executing
>
> > exim4 -bP +local_domains
>
> > and it comes back with the lookup statement, not the domains. Database
> > connection information is defined and correct.
> [...]
> > Is this too early for Exim to connect to the database? Or am I doing
> > something else wrong?
>
> Goo monrning,
>
> -bP does macro replacement, it does not do string expansions, you would
> want to either use -be or run in debug mode.
>
> cu Andreas
> --
> `What a good friend you are to him, Dr. Maturin. His other friends are
> so grateful to you.'
> `I sew his ears on from time to time, sure'
>
> --
> ## 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@???
> ## Exim details at http://www.exim.org/
> ## Please use the Wiki with this list - http://wiki.exim.org/
>
>


--
## 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: Dynamic local_domains [ In reply to ]
exim - bt johndoe@local.domain, where johndoe can be a valid or invalid
local_part

On Mon, Jan 29, 2024, 06:44 Jerry Stuckle via Exim-users <
exim-users@lists.exim.org> wrote:

> Hi, Andreas,
>
> Hopefully I did this correctly.
>
> I tried running exim with -bd -d+all. I started it then ran it with the
> option -d+all -bP +local_domains and redirected stderr to files for both.
>
> Neither debug outputs showed any attempt to make a call to MySQL I had
> the MySQL General log running at the same time - it showed no calls to
> the database.
>
> As this is on a local machine, I don't have an MX entry for it in the
> DNS, so I can't try to send an email to it. The output from the -bP
> option still shows the mysql command, not the results of execution.
>
> I just don't know how to determine if the domain list is working or not.
> Any other ideas?
>
> Thanks.
> Jerry
>
> On 2024-01-28 06:48m, Andreas Metzler wrote:
> > On 2024-01-28 Jerry Stuckle via Exim-users <exim-users@???> wrote:
> > [...]
> > > In my local configuration file I have
> >
> > > MAIN_LOCAL_DOMAINS=${lookup MySQL{SELECT GROUP_CONCAT(DISTINCT domain
> > > SEPARATOR ' : ') FROM emailtable}
> >
> > > (one line)
> >
> > > The Debian configuration file has a line
> >
> > > local_domains = MAIN_LOCAL_DOMAINS
> > [...]
> > > Executing
> >
> > > exim4 -bP +local_domains
> >
> > > and it comes back with the lookup statement, not the domains. Database
> > > connection information is defined and correct.
> > [...]
> > > Is this too early for Exim to connect to the database? Or am I doing
> > > something else wrong?
> >
> > Goo monrning,
> >
> > -bP does macro replacement, it does not do string expansions, you would
> > want to either use -be or run in debug mode.
> >
> > cu Andreas
> > --
> > `What a good friend you are to him, Dr. Maturin. His other friends are
> > so grateful to you.'
> > `I sew his ears on from time to time, sure'
> >
> > --
> > ## 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@???
> > ## Exim details at http://www.exim.org/
> > ## Please use the Wiki with this list - http://wiki.exim.org/
> >
> >
>
>
> --
> ## 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/
>

--
## 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: Dynamic local_domains [ In reply to ]
On 1/29/24 03:41, Jerry Stuckle via Exim-users wrote:
> I tried running exim with -bd -d+all.  I started it

good

> then ran it with the option -d+all -bP +local_domains

that bit is pointless

> and redirected stderr to files for both.

And sent it a mail?

--
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: Dynamic local_domains [ In reply to ]
On Mon, 29 Jan 2024, Odhiambo Washington via Exim-users wrote:

> exim - bt johndoe@local.domain, where johndoe can be a valid or invalid
> local_part

exim -bt johndoe@local.domain
- no space after the dash.

> On Mon, Jan 29, 2024, 06:44 Jerry Stuckle via Exim-users <
> exim-users@lists.exim.org> wrote:
>
>> Hi, Andreas,
>>
>> Hopefully I did this correctly.
>>
>> I tried running exim with -bd -d+all. I started it then ran it with the
>> option -d+all -bP +local_domains and redirected stderr to files for both.
>>
>> Neither debug outputs showed any attempt to make a call to MySQL I had
>> the MySQL General log running at the same time - it showed no calls to
>> the database.
>>
>> As this is on a local machine, I don't have an MX entry for it in the
>> DNS, so I can't try to send an email to it. The output from the -bP
>> option still shows the mysql command, not the results of execution.
>>
>> I just don't know how to determine if the domain list is working or not.
>> Any other ideas?
>>
>> Thanks.
>> Jerry
>>
>> On 2024-01-28 06:48m, Andreas Metzler wrote:
>>> On 2024-01-28 Jerry Stuckle via Exim-users <exim-users@???> wrote:
>>> [...]
>>>> In my local configuration file I have
>>>
>>>> MAIN_LOCAL_DOMAINS=${lookup MySQL{SELECT GROUP_CONCAT(DISTINCT domain
>>>> SEPARATOR ' : ') FROM emailtable}
>>>
>>>> (one line)
>>>
>>>> The Debian configuration file has a line
>>>
>>>> local_domains = MAIN_LOCAL_DOMAINS
>>> [...]
>>>> Executing
>>>
>>>> exim4 -bP +local_domains
>>>
>>>> and it comes back with the lookup statement, not the domains. Database
>>>> connection information is defined and correct.
>>> [...]
>>>> Is this too early for Exim to connect to the database? Or am I doing
>>>> something else wrong?
>>>
>>> Goo monrning,
>>>
>>> -bP does macro replacement, it does not do string expansions, you would
>>> want to either use -be or run in debug mode.
>>>
>>> cu Andreas
>>> --
>>> `What a good friend you are to him, Dr. Maturin. His other friends are
>>> so grateful to you.'
>>> `I sew his ears on from time to time, sure'
>>>
>>> --
>>> ## 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@???
>>> ## Exim details at http://www.exim.org/
>>> ## Please use the Wiki with this list - http://wiki.exim.org/
>>>
>>>
>>
>>
>> --
>> ## 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/
>>
>
> --
> ## 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/
>

--
Andrew C. Aitchison Kendal, UK
andrew@aitchison.me.uk

--
## 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: Dynamic local_domains [ In reply to ]
On 2024-01-28, Jerry Stuckle via Exim-users <exim-users@lists.exim.org> wrote:
> Hi, all,
>
> I saw a similar post on this server from last June but no solution as
> far as i could tell. The only difference is I'm using MySQL instead of
> PGSql and Debian instead of Ubuntu (although both use similar
> configurations). Exim version is 4.96.
>
> In my local configuration file I have
>
> MAIN_LOCAL_DOMAINS=${lookup MySQL{SELECT GROUP_CONCAT(DISTINCT domain
> SEPARATOR ' : ') FROM emailtable}
>
> (one line)

It's missing a }

--
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/