You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by Scherer Pierre <sc...@ibelgique.com> on 2003/03/06 19:05:23 UTC

ID-mail

Hi again,

Is it possible that the ID of a message change during is life-cycle in the
spoolmanager?
Because in my log file 'tracking', I have a change of ID for the same mail
when mail change of processor (root -> transport)
like this :

----------
06/03/03 18:48:07 INFO  tracking: Journal : Mailet [AddFooterTrack], Sender
[test2@127.0.0.1], recipient [test3@scherer.be], message id
[<NJ...@127.0.0.1>], subject [Test local
delivery], remoteIpAddr [127.0.0.1], state [root], size [722.0], size body
[13], info [addFooter : Helloworld]

06/03/03 18:48:07 INFO  tracking: Journal : Mailet [AddHeaderTrack], Sender
[test2@127.0.0.1], recipient [test3@scherer.be], message id
[<NJ...@127.0.0.1>], subject [Test local
delivery], remoteIpAddr [127.0.0.1], state [root], size [722.0], size body
[13], info [header add : name [X-MailetHeader]; value [TEST]]

06/03/03 18:48:07 INFO  tracking: Journal : Mailet [ToProcessorTrack],
Sender [test2@127.0.0.1], recipient [test3@scherer.be], message id
[<NJ...@127.0.0.1>], subject [Test local
delivery], remoteIpAddr [127.0.0.1], state [root], size [722.0], size body
[13], info [pass to transport processor]

06/03/03 18:48:08 INFO  tracking: Journal : Mailet [LocalDeliveryTrack],
Sender [test2@127.0.0.1], recipient [test3@scherer.be], message id
[<83...@pipo>], subject [Test local
delivery], remoteIpAddr [127.0.0.1], state [transport], size [727.0], size
body [13], info [Mail is stroring in the local mailbox of :
test3@scherer.be]

06/03/03 18:48:08 INFO  tracking: Journal : Mailet [LocalDeliveryTrack],
Sender [test2@127.0.0.1], recipient [test3@scherer.be], message id
[<83...@pipo>], subject [Test local
delivery], remoteIpAddr [127.0.0.1], state [ghost], size [727.0], size body
[13], info [Mail comes GHOST]
----------

There is a change of ID between 3 and 4 log.

Thanks evreyone for your constant help!!!!

-Pierre


---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org


RE: ID-mail

Posted by "Noel J. Bergman" <no...@devtech.com>.
> I see that there is a method in the class Mail call getName() that return
a
> String with a ID.

That is available from MailImpl, not MimeMessage, and it is an internal ID
for James only.  It is, however, the key that we use when accessing
repositories.

	--- Noel


---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org


RE: ID-mail

Posted by Scherer Pierre <sc...@ibelgique.com>.
I see that there is a method in the class Mail call getName() that return a
String with a ID.
Is it the same thing? I try using this but I don't pass compilation.

can anyone say me why?

-Pierre


---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org


RE: ID-mail

Posted by Danny Angus <da...@apache.org>.
Agree,
I filed a bug about this, they politely accepted my position and just as politely declined to take action.
:-)

The position is that we should subclass MimeMessage to change this behaviour.


d.

> -----Original Message-----
> From: Serge Knystautas [mailto:sergek@lokitech.com]
> Sent: 07 March 2003 03:14
> To: James Developers List
> Cc: JAVAMAIL-INTEREST
> Subject: Re: ID-mail
> 
> 
> Noel J. Bergman wrote:
> >>In fact I must keep the same ID to make tri on the mails incoming on
> > 
> > 
> > We understand the issue, and the problems that occur when Message-ID is
> > changed because you have added a header to a MimeMessage.  This is not
> > something that James does; it is part of JavaMail.  I am cc'ing the
> > JavaMail-Interest list on this reply.    Sun may have some 
> suggestion(s).
> 
> We used to instantiate MimeMessages in James using a "ServerMimeMessage" 
> that extended MimeMessage, and overrode saveChanges to remove these mail 
> client style behavior.  I'm not sure when or why it was removed, but 
> unless Sun has changed their position, JavaMail is geared towards mail 
> client usage, so this is how they want it to behave.
> 
> -- 
> Serge Knystautas
> President
> Lokitech >> software . strategy . design >> http://www.lokitech.com/
> p. 1.301.656.5501
> e. sergek@lokitech.com
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: james-dev-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org


