Override sent by

We’re using a mail-in DB for queries, and our foreign offices reply from this database. But they’d like the replies to come back there too, now some people are replying to the ‘sent by’ (=username) address.

It is always possible for recipients to see the name in the ‘Sent by’ field, and copy this name, so replying to the sender directly. The recipients can be anyone in the world, thus any mail client in the world.

We have been trying to change the mail template by setting the “From” field to @GetProfileField(“CalendarProfile”; “Owner”), but at the moment the mail is being sent, it is always re-written and we can’t seem to find a location in the code where we can put our own values.

We know there is an openntf groupmailbox, but our users are also using the calendar and todo of the mail-in database so the openntf project is not an option.

Anyone any ideas?

Thanks!

Subject: Some ideas…maybe

I’m not certain how your whole setup is working. If your mail-in db is a central location people go to reply to messages there, you could write an agent that replace/add values in the sendto/sendfrom fields.

If your talking about e-mail addresses being replied to that come from a system generated message, you can modify the e-mail before sending and add a reply-to field, so any replies get sent to that e-mail instead, not back to the system where they are in effect dead.

Perhaps someone else will have better ideas. If this is not what you want, please define how the mails are generated, received and how my suggestions don’t work so I can help further.

-Tim

Subject: Re: Some ideas…maybe

Tim, thanks for your feedback.

The people do indeed reply to emails from a central location. This location is a standard mail file. For example, there is a mailfile called “Copenhagen” for our people in Copenhagen.

I’m trying to change the “From” fields, but I dove into the “CoreEmailClasses” but at the moment the “Send” function in called on the notesuidocument object, the From fields seem to be reset.

So if I write an agent, how can this solve my problem?

Tx

Ken

Subject: Got it

For anyone interested, I solved it by ‘overriding’ the QuerySend event event by putting the following lines at the end of the QuerySend sub:

Groupwave_SendThisMessage(source)

Continue = false

(did this in the Mail, Reply and Forward forms)

The “Groupwave_SendThisMessage” is added in the CoreEmailMessages Script Library. This function drops the email directly in the mail.box, without using the default uidoc.send() function.

Next step is the webmail. Guessing this will be a bit more tricky…

Subject: Code?

Can you post the code you used for this?