How to fix "errno":"ENOTFOUND" error in smtp configuration using express js - express

I am trying to configure node mailer in express js application. During the time of sending mail, I got an error ENOTFOUND.
My smpt configurations are,
smtpServer: {
host: "smtp.gmail.com",
port: 587,
secure: false,
user: "email#gmail.com",
pass: "password",
fromName: "",
fromAddress: ""
}
Error :
{"errno":"ENOTFOUND","code":"ECONNECTION","syscall":"getaddrinfo","hostname":"smtp.gmail.com","host":"smtp.gmail.com","port":587,"command":"CONN","meta":{"errno":"ENOTFOUND","code":"ECONNECTION","syscall":"getaddrinfo","hostname":"smtp.gmail.com","host":"smtp.gmail.com","port":587,"command":"CONN"}}
I suspect this error came because of proxy issues. So, I checked the smpt hostname in my machine nslookup table.
That is returned following result:
$ nslookup smtp.gmail.com
Server: 127.0.1.1
Address: 127.0.1.1#53
Non-authoritative answer:
*** Can't find smtp.gmail.com: No answer
Other than else what I missed here?

Related

How can I disable tls/crypto on apache 2.4, php 8, sendmail, typo3 11 with local mail exchange server?

These are my settings:
sendmail.ini
smtp_server = 10.1.xxx.xxx
smtp_port=25
smtp_ssl=none
php.ini
[mail function]
SMTP = 10.1.xxx.xxx
smtp_port = 25
sendmail_path = "C:\Webserver\sendmail\sendmail.exe -t"
Typo3
'MAIL' => [
'defaultMailFromAddress' => 'noreply#domain.org',
'defaultMailFromName' => 'Domain',
'transport' => 'smtp',
'transport_sendmail_command' => '',
'transport_smtp_encrypt' => false,
'transport_smtp_password' => '',
'transport_smtp_server' => '10.1.xxx.xxx:25',
'transport_smtp_username' => '',
],
SSL certificate is provided by a netscaler configuration
Typo3 Test Mail Setup
Could not deliver mail
Please verify $GLOBALS['TYPO3_CONF_VARS']['MAIL'][*] settings are valid.
Error message: Unable to connect with STARTTLS: stream_socket_enable_crypto():
Peer certificate CN=*.domain.de' did not match expected CN=10.1.xxx.xxx'
Ehm, with transport_smtp_encrypt=false the connection will be tried via STARTTLS. For using an SSL-Connection, transport_smtp_encrypt has to be true.
Important: #91070 - SMTP transport option ‘transport_smtp_encrypt’ changed to boolean
so there is no chance to deactivate encryption as false uses Starttls and true ssl - thanks for the information
#alexinge I think STARTTLS is only used if the server that you try to connect to is able to handle it. As the changelog of version 4.4 of symfony/mailer says (highlight by me):
STARTTLS cannot be enabled anymore (it is used automatically if TLS is disabled and the server supports STARTTLS)
So you might try to change the configuration of the mail server (if you have access to that) or maybe use another port (587 with 'transport_smtp_encrypt' => false or 465 with 'transport_smtp_encrypt' => true).

make the bundle available on any host (0.0.0.0)

I am trying to access localhost in my android phone.
I am using webpack-dev-middleware with an express server.
I do know how to set the host in webpack-dev-server though.
But I don't see any options to specify a host of 0.0.0.0 in webpack-dev-middleware.
Hope that my problem is clear enough
app.listen(3001, 'localhost', function() {
console.log("... port %d in %s mode", app.address().port, app.settings.env);
});
This the way you specify port and host . If you don't specify localhost then it's default exposed in 0.0.0.0
So below code listens in 0.0.0.0
app.listen(3001, function() {
console.log("... port %d in %s mode", app.address().port, app.settings.env);
});
Update:
You can set your ip address directly in webpack config file:
devServer: {
host: '0.0.0.0',//your ip address
port: 8080,
disableHostCheck: true,
...
}

how to send email use nodemailer on local host postfix mail server with SSL

I have set up postfix email server on my DigitalOcean cloud server. Now I want to send email from my program using nodeMailer. I try this setting and success
var transporter = nodemailer.createTransport({
host: "localhost", // hostname
secure: false, // use SSL
port: 25, // port for secure SMTP,
tls: {
rejectUnauthorized: false
}
});
the email were sent in the spam folder on the target recipient Email address.So I think maybe secure:false is reason. So how can I enable SSL?

what is asterisk 13 configration for enabling WebRTC?

I want to setup asterisk 13 that working on ubuntu 16.04 on local machine to enable WebRTC, I'am testing with https://www.doubango.org/sipml5/ on firefox
I had the sipml5 client connected successfully to asterisk but when imitating a call it's said Call in Progress,
http is enable and bound to port 8088
this is sip.conf :
[web_rtc]
context=default
host=dynamic
secret=abc101
type=friend
transport=udp,ws,wss,tcp
encryption=yes
avpf=yes
force_avp=yes
icesupport=yes
directmedia=no
disallow=all
allow=opus
allow=ulaw
dtlsenable=yes
dtlsverify=fingerprint
dtlscertfile=/etc/asterisk/ast.pem
dtlscafile=/etc/asterisk/ast.pem
dtlssetup=actpass/
rtcp_mux=yes
and this is extension.conf :
[web_rtc]
exten => 100,1,Answer()
exten => n,Playback(hello-world)
exten => n,Hangup()
I have tested sipml5 on Ubuntu 18.04 on Asterisk 13 and it worked fine. I suggest to add to your rtp.conf file (/etc/asterisk/rtp.conf) an stun server by adding the following line:
stunaddr=stun.l.google.com:19302
Then, on the live demo, configure your ICE Servers on the expert mode section adding [{ url: 'stun:stun.l.google.com:19302'}]
Anyway, I tried sipml5 and I had some problems integrating it with Asterisk (I have problems muting the call or pausing it), so I tried other libraries and finally I decided to use sip.js (https://sipjs.com/), which I recommend.
Hope it helps.
I edit to add the sipml5 client stack configuration that I used on my JS script:
sipStack = new SIPml.Stack({
realm: 'example.com',
impi: 'sip_user',
impu: 'sip:sip_user#example.com:port',
password: 'super_secret_password',
websocket_proxy_url: 'wss://example.com:port/ws',
outbound_proxy_url: null,
ice_servers: "[{ url: 'stun:stun.l.google.com:19302'}]",
enable_rtcweb_breaker: true,
enable_early_ims: true,
enable_media_stream_cache: true,
sip_headers: [
{ name: 'enter code hereUser-Agent', value: 'IM-client/OMA1.0 sipML5-v1.2016.03.04' },
{ name: 'Organization', value: 'My_company' }
],
events_listener: { events: '*', listener: eventsListener }
});

WebRTC Ice Servers Issue

Uncaught DOMException: Failed to construct 'RTCPeerConnection': Both username and credential are required when the URL scheme is "turn" or "turns".
i have getting this error her is my using ice servers:
var servers =
{'iceServers': [
{url:'turn:numb.viagenie.ca'},
{url:'stun:stun01.sipphone.com'},
{url:'stun:stun.ekiga.net'},
{url:'stun:stun.fwdnet.net'},
{url:'stun:stun.ideasip.com'},
{url:'stun:stun.iptel.org'},
{url:'stun:stun.rixtelecom.se'},
{url:'stun:stun.schlund.de'},
{url:'stun:stun.l.google.com:19302'},
{url:'stun:stun1.l.google.com:19302'},
{url:'stun:stun2.l.google.com:19302'},
{url:'stun:stun3.l.google.com:19302'},
{url:'stun:stun4.l.google.com:19302'},
{url:'stun:stunserver.org'},
{url:'stun:stun.softjoys.com'},
{url:'stun:stun.voiparound.com'},
{url:'stun:stun.voipbuster.com'},
{url:'stun:stun.voipstunt.com'},
{url:'stun:stun.voxgratia.org'},
{url:'stun:stun.xten.com'},
{
url: 'turn:numb.viagenie.ca',
credential: 'muazkh',
username: 'webrtc#live.com'
},
{
url: 'turn:192.158.29.39:3478?transport=udp',
credential: 'JZEOEt2V3Qb0y27GRntt2u2PAYA=',
username: '28224511:1379330808'
},
{
url: 'turn:192.158.29.39:3478?transport=tcp',
credential: 'JZEOEt2V3Qb0y27GRntt2u2PAYA=',
username: '28224511:1379330808'
}
]
};
where is my falt?What can i do?
What the error message says. The first server in your list specifies no username or credentials:
{url:'turn:numb.viagenie.ca'},
You also repeat the same server further down, this time with credentials.
These also look like non-working turn servers cut'n'pasted off the internet. Free turn servers is a lie.
Also waaaaay too many servers. One or two stun and/or turn will do. Too many slows down ICE.