Alfresco smtp configuration for organisational mail - email

I am trying to configure smtp for organisational mail in alfresco 4.2e.
Here is my global configuration
mail.host=smthost.abcd.com
mail.port=25
mail.username=sameer#abcd.com
mail.password=password
mail.encoding=UTF-8
mail.from.default=sameer#abcd.com
mail.smtp.auth=false
I am unable to send the mail. Here is
org.springframework.mail.MailSendException: Mail server connection failed; nested exception is javax.mail.MessagingException: Could not connect to SMTP host: smtphost.abcd.com, port: 25;
nested exception is:
java.net.SocketException: Network is unreachable: connect. Failed messages: javax.mail.MessagingException: Could not connect to SMTP host: smtphost.abcd.com, port: 25;
nested exception is:
java.net.SocketException: Network is unreachable: connect; message exception details (1) are:
Failed message 1:
javax.mail.MessagingException: Could not connect to SMTP host: smtphost.abcd.com, port: 25;
I am able to connect using
telnet smtphost.abcd.com25
and I am able to ping

Your network (most likely your gateway) is telling you it cannot reach the network of abc.efgh.ijkl.com. If you test, make sure to execute telnet from the server giving you the error. Telnet should give you same error message.
tcpdump -n -i any port 25
will show all outgoing traffic targeting SMTP and should give you further information about the problem at the network level (such as IP addresses used).

After so much search I found the issue of the problem. The problem occured because java using IPv6 by default. To fix,
I disabled IPV6 on windows
Set the Java property as setx _JAVA_OPTIONS -Djava.net.preferIPv4Stack=true

Related

How to set up email notifications in the Bug Tracker Redmine

We installed Redmine with Bitnami in Windows and can't set up email notifications. I am trying to edit the file C:\Bitnami\redmine-4.2.3-3\apps\redmine\htdocs\config\configuration.yml
default:
email_delivery:
delivery_method: :smtp
smtp_settings:
address: "localhost"
port: 25
authentication: :none
but get an error:
An error occurred while sending mail (No connection could be made because the target machine actively refused it. - connect(2) for "localhost" port 25)
We are using the Microsoft Exchange server. Can anyone help me to properly set up email notifications in Redmine?

KeyCloak fails to send email using SMTP with status 500

I have Keycloak running in a Kubernetes cluster. Authentication works but I need to set up e-mail to be able to send e-mails for verification and password reset.
I have SendGrid set up as an SMTP Relay. These settings (host, port and api key) work when I send mail using the SendGrid java client. However, when pressing Test connection in KeyCloak I get:
[Error] Failed to load resource: the server responded with a status of 500 ()
[Debug] Remove message (services.js, line 14)
[Debug] Added message (services.js, line 15)
[Error] Can't find variable: error
https://<domain>/auth/resources/ong8v/admin/keycloak/js/controllers/realm.js:76 – "Possibly unhandled rejection: {}"
[Debug] Remove message (services.js, line 14)
There isn't much to go on here. I have an e-mail address set up for the currently logged in user. I've also tried resetting the password in case the Test connection functionality was broken but that didn't work either.
The Realm Settings settings user for email are as such:
host: smtp.sendgrid.net
port: 587
from: test#<domain>
Enable StartTLS: true
Username: "apikey"
Password: <api key>
Any idea what can be wrong? Or how to find out? For instance, maybe I can get a more meaningful error message somehow.
Edit:
I got the server logs.
Failed to send email: com.sun.mail.util.MailConnectException: Couldn't connect to host, port: smtp.sendgrid.net, 587; timeout 10000;
nested exception is: java.net.SocketTimeoutException: connect timed out
Edit 2:
I've tried sending mail using Telnet using the exact same settings and that works. So apparently it's something with Keycloak or its underlying Java libraries that's causing issues sending e-mail.
Turns out that Keycloak works and that emails were blocked by the hosting provider.

