• Mailspam.nsf Webform for end-users

    By henny kohler 2 decades ago

    I want to let each user see wich emails are stored for him/her in the database mailspam.nsf.

    He/she must be able to decide if this mail is spam or not.



    I have made a webform for mailspam.nsf, showing all emails (or all new emails).

    I have added a button in the the webform 'memo' to confirm that it is spam (set confirmation to "O") or to confirm that it is no spam (move email to mailgood.nsf)



    The only issue I have is that the user sees all mail in mailspam.nsf, also the emails for other users. Of course, that's not good.



    I have tried to use a view selection, with the function SELECT @Contains(@Trim(Recipients); @NameLookup([NoUpdate];@UserName; "InternetAddress")))

    but that does not work in Notes 6.

    Also, one user can have more than one email-address so I'm trying to find annother way to solve this.



    Perhaps it is possible to fill a new field "UserCN" on arrival of the message with the @Username value of the recipient.

    Then I can use the view selection

    SELECT @Contains(UserCN; @Username)



    Is this possible?


    • By Nico Vis 2 decades ago

      Have you tried to enable the KS_RECIPIENTS variable?

      Nico

      • By henny kohler 2 decades ago

        Hi Nico,



        I've tried KS_Recipients, but that gave me unpredictable results.

        Suddenly I get views with categories but without documents.



        Anyway, the function @UserName returns values as "CN=Henny Kohler/O=HEKOM" and KS-Recipient only gives me the value "Henny Kohler"



        Also, in my case, one user can have more than one email-address, or can be responsible for other email-addresses.



        I have created another solution:

        1. created a new form in ksmapcon.nsf with 2 fields: NotesUsername and Internetaddress
        2. added a view in kspamcon.nsf called EmailUser with the columns Internetaddress , Username.
        3. added a hidden field NotesUsername to the Form "Memo" in mailspam.nsf
        4. created a shared agent in mailspam.nsf, runs on schedule every 30 minutes

          This agent has the document selection set to [field confirmation does not contain "O"]

          and the Action:

          tmpReceiver := @Trim(Recipients);

          tmpUserINET:= @DbLookup("":"NoCache";"":"kspamcon.nsf";"EmailUser"; tmpReceiver; "Username");

          FIELD NotesUsername := tmpUserINET;

          SELECT @True



          Now, My webform in mailspam.nsf can have the ViewSelection " SELECT (@Contains(NotesUsername; @UserName)) & @Created < @Now " and it works perfectly!

          This webform shows only the messages for the user who logged in.

          (note: I have added @Created <@Now to force rebuilding indexes when the view is displayed)



          Of course, I have to maintain the translation-table Internetaddress-Username in the Kspamcon.nsf but that acceptable for me and it gives me a independent way to decide wich user is responsible for wich emailaddress.



          The only 'problem' I have is that the agents runs scheduled every 30 minutes. I would rarther see it runnig at the arrival of a new messages, but thats seems not rebliable enough.



          greetings from Holland,.

          Henny