Solved

How do I set Return-Path in JavaMail?

Posted on 2003-11-03
7
2,340 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
Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

 

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

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.

Question has a verified solution.

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

Suggested Solutions

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

792 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