|  | @@ -0,0 +1,69 @@
 | 
		
	
		
			
			|  | 1 | +PostSRSd integration with Exim
 | 
		
	
		
			
			|  | 2 | +==============================
 | 
		
	
		
			
			|  | 3 | +
 | 
		
	
		
			
			|  | 4 | +## SRS Return router
 | 
		
	
		
			
			|  | 5 | +
 | 
		
	
		
			
			|  | 6 | +If using a domain solely for SRS return addresses:
 | 
		
	
		
			
			|  | 7 | +
 | 
		
	
		
			
			|  | 8 | +    SRS_DOMAIN = srs.your.domain
 | 
		
	
		
			
			|  | 9 | +    
 | 
		
	
		
			
			|  | 10 | +    begin routers
 | 
		
	
		
			
			|  | 11 | +    
 | 
		
	
		
			
			|  | 12 | +    srs0_return:
 | 
		
	
		
			
			|  | 13 | +      caseful_local_part
 | 
		
	
		
			
			|  | 14 | +      domains = SRS_DOMAIN
 | 
		
	
		
			
			|  | 15 | +      driver = redirect
 | 
		
	
		
			
			|  | 16 | +      allow_fail
 | 
		
	
		
			
			|  | 17 | +      data = ${if match {$local_part}{\N(?i)^srs[01]=\N} \
 | 
		
	
		
			
			|  | 18 | +    	{${if match \
 | 
		
	
		
			
			|  | 19 | +    	  {${readsocket{inet:localhost:10002}{get ${quote_local_part:$local_part_prefix$local_part}@$domain}{3s}}} \
 | 
		
	
		
			
			|  | 20 | +    	  {\N^200 (.+)\N} \
 | 
		
	
		
			
			|  | 21 | +    	  {$1} \
 | 
		
	
		
			
			|  | 22 | +    	  {:fail: Invalid SRS bounce} \
 | 
		
	
		
			
			|  | 23 | +    	}} \
 | 
		
	
		
			
			|  | 24 | +    	{:fail: Invalid SRS bounce} \
 | 
		
	
		
			
			|  | 25 | +      }
 | 
		
	
		
			
			|  | 26 | +      no_more
 | 
		
	
		
			
			|  | 27 | +
 | 
		
	
		
			
			|  | 28 | +If your SRS domain is also used for other addresses:
 | 
		
	
		
			
			|  | 29 | +
 | 
		
	
		
			
			|  | 30 | +    SRS_DOMAIN = srs.your.domain
 | 
		
	
		
			
			|  | 31 | +    
 | 
		
	
		
			
			|  | 32 | +    begin routers
 | 
		
	
		
			
			|  | 33 | +    
 | 
		
	
		
			
			|  | 34 | +    srs0_return:
 | 
		
	
		
			
			|  | 35 | +      caseful_local_part
 | 
		
	
		
			
			|  | 36 | +      domains = SRS_DOMAIN
 | 
		
	
		
			
			|  | 37 | +      local_part_prefix = srs0= : srs1=
 | 
		
	
		
			
			|  | 38 | +      driver = redirect
 | 
		
	
		
			
			|  | 39 | +      allow_fail
 | 
		
	
		
			
			|  | 40 | +      data = ${if match \
 | 
		
	
		
			
			|  | 41 | +        {${readsocket{inet:localhost:10002}{get ${quote_local_part:$local_part_prefix$local_part}@$domain}{3s}}} \
 | 
		
	
		
			
			|  | 42 | +        {\N^200 (.+)\N} \
 | 
		
	
		
			
			|  | 43 | +        {$1} \
 | 
		
	
		
			
			|  | 44 | +        {:fail: Invalid SRS bounce} \
 | 
		
	
		
			
			|  | 45 | +      }
 | 
		
	
		
			
			|  | 46 | +
 | 
		
	
		
			
			|  | 47 | +## Rewriting outgoing mail in the SMTP transport
 | 
		
	
		
			
			|  | 48 | +
 | 
		
	
		
			
			|  | 49 | +The following excludes locally submitted mail, or mail submitted by authenticated
 | 
		
	
		
			
			|  | 50 | +users from SRS rewriting. Of course, if the sender address is already in
 | 
		
	
		
			
			|  | 51 | +one of our local domains, there is no need to rewrite the address.
 | 
		
	
		
			
			|  | 52 | +
 | 
		
	
		
			
			|  | 53 | +    begin transports
 | 
		
	
		
			
			|  | 54 | +    
 | 
		
	
		
			
			|  | 55 | +    remote_smtp:
 | 
		
	
		
			
			|  | 56 | +      debug_print = "T: remote_smtp for $local_part@$domain"
 | 
		
	
		
			
			|  | 57 | +      driver = smtp
 | 
		
	
		
			
			|  | 58 | +      return_path = ${if and { \
 | 
		
	
		
			
			|  | 59 | +    		{!match_ip{$sender_host_address}{:@[]}} \
 | 
		
	
		
			
			|  | 60 | +    		{!def:authenticated_id} \
 | 
		
	
		
			
			|  | 61 | +    		{!match_address {$sender_address} { : *@+local_domains : *@+virtual_domains : SRS_DOMAIN}} \
 | 
		
	
		
			
			|  | 62 | +    	} \
 | 
		
	
		
			
			|  | 63 | +    	{${if match \
 | 
		
	
		
			
			|  | 64 | +    	  {${readsocket{inet:localhost:10001}{get $sender_address}{3s}}} \
 | 
		
	
		
			
			|  | 65 | +    	  {\N^200 (.+)\N} \
 | 
		
	
		
			
			|  | 66 | +    	  {$1} \
 | 
		
	
		
			
			|  | 67 | +    	  fail } \
 | 
		
	
		
			
			|  | 68 | +    	} \
 | 
		
	
		
			
			|  | 69 | +    	fail }
 |