Hello, I hope someone can save my sanity by helping me understand why a
very simple thing I'm trying to do inside a mailet's service method
doesn't work as I expect:
public void service(Mail mail)
throws MessagingException {
try {
MimeMessage mm = mail.getMessage();
String subject = mm.getSubject();
mm.setSubject(subject +"blabla");
subject = mm.getSubject();
.....
I would now expect the "subject" variable to contain the original
subject PLUS the added string but it's not: the second getSubject
invokation still returns the original subject instead of the modified one.
In addition, mailets following this one in the processor actually see
the modified subject and NOT the original one.
I don't get it, please help, thanks ciao
ste
p.s. I'm asking this 'cause I still don't get why this happens even
after I filled the Javamail's InternetHeaders class with debug prints.
I see the InternetHeaders.setHeader is called and that, at the end of
it, the subject header has been modified BUT the immediately following
InternetHeaders.getHeader call still sees the old one......
p.s.p.s. Of course I tried invoking saveChanges but that doesn't help
either (this is because it handles only the content of the mail and
content-related headers, at least from what I understood by looking at
Javamail sources).
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>