[exim] VERP (working) example requested

Top Page
Delete this message
Reply to this message
Author: David Favor
Date:  
To: EXIM Users
Subject: [exim] VERP (working) example requested
The EXIM manual has a very simplistic example:

    verp_smtp:
       driver = smtp
       max_rcpt = 1
       return_path = \
         ${if match {$return_path}{^(.+?)-request@???\$}\
          {$1-request=$local_part%$domain@???}fail}


This is incomplete. I've looked for hours trying to find the answer
to a "complete" version, have given up and am posting.

What I desire is something like is to send to:

    foo-request@???


and have the following happen. I've just started working with EXIM
and am unsure of syntax. Here's the logic though:

    if match {$return_path}{^(.+?)-request@} {


        #
        # if I understand EXIM syntax this code will only proceed
        # for addresses of the form 'foo-request@???'
        #


        return_path = \
          ${if match {$return_path}{^(.+?)-request@???\$}\
          {$1-request=$local_part%$domain@???}fail}


        #
        # determine the correct 'real_recipient' who will be receiving
        # this email (SMTP RCPT) by chopping off the trailing '-request'
        #


        real_recipient = ${extract{1}{-}{$local_part}}


        #
        # fixup all the headers where 'Deliver-To: ...' is a guess at
        # what header to add to set the correct SMTP 'RCPT TO: ...' info
        #


        headers_remove "Deliver-To:To:Return-Path:Errors-To:"


        headers_add    "Deliver-To: $real_recipient\nTo: $real_recipient\n\
                        Return-Path: $return_path\n\Errors-To: $return_path"


    }


The manual example will always fail as sending mail to
foo-request@??? will always cause:

           "Recipient address rejected: User unknown


as the recipient should be foo@??? rather than foo-request@???.

Thanks.

--
Can you feel like $1,000,000 all day, every day? Yes you can!
Your simple secrets are here - http://RadicalHealth.com/peak