0

I have an rarely used /etc/aliases entry

vmailusers: :include:/usr/local/etc/vmailusers

The /usr/local/etc/vmailusers file is generated by a cronjob executing

ls /home/vmail | grep -v lists > /usr/locale/etc/vmailusers
chmod 0640 /usr/local/etc/vmailusers
chmod mailnull:mail /usr/local/etc/vmailusers

Is there a way to avoid having to run a cron job but rather execute the ls command in the very moment the vmailusers alias is used?

Frerich Raabe
  • 801
  • 7
  • 16
  • Moin Frerich, It seems to be possible with sendmail, there is the same question for sendmail on serverfault. But i have no idea if it works the same in exim. – arved Oct 12 '12 at 06:58
  • @arved: Hello there, long time no see :-) I'll have a look at the sendmail answer and see whether it applies to exim as well. – Frerich Raabe Oct 12 '12 at 07:11

1 Answers1

0

With exim you need no /etc/aliases anymore. All that you have to do - is to define redirect router like that:

vmail_aliases:
        driver          = redirect
        data            = ${lookup{$local_part}lsearch{/usr/local/etc/vmailusers}}
        file_transport  = address_file
        pipe_transport  = address_pipe

Refer to the exim spec chapter 9.3 describing lookup in the files by lsearch. At least, lsearch'ed files have the same syntax as /etc/aliases so you haven't mess with converting your current /usr/local/etc/vmailusers to some freaky format. Don't forget to place that router before any accepting router in your config.

Exim lookup for given key each time the message is processed, so all your changes become actual just when you save your aliases file.

Kondybas
  • 6,964
  • 2
  • 20
  • 24