Setting up Meteor Email with AWS SMTP - email

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.

Related

Radiusd server not serving the request

I have set up a radiud server on centos 6.8 and I have a switch that I want to call this radius server for authentication. The switch ip address is 10.2.1.4 which is there in the clients config file. Here is the part of my client conf file
client switch {
ipaddr = 10.2.1.4
secret = testing123
nastype = other
}
Below is the error that I am getting
... adding new socket proxy address * port 55146
Listening on authentication address * port 1812
Listening on accounting address * port 1813
Listening on command file /var/run/radiusd/radiusd.sock
Listening on authentication address 127.0.0.1 port 18120 as server inner-
tunnel
Listening on proxy address * port 1814
Ready to process requests.
Ignoring request to authentication address * port 1812 from unknown client
10.2.1.4 port 1037
Ready to process requests.
Can anyone please help me here?

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.

Alfresco smtp configuration for organisational mail

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

How configure roundcube to work with imaps?

I recently installed Postfix, Dovecot to setup a mail server on my own VPS ( using this tutorial: Email with Postfix, Dovecot, Mysql)
Imaps server uses port 993 for Authentication, and Postfix uses port 25 to send mails.
In this tutorial, users stored in a Database ( so imaps use mysql to authenticate users).
i'm sure every thing works fine with imaps and postfix , because few days ago i installed Kmail client (on my linux) and receive mails from my server. sending mails also works fine, i sent a mail to Gmail and google received it without a problem (in my "Gmail inbox" not spam folder)
So to get to my Emails from a web mail client, i installed Roundcube on /var/www/mail directory.
I configured Roundcube many times. but each time it gives me this Error:
IMAP Error: Login failed for [me#mydomain] from X.x.X.x . Empty
startup greeting (localhost:993) in
/var/www/mm/program/lib/Roundcube/rcube_imap.php on line 184 (POST
/mm/?_task=login?_task=login&_action=login)
When i do log in from roundcube, imap server says ( in /var/log/mail.log ):
May 20 07:05:16 my-server dovecot: imap-login: Disconnected (no auth
attempts): rip=::1, lip=::1, TLS handshaking: Disconnected
Here is my roundcube config file :
$config['db_dsnw'] = 'mysql://roundcubeuser:myPassword#localhost/roundcubemail';
// ----------------------------------
// IMAP
// ----------------------------------
$config['debug_level'] = 13;
$config['default_host'] = 'ssl://127.0.0.1';
$config['default_port'] = 993;
// ----------------------------------
// SMTP
// ----------------------------------
$config['smtp_server'] = 'ssl://localhost';
What's the problem? i really have no idea what is happening !
Thank you.
I'm using postfix + dovecot + roundcube a few months now and it's working for me. In my configuration, postfix rejects plaintext sessions, so roundcube has to connect with ssl - and it's working.
This is from my main.inc.php. I don't remember editing anything here, it's just the initial config created during the installation.
Now that I'm looking at it, default_port doesn't make any sense, I think it's just ignored.
// To use SSL/TLS connection, enter hostname with prefix ssl:// or tls://
// Supported replacement variables:
// %n - http hostname ($_SERVER['SERVER_NAME'])
// %d - domain (http hostname without the first part)
// %s - domain name after the '#' from e-mail address provided at login screen
// For example %n = mail.domain.tld, %d = domain.tld
// TCP port used for IMAP connections
$rcmail_config['default_port'] = 143;
$rcmail_config['default_host'] = array("ssl://localhost:993");
// TCP port used for IMAP connections
$rcmail_config['default_port'] = 143;
In case the other answer does not work, this is what worked for me. My config.inc.php now contains:
$config['default_host'] = 'ssl://localhost';
$config['default_port'] = 993;
NOTE: using tls://localhost did not work for me. I had to specify ssl:// as the URI scheme.
Via PhpMyAdmin, I also ran this SQL command (all my user accounts are on the same machine that runs RoundCube):
UPDATE `rc_users` SET `mail_host`='ssl://localhost'
I got the port number 993 from running sudo netstat -tulnp in order to determine the port on which Dovecot was listening.

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