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?

  • 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, 2012 at 6: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. Oct 12, 2012 at 7:11

1 Answer 1


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

        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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.