Accessing a mail box from an another user.

Discussion in 'Lotus Notes Programming' started by Eddy POULLET, Sep 21, 2005.

  1. Eddy POULLET

    Eddy POULLET Guest

    Hi,

    I must write a program (the DLL of Notes are accessed via Delphi)
    1) access the mailbox db file of multiples users and (move some mails in
    another local DB).
    2) the ACL of each mailbox DB is updated with a "virtual" user that have
    full rights on the DB.

    When I open the DB with the API "NFSOpenExtended" and a namelist of the
    virtual user, Lotus Notes ask allways my password with my Username.id
    and not with the Username.id fo the user in the namelist. Why ?

    Is it possible or does it exist an another/better mean to do it ?

    Thanks,
    Eddy POULLET
    Brussels
     
    Eddy POULLET, Sep 21, 2005
    #1
    1. Advertisements

  2. Eddy POULLET

    NUNZ Guest

    sk allways my password with my Username.id
    and not with the Username.id fo the user in the namelist. Why ?
    The reason for this is the Notes_Session you created either asked for a
    password or else you have the option that gives the ability to share
    your password with the operating system turned on and you are
    automatically starting the NOTES_SESSION as you.

    So, to fix this you can create a notes session using the following com
    / ole / call .


    You must explicitly initialize a COM session with one of the following
    NotesSession methods. These methods do not apply to LotusScript
    applications.
    Call session.Initialize("passwordOptional")
    Call session.InitializeUsingNotesUserName("name", "passwordOptional")

    Initializes a COM session with a specified user name.
    Note This method is new with Release 5.0.2b.
    Note This method is supported in COM only.
    Defined in
    NotesSession
    Syntax
    Call notesSession.InitializeUsingNotesUserName( name$ [, password$ ] )
    You must be connected to a Domino server for this to work.

    Password is optional. If you don't supply one then it will ask you for
    the password (only once as long as the session object endures).

    There is another method as well which may be better for you called
    SwitchToID and it is found in NotesRegistration
    variant = notesRegistration.SwitchToID( idfile$ [ , userpw$ ])
    Parameters
    idfile$
    String. The ID file to which you want to switch; specify the complete
    path, for example, c:\notes\data\user.id.
    userpw$
    String. The user's password.


    To use it try the following ... this assumes you have a session

    set reg = Createobject( "NotesRegistration" );
    Call reg.SwitchToID('somedrive\somepath\user.id', 'myPassword' );

    If you replace somedrive\somepath\user.id with the path to the users
    id file and the password is the users password then it should change
    the user for you.
     
    NUNZ, Sep 24, 2005
    #2
    1. Advertisements

  3. Eddy POULLET

    Eddy POULLET Guest

    Thanks for the help. With your informations and after looking at COM
    library and the C/C++ API doc, I have found the solution.

    Now I use a function defined in the notes C API : NotesInitIni that take
    as argument the lotus inifile. With this, I can open a session under the
    "virtual" username.

    Eddy POULLET
    Brussels

     
    Eddy POULLET, Sep 28, 2005
    #3
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.