james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Norman Maurer <nor...@apache.org>
Subject Re: MailRepository.store() current user?
Date Mon, 04 Jun 2007 20:03:28 GMT
Hi,

I think i now understand your problem.. Maybe you could add a costum MessageHandler (SMTP)
which stores the needed info as mail attribute and use the attribute later in a costum ToRepository
mailet ?

Something like:

MessageHandler:
session.getMail().setMailAttribute("USERNAME", username);
session.getMail().setMailAttribute("PASSWORD", pass);

ToRepository:

mail.getMailAttribute("USERNAME");
....

Maybe you have to extent the AuthCmdHandler to store the needed stuff in the session before
to access it later in the MessageHandler.

If im not wrong then the username is allready stored as mailattribute. Check the DataCmdHandler
( I think this was the right CmdHandler) for what is stored.


I hope I not confuse you to much.. For sure ask if any questions still present. I will try
to assist you as much as I can :-)

bye
Norman


On Mon, 4 Jun 2007 10:13:36 -0700 (PDT), Michael Valenty <mike@valenty.com> wrote:
>
> Sure. I have an existing messaging/crm system with a UI and I am using
> James
> to expose pop3/smtp services. I implemented a custom MailRepository and
> UsersRepository to authenticate and pull messages from my companies
> backend.
>
> I am testing with a few pop3 clients, including Outlook Express, to
> retreive
> mail (works). The smtp part is used when sending mail from a pop3 client.
> I
> would like the mail to be logged by my messaging system so the user can
> see
> the mail in their sent items when using the existing web UI.
>
> For smtp, I require auth and us my custom UsersRepository (works). I am
> using the ToRepository mailet to send the mail to my custom
> MailRepository.
> This invokes the store() method as expected.
>
> The part that is a problem is that the instance of MyMailRepository that
> store is invoked on is not tied to the authenticated user from the smtp
> session. It's the same instance of MyMailRepository every time and the
> only
> way I can see to distinguish who sent the mail is by looking at
> Mail.getSender(). This is a problem because I need auth info on the user.
>
> I hope I didn't confuse you more :) Thanks for attempting to understand my
> setup...
>
>
> Norman Maurer-3 wrote:
>>
>> Hi ,
>>
>> can you ellaborate ?
>>
>> I'm a bit lost atm :-/
>>
>> bye
>> Norman
>>
>> Am Freitag, den 01.06.2007, 17:35 -0700 schrieb Michael Valenty:
>>> I am trying to put a "sent item" in my messaging system
>>> (MyMailRepository)
>>> when sending mail from a smtp client like Outlook Express. The
>>> ToRepository
>>> mailet (see below) is working but I don't know how to get the user
>>> credentials from the smtp session.
>>>
>>>
>>> Michael Valenty wrote:
>>> >
>>> > In config.xml > spoolmanager > processor(name=transport), I added:
>>> >
>>> >       <mailet match="All" class="ToRepository">
>>> >         <repositoryPath>ew://mail/outgoing/</repositoryPath>
>>> >       </mailet>
>>> >
>>> > Then, when I send mail from a Outlook to a remote recipient
>>> > MyMailRepository.store() is invoked as expected. The issue is that it
>>> > looks like there is only one instance of MyMailRepository for all
> users
>>> > and I have to look at mail.getSender() to figure who it's from.
>>> >
>>> > I noticed that MyMailRepository.configure is called with
>>> destinationURL=
>>> > ew://mail/outgoing/ and not ew://mail/outgoing/<username> like w/
>>> > inboxRepository.
>>> >
>>> > Also, I am requiring auth on SMTP and I would like to get the current
>>> > user... Any ideas?
>>> >
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
>> For additional commands, e-mail: server-dev-help@james.apache.org
>>
>>
>>
>
> --
> View this message in context:
> http://www.nabble.com/MailRepository.store%28%29-current-user--tf3848358.html#a10953965
> Sent from the James - Dev mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
> For additional commands, e-mail: server-dev-help@james.apache.org
>
>
> !DSPAM:1,46644866102395673013606!


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


Mime
View raw message