Link to home
Start Free TrialLog in
Avatar of sridevi911
sridevi911

asked on

Server Agent not sending email successfully

Hi,

I've a webform, which has some fields and one among them is originator email address (origiemail).

This is what happens: when a user submits a requests via the web, the web query save agent will run an agent and sends an email to
doc.origemail(0) saying that the request is submitted successfully.

Now, this request (record) will come and sit in a view. Every 10 minutes I've another scheduled agent that processes this record.
After successfull processing, it sends an email to doc.origemail(0) saying that the request is processed successfully.

However, the second email part is not working. It sends email to doc.origemail(0). But the email is returned back saying the following:

"Error transferring to coregate2.INTERWAN.Companyname.COM; Invalid Internet address specified. Invalid Internet address specified"

However, the email address is a valid address. If i manually send an email to this address from my inbox, it works fine.

Please advise,
thanks
Sri
Avatar of qwaletee
qwaletee

The internet address being referred is the relay server IP address.  Change it to a host name.
Avatar of sridevi911

ASKER

please be advised, the first email is being sent correctly to the doc.origemail(0).

the second email is bouncing back when the email is sent to the same address doc.origemail(0).

Avatar of Sjef Bosman
How did you specify the addresses? What is in the Notes.log database?
Looks like some configuration error...

Make sure the Domain docs in both the server (one running web server and the agent process) are converting the address properly (look under conversions section/tab)

~Hemanth
Qwaletee, how do i change it to host name.

sjef,
for example if the user enters hisname@yahoo.com in the origemail field in the form and clicks on submit then,
the first web query save agent sends it successfully. here is the code for that.

Set doc3 = New NotesDocument(db)
doc3.form = "Memo"
doc3.SendTo = doc.Origemail(0)
doc3.CopyTo = EDImail

doc3.Subject = "Portal Adds & Deletes Request # " & doc.txtFormNumber(0) & " for " & doc.ConID(0) & " is SUBMITTED successfully."
Line1= "You are receiving this email because you are the Originator of this request. "  & Chr$(10)
Set rtitem = New notesRichTextItem(doc3,"Body")
Call rtitem.appendText(Line1)
Call doc3.send ( True )


Now this request sits in the view. When the scheduled agent runs, it process all what it has to and sends another email exactly using the same code above.
but the subject says PROCESSED successfully.

That is when I'm getting this message bounced back to our server... All i get is this message:
Error transferring to coregate2.INTERWAN.companyname.COM; Invalid Internet address specified. Invalid Internet address specified.

Very strange. And you are absolutely sure that there are no differences in the code, and that Origemail contains the right value? Can you run the second agent manually? Does it then give the same error? What happens if you enable the debugger and run the agent manually, what's the situation just before the Send?
if i run it manually it runs fine. In both the agents above, i'm using run on behalf of option.

the email id i used in the run on behalf of is a mail-in database.
So it is my understanding that mail-in databases cannot send emails when you run a server side agent which has the mail-in database email ID in the run on behalf of.

Again if this is the case i wonder how did the first one worked? the first agent (web query save agent which has the subject: submitted successfully)
also has the email ID of the mail-in database. This one works fine... but the second scheduled agent is the one that is not.

Does the user "on behalf of" whom the agent runs have sufficient rights to run agents? What's the Domino version of your server? If R6, what security level is set in the properties? What happens if you remove the "on behalf of", does it work then?
version is r6. i do not know the security level as it is done by the admin. also if i remove the on  behalf of, it works fine. but the email is being sent as if i'm sending it as i signed the agent.
Use the mailDoc.Principal field to set the senders name.
Otherwise will all restrictions prohibit the run of your Agent for proviledged access.

The security level can be set in the Agent's properties itself, since R6. Anyway, as Zvonko says, your Agent will probably never run on behalf of someone successfully this way. Use the Principal field.
Once more, this is not a problem with the addres on the e-mail.  It is a known problem with sending messages from an agent, where the destination SMTP server (the first SMTP server after leaving the Domino mail system) is specified to Domino as an IP address.  Don't ask me WHY this is a problem, it just is.  This can occur when you specify a relay host on an SMTP domain or a server configuration document or an SMTP connection document.
If i use the principal field it is sending the email successfully , however, if the doc.Origemail  is an internal company user then it is working fine.

otherwise if it is an external user it is sending an email as if I'm sending it (since i'm the signer of the agent).  

The security level of this agent is 2 = Allow Restricted Operations.

So when user do not have the permission to execute Agents with Restricted operations, then your agent will not even start when set to run on behalf of their rights.

You HAVE TO redesign the agent to run with aithorised rights and use users sender address. There are several pitfals with the Principal address.
Add your mail domain after the user name.
Like this:

doc3.Principal = session.EffecitiveUsername & "@yourNotesDomain"

Another way is to enter users Internet address as Principal.


ASKER CERTIFIED SOLUTION
Avatar of kalios
kalios

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial