Query reg SMTP port - email

Hi am having a confusion reg SMTP ports. I have configured an application in my local machine to use gmail's smtp server by getting the details from here - https://www.siteground.com/kb/google_free_smtp_server/ and am able to trigger emails without any issues.
When I set the same application in a windows server and use the same smtp settings the emails aren't going and I keep getting errors like "unable to connect to smtp port 465". So is the port being mentioned here - 465 - is this port being used from my machine to connect to gmail's smtp server or is this port being referred to the port in the machine where gmail's smtp server is hosted?

Related

Setting up hMailServer to send and receive email

I'm trying to configure hMailServer on my computer to be able to send email out and also receive emails. I'm not sure if I have everything set up correctly as some tests works and some others do not so I am confused.
I have already set up in the DNS of my domain these 3 MX records:
mail.example.com
smtp.example.com
imap.example.com
Each one of those records points to the domain name of my server. I am able to connect to the web server of my domain. In my router, I have forwarded ports 25, 110, 143, 465 and 587 to my local computer running the hMailServer application. When running a port check on the web, it looks like port 25, 110 and 465 are blocked, but the rest are not.
If I open my Mozilla Thunderbird mail client, I set up an account I created in hMailServer for the domain in question.
I have also allowed the hMailServer application through my Windows firewall for both the private and public networks. I did the same for the Thunderbird email client.
I can locally send emails to myself and other local domains set up in hMailServer. However, I cannot send or receive any email to/from external recipients, like to/from Gmail or Hotmail for example. I'm getting this error message:
Error Type: SMTP
Connection to recipients server failed.
Error: Host name: 1.1.1.1 (edited) message: 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
Here are the TCP/IP ports summary in hMailServer:
The second part of my question is once I can actually send and receive email to/from external domains, how would I secure the connection (SSL/TSL...)? I already have a SSL certificate for my web server (example.com and www.example.com). Do I just need to generate another one for say mail.example.com or do email servers use a different kind of certificate?

CentOS iptables and port configuration for using external SMTP server

I have a web server running CentOS and a separate mail server running Microsoft Exchange. I have the web server connecting to the mail server via SMTP on port 587 to send emails.
Sometimes the connection to the mail server refuses, but it's rare. Could an intermittent failure be related to port settings? I would have thought it's all or nothing.
For the CentOS web server, what rules should I be looking to configure in the iptables if any? Do I need to add an entry for port 587 on this server? Or do I just need to allow incoming connections on the mail server for 587?
Thanks in advance.
You don't need to set up any iptables rules on your webserver, since outgoing connections are allowed by default. Your occasional drops won't have anything to do with the webserver's firewall, so you'll want to look at tuning your Exchange server, if the error is impactful enough to worry about it.

Grails mail plugin configuration for MS Exchange server

I am able to send email using my gmail account from my grails application but when I use MS exchange server account I am getting this error
Message: Mail server connection failed; nested exception is com.sun.mail.util.MailConnectException: Couldn't connect to host, port: smtp.exg6.exghost.com/, 25; timeout -1;
Configuration I used is :
mail {
host = "smtp.exg6.exghost.com"
port = 25
username = "xxxx"
password = "xxxx"
props = ["mail.smtp.auth":"true",
"mail.smtp.socketFactory.port":"25",
"mail.smtp.socketFactory.class":"javax.net.ssl.SSLSocketFactory",
"mail.smtp.socketFactory.fallback":"false"]
I am not sure what configuration to use. I tried changing port to 465 & 993 but that didn't work too. Please help
There are several things wrong with your setup. First of all, you are submitting mail to a Microsoft Exchange server (presumably), not Outlook. Outlook is a mail client and only provides end user functionality by connecting to the same server that you are trying to get the Mail plugin to connect to.
Your host name must be a valid Internet DNS host name -- therefore it must be "smtp.exg6.exghost.com". This might be all you have to do depending on the submission/relay policies in your SMTP server. Most likely you need to read on.
The SMTP protocol supports authentication and security for mail submission (new message injection) using either SSL or SASL. If you are using SSL, the default port to connect to is 465 (SMTPS port). If you are using SASL, then most servers are configured to accept new mail with authentication on port 587 (submit service port). Most SMTP servers will not accept mail submission on port 25.
In your case it looks like you are trying to connect with SSL, so you probably want to configure it using the SMTPS setup. To make sure that you have a proper setup, use a mail client like Thunderbird to try to make an SMTP connection to the server. It actually has a discovery algorithm in it that will try the common setups and report success when it has found one. Once you know what the connection parameters are, then you can proceed with configuring the Mail plugin.
I finally got this working. Turns out Microsoft provide a separate API / web-services to send email and perform all other mail related operations. This API gives developers programmatic access to Exchange Online, Exchange Online as part of Office 365, and versions of Exchange starting with Exchange Server 2007 Service Pack 1 (SP1). Click here for details.
exg6.exghost.com is host for Exchange Server 2007
And I am not sure but I think Exchange server 2007 and onwards don't use SMTP.

Why can I not do an SMTP telnet to gmail?

I have tried connecting and using telnet to a gmail service for testing:
telnet gmail-smtp-in.l.google.com 25
Yet it says
Connecting to gmail-smtp-in.l.google.com failed.. Could not open connection to the host, on port 25: Connect Failed
Is this because of my firewall or am I doing something wrong?
I have tested this at work and at home and I am still unable to telnet in.
Yet, when I do an SMTP test using mxtoolbox, it seems that they can telnet in.
Is there something I am missing?
I am trying to do an SMTP test using Telnet.
Your ISP may be blocking outgoing SMTP connections to smtp (25) port as outgoing spam prevention.
Can you telnet smtp (25) port on any email host beyond your ISP network?
Can you telnet smtp.gamil.com 587?
[Port 587 is intended for client to server SMTP sessions, gmail supports it]

Where to get the configuration? (Mail Client)

I just purchased a domain name few weeks ago,
and then i registered my domain into Windows Live Admin ( domain.live.com )
because from that Windows Live, I could manage
several email accounts. And I did. now every time I
want to write email / receive email i just go to mail.live.com
and login depend on the email accounts I just made there.
Then I tried to install Opera Mail, or even Thunderbird
in my Computer (laptop).
There are several configuration I confused.
What should I type into the incoming and outcoming server ? Imap / Pop? Which port?
I dunno....
Confused.
Because WHen I try to use thee details:
IMAP Server: as imap.charter.net SMPT Server: as smpt.charter.net
It doesnt work.
Then I tried to use
mail.mydomain.com
for both incoming & outgoing server.
And it is also doesnt work.
ANy ideas?
You have to use the outlook.com server, not your own domain:
Incoming mail server - imap-mail.outlook.com
Incoming mail server port - 993 (SSL)
Outgoing (SMTP) mail server - smtp-mail.outlook.com
Outgoing (SMTP) mail server port - 587 (SSL/TLS)
Outgoing server (SMTP) authentication - same settings as your incoming mail server