[exim] known senders from file

Top Page
Delete this message
Reply to this message
Author: Jeremy C. Reed
Date:  
To: exim-users
Subject: [exim] known senders from file
Using exim 4.69. I want to only allow mail from known senders. I did this
for a few years with exim 3
(http://www.reedmedia.net/misc/mail/exim-verify_known_sender.html). But
having troubles trying with exim 4. (I have been happily running exim 4
for years and it has worked so well I rarely need to look at my configs.)

So I only want to do the check if file exists and I want to have a custom
failure message. Also accept bounce messages.

I currently have in acl_check_rcpt: section right after my dnslists
configurations:

   require senders = : /etc/virtual/$domain/$local_part/mail-accept-list
        condition = ${if exists{/etc/virtual/$domain/$local_part/mail-accept-list}\
                        {}}
        message = Not accepted 1


But that fails with:

20914 ----------- end verify ------------
20914 sender reed@??? verified ok
20914 require: condition test succeeded
20914 processing "require"
20914 check senders = : /etc/virtual/$domain/$local_part/mail-accept-list
20914 address match: subject=reed@??? pattern=
20914 example.net in ""? no (end of list)
20914 LOG: MAIN PANIC DIE
20914 failed to open /etc/virtual/example.net/reed/mail-accept-list when
checking ": /etc/virtual/$domain/$local_part/mail-accept-list": No such
file or directory

I also tried just using

    require senders = ${if 
exists{/etc/virtual/$domain/$local_part/mail-accept-list}\
{/etc/virtual/$domain/$local_part/mail-accept-list} \
                        {}}


but that caused a 550 Administrative prohibition

I also tried require_files instead of the condition, but that was not
allowed syntax.

I found http://wiki.exim.org/FAQ/Policy_controls/Q0716 but it was simpler
than I am looking for.

If the file (or even directory) doesn't exist, I want that check to be
skipped. If the file does exist, then the sender must exist in that file
for it to be delivered. Any suggestions or examples would be appreciated.

Thanks,



Jeremy C. Reed

echo 'EhZ[h ^jjf0%%h[[Zc[Z_W$d[j%Xeeai%ZW[ced#]dk#f[d]k_d%' | \
  tr            '#-~'            '\-.-{'