Connection to Exchange mail server refused using IMAP - jakarta-mail

I have a bit of jave code which is successful in connecting to a mail server using IMAP. However when trying to connect to the MS Exchange server at client site I am receiving "connection refused.
Is it possible that the exchange server is able to refuse connections not being made via the Outlook client?

More likely the Exchange server doesn't have IMAP support enabled, which is why the machine (not the server) is refusing the connection.

Related

RDS SQL Server - error when trying to use Database Email

I am trying to configure Database Email on RDS for SQL Server.
I used this guide https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/SQLServer.DBMail.html
I am using existing, working SES credentials (used currently in EC2 instance)
The outbound security group rule is 0.0.0.0/0
When trying to send a email I get the below error:
The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 6 (2021-02-25T20:57:01). Exception Message: Could not connect to mail server. (A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond [aws ip]:587).
)
Any other ideas on this one?
The solution was to set up a VPC Endpoint
https://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-email-set-up-vpc-endpoints.html#send-email-set-up-vpc-endpoints-procedure

Connection from Azure Web App to On Premise SQL Server using Hybrid Connection is not working in a closed network environment

The installation on both Azure and Sql Server side is done exactly according to Microsoft specifications in
https://learn.microsoft.com/en-us/azure/app-service/app-service-hybrid-connections.
The endpoint host is the SQL Server machine name using fixed port 1433.
The SQL Server is a named instance of SQL Server Express in a Windows 2012 Server.
The connection is also shown as Connected both on Azure and Server HCM sides.
I have done several similar installations before without any problems in more open networks, but in this case the
SQL Server is installed on a "security network" and the only TCP/IP connection opened from the server is to
the Service Bus relay on port 443. But this should be possible according to the specs.
When my Azure Web App tries to open the SQL connection it responds with the error:
"Connection Timeout Expired. The timeout period elapsed while attempting to consume
the pre-login handshake acknowledgement. This could be because the pre-login handshake
failed or the server was unable to respond back in time. The duration spent while attempting
to connect to this server was - [Pre-Login] initialization=0; handshake=15028; "
In Azure diagnostics tool tcpping also works fine to machinename:1433.
What could be the reason for this behaviour?
Are there still some more ports to open or some other settings to change?
EDIT: The solution which finally solved this problem was a quite obvious one. The original settings had the firewall for the on Premise server open only for the Service Bus relay on port 443, just as the specs said would be enough. By opening port 443 for all outbound TCP/IP addresses the connection started immediately to work from my Azure Web App. So there are obviously more addresses used by Hybrid Connection, but I haven't found which ones.

Cannot send database Mail using sql server 2008 r2 Data Center Edition

I have configured different ways and tried to send test email , didn't work.
Error: The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 5 (2018-01-22T14:28:24). Exception Message: Could not connect to mail server.
(A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 74.125.24.108:587). )
Configured the database Mail as blow.
I have tried possible changes but still getting failed.
1.Verified all usernames and passwords
2.Checked with different ports 465 ,587 and default 25
3.pinged SMTP.gmail.com its working
4.Control antivirus and firewall settings
I have refereed
Sending Email through SQL Server FAILED
any other ways ?
Please check your settings on GMail. You need to switch on the 'Allow Less Secure Apps' setting so that it will allow third party apps such as SQL Server to access the GMail servers.

SQL Azure VM (Resource Manager) can't send DBMail (Port 587 blocked)

I created a new VM for SQL Server and trying to setup the dbmail. The smtp server settings are all valid but I can't send emails out. I keep on getting following error:
The mail could not be sent to the recipients because of the mail server failure.
(Sending Mail using Account 1 (2016-07-20T09:19:34).
Exception Message: Could not connect to mail server. (A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 159.122.224.196:587).
)
I tried doing a telnet check on the IP and port no. from my my local machine and SQL Server VM. While the local machine just works fine, the SQL Server VM can't connect to the port.
I also tried to open a port 587 using the link http://michaelsync.net/2015/09/28/where-is-the-endpoint-setting-for-vm-in-new-azure-portal but even after allowing a port 587, I still can't send emails. Any help will be much appreciated.
NOTE: The IP address 159.122.224.196 belongs to sendgrid.
What E-mail (SMTP) server are you using?
Make sure that you're configuring connectivity to it correctly and that the E-mail server is

How do I configure Windows Server 2008 R2 to allow sending of email from an Integrated Services Package in SQL Server

How do I configure Windows Server 2008 R2 to allow sending of email from an Integrated Services Package in SQL Server?
I am trying to send an email from an SSIS package that that has been imported into the MSDB stored packages.
When I run the package I get the below error:
[Send Mail Task] Error: An error occurred with the following error
message: "Failure sending mail. System.Net.WebException: Unable to
connect to the remote server System.Net.Sockets.SocketException: An
attempt was made to access a socket in a way forbidden by its access
permissions
I have tried the same thing using a script task and MailMessage() and SmtpClient() in .NET and the task does not fail but it also does not send the email.
As a sidenote: I know there is a website setup on the server through IIS that is able to send emails via port 25.
I have given the package the same host IP address and port number, but it I still get an error.
Does anyone know what I can troubleshoot for finding a way to make this work?
Thanks
Does the package send the email successfully when running in debug mode on your dev workstation? If so, then I'm guessing the SMTP server is denying the SQL Server Integration Services server permission to connect. Perhaps the ip address of the SSIS server needs to be granted connect and/or relay permission in the SMTP product?
To test this, and other connectivity issues, telnet from the SSIS server to the SMTP server on port 25 (http://support.microsoft.com/kb/153119).
Additionally, set up Database Mail in SQL Server Database Services and test email from there. This also tests that the SMTP server allows the SSIS/MSSSQL server to connect and send mail.
Always test using both an internal email address and an external email address - that way you test relay permissions as well.
The problem was that the server had changed to use something other than the default TCP port.
The SSIS send email task only supports port 25, so I updated the script tasks and used them.

Resources