Re: [Exim] Question about aliasfile explansion

Top Page
Delete this message
Reply to this message
Author: Philip Hazel
Date:  
To: Dag Viggo Lokøen
CC: exim-users
Subject: Re: [Exim] Question about aliasfile explansion
On Fri, 17 Aug 2001, Dag Viggo Lokøen wrote:

> We have some mailing lists in the /etc/aliases file. An example is:
>
> list: user1,user2,user3
>
> The problem is that when f.x. user1 sends a mail to list@mydomain, it
> recieves a copy of it's own mail.
>
> I've looked through the docs, but can't find out how to avoid this.


There is no way to make Exim behave specially if the incoming message
happens to be from a local user who also happens to be on the alias
list.

If you really want to make Exim behave differently in this rather
special case, you have to do it by detecting the fact later, and
discarding the delivery. You could test for:

  $local_part = same local part as sender
  $domain     = same domain as sender (or assume your domain)
  $original_local_part = one of your mailing lists


So you would end up with an initial director along these lines

discard_list_from_me_to_me:
driver = smartuser
domains = mydomain
senders = $local_part@mydomain
condition = ${if eq{$original_local_part}{list}{yes}{no}}
new_address = /dev/null

I have not tested this.

-- 
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.