Solved

How do I set Return-Path in JavaMail?

Posted on 2003-11-03
7
2,262 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
Comment Utility
0
 

Author Comment

by:jerra
Comment Utility
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
Comment Utility
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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 

Author Comment

by:jerra
Comment Utility
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
Comment Utility
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
Comment Utility
Yes you're right, as always...  (;

Thanks!
0
 
LVL 86

Expert Comment

by:CEHJ
Comment Utility
:-)
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Performance issue while iterating with streams 5 39
countX 22 68
mapBully challenge 6 88
groovy example issue 10 65
An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
I had a project requirement for a displaying a user workbench .This workbench would consist multiple data grids .In each grid the user will be able to see a large number of data. These data grids should allow the user to 1. Sort 2. Export the …
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 arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…

762 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now