We’ve always kept our virtual domains in /etc/mail/virtuals and I was under the impression it was the default location. It isn’t.
I don’t remember adding this code when I set up Exim4 on my Linode server, but it is missing on my Digital Ocean server. I needed to add the folowing lines to exim4.conf.template, just above the line system_aliases: in the router section.
virtual_domains:
driver = redirect
domains = dsearch;/etc/mail/virtuals
data = ${lookup{$local_part}wildlsearch{/etc/mail/virtuals/$domain}}
allow_fail
allow_defer
file_transport = address_file
I also missed the step of creating the self-signed key and cert, so make sure you do that as well.
The documents have lots of special cases for handling email that I never used, but one could come in handy. An attempt to deliver to a particular local part can be deferred or forced to fail by aliasing the local part to
:defer:
or
:fail:
So you could do something like this, since spammers use this address all the time.
support: :fail:
One thing we never did in the virtuals file is to send a comment for addresses that bounce, but it could come in handy. e.g
X.Employee: :fail: Gone away, no forwarding address
support: :fail: Please use the contact form on our website if you have support questions.