Solved

How do I set Return-Path in JavaMail?

Posted on 2003-11-03
7
2,314 Views
Last Modified: 2013-11-24
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
Comment
Question by:jerra
  • 4
  • 3
7 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 9670794
0
 

Author Comment

by:jerra
ID: 9670895
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
 
LVL 86

Expert Comment

by:CEHJ
ID: 9670920
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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 

Author Comment

by:jerra
ID: 9670954
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
 
LVL 86

Accepted Solution

by:
CEHJ earned 100 total points
ID: 9671002
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
 

Author Comment

by:jerra
ID: 9671024
Yes you're right, as always...  (;

Thanks!
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 9671047
:-)
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
JDeveloper 12c for 32 bit 4 84
object oriented programming comparison 5 71
Why my table column Id is not passed to java object? 4 39
servlet example 17 31
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question