My droplet (Ubuntu 14.04) is hosting multiple websites using Apache virtual hosts. I have send-only Exim4 installed (for website contact forms, admin emails etc.) and I’ve set up SPF and DKIM records. Emails from all the websites are verified and do not end up with any flags or go into spam. Awesome!

However, emails from all websites except my main website (the one my droplet is named after) arrive with “From: Name <> via”.

How can I get rid of “via”?

My /etc/exim4/conf.d/transport/30_exim4-config_remote_smtp contains the following:

DKIM_DOMAIN = ${lc:${domain:$h_from:}}
DKIM_PRIVATE_KEY = /etc/exim4/dkim/{DKIM_DOMAIN}.pem
DKIM_CANON = relaxed

In other words, all my websites are using the same DKIM keys. But that shouldn’t make a difference, right?

edited by ryanpq

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
2 answers

Hi @jpgklassen

Looks like a good Exim setup. It has nothing to do with DKIM - not in this case.

I’m guessing you’re using PHP. You need to change the MAILFROM address, so it doesn’t automatically use your domain.
I don’t know Exim, but I think it’s a drop-in-replacement of Sendmail just like Postfix is.

You can modify the php.ini for each domain, or simply add the following to the root .htaccess file (there is a space after the -i in the end):

php_value sendmail_path /usr/sbin/sendmail -t -f -i 
  • Ah nice, I didn’t know about that php setting. But the emails from my various websites are all coming from the email addresses I want -,, etc. I don’t want to change them. I just want to get rid of the “via” (FQDN) at the end, when I open the emails in ie. Gmail.

    Changing that php variable would change the email address the email is being sent from, right? That’s not quite what I’m looking for.

Hi @jpgklassen

To answer you question:
So it sounds to me that there’s no way for me to have multiple websites sending emails from multiple domains on the same server, without getting the “via”

Yes, follow what I’ve written in the first answer - add the PHP value.
I’m running several servers with many websites on each server and all of them are setup like this.