emailjs / emailjs-smtp-client Goto Github PK
View Code? Open in Web Editor NEWSMTP Client for node.js and browser runtimes
License: MIT License
SMTP Client for node.js and browser runtimes
License: MIT License
./node_modules/emailjs-smtp-client/src/emailjs-smtp-client.js
Module not found: Can't resolve 'emailjs-smtp-client-response-parser'
while using this in a react application.
#10 implemented opportunistic STARTTLS support. It checks whether the server reports STARTTLS as an option during the initial EHLO over an unencrypted connection. However, an active attacker / MITM attack can opt to not report STARTTLS and bypass encryption entirely.
In the Gaia email app and in our monkeypatches (the removal of which is tracked at https://bugzil.la/1060558) we pass in to our account constructors either { crypto: 'ssl' } to convey initial-TLS or { crypto: 'starttls' } to convey mandatory STARTTLS upgrade. I think this is a sensible strategy, although it might be a good idea to avoid reusing 'useSecureTransport' for this since that implies TCPSocket semantics which wouldn't support 'starttls'. Note that I don't really have a strong opinion here.
When implementing required STARTTLS it would be good to ensure that an explicit error code or family of error codes conveys that establishing a connection failed for security reasons. (Failure to indicate support of STARTTLS, failure to honor STARTTLS, certificate problems when performing STARTTLS, etc.) See #9 for some brief discussion/references of how the Gaia email app currently deals with errors.
Hi, pretty amazing work.
TCPSocket allows custom ws url option, but currently it's not propagatated.
BEFORE:
this.socket = this._TCPSocket.open(this.host, this.port, {
binaryType: 'arraybuffer',
useSecureTransport: this._secureMode,
ca: this.options.ca,
tlsWorkerPath: this.options.tlsWorkerPath
});
AFTER:
this.socket = this._TCPSocket.open(this.host, this.port, {
binaryType: 'arraybuffer',
useSecureTransport: this._secureMode,
ca: this.options.ca,
tlsWorkerPath: this.options.tlsWorkerPath,
ws: this.options.ws
});
Is the quirks section outdated or does the SMTP client really not support STARTTLS? I just had a quick look and noticed that there are STARTTLS related options mentioned in the README.
I try to send gmail via emailjs-smtp-client at google chrome, opera and firefox. It has emailjs-tcp-socket in depencencies list.
I've tried to set timeouts at emailjs-smtp-client/src/client.js
const TIMEOUT_SOCKET_LOWER_BOUND = 100000
const TIMEOUT_SOCKET_MULTIPLIER = 0.01
It did not help, same result.
Init connection at vue template:
import SmtpClient from 'emailjs-smtp-client';
let client = {};
let options = {};
let alreadySending = false;
options = {
auth: {
user: mail.mail,
pass: mail.pass,
ca: true,
ignoreTLS: false,
requireTLS: true,
},
};
client = new SmtpClient(mail.host, 587, options);
client.onidle = () => {
console.log('Connection has been established');
if (alreadySending) {
return;
}
alreadySending = true;
client.useEnvelope({
from: mail.mail,
to: mail.mail,
});
};
client.onready = () => {
client.send('Subject: test\r\n');
client.send('\r\n');
client.send('Message body');
client.end();
};
client.onerror = (err) => {
console.log(err);
};
client.ondone = (success) => {
if (success) {
// show succes send message
console.log('The message was transmitted successfully');
}
};
client.quit();
command > telnet smtp.gmail.com 587
, runs and connects fine.
In FireBug, -> network tab -> WS connection is empty.
I receive the Error in console.
Uncaught (in promise) TypeError: this.socket.send is not a function at SmtpClient._send (client.js?00c3:486) at SmtpClient._sendCommand (client.js?00c3:480) at SmtpClient.quit (client.js?00c3:177) at eval (VM5894 761:276) at _send @ client.js?00c3:486 _sendCommand @ client.js?00c3:480 quit @ client.js?00c3:177 fn._withTask.fn._withTask @ vue.esm.js?65d7:1826 VM5894 761:269 Error: Socket timed out! at SmtpClient._onTimeout (client.js?00c3:419)
How would you send an email with attachments?
Is it possible with this library?
Thanks.
Has this ever been attempted before?
I've included the libraries as script tags
<script src="../emailjs/emailjs-smtp-client-response-parser.js"></script>
<script src="../emailjs/emailjs-smtp-client.js"></script>
but the JS engine cannot find SmtpClient object.
var mailclient = new SmtpClient("smtp.google.com", 587,
{
auth: {
user: '[email protected]',
pass: 'str@ng3'
}
}
)
"ReferenceError: SmtpClient is not defined[Learn More]"
what am I doing wrong?
Using FF verison 57.0b10 (64-bit)
☝️ Greenkeeper’s updated Terms of Service will come into effect on April 6th, 2018.
Branch | Build failing 🚨 |
---|---|
Dependency | sinon |
Current Version | 4.4.6 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
sinon is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
The new version differs by 7 commits.
e060fe9
Update docs/changelog.md and set new release id in docs/_config.yml
e9fce06
Add release documentation for v4.4.7
f047838
4.4.7
cc91fe6
Update History.md and AUTHORS for new release
9fb8577
Emojify the support message :heart:
a87ef85
Use existing mini-lib for coloring
1f33fe5
Reduce noisy NPM output from postinstall script
See the full diff
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
SmtpClient is not defined
<script type="text/javascript" src="node_modules/emailjs-smtp-client/src/emailjs-smtp-client-response-parser.js"></script><script type="text/javascript" src="node_modules/emailjs-smtp-client/src/emailjs-smtp-client.js"></script>
<script type="text/javascript">
var client = new SmtpClient(host, 143, {
'auth': {
'user': 'xxxxx',
'pass': '..........'
},
'ignoreTLS': true
})
</script>
Branch | Build failing 🚨 |
---|---|
Dependency | sinon |
Current Version | 4.1.3 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
sinon is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
The new version differs by 36 commits.
1ea2749
Update docs/changelog.md and set new release id in docs/_config.yml
078c082
Add release documentation for v4.1.4
571263e
4.1.4
f2ee9f1
Update History.md and AUTHORS for new release
a8262dd
Assertion error messages handle symbolic method names
8fa1e14
Merge pull request #1641 from mroderick/point-to-stack-overflow
7c1ebd0
Update issue links to point to sinonjs/sinon
93418f6
Update documentation to emphasize Stack Overflow
ca9e2fa
Merge pull request #1636 from fearphage/fix-headless-chrome-in-circle
39186f4
use google-chrome-unstable for tests
6315621
invalidate cache
d078af9
try using default chrome install
177c4b6
upgraded to the lastest official version of mochify
ecdc4e0
test with updated mochify
360c2e7
added more details and notes
There are 36 commits in total.
See the full diff
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
Safari doesn't support TextEncoding yet. Following shim works perfectly with Safari.
I have no clue how I'm supposed to use this in the browser since the instructions are broken. It says
Include files emailjs-smtp-client-response-parser.js and emailjs-smtp-client.js on the page.
but those files no longer exist in the repo. So... what do I do? There's no dist directory with a file to include. I tried including client.js
but I just got Uncaught SyntaxError: Unexpected token {
.
The errors thrown from the BrowserBox and SmtpClient libraries don't provide many contextual details, making it difficult to report a proper error status to the user. For our implementation, we monkeypatched some changes to pass along details, such as logged-in state and IMAP/SMTP error codes, in the following files:
https://github.com/mozilla-b2g/gaia-email-libs-and-more/blob/master/js/imap/client.js
https://github.com/mozilla-b2g/gaia-email-libs-and-more/blob/master/js/smtp/client.js
It would be helpful to have native support of some format (the format needn't be identical to ours, just the information is important); in addition to passing along the errors, it may be worth inferring certain categories of errors (such as our "bad-user-or-pass" generic errors and the like).
Could someone take a peak and point out what I am doing wrong? I am trying to use this with StartTLS in the browser and don't get neither any reaction nor error message:
emailjs-tcp-socket-tls-worker.js
: perguth/freifunk-monitor@c7392ef#diff-b9cfc7f2cdf78a7f4b91a753d10865a2R20Just tried to log .log
after ten seconds after instantiation but it's undefined.
All files here: https://github.com/perguth/ffs-monitor/tree/c7392ef3a789de8c68ff971a8167e6ee18f5e1a6
Hello,
I read this issue: #36
But the error persist today.
Log:
Error: Cannot find module "emailjs-smtp-client-response-parser"
at webpackMissingModule (http://localhost:8100/build/vendor.js:168532:139)
at _typeof (http://localhost:8100/build/vendor.js:168532:251)
at Object._typeof (http://localhost:8100/build/vendor.js:168551:2)
at webpack_require (http://localhost:8100/build/vendor.js:55:30)
at Object.368 (http://localhost:8100/build/main.js:306:78)
at webpack_require (http://localhost:8100/build/vendor.js:55:30)
at Object.367 (http://localhost:8100/build/main.js:255:69)
at webpack_require (http://localhost:8100/build/vendor.js:55:30)
at Object.246 (http://localhost:8100/build/main.js:93:69)
at webpack_require (http://localhost:8100/build/vendor.js:55:30)
The site emailjs.com is down
How do I send attachments?
(The following description is identical to the corresponding BrowserBox bug.)
For Gaia Email, we monkeypatched STARTTLS support in bug 885110. Andris said the following in that thread:
We are already working on STARTTLS both for Browserbox and smtpclient but we have to implement upgradeToSecure in the TCPSocket Chrome shim first. Once we have the upgrade working, we'll add STARTTLS as well.
Opening this here only for tracking purposes. Our corresponding tracking bug for this is bug 1060558.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.