Setting up Meteor Email with AWS SMTP

This Meteor server code tries to send email from the server start up.
The steps I followed after reading the AWS docs are:
1) Verify an email address which is also on AWS webMail.
2) Applied to increase sending limits.
3) Created and received SMTP credentials.
Meteor 1.4.4.2
email#1.2.1
//server/main.js
smtp = {
'username': 'from smtp credentials',
'password': 'from smtp credentials',
'host': 'email-smtp.us-east-1.amazonaws.com',
'port': '465',
'auth': true
};
process.env.MAIL_URL = 'smtp://' + encodeURIComponent(smtp.username) + ':' + encodeURIComponent(smtp.password) + '#' + encodeURIComponent(smtp.outgoingServer) + ':' + smtp.outgoingPort;
Meteor.startup(() => {
Email.send({
to: 'my-aws-verified-email#comp.com',
subject: 'sending-to-myselft',
text: 'Just checking if it is working'
});
});
Error: getaddrinfo ENOTFOUND undefined undefined:587
Any idea how to get it to work? thx
edit
After changing the process.env.MAIL_URL value to:
process.env.MAIL_URL = 'smtp://' + encodeURIComponent(smtp.username) +
':' + encodeURIComponent(smtp.password) +
'#' + encodeURIComponent(smtp.host) +
':' + smtp.auth + ':' + smtp.port;
The error now is:
Error: Greeting never received
changing the port to "587" gives a different error:
Error: Mail command failed: 501 Invalid MAIL FROM address provided
telnet email-smtp.us-east-1.amazonaws.com 465
Trying 107.21.244.69...
Connected to ses-smtp-prod-335357831.us-east-1.elb.amazonaws.com.
Escape character is '^]'.
Connection closed by foreign host.
telnet email-smtp.us-east-1.amazonaws.com 2465
Trying 54.221.247.194...
Connected to ses-smtp-prod-335357831.us-east-1.elb.amazonaws.com.
Escape character is '^]'.
Connection closed by foreign host.
telnet email-smtp.us-east-1.amazonaws.com 25
Trying 54.243.106.227...
telnet: connect to address 54.243.106.227: Connection refused
Trying 107.21.244.69...
telnet: connect to address 107.21.244.69: Connection refused
Trying 23.21.91.54...
telnet: connect to address 23.21.91.54: Connection refused
Trying 50.19.94.229...
telnet: connect to address 50.19.94.229: Connection refused
Trying 54.235.77.145...
telnet: connect to address 54.235.77.145: Connection refused
Trying 54.243.97.84...
telnet: connect to address 54.243.97.84: Connection refused
Trying 23.23.104.248...
telnet: connect to address 23.23.104.248: Connection refused
Trying 54.221.247.194...
telnet: connect to address 54.221.247.194: Connection refused
telnet: Unable to connect to remote host
telnet email-smtp.us-east-1.amazonaws.com 587
Trying 54.221.247.194...
Connected to ses-smtp-prod-t5t357831.us-east-1.elb.amazonaws.com.
Escape character is '^]'.
220 email-smtp.amazonaws.com ESMTP SimpleEmailService-1110753669 CalqM0Qfzgny2ooZ0wo5
421 Timeout waiting for data from client.
Connection closed by foreign host.
telnet email-smtp.us-east-1.amazonaws.com 2587
Trying 23.23.104.248...
Connected to ses-smtp-prod-337800831.us-east-1.elb.amazonaws.com.
Escape character is '^]'.
220 email-smtp.amazonaws.com ESMTP SimpleEmailService-20753669yy 4qrIfUj4ApTwkj4ZJUNa
421 Timeout waiting for data from client.
Connection closed by foreign host.
You were troubleshooting two simultaneous issues, and when you fixed one of them, it wasn't obvious that you were making progress, because then you encountered the other.
For outbound email, SES listens on two sets of ports.
STARTTLS on the standard port 587, the traditional (but wrong) port 25, and an unprivileged port 2587.
TLS Wrapper on the standard port 465, and an unprivileged port 2465.
The difference between the two sets is how the SSL (TLS) is negotiated. With STARTTLS, the server talks first and the client asks that the connection switch to encrypted mode... while with TLS Wrapper, the connection starts out with TLS but the client talks first, initiating TLS negotiation.
Clearly, from these descriptions, using a TLS Wrapper port when the client anticipates using STARTTLS will result in a timeout, since both sides are waiting for the other side to talk.
Port 25 is not a winner, since EC2 has aggressive rate limiting enabled by default, to prevent the obvious spam problem that would otherwise happen. You can ask for this to be disabled by submitting a support request, but the simplest solution is to just use port 587.
http://docs.aws.amazon.com/ses/latest/DeveloperGuide/smtp-connect.html
Then, your client wasn't setting a sender address, since no from address was being specified.

