Open JTP3XP opened 1 year ago
@JTP3XP
Thanks for reporting this. I am having a hard time reproducing this.
Could it be that your SMTP server will automatically rewrite the from
address to the one used for authentication?
Often, SMTP servers will raise an error if the address in the from
field does not match the one of the user authenticating against it. Maybe yours will try to rewrite it?
What mail system are you using?
@moesterheld You are right - we are using Gmail and they require you to do some configuration on your account before you can change the sender email address in outgoing emails. Thanks for the nudge in the right direction.
I still believe enabling the use of the name parameter in the other setFrom
overload (perhaps with a new config parameter) would be a valuable enhancement. It would allow folks to change the name easily, especially when the smtp server does not allow the mismatch between the sender address and authentication address. This could also make it trivial to specify many different sender names in different alerts if the option was added to the alerts UI (today I would have to set up and validate every different alias on the Gmail side - and Gmail has limits on how many aliases you can use). It's also nice for the from
label to not be restricted to valid email addresses, so you can have the emails coming from "Graylog" rather than "graylog@domain.com".
For example, the attached screenshot shows my options today in graylog - I can have it use the "mail@..." authentication address or an alias for the account that shows up as "graylog@...". But I cannot have a nice formatted name like "GitHub" or "Graylog Alerts". It's even worse in Outlook where the lack of name makes the preview pane show the whole email address instead of just the username part.
Is this something you all might add?
@JTP3XP Glad to be of help. I'll change this issue to a feature request and will put it in our backlog.
There appear to be 2 ways to set the "from" email address for email notifications:
transport_email_from_email
(directly or via env variableGRAYLOG_TRANSPORT_EMAIL_FROM_EMAIL
)Expected Behavior
When the email is received it should appear to come from the specified address
Current Behavior
The email always comes from the email address used for authentication
Steps to Reproduce (for bugs)
Both notifications will be sent without changing the sender address from the authentication address.
Context
It would be valuable to be able to control the from address because we reuse mail accounts for multiple services and changing the from address allows us to set up filters in our mail accounts to route messages from different sources appropriately.
On a related note, it can be a nice bit of polish to be able to utilize the
name
in addition to the email address, which should be possible by just using another overload of thesetFrom
method already in use.Your Environment