Date: Tue, 3 Feb 2004 02:15:29 +0100 From: Martin Treusch von Buttlar Subject: RPR ported to exim4 Hi, I have successfully ported your RPR-implementation to exim 4.30. Please understand that I had to change the indentation and some conditions, while I was trying to understand this. Some things could be further simplified, but I am to tired right now :) If you don't mind I will put this onto a website for you to link to. You can use it for any purpose, as long as you include a reference to me. Here are the necessary routers: rpr_lookup_mx: driver = dnslookup senders = ! *@+local_domains ignore_target_hosts = 127.0.0.0/8 domains = ! +local_domains verify = false address_data = ${eval:$tod_epoch+86400*5}=\ ${sg {${sg {$sender_address}{([=#%_])}{_\$1}}}{@}{#}}=\ ${sg {$original_local_part}{([=#%_])}{_\$1}}\ ${if eq {$domain}{$original_domain}\ {%$original_domain@$primary_hostname}\ {@$original_domain}} # Check for empty sender_address and prevent bounces from being rewritten condition = ${if and {{!eq {$sender_address}{}}\ {!match {$h_X-RPR-Return:}{$primary_hostname}}\ }{1}{0}} headers_add = "X-RPR-Rewrite: SMTP envelope sender rewritten by $primary_hostname\n\ \tSee RPR_EXPLAIN_URL" errors_to = bounce-${md5:RPR_SECRET-$address_data}-$address_data transport = remote_smtp rpr_return: driver = redirect local_part_prefix = bounce- senders = : condition = ${if match {$local_part}{\N^([0-9a-f]{32})-(\d+=(?:.*[^_])?(?:_[_#])*#[^=#]+=.+)$\N} {${if eq {${md5:RPR_SECRET-$2@$domain}}{$1} {1}{0}}}{0}} data = ${if match {$local_part}{\N^[0-9a-f]{32}-(\d+)=((?:.*[^_])?(?:_[_#])*)#([^=#]+)=(.+)$\N}{ ${sg {${if >{$1}{$tod_epoch} {$2@$3}{"postmaster@gnuher.de"}}} {_([_=#%])}{\$1}} }{"postmaster@$domain"}} headers_add = "X-RPR-Return: DSN routed to destination via $primary_hostname\n\ \tSee RPR_EXPLAIN_URL" rpr_error_checksum: driver = redirect local_part_prefix = bounce- senders = : condition = ${if match {$local_part}{\N^([0-9a-f]{32})-(\d+=(?:.*[^_])?(?:_[_#])*#[^=#]+=.+)$\N} {${if eq {${md5:RPR_SECRET-$2@$domain}}{$1} {1}{0}}}{0}} data = "postmaster@$domain" headers_add = "X-RPR-Alert: Checksum mismatch!" rpr_error_nodsn: driver = redirect local_part_prefix = bounce- condition = ${if match {$local_part}{\N^([0-9a-f]{32})-(\d+=(?:.*[^_])?(?:_[_#])*#[^=#]+=.+)$\N} {${if eq {${md5:RPR_SECRET-$2@$domain}}{$1} {1}{0}}}{0}} data = "postmaster@$domain" headers_add = "X-RPR-Alert: Not a DSN (non-empty return-path)!" Thanks for the great work Martin