Error
Error Code:
ORA-29279
Oracle Database Error ORA-29279: SMTP Permanent Failure
Description
The ORA-29279 error indicates a permanent failure during an SMTP (Simple Mail Transfer Protocol) operation within the Oracle Database. This typically occurs when sending emails directly from the database using packages like UTL_SMTP, and the mail server rejects the request.
Error Message
ORA-29279: SMTP permanent error: string
Known Causes
4 known causesInvalid Recipient Address
The email address of the recipient is incorrect or does not exist, causing the SMTP server to reject the message. This could include typos, invalid domain names, or non-existent accounts.
Authentication Failure
The database is not properly authenticated to send emails through the SMTP server. This may be due to incorrect username/password credentials or missing authentication mechanisms.
Server Configuration Issues
The SMTP server is configured to reject emails from the database server's IP address or domain. This is often a security measure to prevent unauthorized email sending.
Email Size Limit Exceeded
The email being sent (including attachments) exceeds the maximum size limit allowed by the SMTP server, resulting in rejection.
Solutions
4 solutions available1. Verify SMTP Server Hostname and Port Configuration easy
Ensure the SMTP server details within UTL_SMTP are correctly configured.
1
Identify the UTL_SMTP package configuration used by your application or script. This is typically set within PL/SQL code that calls `UTL_SMTP.OPEN_CONNECTION` or `UTL_SMTP.HOST` and `UTL_SMTP.PORT` parameters.
2
Consult your network administrator or email service provider to confirm the correct SMTP server hostname (e.g., `smtp.example.com`) and the corresponding port number (commonly 25, 465 for SMTPS, or 587 for STARTTLS).
3
Update the `UTL_SMTP.OPEN_CONNECTION` call or the `UTL_SMTP.HOST` and `UTL_SMTP.PORT` settings in your PL/SQL code with the verified details.
BEGIN
-- Example using OPEN_CONNECTION with host and port
l_smtp_connection := UTL_SMTP.OPEN_CONNECTION('smtp.example.com', 587);
-- Or if using HOST and PORT separately:
-- UTL_SMTP.HOST('smtp.example.com');
-- UTL_SMTP.PORT(587);
-- l_smtp_connection := UTL_SMTP.OPEN_CONNECTION;
-- ... rest of your email sending logic
END;
4
Re-run the process that triggered the ORA-29279 error to verify if the connection can now be established.
2. Check Network Connectivity and Firewall Rules medium
Confirm that the Oracle database server can reach the SMTP server.
1
Log in to the Oracle database server operating system as a user with appropriate privileges (e.g., `oracle` user).
2
Use a network utility like `telnet` or `nc` (netcat) to test connectivity to the SMTP server's hostname and port from the database server. Replace `smtp.example.com` and `587` with your actual SMTP server details.
telnet smtp.example.com 587
# or
nc -vz smtp.example.com 587
3
If the `telnet` or `nc` command fails to connect (e.g., times out or connection refused), it indicates a network issue. This could be due to a firewall blocking the connection on the database server, the network path, or the SMTP server itself.
4
Contact your network administrator or firewall team to ensure that outbound connections from the Oracle database server to the SMTP server on the specified port are allowed. Provide them with the source IP address of your database server and the destination SMTP server details.
5
Once firewall rules are confirmed and adjusted, re-test connectivity using `telnet` or `nc` and then re-run your Oracle database email sending process.
3. Address SMTP Server Authentication and Authorization Issues medium
Ensure the database user has the necessary credentials and permissions to send emails via the SMTP server.
1
Determine if your SMTP server requires authentication (username and password) for sending emails. This is common for most modern email services.
2
If authentication is required, verify that the username and password provided in your `UTL_SMTP` calls are correct. Incorrect credentials will often result in a permanent failure from the SMTP server.
3
Ensure the database user or the principal account used by the Oracle database to send emails is authorized by the SMTP server. Some SMTP servers have IP whitelists or specific user accounts designated for relaying mail. Consult your email administrator.
4
If your SMTP server uses STARTTLS or SMTPS, ensure your `UTL_SMTP` configuration correctly handles these security protocols. This might involve using `UTL_SMTP.STARTTLS` or ensuring the connection is opened with the appropriate secure protocol if supported by your Oracle version and configuration.
BEGIN
l_smtp_connection := UTL_SMTP.OPEN_CONNECTION('smtp.example.com', 587);
UTL_SMTP.STARTTLS(l_smtp_connection);
-- Authenticate if required
UTL_SMTP.AUTHENTICATE(l_smtp_connection, 'your_username', 'your_password');
-- ... rest of your email sending logic
END;
5
Test sending a simple email from a client application (like Outlook or Gmail) using the same credentials and SMTP server to rule out client-side issues or account restrictions.
6
If authentication is successful, re-run your Oracle database email sending process.
4. Examine the Specific SMTP Error String for Clues advanced
Analyze the detailed error message provided by the SMTP server for specific failure reasons.
1
The ORA-29279 error message includes a specific SMTP error string (e.g., '550 Recipient address rejected: User unknown', '530 Authentication required', '451 Try again later'). Capture this exact string.
2
Search online documentation, RFCs (Request for Comments) related to SMTP, or your SMTP server's vendor documentation for the meaning of the specific error code and message string. Common SMTP error codes and their meanings include:
550: Requested action not taken: mailbox unavailable (e.g., unknown user, mailbox full)
530: Authentication required or authentication failed
451: Requested action aborted: local error in processing
503: Bad sequence of commands
554: Transaction failed
3
Based on the specific error string, take targeted action. For example:
- If the error is '550 User unknown', verify the recipient email address is spelled correctly and exists.
- If the error is '530 Authentication required', ensure you are properly authenticating with the SMTP server (see Solution 3).
- If the error is '451 Try again later', implement retry logic in your Oracle application or wait and try again.
- If the error indicates a policy violation or spam filter issue, contact your email administrator.
4
Update your PL/SQL code, configuration, or address the underlying issue as indicated by the specific SMTP error message.
5
Re-run the process and monitor the error output to confirm the issue is resolved.