Agent/Emails

We have a mail-in DB which serves a purpose of a mail-box. When new email arrives, an agent picks it up and copies to another database - let’s call it Database A. Another agent runs from the Database A and sends out emails to the original email senders with a text message. Lately we noticed that %text get appended to our email address. That prevents people from responding. For example instead of ESBInfo@aaa.com it puts ESBInfo%ESB@aaa.com. Does anyone knows why?

Subject: Agent/Emails

Can you please send me the code of that agent…

Subject: RE: Agent/Emails

Here is a code of the agent:Sub Initialize

Dim s As New NotesSession	

Dim db As NotesDatabase

Dim v As NotesView

Dim doc As NotesDocument

Dim doc2 As NotesDocument

Dim notifyGroupDoc As NotesDocument

Dim notifyDoc As NotesDocument

Dim notifyName1 As NotesItem

Dim notifyName As String

Dim item As NotesItem

Dim tranDoc As NotesDocument

Dim logItem As NotesRichTextItem

Dim body As String







Set db = s.CurrentDatabase

'Create New Transfer Log

Set tranDoc = db.CreateDocument()

tranDoc.Form = "TranLog"

tranDoc.logType = "Email Data"

tranDoc.logDate = Now

Set logItem =  New NotesRichTextItem(tranDoc,"log")

Set style = s.CreateRichTextStyle



Set v = db.GetView("(agent view)")

v.AutoUpdate = False

Set doc = v.GetFirstDocument

Set notifyDoc = New NotesDocument(db)

notifyDoc.Form = "ARF"

body = "text"

While Not (doc Is Nothing)	

Set item = doc.GetFirstItem("dataSend")

If (item.text ="Yes") Then

'Skip already processed documents..

Goto NextDoc

End If

Call doc.ReplaceItemValue("dataSend", "Yes")

Call doc.Save(True,False,False)

Set notifyName1 = doc.GetFirstItem("From")

notifyName= notifyName1.text

notifyName=Strright(notifyName,"<")

notifyName=Strleft(notifyName,">")

	

If Not(notifyName="") Then

notifyDoc.reqId=doc.reqID(0)

		notifyDoc.SendTo=notifyName

notifyDoc.Subject = “ESB Info”+" [" & doc.reqID(0) & “]”

notifyDoc.Principal = "ESBInfo"

Call notifyDoc.ReplaceItemValue("Body",body)

Call notifyDoc.Send(False)

'Update TranLog

Call logItem.AddNewLine(1)

style.NotesFont = FONT_HELV

style.FontSize = 14

style.NotesColor = COLOR_DARK_YELLOW

style.Bold = True

Call logItem.AppendStyle(style)

Call logItem.AppendText("Emailed To: " + notifyName)

Call logItem.AddNewLine(1)		

Call tranDoc.Save(False,False)

End If	

NextDoc:

	Set doc = v.GetNextDocument(doc)

Wend		



v.AutoUpdate = True

End Sub

Subject: Agent/Emails

Lately we noticed that %text get appended to our email address.

Then you said:

For example instead of ESBInfo@aaa.com it puts ESBInfo%ESB@aaa.com.

I just wnt to make sure I ddin’t miss something when %text and then showed %ESB.

Everything looks OK, when the document gets copied from the mail-in DB to database A? Do you have an original copy of the document sent from Database A? (or is it deleted after it’s mailed? - Maybe for testing keep a few copies and see if the From value has %text or if it’s added AFTER by the mail server.

Subject: RE: Agent/Emails

Thank you for taking time to answer to me. Here is clarification. First of all, this agent has been running for more then a year with no problems. The problem in question start happening recently. My best guess would be that something causing it on a Mail server but I cannot be sure. I am a developer and have no Admin rights. Everything looks fine by the time Call Doc.Send(False) executes. My other guess is an address book. I set principle field to: notifyDoc.Principal = “ESBInfo”. “ESBInfo” is listed in a address book along with its email address.

Subject: RE: Agent/Emails

The message is going out by internet email, and the mail gateway is adjusting the “From” email address – converting it to internet syntax. There has been some change in the internet mail gateway or in the address book document of the sending ID. You need to talk to your mail admins.

Note that when you send email, you can use the ReplyTo item to specify a different reply address from the sending address. So you could put whatever the correct address is, in that field.

But it would be better to get the gateway set up to provide the correct address. I’m sorry, I don’t know the details of how, offhand.