Author |
Message |
Malcolm Wise
Joined: 26 Jan 2000 Posts: 22
|
|
Mail Return Failure on Remote Agent |
|
I am running a job of type 'Database' using a remote agent. The job is setup to send notification by email on start of job. I am not receiving the email even though the job executes. The following message appears in schedule.log on the agent computer (Win NT4 server SP4): Sending mail failed: Mail Return Failure! If I run the job from 24x7 in normal mode on the same server (not via the agent) the mail is sent, so the mail profile setup seems to be OK. I can also send messages using Sybase ASE sybmail using the same profile. I am running 24x7 v1.6.3.
|
|
Wed Jan 26, 2000 11:19 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
Re: Mail Return Failure on Remote Agent |
|
You get "Mail Return Failure!" because mail log-on fails. If you run 24x7 as an NT service, it will not be able to send emails using simple MAPI interface. This a limitation of the MAPI. For local jobs running by the main scheduler consider using available command line SMTP utility instead. You can find one on the MS Exchange Server Resource Kit. Change the job notification action to "create a semaphore file" before start. Make another job that watches for that file and runs SMTP utility when it finds the file then deletes it. For a remote job you can change the job type from database to script then do: Run "smtp .... DatabaseConnect DatabaseExecute <same SQL here, ... DatabaseDisconnect : I am running a job of type 'Database' using a remote agent. The job is setup : to send notification by email on start of job. I am not receiving the : email even though the job executes. The following message appears in : schedule.log on the agent computer (Win NT4 server SP4): Sending mail : failed: Mail Return Failure! : If I run the job from 24x7 in normal mode on the same server (not via the : agent) the mail is sent, so the mail profile setup seems to be OK. I can : also send messages using Sybase ASE sybmail using the same profile. : I am running 24x7 v1.6.3.
|
|
Wed Jan 26, 2000 11:54 am |
|
 |
Malcolm Wise
Joined: 26 Jan 2000 Posts: 22
|
|
Re: Mail Return Failure on Remote Agent |
|
So running 24x7 as an agent is the same as running it as an NT service? I have not configured 24x7 to run as an NT service! : You get "Mail Return Failure!" because mail log-on fails. If you : run 24x7 as an NT service, it will not be able to send emails using simple : MAPI interface. This a limitation of the MAPI. : For local jobs running by the main scheduler consider using available command : line SMTP utility instead. You can find one on the MS Exchange Server : Resource Kit. Change the job notification action to "create a : semaphore file" before start. Make another job that watches for that : file and runs SMTP utility when it finds the file then deletes it. : For a remote job you can change the job type from database to script then do: : Run "smtp .... : DatabaseConnect : DatabaseExecute <same SQL here, ... : DatabaseDisconnect
|
|
Wed Jan 26, 2000 12:24 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
Re: Mail Return Failure on Remote Agent |
|
Nop, it's NOT the same. If you are not running it as a service, make sure you can send email using the same settings. Can you send email from the Agent computer using the setting that you specified in the job definition? : So running 24x7 as an agent is the same as running it as an NT service? I : have not configured 24x7 to run as an NT service!
|
|
Wed Jan 26, 2000 12:53 pm |
|
 |
Malcolm Wise
Joined: 26 Jan 2000 Posts: 22
|
|
Re: Mail Return Failure on Remote Agent |
|
Yes, I can send email from the agent computer using the same mail settings. The agent computer is also a SQL server running Sybase Adaptive Server 11.5.1. I can send email using sybmail, which is Sybase's method of sending email using stored procedures via MAPI. If I shut down the agent and start 24x7 in normal mode as a master scheduler (also not running as an NT service), I can send email using MailSend from 24x7 script jobs and also use the email notification for start/end of job and job error conditions. I am using the same mail profile settings for all these operations. : Nop, it's NOT the same. : If you are not running it as a service, make sure you can send email using : the same settings. Can you send email from the Agent computer using the : setting that you specified in the job definition?
|
|
Wed Jan 26, 2000 5:19 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
Re: Mail Return Failure on Remote Agent |
|
What is happening when you send email from the agent while your email client software such as MS Outlook is running (it will keep MAPI loaded in memory)? : Yes, I can send email from the agent computer using the same mail settings. : The agent computer is also a SQL server running Sybase Adaptive Server : 11.5.1. I can send email using sybmail, which is Sybase's method of : sending email using stored procedures via MAPI. If I shut down the agent : and start 24x7 in normal mode as a master scheduler (also not running as : an NT service), I can send email using MailSend from 24x7 script jobs and : also use the email notification for start/end of job and job error : conditions. I am using the same mail profile settings for all these : operations.
|
|
Wed Jan 26, 2000 7:03 pm |
|
 |
Malcolm Wise
Joined: 26 Jan 2000 Posts: 22
|
|
Re: Mail Return Failure on Remote Agent |
|
There is still no mail sent. I am running with MS Outlook 98 as the client. : What is happening when you send email from the agent while your email client : software such as MS Outlook is running (it will keep MAPI loaded in : memory)?
|
|
Thu Jan 27, 2000 4:20 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
Re: Mail Return Failure on Remote Agent |
|
I just tested it in two different configurations and it works here. Are you sure that you are sending email using the same settings. Also, here is a workaround that may want to use. Make another job script type and schedule it instead of the orifginal job. In the script put the following MailSend ... JobRun( ) in this case the email will be generated and sent by the central scheduler and eventually provide you with the same result of being notified before original job starts. : There is still no mail sent. I am running with MS Outlook 98 as the client.
|
|
Thu Jan 27, 2000 1:06 pm |
|
 |
