change approach again
This commit is contained in:
47
node_modules/nodemailer/lib/well-known/index.js
generated
vendored
Normal file
47
node_modules/nodemailer/lib/well-known/index.js
generated
vendored
Normal file
@ -0,0 +1,47 @@
|
||||
'use strict';
|
||||
|
||||
const services = require('./services.json');
|
||||
const normalized = {};
|
||||
|
||||
Object.keys(services).forEach(key => {
|
||||
let service = services[key];
|
||||
|
||||
normalized[normalizeKey(key)] = normalizeService(service);
|
||||
|
||||
[].concat(service.aliases || []).forEach(alias => {
|
||||
normalized[normalizeKey(alias)] = normalizeService(service);
|
||||
});
|
||||
|
||||
[].concat(service.domains || []).forEach(domain => {
|
||||
normalized[normalizeKey(domain)] = normalizeService(service);
|
||||
});
|
||||
});
|
||||
|
||||
function normalizeKey(key) {
|
||||
return key.replace(/[^a-zA-Z0-9.-]/g, '').toLowerCase();
|
||||
}
|
||||
|
||||
function normalizeService(service) {
|
||||
let filter = ['domains', 'aliases'];
|
||||
let response = {};
|
||||
|
||||
Object.keys(service).forEach(key => {
|
||||
if (filter.indexOf(key) < 0) {
|
||||
response[key] = service[key];
|
||||
}
|
||||
});
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolves SMTP config for given key. Key can be a name (like 'Gmail'), alias (like 'Google Mail') or
|
||||
* an email address (like 'test@googlemail.com').
|
||||
*
|
||||
* @param {String} key [description]
|
||||
* @returns {Object} SMTP config or false if not found
|
||||
*/
|
||||
module.exports = function(key) {
|
||||
key = normalizeKey(key.split('@').pop());
|
||||
return normalized[key] || false;
|
||||
};
|
247
node_modules/nodemailer/lib/well-known/services.json
generated
vendored
Normal file
247
node_modules/nodemailer/lib/well-known/services.json
generated
vendored
Normal file
@ -0,0 +1,247 @@
|
||||
{
|
||||
"1und1": {
|
||||
"host": "smtp.1und1.de",
|
||||
"port": 465,
|
||||
"secure": true,
|
||||
"authMethod": "LOGIN"
|
||||
},
|
||||
|
||||
"AOL": {
|
||||
"domains": ["aol.com"],
|
||||
"host": "smtp.aol.com",
|
||||
"port": 587
|
||||
},
|
||||
|
||||
"DebugMail": {
|
||||
"host": "debugmail.io",
|
||||
"port": 25
|
||||
},
|
||||
|
||||
"DynectEmail": {
|
||||
"aliases": ["Dynect"],
|
||||
"host": "smtp.dynect.net",
|
||||
"port": 25
|
||||
},
|
||||
|
||||
"FastMail": {
|
||||
"domains": ["fastmail.fm"],
|
||||
"host": "mail.messagingengine.com",
|
||||
"port": 465,
|
||||
"secure": true
|
||||
},
|
||||
|
||||
"GandiMail": {
|
||||
"aliases": ["Gandi", "Gandi Mail"],
|
||||
"host": "mail.gandi.net",
|
||||
"port": 587
|
||||
},
|
||||
|
||||
"Gmail": {
|
||||
"aliases": ["Google Mail"],
|
||||
"domains": ["gmail.com", "googlemail.com"],
|
||||
"host": "smtp.gmail.com",
|
||||
"port": 465,
|
||||
"secure": true
|
||||
},
|
||||
|
||||
"Godaddy": {
|
||||
"host": "smtpout.secureserver.net",
|
||||
"port": 25
|
||||
},
|
||||
|
||||
"GodaddyAsia": {
|
||||
"host": "smtp.asia.secureserver.net",
|
||||
"port": 25
|
||||
},
|
||||
|
||||
"GodaddyEurope": {
|
||||
"host": "smtp.europe.secureserver.net",
|
||||
"port": 25
|
||||
},
|
||||
|
||||
"hot.ee": {
|
||||
"host": "mail.hot.ee"
|
||||
},
|
||||
|
||||
"Hotmail": {
|
||||
"aliases": ["Outlook", "Outlook.com", "Hotmail.com"],
|
||||
"domains": ["hotmail.com", "outlook.com"],
|
||||
"host": "smtp.live.com",
|
||||
"port": 587,
|
||||
"tls": {
|
||||
"ciphers": "SSLv3"
|
||||
}
|
||||
},
|
||||
|
||||
"iCloud": {
|
||||
"aliases": ["Me", "Mac"],
|
||||
"domains": ["me.com", "mac.com"],
|
||||
"host": "smtp.mail.me.com",
|
||||
"port": 587
|
||||
},
|
||||
|
||||
"mail.ee": {
|
||||
"host": "smtp.mail.ee"
|
||||
},
|
||||
|
||||
"Mail.ru": {
|
||||
"host": "smtp.mail.ru",
|
||||
"port": 465,
|
||||
"secure": true
|
||||
},
|
||||
|
||||
"Maildev": {
|
||||
"port": 1025,
|
||||
"ignoreTLS": true
|
||||
},
|
||||
|
||||
"Mailgun": {
|
||||
"host": "smtp.mailgun.org",
|
||||
"port": 587
|
||||
},
|
||||
|
||||
"Mailjet": {
|
||||
"host": "in.mailjet.com",
|
||||
"port": 587
|
||||
},
|
||||
|
||||
"Mailosaur": {
|
||||
"host": "mailosaur.io",
|
||||
"port": 25
|
||||
},
|
||||
|
||||
"Mailtrap": {
|
||||
"host": "smtp.mailtrap.io",
|
||||
"port": 2525
|
||||
},
|
||||
|
||||
"Mandrill": {
|
||||
"host": "smtp.mandrillapp.com",
|
||||
"port": 587
|
||||
},
|
||||
|
||||
"Naver": {
|
||||
"host": "smtp.naver.com",
|
||||
"port": 587
|
||||
},
|
||||
|
||||
"OpenMailBox": {
|
||||
"aliases": ["OMB", "openmailbox.org"],
|
||||
"host": "smtp.openmailbox.org",
|
||||
"port": 465,
|
||||
"secure": true
|
||||
},
|
||||
|
||||
"Outlook365": {
|
||||
"host": "smtp.office365.com",
|
||||
"port": 587,
|
||||
"secure": false
|
||||
},
|
||||
|
||||
"Postmark": {
|
||||
"aliases": ["PostmarkApp"],
|
||||
"host": "smtp.postmarkapp.com",
|
||||
"port": 2525
|
||||
},
|
||||
|
||||
"QQ": {
|
||||
"domains": ["qq.com"],
|
||||
"host": "smtp.qq.com",
|
||||
"port": 465,
|
||||
"secure": true
|
||||
},
|
||||
|
||||
"QQex": {
|
||||
"aliases": ["QQ Enterprise"],
|
||||
"domains": ["exmail.qq.com"],
|
||||
"host": "smtp.exmail.qq.com",
|
||||
"port": 465,
|
||||
"secure": true
|
||||
},
|
||||
|
||||
"SendCloud": {
|
||||
"host": "smtpcloud.sohu.com",
|
||||
"port": 25
|
||||
},
|
||||
|
||||
"SendGrid": {
|
||||
"host": "smtp.sendgrid.net",
|
||||
"port": 587
|
||||
},
|
||||
|
||||
"SendinBlue": {
|
||||
"host": "smtp-relay.sendinblue.com",
|
||||
"port": 587
|
||||
},
|
||||
|
||||
"SendPulse": {
|
||||
"host": "smtp-pulse.com",
|
||||
"port": 465,
|
||||
"secure": true
|
||||
},
|
||||
|
||||
"SES": {
|
||||
"host": "email-smtp.us-east-1.amazonaws.com",
|
||||
"port": 465,
|
||||
"secure": true
|
||||
},
|
||||
"SES-US-EAST-1": {
|
||||
"host": "email-smtp.us-east-1.amazonaws.com",
|
||||
"port": 465,
|
||||
"secure": true
|
||||
},
|
||||
"SES-US-WEST-2": {
|
||||
"host": "email-smtp.us-west-2.amazonaws.com",
|
||||
"port": 465,
|
||||
"secure": true
|
||||
},
|
||||
"SES-EU-WEST-1": {
|
||||
"host": "email-smtp.eu-west-1.amazonaws.com",
|
||||
"port": 465,
|
||||
"secure": true
|
||||
},
|
||||
|
||||
"Sparkpost": {
|
||||
"aliases": ["SparkPost", "SparkPost Mail"],
|
||||
"domains": ["sparkpost.com"],
|
||||
"host": "smtp.sparkpostmail.com",
|
||||
"port": 587,
|
||||
"secure": false
|
||||
},
|
||||
|
||||
"Yahoo": {
|
||||
"domains": ["yahoo.com"],
|
||||
"host": "smtp.mail.yahoo.com",
|
||||
"port": 465,
|
||||
"secure": true
|
||||
},
|
||||
|
||||
"Yandex": {
|
||||
"domains": ["yandex.ru"],
|
||||
"host": "smtp.yandex.ru",
|
||||
"port": 465,
|
||||
"secure": true
|
||||
},
|
||||
|
||||
"Zoho": {
|
||||
"host": "smtp.zoho.com",
|
||||
"port": 465,
|
||||
"secure": true,
|
||||
"authMethod": "LOGIN"
|
||||
},
|
||||
"126": {
|
||||
"host": "smtp.126.com",
|
||||
"port": 465,
|
||||
"secure": true
|
||||
},
|
||||
"163": {
|
||||
"host": "smtp.163.com",
|
||||
"port": 465,
|
||||
"secure": true
|
||||
},
|
||||
"qiye.aliyun": {
|
||||
"host": "smtp.mxhichina.com",
|
||||
"port": "465",
|
||||
"secure": true
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user