RE: ID-mail

Posted by "Noel J. Bergman" <no...@devtech.com>.
Serge,

I know that Sun is aware of the issue.  It is actually an FAQ:

  http://java.sun.com/products/javamail/FAQ.html#msgid

and I know that you raised the issue in the past.  We have had this issue
come up more than once in even the past month on the James list, and I just
want Sun to be aware of the fact that this is a continuing issue.

As I said, we can implement subclassing, as discussed in the FAQ and our own
mailing list, but Sun might want to reconsider the subject.  The comment I
found in the archives from Bill Shannon was: "it guards against [accidental
usage]", and I suggest that there ought to be a way within the standard code
body to control the behavior.

One reason why I think it should be addressed in the base class rather than
left to subclasses is that service providers may provide their own
MimeMessage subclasses, and they won't necessarily provide the desired
behavior.  When updating a message received from Folder.getMessage(), I
don't know what updateHeaders semantic is implemented by that service
provider's MimeMessage subclass.

With respect to the client vs server usage argument, I could have client
code that scans messages in the background for spam or virii, and adds a
header.  I expect that at some point to see a Mailet pipeline in a mail
client.  The FetchPOP and newer FetchMail service for James basically
demonstrate that people are already using James almost as a server-side
client, so why not embed a Mailet pipeline directly in a client?

	--- Noel


---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org


Re: ID-mail

Posted by Serge Knystautas <se...@lokitech.com>.
Noel J. Bergman wrote:
>>In fact I must keep the same ID to make tri on the mails incoming on
> 
> 
> We understand the issue, and the problems that occur when Message-ID is
> changed because you have added a header to a MimeMessage.  This is not
> something that James does; it is part of JavaMail.  I am cc'ing the
> JavaMail-Interest list on this reply.    Sun may have some suggestion(s).

We used to instantiate MimeMessages in James using a "ServerMimeMessage" 
that extended MimeMessage, and overrode saveChanges to remove these mail 
client style behavior.  I'm not sure when or why it was removed, but 
unless Sun has changed their position, JavaMail is geared towards mail 
client usage, so this is how they want it to behave.

-- 
Serge Knystautas
President
Lokitech >> software . strategy . design >> http://www.lokitech.com/
p. 1.301.656.5501
e. sergek@lokitech.com



---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org


RE: ID-mail

Posted by "Noel J. Bergman" <no...@devtech.com>.
> In fact I must keep the same ID to make tri on the mails incoming on

We understand the issue, and the problems that occur when Message-ID is
changed because you have added a header to a MimeMessage.  This is not
something that James does; it is part of JavaMail.  I am cc'ing the
JavaMail-Interest list on this reply.    Sun may have some suggestion(s).

RFC 2822, section 3.6.4, states:

   Note: There are many instances when messages are "changed", but those
   changes do not constitute a new instantiation of that message, and
   therefore the message would not get a new message identifier.  For
   example, when messages are introduced into the transport system, they
   are often prepended with additional header fields such as trace
   fields (described in section 3.6.7) and resent fields (described in
   section 3.6.6).  The addition of such header fields does not change
   the identity of the message and therefore the original "Message-ID:"
   field is retained.  In all cases, it is the meaning that the sender
   of the message wishes to convey (i.e., whether this is the same
   message or a different message) that determines whether or not the
   "Message-ID:" field changes, not any particular syntactic difference
   that appears (or does not appear) in the message.

JavaMail changes the Message-ID header whenever you call
MimeMessage.saveChanges().  This occurs in MimeMessage.updateHeaders().
Rather than require applications to subclass MimeMessage to override this
behavior, perhaps a future version of JavaMail could facilitate keeping the
existing  Message-ID except when the application explicitly wants a new one.

In the meantime, changing this behavior under JavaMail v1.3 requires
subclassing the MimeMessage class.  We plan to do that in James v3 for the
local stores.  It could be done in James v2 as well, with an
org.apache.[mailet | james].MimeMessage class that would be used instead of
MimeMessage throughout the code.  We'd have to override updateHeaders.

	--- Noel


---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org


RE: ID-mail

Posted by Scherer Pierre <sc...@ibelgique.com>.
>The trick is to get the message id before you save changes and put it back
once the save is done.

I don't really understand how you can do that(use a X-header?). Can you give
me the command to do that(How can you restore ID when you change mailet and
processor).

In fact I must keep the same ID to make tri on the mails incoming on
James(so it's really important to keep this value).

Also, does AddFooter mailet run corretly on your server? Because with me it
never print the fotenote at the bottom of mails.

Thanks,

-Pierre


---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org


RE: ID-mail

Posted by Danny Angus <da...@apache.org>.
Yes message-ID calls to MimeMessage.saveChanges() generate a new message-ID.

This is expected behaviour. The theory is that any changes made make this a different message o the previous version.
I don't agree with that, but its not going to change.
The trick is to get the message id before you save changes and put it back once the save is done.

d.

> -----Original Message-----
> From: Scherer Pierre [mailto:scherer_pierre@ibelgique.com]
> Sent: 06 March 2003 18:05
> To: James-dev
> Subject: ID-mail
> 
> 
> 
> Hi again,
> 
> Is it possible that the ID of a message change during is life-cycle in the
> spoolmanager?
> Because in my log file 'tracking', I have a change of ID for the same mail
> when mail change of processor (root -> transport)
> like this :
> 
> ----------
> 06/03/03 18:48:07 INFO  tracking: Journal : Mailet 
> [AddFooterTrack], Sender
> [test2@127.0.0.1], recipient [test3@scherer.be], message id
> [<NJ...@127.0.0.1>], subject [Test local
> delivery], remoteIpAddr [127.0.0.1], state [root], size [722.0], size body
> [13], info [addFooter : Helloworld]
> 
> 06/03/03 18:48:07 INFO  tracking: Journal : Mailet 
> [AddHeaderTrack], Sender
> [test2@127.0.0.1], recipient [test3@scherer.be], message id
> [<NJ...@127.0.0.1>], subject [Test local
> delivery], remoteIpAddr [127.0.0.1], state [root], size [722.0], size body
> [13], info [header add : name [X-MailetHeader]; value [TEST]]
> 
> 06/03/03 18:48:07 INFO  tracking: Journal : Mailet [ToProcessorTrack],
> Sender [test2@127.0.0.1], recipient [test3@scherer.be], message id
> [<NJ...@127.0.0.1>], subject [Test local
> delivery], remoteIpAddr [127.0.0.1], state [root], size [722.0], size body
> [13], info [pass to transport processor]
> 
> 06/03/03 18:48:08 INFO  tracking: Journal : Mailet [LocalDeliveryTrack],
> Sender [test2@127.0.0.1], recipient [test3@scherer.be], message id
> [<83...@pipo>], subject [Test local
> delivery], remoteIpAddr [127.0.0.1], state [transport], size [727.0], size
> body [13], info [Mail is stroring in the local mailbox of :
> test3@scherer.be]
> 
> 06/03/03 18:48:08 INFO  tracking: Journal : Mailet [LocalDeliveryTrack],
> Sender [test2@127.0.0.1], recipient [test3@scherer.be], message id
> [<83...@pipo>], subject [Test local
> delivery], remoteIpAddr [127.0.0.1], state [ghost], size [727.0], 
> size body
> [13], info [Mail comes GHOST]
> ----------
> 
> There is a change of ID between 3 and 4 log.
> 
> Thanks evreyone for your constant help!!!!
> 
> -Pierre
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: james-dev-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org