• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2628
  • Last Modified:

How do I set Return-Path in JavaMail?

I have tried MimeMessage.setHeader("Return-Path","<" + returnPath + ">"); but it does not work.
JavaMail always sets the address of the sender as "Return-Path".

0
jerra
Asked:
jerra
  • 4
  • 3
1 Solution
 
jerraAuthor Commented:
Return-Path is not the same as Reply-To.
I thought they were the same at first but apparently not.

Return-Path is the address to where all errormessages is directed.
Reply-To the address used when user hits "Reply" in the mail client.

I am starting to believe it is not possible to change this in JavaMail.
0
 
CEHJCommented:
Ah I see. I would be very surprised if JavaMail does not allow this as they would not then have implemented the spec (unless it's a new addition)
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
jerraAuthor Commented:
RFC 2821
"When the delivery SMTP server makes the "final delivery" of a
   message, it inserts a return-path line at the beginning of the mail
   data.  This use of return-path is required; mail systems MUST support
   it."

My mistake, apparently it is not up to the client to set this.
0
 
CEHJCommented:
Yes. This would suggest using my first post *is* the way to go:

http://www.ornl.gov/lists/mailing-lists/qmail/2002/09/msg00083.html

>>
The Return-Path header is always added by the final delivery agent, and it's
based on the envelope sender address. What you need to do is have your Java
mail program set the correct envelope sender address (this is the address
specified in the SMTP MAIL FROM command). Most MUA's automatically set the
envelope sender address to be the same as the address in the From header unless
you specify something else.
>>
0
 
jerraAuthor Commented:
Yes you're right, as always...  (;

Thanks!
0
 
CEHJCommented:
:-)
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now