Running AHFCTL Commands to Manage EMail Configuration for All AHF Tools
ahfctl setsmtp
Use the ahfctl setsmtp command to set the SMTP mail configuration parameters.
Syntax
ahfctl setsmtp
[-h]
[-debug]
[-all]
[-host HOST]
[-user USER]
[-password]
[-from FROM]
[-to TO]
[-port PORT]
[-cc CC]
[-bcc BCC]
[-ssl SSL]
[-auth AUTH]
Parameters
ahfctl setsmtp Command Parameters
| Parameter | Description |
|---|---|
-debug | Specify the -debug option to enable debugging. |
-all | Specify to set all smtp parameters. |
-host HOST | Specify the name of the SMTP server, for example, smtphostname. |
-user USER | Specify the name of the SMTP user, for example, smtpuser. |
-password | Specify the password of the SMTP user. |
-from FROM | Specify the email address of the sender. |
-to TO | Specify the email address of the recipient. |
-port PORT | Specify the port of the SMTP server, for example, 44. |
-cc CC | Specify the CC email address. |
-bcc BCC | Specify the BCC email address. |
-ssl SSL | Specify true to enable SSL and false to disable SSL. Default: false . |
-auth AUTH | Specify true to enable SMTP authentication and false to disable SMTP authentication. Default: false. |
Example ahfctl setsmtp
To set all the SMTP parameters:
ahfctl setsmtp -user smtpuser -from ahfteam@example.com -to touser@example.com -port 24 -password
To set only the to email address:
ahfctl setsmtp -to toaddress@example.com
If you see the Parameter smtp.to is already set message, then run the unsetsmtp command to clear the existing smtp.to configuration followed by the setsmtp command to configure smtp.to anew.
ahfctl setsmtp -to
Parameter smtp.to is already set
ahfctl unsetsmtp -to
Unset SMTP parameters completed successfully.
ahfctl setsmtp -to <email>
Set SMTP parameters completed successfully.
ahfctl getsmtp
Use the ahfctl getsmtp command to query the SMTP mail configuration parameters.
Syntax
ahfctl getsmtp
[-h]
[-debug]
[-all]
[-host]
[-user]
[-password]
[-from]
[-to]
[-port]
[-cc]
[-bcc]
[-ssl]
[-auth]
Parameters
ahfctl getsmtp Command Parameters
| Parameter | Description |
|---|---|
-debug | Specify to query if debugging is enabled or not |
-all | Specify to query all smtp parameters. |
-host HOST | Specify to query the name of the SMTP server. |
-user USER | Specify to query the name of the SMTP user, |
-password | Specify to query the password of the SMTP user. |
-from FROM | Specify to query the email address of the sender. |
-to TO | Specify to query the email address of the recipient. |
-port PORT | Specify to query the port of the SMTP server. |
-cc CC | Specify to query the CC email address. |
-bcc BCC | Specify to query the BCC email address. |
-ssl SSL | Specify to query if SSL is enabled or not. |
-auth AUTH | Specify to query if authentication is enabled or not. |
Example ahfctl getsmtp
To query all of the SMTP parameters:
ahfctl getsmtp -all
To query the SMTP server configuration for from email address:
ahfctl getsmtp -to
ahfctl checksmtp
Use the ahfctl checksmtp command to check the stored SMTP mail configuration parameters.
Syntax
ahfctl checksmtp
[-h]
[-debug]
[-to TO]
[-attachment ATTACHMENT]
Parameters
ahfctl checksmtp Command Parameters
| Parameter | Description |
|---|---|
-debug | Specify to check if debugging is enabled or not. |
-to TO | Specify to check the email address of the recipient. |
-attachment ATTACHMENT | Specify to check the mail attachment, for example, ahf_report.log. |
Example ahfctl checksmtp
To check the stored SMTP parameters:
ahfctl checksmtp
To check the stored SMTP parameters with the specified recipient email address:
ahfctl checksmtp -to toaddress@example.com
ahfctl unsetsmtp
Use the ahfctl unsetsmtp command to unset the SMTP mail configuration parameters that you have set. AHF is installed with default SMTP configurations. You can use the ahfctl unsetsmtp command to unset these default parameters as well.
Syntax
ahfctl unsetsmtp
[-h]
[-debug]
[-all]
[-host]
[-user]
[-password]
[-from]
[-to]
[-port]
[-cc]
[-bcc]
[-ssl]
[-auth]
Parameters
ahfctl unsetsmtp Command Parameters
| Parameter | Description |
|---|---|
-debug | Specify the -debug option to enable debugging. |
-all | Specify to unset all smtp parameters and the default SMTP mail configuration parameters as well. |
-host | Specify the name of the SMTP server to unset. |
-user | Specify the name of the SMTP user to unset. |
-password | Specify the password of the SMTP user to unset. |
-from | Specify the email address of the sender to unset. |
-to | Specify the email address of the recipient to unset. |
-port | Specify the port of the SMTP server to unset. |
-cc | Specify the CC email address to unset. |
-bcc | Specify the BCC email address to unset. |
-ssl | Specify to unset SSL configuration. |
-auth | Specify to unset auth configuration. |
Examples ahfctl unsetsmtp
To unset all of the SMTP parameters
ahfctl unsetsmtp -all
To unset the from parameter:
ahfctl unsetsmtp -from
ahfctl sendmail
Use the ahfctl sendmail command to send a test email to verify SMTP configuration.
Syntax
ahfctl sendmail
[-h]
[-to TO]
[-cc CC]
[-bcc BCC]
[-subject SUBJECT]
[-body BODY]
[-attachment ATTACHMENT]
| Parameter | Description |
|---|---|
-to TO | Specify the recipient email address. |
-cc CC | Specify the email address to send a carbon copy of the email. |
-bcc BCC | Specify the email address to send a blind carbon copy of the email |
-subject SUBJECT | Specify to add email subject. |
-body BODY | Specify to add body of the email. |
-attachment ATTACHMENT | Specify to add an attachment. |
Examples
To send an email to recipients with default/set parameters:
ahfctl sendmailTo send an email with attachment:
ahfctl sendmail -to toaddress@company.com -attachment <path_to_file>ahfctl sendmail -to $ORACLE_USER@oracle.com -attachment /tmp/test_email.log Mail has sent successfully to oradb@oracle.com