exim

Exim Verify Reciepient by existence of a file


I want to configure Exim to verify and accept emails only for users where a File exists. The File itself lies in a Folder constructed by paths of the Filename. (for use with modified mailman):

the mail for "mailing_address.tld@domain.tld" should only be accepted if a file exists:

/var/lib/mailman/a/ad/domain.tld/mailing/config.pck

So

/var/lib/mailman/{first letter of address "**a**"}/{first and second letter of address "**ad**"}/{first part of local_part delimtered by _ "**mailing**"}/config.pck

I've tried with exim sg and substring but I couldn't get it to work.


Solution

  • I found a solution with sg and substr:

    MM_NAME=${sg{$local_part}{_.*}{}}

    MM_DOMAIN=${sg{lc::$local_part}{.*_}{}}

    MM_LISTCHK=/var/lib/mailman/lists/${substr{0}{1}{MM_DOMAIN}}/${substr{0}{2}{MM_DOMAIN}}/MM_DOMAIN/MM_NAME/config.pck

    it's 3 parts but works like intended