I wrote a Salesforce email handler class in which I need to store the From address and later send emails to it. But I noticed that the from addresses were mangled for emails coming from my company.

Some investigation revealed that Salesforce was providing me the "Return-Path" header instead of the "From" header. Return-Path is where undeliverable messages are to be sent, not where human-generated replies are to be sent according to RFCs 3834 and 2821

These pieces of my headers look like this:

From: "Newman, Todd" <[email protected]>
Return-Path: [email protected]

The prepended string on the email comes from Barracuda, it's a part of SPF email security.

1 Answer 1


I discovered that the From address provided by the InboundEmail is the correct "From" header. Meaning, InboundEmail provides the "From" header and InboundEnvelope provides the "Return-Path" header.

This contradicts the documentation which says both classes provide the From header value. (Envelope and Email)

I spent some time with Salesforce support on this. They insisted that the from value is being mangled by the sending server. This obviously doesn't makes sense. If it were true I wouldn't get different answers from the Envelope and Email classes. Also, nobody in the world would be able to reply to emails from our company.

So I'll put this out there in case someone else runs into the problem. Use .fromAddress from the Email object, not the Envelope object.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .