james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Daring" <cog...@chello.at>
Subject Re: LocalDelivery and Delivered-To
Date Sun, 09 Nov 2003 11:37:45 GMT
> Unfortunately, not true,  The LocalDelivery mailet is called to delivery
> all local recipients associated with a message.  Each one needs a unique
> Delivered-To header, which is additive with any Deliverted-To headers that
> might already exist.

Yes, no doubt about that.

> The code for doing that does need to be written, but the requirements
> need to be kept in mind.

To make things clear I replaced this
                // Add qmail's de facto standard Delivered-To header
                MimeMessage localMessage = new MimeMessage(message) {
                    protected void updateHeaders() throws MessagingException
                        if (getMessageID() == null) super.updateHeaders();
                        else {
                            modified = false;

with that
message.addHeader("Delivered-To", recipient.toString());
// no message.saveChanges();
and it's working fine for me. I do have the "Delivered-To"-Header in all of
local-mails (didn't removed the for-loop).
My point is that you dont have to call saveChanges() in order to add a
as long as the body didn't change or at least doesn't contain any non ascii
My James version im working with is quite different but I dont think it has
any affect
on this peace of code. For example I dont duplicate the mail in the
when it gets to the next mailet just use a reference. Therefor I also have
to remove the
Header on exit of LocalDelivery.

My intention was bringing the tmp-file from the smpt-handler (.m64) to my
without any additional processing (inserts in DB or copies in
filesystem(only move)) and without loading
the mail into memory in case its a really big one. One place where the
message is loaded into
memory is the new instance of MimeMessage above.


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

View raw message