Can I stamp the "From" field with a LotusScript encryption agent without affecting the sender name?
I am using the EncryptOnSend method to send encrypted mail to the recipient through an agent. If the recipient is outside the SMTP domain, the "From" address automatically comes as the signer of the LotusScript agent.
I want the sender name stamped in the "From" field when it is getting posted to the mailbox.
Do you have any LotusScript solutions?
If I understand you correctly, no I don't. It sounds like what you want to do is have various users generate Lotus Notes email that is somehow routed to a LotusScript agent, which encrypts it and passes it on. You do not want the email to appear to be from the signer of the LotusScript agent doing the encryption.
You will not be able to accomplish this within Lotus Notes. The "From" field will ALWAYS be set to the owner of the code that executes the send method -- in this case, your LotusScript agent. Now, the agent can modify the text of the message to begin with a header stating who the message came from…
(Doc is the document which presumably has been delivered to a mail-in database and is being processed by an agent which is about to encrypt it and send it?)
Dim body As NotesRichTextItem Set body=doc.GetFirstItem("Body") Dim NewMemo As NotesDocument Call Doc.CopyAllItems(NewMemo) Call newmemo.removeitem("Body") Dim newBody As New notesRichTextItem(NewMemo,"Body") Call newBody.AppendText ("This message was sent by "+doc.from(0)+" and encrypted by the super deluxe encryptor dohickey.") Call newBody.AddNewline(2) Call newBody.AppendRTItem(body)
Within Lotus Notes, you can add a "Principal" field, which the Lotus Notes mailbox will report as the sender, but which other email systems will generally ignore. You cannot change the "From" field. Although others claim to do it, running an agent inside mail.box is such a bad idea that I'm not even going to discuss it.
If this is an absolute showstopper, you might consider writing your agent in .NET or Visual Basic. It's easy to access a Lotus Notes document through COM, and you can change the apparent sender pretty easily when using the System.Mail SMTP API. But I don't know if this would be feasible, since you want to employ Lotus Notes encryption.
I've accomplished this in the past by saving a Lotus Notes document with LotusScript in mail.box and stuffing the From field with the alias. I've used this technique since Lotus Notes R4 and it works great. The only downside is you must have access to the Domino server for this to work.
Do you have comments on this tip? Let us know.
Related information from SearchDomino.com:
This was first published in September 2006