Architecting, installing and maintaining your SAS environment

Need help on secure way to send an email with sas please

Accepted Solution Solved
Reply
Senior User
Posts: 1
Accepted Solution

Need help on secure way to send an email with sas please

Hi, 

 

I am wondering if someone could provide help... Now we are using SMTP to send emails and we noticed that user can send email on behalf of somebody else using SAS servers with Display Manager and Enterprise Guide.

 

Code example:

 

* Automatic Parameters:

*;

%let email_to   ="pdupuis@cihi.ca" ;

%let email_from ="Mickey Mouse <MickeyMouse@cihi.ca>";

%let email_cc   ="Mini Mouse <MickeyMouse@cihi.ca>";

 

* Step: Sending log via email:

*;

%macro SendEmail;

               filename outbox email "null" emailsys=smtp from=(&email_from.);

               data  _null_;

                                           file outbox

                                            to=(&email_to.)

                                            cc=(&email_cc.)

                                            subject="Test email"                                           

                                            lrecl=256;

                                            put " ";

                                            put "Hi,";

                                            put " ";

                                            put "This is a test email.";

                                            put " ";                                 

                                            put " ";                                 

                              run;

run;

%mend;

%SendEmail

 

 

We wish to enabled the SMTP authentication but because of our security rules we cannot allow our SAS users to have their password save in their SAS program even though it is encoded using "pwencode" or save using macro variable under a personal location.

 

I asked TS and apparently the only secure way is to use "pwencode" to save the password.  Does anyone figured a way? 

 

Thanks.

 

Pierre.  

 


Accepted Solutions
Solution
‎05-18-2016 07:33 AM
SAS Employee
Posts: 13

Re: Need help on secure way to send an email with sas please

Pierre,

      How about asking for the user and password?  I am sure there are better ways using Display Manager.

 

%window info         
  #5 @5 'Please enter your email address:'       
  #5 @40 id 88 attr=underline                
  #7 @5 'Please enter password:'            
  #7 @28 pass 20 attr=underline display=no;           
       
%display info;     

options emailauthprotocol = LOGIN;
options emailpw="&pass";
* Automatic Parameters:
*;
%let email_to   ="Myemail@corp.com" ;
%let email_from ="&id";
%let email_cc   ="Mini Mouse <MickeyMouse@cihi.ca>";

%macro SendEmail;               
               filename outbox email "null" emailsys=smtp from=(&email_from.);
               data  _null_;
                                           file outbox
                                            to=(&email_to.)
                                            cc=(&email_cc.)
                                            subject="Test email"                                           
                                            lrecl=256;
                                            put " ";
                                            put "Hi,";
                                            put " ";
                                            put "This is a test email.";
                                            put " ";                                 
                                            put " ";                                           
                run;
                filename outbox clear;
run;
%mend;
%SendEmail

View solution in original post


All Replies
Solution
‎05-18-2016 07:33 AM
SAS Employee
Posts: 13

Re: Need help on secure way to send an email with sas please

Pierre,

      How about asking for the user and password?  I am sure there are better ways using Display Manager.

 

%window info         
  #5 @5 'Please enter your email address:'       
  #5 @40 id 88 attr=underline                
  #7 @5 'Please enter password:'            
  #7 @28 pass 20 attr=underline display=no;           
       
%display info;     

options emailauthprotocol = LOGIN;
options emailpw="&pass";
* Automatic Parameters:
*;
%let email_to   ="Myemail@corp.com" ;
%let email_from ="&id";
%let email_cc   ="Mini Mouse <MickeyMouse@cihi.ca>";

%macro SendEmail;               
               filename outbox email "null" emailsys=smtp from=(&email_from.);
               data  _null_;
                                           file outbox
                                            to=(&email_to.)
                                            cc=(&email_cc.)
                                            subject="Test email"                                           
                                            lrecl=256;
                                            put " ";
                                            put "Hi,";
                                            put " ";
                                            put "This is a test email.";
                                            put " ";                                 
                                            put " ";                                           
                run;
                filename outbox clear;
run;
%mend;
%SendEmail

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 274 views
  • 1 like
  • 2 in conversation