Forum Discussion
How to modify SMTP from-address?
SMTP has two Froms, one is in the SMTP commands (FROM xxx) and the other is in the message headers (From: xxx). I think there is some way to get sendmail to read the headers to infer the "FROM" it should use, but you can just use the -f switch to set it when you call it from a script. This is more of a unix question rather than APM: The delivery agent used by APM is completely separate from sendmail.
Your command would then look like:
echo "message data here" | sendmail -f 'ops-noreply@company.com' 'recipient@company.com
Google "sendmail from address" for more in depth discussion on this topic and information about how different user agents need this to be formatted to display a "friendly name" part of the address. Also be sure to sanitize username input if it's from an external source, especially those usernames with apostrophes, parens, or shell script injection attacks.
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com