Hi Michael,

why you think the same MailRepository should ne be used for all users ?
I don't understand your problem.. Maybe you can ellaborate again
why/when you need which MailRepository for which users..

Maybe that give me some idea and i can help again.

bye
Norman

Am Montag, den 04.06.2007, 14:06 -0700 schrieb Michael Valenty:
> I iterated through Mail.getAttributeNames() and SMTPAuthUser was already in
> there (put there by DataCmdHandler). With that, I am able to lookup the
> credential info I need. Thanks!!!
> 
> Still seems odd that the same MailRepository instance is invoked by the
> ToRepository mailet for all users. I can work around that but it makes me
> think I am doing something wrong...
> 
> 
> Norman Maurer-3 wrote:
> > 
> > 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
> > <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED]
> >>> For additional commands, e-mail: [EMAIL PROTECTED]
> >>>
> >>>
> >>>
> >>
> >> --
> >> 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: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >> 
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> > 
> > 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to