On Wed, Nov 29, 2017 at 10:12:42AM +0100, Tom Van Looy wrote:
> Hi
> 
> We use mailhog in development / testing and hook it up to postfix. It so
> that if you mail to an email address ending in .external, it will be
> relayed to a real server. And, if doesn't we relay it to mailhog.
> 
> Postfix configuration /etc/postfix/main.cf:
> 
> myhostname = myserver.mydomain.tld
> relayhost = real-smtp-relay.mydomain.tld
> smtp_generic_maps = pcre:/etc/postfix/smtp_generic_maps.pcre
> transport_maps = hash:/etc/postfix/transport
> 
> The smtp maps make sure that the .external part is stripped off.
> 
> /(.*)\.external$/ $1
> 
> The transport maps decide that .external addresses will be relayed to the
> real SMTP server and the rest will be relayed to mailhog.
> 
> .external :
> *           smtp:127.0.0.1:1025
> 
> I would like to migrate this setup to OpenSMTPd but I'm not sure if it can
> be done. I think the important part is that the PCRE trick is missing.
> 
> Or should I use a different approach?
> 
> Kind regards,
> 
> Tom Van Looy

I'm afraid you would need the PCRE magic that isn't available :( It may
be possible with the FORMAT SPECIFIERS but it would probably still be
difficult.

-- 
You received this mail because you are subscribed to misc@opensmtpd.org
To unsubscribe, send a mail to: misc+unsubscr...@opensmtpd.org

Reply via email to