james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Bagnara <apa...@bago.org>
Subject Re: MailRepository.store() current user?
Date Tue, 05 Jun 2007 17:10:15 GMT
Michael Valenty ha scritto:
>>>From a mail client like Outlook Express, users configure outgoing mail to use
> smtp.mycompany.com w/ auth required and then compose a message. I want that
> piece of mail to appear as a sent item in my company's existing messaging
> system.
> I am using James to handle the smtp session and do authentication using
> MyUsersRepository. I am logging the sent item in my company's messaging
> system using the ToRepository mailet & MyMailRepository.store(). I was
> expecting the instance of MyMailRepository to be associated w/ SMTPAuthUser,
> but it is the same instance for all users. The ToRepository mailet is always
> loading the same instance of MyMailRepository.

In a previous message I wrote you should use ToMultiRepository instead
of ToRepository otherwise you are simply telling JAMES Server to place
all outgoing mail to the outgoing repository (with no specific details
about the sender/recipient).

Now I add that I was wrong because you probably want the AUTH user to be
appended to the repository url and not the local part of the recipient.

Then the simplest thing you can do is to look at the
ToMultiRepository.java source and change the way it works to use the
authenticated sender instead of the local part of the recipient.

You probably will want to remove the iteration of recipients at all
because you need to store a single message even if there are multiple

Also, you should remove the "mail.setState(Mail.GHOST); " because you
probably don't want the mail to die after being stored.


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

View raw message