Re: [exim] allow alias file to include aliases from another …

Top Page
Delete this message
Reply to this message
Author: Jason Keltz
Date:  
To: exim-users
Subject: Re: [exim] allow alias file to include aliases from another file
On 6/30/2020 8:16 AM, Jeremy Harris via Exim-users wrote:

> On 29/06/2020 20:44, Jason Keltz via Exim-users wrote:
>>>     If an item is of the form
>>>
>>>     :include:<path name>
>>>
>>>     a list of further items is taken from the given file and included
>>>     at that point. Note: Such a file can not be a filter file; it is
>>>     just an out-of-line addition to the list. The items in the
>>>     included list are separated by commas or newlines and are not
>>>     subject to expansion. If this is the first item in an alias list
>>>     in an lsearch file, a colon must be used to terminate the alias
>>>     name. This example is incorrect:
>>>
>>>     list1    :include:/opt/lists/list1
>>>
>>>     It must be given as
>>>
>>>     list1:   :include:/opt/lists/list1
>>>
>>>     Tainted data may not be used for a filename.
>>>
>> I can use the third form (last1: :include:/opt/lists/list1) in my
>> /etc/aliases file.  However, I cannot use the first form:
>>
>> :include:/etc/aliases.alternate
>>
>> Am I misinterpreting the instruction?
> It depends on how you are obtaining this list item. The item itself
> takes the "first form". If you are doing an lsearch to get the item,
> then the line in the file for lsearch (which needs both a key to
> search for, and the data to be returned) needs to terminate the
> key with a colon.
>
> If you are not using an lsearch then "third form" is not relevant.


Hi Jeremy,

Thanks for your response.  I'm still missing something ....

All I want to know is whether the following line alone in an existing
/etc/aliases file should or should not allow me to include aliases from
an additional external file:

:include:/etc/aliases.alternate

My system_aliases is defined as:

system_aliases:
  driver = redirect
  allow_fail
  allow_defer
  data = ${lookup{$local_part}lsearch{/etc/aliases}}
  user = exim
  file_transport = address_file
  pipe_transport = address_pipe

If this syntax will not work, is there an additional way to include a
secondary aliases file?

The reason I am asking for this is because one alias file is modified by
hand, but the other one is automatically generated.

Thanks!

Jason.