Skip to content
Snippets Groups Projects
Commit 1786d706f8ee authored by Jean-Francois Pieronne's avatar Jean-Francois Pieronne
Browse files

secrules/get_mail_info.py initial version

parent d2155fa445bd
No related branches found
No related tags found
No related merge requests found
import os
from vms import starlet
from vms.rtl import lib
from vms import user
from FindFile import FindFile
def getMailObjectInfo():
all_users = user.all_users()
maxsysgroup = lib.getsyi(syidef.SYI__MAXSYSGROUP)[1]
def file_exists(fn):
try:
with FindFile (fn) as ifn:
ifn.__next__()
return True
except VMSError, e:
return False
objectMailPresent = False
objectMailAccount = False
objectMailUser = ''
with os.popen('MCR NCL SHOW SESSION CONTROL APPLICATION MAIL') as p:
r = [x[:-1] for x in p]
for l in r:
if '= MAIL' in l:
objectMailPresent = True
if objectMailPresent:
for u in all_users.values():
if u.username == 'MAIL$SERVER':
objectMailUser = u
objectMailAccount = True
return objectMailPresent, objectMailAccount, objectMailUser
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment