Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
    
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 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. –  Frerich Raabe Oct 12 '12 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:

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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