Malcolm Wise
Joined: 26 Jan 2000 Posts: 22
|
|
Re: Mail Return Failure on Remote Agent |
|
Yes. I only have one mail profile set up on this machine. I have noticed, however, that if I just supply an empty string ("") or an invalid password as the password parameter in a MailSend the mail still gets sent (when running the script job on the agent machine via 24x7 in normal mode). I get no prompt for a password. Outlook does not have to be running at the time. Is it possible to give me details of the configurations that you've tested to see if I can spot any discrepancies? I have also tried using another remote agent with the same results. : I just tested it in two different configurations and it works here. Are you : sure that you are sending email using the same settings. : Also, here is a workaround that may want to use. : Make another job script type and schedule it instead of the orifginal job. : In the script put the following : MailSend ... : JobRun( ) : in this case the email will be generated and sent by the central scheduler : and eventually provide you with the same result of being notified before : original job starts.
|
|
Fri Jan 28, 2000 9:18 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
Re: Mail Return Failure on Remote Agent |
|
1) NT 4, SP5, workstation to NT 4, SP5 with MAPI and Novell Groupwise 5.5, to send/read email requires both user and password 2) Windows 98 laptop, both master and agent run locally, MAPI, Exhange, MS Outlook Express, to send/read email by default does not require user and password. In your case the problem most likely is related to how MAPI works on your computer. For some reasons it either deny access or fails to initialize whenever email is sent from a application without visible window or having no window at all. I will try to search on Microsoft Developer Network for similar issues. : Yes. I only have one mail profile set up on this machine. I have noticed, : however, that if I just supply an empty string ("") or an : invalid password as the password parameter in a MailSend the mail still : gets sent (when running the script job on the agent machine via 24x7 in : normal mode). I get no prompt for a password. Outlook does not have to be : running at the time. : Is it possible to give me details of the configurations that you've tested to : see if I can spot any discrepancies? I have also tried using another : remote agent with the same results.
|
|
Fri Jan 28, 2000 11:44 am |
|
 |
Malcolm Wise
Joined: 26 Jan 2000 Posts: 22
|
|
Re: Mail Return Failure on Remote Agent |
|
This is the configuration that I'm using: Master Scheduler is running on an NT4 SP6 workstation. Agent is running on an NT4 SP4 server. Outlook 98 is installed with MS Mail/Workgroup Mail/Exchange and Internet e-mail (POP3/SMTP) options. I have one profile set up. This has the following services: Internet E-Mail, Personal Address Book, Outlook Address Book I don't know if it's possible for you to reproduce this setup and see if you have the same problem sending mail via the agent. By the way, if I run master and agent locally (i.e. set up an agent with driver = local), the mail works fine. : 1) NT 4, SP5, workstation to NT 4, SP5 with MAPI and Novell Groupwise 5.5, to : send/read email requires both user and password : 2) Windows 98 laptop, both master and agent run locally, MAPI, Exhange, MS : Outlook Express, to send/read email by default does not require user and : password. : In your case the problem most likely is related to how MAPI works on your : computer. For some reasons it either deny access or fails to initialize : whenever : email is sent from a application without visible window or having no window : at all. I will try to search on Microsoft Developer Network for similar : issues.
|
|
Tue Feb 01, 2000 6:38 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
Re: Mail Return Failure on Remote Agent |
|
Please check out this documents http://msdn.microsoft.com/library/psdk/mapi/intro_2qnn.htm http://msdn.microsoft.com/library/psdk/mapi/intro_1qwj.htm Keep in mind that 24x7 uses "Simple MAPI" interface. If you can obtain the debug version of MAPI you can try "To produce application log entries through asserts and error traces" to see what is going on For details see the first document listed above. : I am running a job of type 'Database' using a remote agent. The job is setup : to send notification by email on start of job. I am not receiving the : email even though the job executes. The following message appears in : schedule.log on the agent computer (Win NT4 server SP4): Sending mail : failed: Mail Return Failure! : If I run the job from 24x7 in normal mode on the same server (not via the : agent) the mail is sent, so the mail profile setup seems to be OK. I can : also send messages using Sybase ASE sybmail using the same profile. : I am running 24x7 v1.6.3.
|
|
Tue Feb 01, 2000 1:14 pm |
|
 |
Malcolm Wise
Joined: 26 Jan 2000 Posts: 22
|
|
Re: Mail Return Failure on Remote Agent |
|
I've managed to get a remote job to send mail!! I made a change to the job to run asynchronously and it will now work. Any ideas as to why?? : Please check out this documents : http://msdn.microsoft.com/library/psdk/mapi/intro_2qnn.htm : http://msdn.microsoft.com/library/psdk/mapi/intro_1qwj.htm : Keep in mind that 24x7 uses "Simple MAPI" interface. : If you can obtain the debug version of MAPI you can try "To produce : application log entries through asserts and error traces" to see what : is going on : For details see the first document listed above.
|
|
Wed Feb 02, 2000 12:29 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
Re: Mail Return Failure on Remote Agent |
|
It looks like the only difference is that the async. job is executed in a separate thread (sort of a separate process). So that MAPI gets called by an virtually independed process and somehow it responds differently. : I've managed to get a remote job to send mail!! I made a change to the job to : run asynchronously and it will now work. Any ideas as to why??
|
|
Wed Feb 02, 2000 12:39 pm |
|
 |
|