SOLVED

ORA-24247: Network Access Denied By Access Control List (ACL)

Asked by OracleDba11 viewsoracle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
ORA-24247: Network Access Denied By Access Control List (ACL)

Problem :

While sending mail using utl_mail or utl_stmp ,  you may get access denied error:

begin

utl_mail.send(sender => ‘

[email protected]

’,

recipients => ‘

[email protected]

’,

subject => ‘MAIL from ADMIn of learnomate’,

message => ‘Do visit learnomate’);

end;

/

*

ERROR at line 1:

ORA-24247: network access denied by access control list (ACL)

ORA-06512: at “SYS.UTL_MAIL”, line 662

ORA-06512: at “SYS.UTL_MAIL”, line 679

ORA-06512: at line 2
#oracle#error

Solutions(1)

Accepted Solution
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
From 11g onward, to send mail using UTL_MAIL or UTL_SMTP , ACL need to be created in the database.

Set the SMTP_OUT_SERVER parameter

SQL> alter system set smtp_out_server='mailhost.learnomate.com' scope=both;

System altered.

Now create ACLS

Suppose the user APPUSER want to send mail from procedure.

--- creating ACL as below

exec DBMS_NETWORK_ACL_ADMIN.CREATE_ACL('send_mail.xml','Allow mail to be send', 'APPUSER', TRUE, 'connect');

commit;

----Grant the connect and resource privilege as below

exec DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE('send_mail.xml','APPUSER',TRUE, 'connect');

exec DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE('send_mail.xml','APPUSER',TRUE, 'resolve');

exec DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL('send_mail.xml','*',25);

commit;

Now try to send mail:

SQL> conn appuser

Enter password:

Connected.

SQL> begin

utl_mail.send(sender => '

[email protected]

',

recipients => '

[email protected]

',

subject => 'MAIL from ADMIn of learnomate',

message => 'Do visit learnomate');

end;

/ 2 3 4 5 6 7

PL/SQL procedure successfully completed.

Hope it Helps!
OracleDba

Post Your Solution