Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

Display new Mail message using SSH

 
Tom Hartsook
Advisor

Display new Mail message using SSH

When I login to my username using SSH, the "new Mail" message fails to appear. Using TELNET, the message appears as normal. The CheckMail parameter is set to yes. Any ideas?

Thanks.

Tom
3 REPLIES 3
Hein van den Heuvel
Honored Contributor

Re: Display new Mail message using SSH

SSH also does SY$ANNOUNCEMENT differently.
Too bad.


If you like a workaround, then you could use the following trivial code...


#include
#include
#include
typedef struct { short len, cod; void *address; int *retlen; } item;
main()
{
int status, user_context = 0;
int SYS$GETJPIW(), MAIL$USER_BEGIN(), MAIL$USER_GET_INFO(), MAIL$USER_END();
char username[14];
short mess;
item null[] = {0,0,0,0};
item user[] = {12, JPI$_USERNAME, username, (int *)user, 0,0,0,0};
item news[] = {sizeof(mess), MAIL$_USER_NEW_MESSAGES, &mess, 0, 0,0,0,0};

status = MAIL$USER_BEGIN(&user_context, null, null);
if (status & 1) status = SYS$GETJPIW(0,0,0,user,0,0,0);
user[0].cod = MAIL$_USER_USERNAME; /* watch out! Double usage user itemlist */
if (status & 1) status = MAIL$USER_GET_INFO(&user_context, user, news);
MAIL$USER_END(&user_context, null, null);
username[user[0].len] = '\0';
printf ("%d new message%s for %s\n", mess, (mess==1)? "": "s", username);
return status;
}

hth,
Hein.

Jon Pinkley
Honored Contributor

Re: Display new Mail message using SSH

As Hein said, SSH doesn't behave like telnet.

Another thing that does not work with SSH is disconnectable terminals. I.e. process using VTAxx like the following:

$ sho term
Terminal: _VTA888: Device_Type: VT400_Series Owner: JON
Physical terminal: _TNA889:

Jon
it depends
Tom Hartsook
Advisor

Re: Display new Mail message using SSH

Thanks for the program. Works great.
Tom