I have tried so many different tests I didnt post any of them because I thought it would be more confusing. The most recent thing I tried is:
mitmproxy -R http://webmail.abc.com -p 80 --replace :~q:abc:xyz --replace :~q:webmail:abccom
There is never a response with the replacements so it times out.
How should that redirection look like? Do you want to display the contents of abccom.xyz.com at webmail.abc.com? Do That could be tricky: http://docs.mitmproxy.org/en/stable/modes.html#reverse-proxy Do you want to send a HTTP 30x redirect? What exactly are you trying to accomplish?
We don’t, but that’s a rather non-mitmproxy-specific problem, so you should find a lot of examples for writing systemd service files on Google/StackOverflow.