Configuring the From Email Address
Lets begin by looking at a basic email header from a default configured LiquidFiles system:
Here we can see that email@example.com has send a secure message to firstname.lastname@example.org. We can also see that the actual From address is email@example.com. In this case LiquidFiles will also set a Reply-To header with the value of firstname.lastname@example.org so if the recipient clicks Reply or Reply-All, it should set the To address to email@example.com.
And just to be super clear, the From: header is composed of
From: "Friendly Name" <emailaddress>
In most email clients, they would show the Friendly Name, but it's completely up to the email client and sometimes configuration within the email client what it actually shows.
The From email address, firstname.lastname@example.org is configured in Admin → Configuration → Email as the Email Sender Address:
We can see two settings here:
- Email Sender Address: This is the Email Address that will be set as the default From address, and any system generated emails (password resets, ...) where there's no defined Sender.
- Use The Email Sender Address as from address for all emails: controls if LiquidFiles should use the Sending Users Email Address as From Address or the global Email Sender Address.
Can we set that LiquidFiles sends Emails with the Sending Users Emails Address as the From Email Address?
Yes, absolutely, if you untick the "Use Email Sender Address as from address for all emails", LiquidFiles will send emails with the sending users Email Address, lets repeat the example above with that configuration:
And when email@example.com sends a secure message to firstname.lastname@example.org, the header will now look like:
As you can see, the email will now have a From Header that looks like
From: System Administrator <email@example.com>
which is how you would normally expect an Email From header to look.
So, if this how an Email From header normally looks, why isn't this the default configuration?
Here's a list of some issues you may need to deal with:
Email Relay services
If you use an Email Relay service with LiquidFiles, it's almost guaratneed that the email relay service will have some form of sender restriction. And while Microsoft Office365 is a popular choice as an Email Relay Service, it was not design with this use case in mind and is not great at it. For instance, if you login to Office365 as firstname.lastname@example.org, the email From address MUST be set to email@example.com. This in turn means that the only possible configuration is to set the Email Sender address to firstname.lastname@example.org and to enable "Use Email Sender Address as from address for all emails", to ensure that you only ever send emails with this addres.
Dedicated Email Relay services like SMTP2Go will allow you to restrict email relays to certain domains, so if you login to SMTP2Go using email@example.com, you can still set the Email Sender Address to something like firstname.lastname@example.org. But, lets say that you have an external user email@example.com with an account on your LiquidFiles system. If she logins in and sends a message to firstname.lastname@example.org, if we don't enable "Use Email Address as from addres for all emails", the From address will be email@example.com and your Email Relay Service will almost certainly reject this email because it's not from a list of approved email domains.
There used to be email relay services that didn't restrict the From address but with the amount of email abuse that exist these days, we're not aware of any email relay services that will permit unrestricted from addresses. And unless your LiquidFiles use case is heavily restricted to only a handful of email domains you deal with, it's unlikely practical to specify every possible email domain.
Email Relay servers
If you have a local email server you wish to use to relay emails from internal systems such as LiquidFiles, you may be able to remove email sender (From address) restrictions. Please refer to the documentation or support for your email server to see if this is a possibility.
Sender Policy Framework (SPF)
Lets say that you decide to not use an email relay service and configure LiquidFiles to deliver emails directly without using an email relay server or service.
The next issue you will have to deal with is SPF. Almost all email domains these days are configured with SPF, which basically outlines which servers that a receiving email server can expect connections from. Lets go to MXToolbox.com and look at hotmail.com as an example:
Here you can see a list of servers and IP address ranges that a receiving email server can expect connections from to help determine if this is a legitimate email or not.
Lets say that you disable "Use Email Sender address as from address for all emails" and a remote user firstname.lastname@example.org logs in and send a message to email@example.com. If your email server is configured correctly, it will look at the connecting IP address and lookup the SPF record for @hotmail.com and see a list like the one above and determine this connection is NOT from an approved list of senders for @hotmail.com.
If the only email server that will ever receive emails from external users email addresses is your email server, you should be able to whitelist the LiquidFiles IP address and tell your email server to always trust the LiquidFiles IP address, you should be able to get around these SPF restrictions.
But lets say you also have a list of External Users that can send to other external users. You now have external email servers that you will need to work with the system administrators to ensure that their email server(s) will also trust that any email from your LiquidFiles system should be trusted and not perform SPF checks for the LiquidFiles IP address.
As you can see, LiquidFiles is configurable so you can set it to use whatever Email Sender address is right for your environment. And please make sure your enviroment supports the configuration you wish to set.