Pentaho DI Send Mail. Read timed out

I am trying to send an email from my Gmail account. Bellow are the SMTP details that I provided.
Server: smtp.gmail.com
Port : 465 (also tried 587) Use
Authentication: Yes
Authentication User: my full email id
Authentication password: my password
Use Secure Authentication: Yes
Secure Connection Type: SSL
This is the error that I am getting.
2016/03/16 17:35:45 - [ftp-poc].Mail - ERROR (version 5.2.0.0, build 1
from 2014-09-30_19-48-28 by buildguy) : Problem while sending message:
javax.mail.MessagingException: Could not connect to SMTP host:
gmail-smtp-msa.l.google.com, port: 465; nested exception is:
java.net.SocketTimeoutException: Read timed out
I tried these two things.
ping smtp.gmail.com - Successfull
telnet smtp.gmail.com 465 - I get a empty black screen with a cursor
blinking. No prompt or any text appears when I type. But the cursor
moves.
Gmail security - you need to authorize access by allowing "less secure" (something like that) access, from the gmail side.

XMPP server giving error "No response from server"

hi i am using smack.jar to connect to my gmail server. but xmppconnection.connet() is failing and it says that server is not responding . i am attaching the log. please help me out.
Exception in thread "main" Connection failed. No response from server.:
at org.jivesoftware.smack.PacketReader.startup(PacketReader.java:164)
at org.jivesoftware.smack.XMPPConnection.initConnection(XMPPConnection.java:945)
at org.jivesoftware.smack.XMPPConnection.connectUsingConfiguration(XMPPConnection.java:904)
at org.jivesoftware.smack.XMPPConnection.connect(XMPPConnection.java:1415)
at JabberSmackAPI.login(JabberSmackAPI.java:29)
at JabberSmackAPI.main(JabberSmackAPI.java:79)
To be clear, the server isn't returning this error, because you haven't connected to the server yet.
It might be a configuration problem. If your server doesn't have a client DNS SRV record (e.g. _xmpp-client._tcp.gmail.com), then you'll need to pass the XMPPConnection object a ConnectionConfiguration with the name of the machine to connect to for your domain.
It is also possible that this is a network problem (connectivity, routing, firewall, etc.). To test for this, try commands like this on the command line:
% dig +short _xmpp-client._tcp.gmail.com SRV
5 0 5222 talk.l.google.com.
20 0 5222 talk2.l.google.com.
20 0 5222 talk1.l.google.com.
20 0 5222 talk3.l.google.com.
20 0 5222 talk4.l.google.com.
% telnet talk.l.google.com 5222
Trying 74.125.155.125...
Connected to talk.l.google.com.
Escape character is '^]'.
>
Note that you type the greater-than character. Most XMPP servers will disconnect you immediately at this point, since you've sent them XML that is not well-formed.
If you've got a network problem, you'll see something like this:
Trying 74.125.155.125...
telnet: connect to address 74.125.155.125: Connection refused
telnet: Unable to connect to remote host