2010-09-16

11g Release 2 (11.2.0.2) new UTL_SMTP feature:TLS/SSL

In the recent release of Oracle Database 11g Release 2 (11.2.0.2) the UTL_SMTP package gains a interesting new feature: SMTP Authentication and Encryption.

STARTTLS (procedure and function): Sends STARTTLS command to secure the SMTP connection using SSL/TLS. Requires an Oracle wallet which must be specified when the connection was opened by the OPEN_CONNECTION Functions

AUTH (procedure and function): Sends the AUTH command to authenticate to the SMTP server


DECLARE
c utl_smtp.connection;
BEGIN
c := utl_smtp.open_connection(
host => 'smtp.example.com',
port => 25,
wallet_path => 'file:/oracle/wallets/smtp_wallet',
wallet_password => 'password',
secure_connection_before_smtp => FALSE);
UTL_SMTP.STARTTLS(c);
UTL_SMTP.AUTH(
c => c,
username => 'scott',
password => 'password'
schemes => utl_smtp.all_schemes);
END;


Also a new procedure was created:
CLOSE_CONNECTION (procedure): Closes the SMTP connection, causing the current SMTP operation to terminate. Use this procedure only to cancel an e-mail in the middle of the data session. To end the SMTP connection properly, use the QUIT Function and Procedure.

Documentation

Update: see this post about the problems with using conditional to check for this feature :-(

No comments:

Post a Comment

Os comentários são moderados.
The comments are moderated.