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:
- created a new form in ksmapcon.nsf with 2 fields: NotesUsername and Internetaddress
- added a view in kspamcon.nsf called EmailUser with the columns Internetaddress , Username.
- added a hidden field NotesUsername to the Form "Memo" in mailspam.nsf
- 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