Comparing version 0.13.4 to 0.14.0
@@ -7,3 +7,3 @@ /* global angular, io */ | ||
var app = angular.module('mailDevApp', ['ngRoute', 'ngResource', 'ngSanitize']); | ||
var app = angular.module('mailDevApp', ['ngRoute', 'ngResource', 'ngSanitize', 'ngCookies']); | ||
@@ -10,0 +10,0 @@ app.config(['$routeProvider', function($routeProvider){ |
@@ -8,4 +8,4 @@ /* global angular, app */ | ||
app.controller('ItemCtrl', [ | ||
'$scope', '$rootScope', '$routeParams', '$location', 'Email', '$http', | ||
function($scope, $rootScope, $routeParams, $location, Email, $http) { | ||
'$scope', '$rootScope', '$routeParams', '$location', 'Email', '$http', '$cookies', | ||
function($scope, $rootScope, $routeParams, $location, Email, $http, $cookies) { | ||
@@ -102,2 +102,7 @@ var iframe = null; | ||
function validateEmail(email) { | ||
var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; | ||
return re.test(email); | ||
} | ||
addHideDropdownHanlder( window ); | ||
@@ -126,4 +131,23 @@ | ||
// Relay email to | ||
$scope.relayTo = function(item){ | ||
var lastRelayTo = $cookies.relayTo; | ||
var relayTo = prompt("Please enter email address to relay", lastRelayTo); | ||
if (relayTo){ | ||
if (validateEmail(relayTo)){ | ||
$scope.relay(item, relayTo); | ||
$cookies.relayTo = relayTo; | ||
} | ||
else { | ||
window.alert('The specified email address is not correct.'); | ||
} | ||
} | ||
}; | ||
// Relay email | ||
$scope.relay = function(item) { | ||
$scope.relay = function(item, relayTo) { | ||
@@ -140,5 +164,6 @@ if (!$rootScope.config.isOutgoingEnabled) { | ||
if ( | ||
window.confirm( | ||
'Are you sure you want to REALLY SEND email to ' + | ||
item.to.map(function(to){return to.address;}).join() + ' through ' + | ||
(relayTo ? relayTo : item.to.map(function(to){return to.address;}).join()) + ' through ' + | ||
$rootScope.config.outgoingHost + '?' | ||
@@ -150,3 +175,3 @@ ) | ||
method: 'POST', | ||
url: '/email/' + item.id + '/relay' | ||
url: 'email/' + item.id + '/relay' + (relayTo ? '/' + relayTo : '') | ||
}) | ||
@@ -153,0 +178,0 @@ .success(function(data, status) { |
@@ -8,2 +8,3 @@ | ||
var emailRegexp = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; | ||
@@ -123,6 +124,16 @@ module.exports = function(app, mailserver, basePathname) { | ||
// Relay the email | ||
router.post('/email/:id/relay', function(req, res){ | ||
router.post('/email/:id/relay/:relayTo?', function(req, res){ | ||
mailserver.getEmail(req.params.id, function(err, email){ | ||
if (err) return res.status(404).json({ error: err.message }); | ||
if (req.params.relayTo) { | ||
if (emailRegexp.test(req.params.relayTo)) { | ||
email.to = [{address: req.params.relayTo}]; | ||
email.envelope.to = [ { address: req.params.relayTo, args: false }] | ||
} | ||
else { | ||
return res.status(400).json({ error: 'Incorrect email address provided :' + req.params.relayTo }); | ||
} | ||
} | ||
mailserver.relayMail(email, function(err) { | ||
@@ -129,0 +140,0 @@ if (err) return res.status(500).json({ error: err.message }); |
{ | ||
"name": "maildev", | ||
"description": "SMTP Server and Web Interface for reading and testing emails during development", | ||
"version": "0.13.4", | ||
"version": "0.14.0", | ||
"keywords": [ | ||
@@ -23,2 +23,5 @@ "email", | ||
}, | ||
"scripts": { | ||
"test": "./node_modules/.bin/istanbul cover _mocha" | ||
}, | ||
"main": "./index.js", | ||
@@ -30,32 +33,30 @@ "bin": { | ||
"dependencies": { | ||
"async": "^1.5.1", | ||
"commander": "^2.9.0", | ||
"express": "^4.13.4", | ||
"mailparser": "^0.5.3", | ||
"open": "~0.0.5", | ||
"simplesmtp": "^0.3.35", | ||
"smtp-connection": "^2.3.1", | ||
"smtp-server": "^1.4.0", | ||
"socket.io": "^1.4.5", | ||
"wildstring": "^1.0.8" | ||
"async": "1.5.1", | ||
"commander": "2.9.0", | ||
"express": "4.13.4", | ||
"mailparser": "0.5.3", | ||
"open": "0.0.5", | ||
"simplesmtp": "0.3.35", | ||
"smtp-connection": "2.3.1", | ||
"smtp-server": "1.4.0", | ||
"socket.io": "1.4.5", | ||
"wildstring": "1.0.8" | ||
}, | ||
"devDependencies": { | ||
"grunt": "^0.4.5", | ||
"grunt-concurrent": "^2.2.1", | ||
"grunt-contrib-jshint": "^1.0.0", | ||
"grunt-contrib-watch": "^1.0.0", | ||
"grunt-nodemon": "^0.4.0", | ||
"grunt-sass": "^1.1.0", | ||
"http-proxy-middleware": "^0.12.0", | ||
"matchdep": "^1.0.1", | ||
"mocha": "^2.2.5", | ||
"nodemailer": "^2.3.0", | ||
"request": "^2.69.0" | ||
"grunt": "0.4.5", | ||
"grunt-concurrent": "2.2.1", | ||
"grunt-contrib-jshint": "1.0.0", | ||
"grunt-contrib-watch": "1.0.0", | ||
"grunt-nodemon": "0.4.1", | ||
"grunt-sass": "1.1.0", | ||
"http-proxy-middleware": "0.12.0", | ||
"istanbul": "0.4.4", | ||
"matchdep": "1.0.1", | ||
"mocha": "2.2.5", | ||
"nodemailer": "2.3.0", | ||
"request": "2.69.0" | ||
}, | ||
"engines": { | ||
"node": ">=0.10.0" | ||
}, | ||
"scripts": { | ||
"test": "./node_modules/mocha/bin/mocha" | ||
} | ||
} |
@@ -149,2 +149,4 @@ # MailDev | ||
**Drupal** -- Install and configure [SMTP](https://www.drupal.org/project/smtp) module or use a library like [SwiftMailer](http://swiftmailer.org/). | ||
## Features | ||
@@ -151,0 +153,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
2229220
73
22684
195
12
+ Addedaccepts@1.1.41.2.13(transitive)
+ Addedafter@0.8.1(transitive)
+ Addedasync@1.5.1(transitive)
+ Addedbase64-arraybuffer@0.1.2(transitive)
+ Addedbase64id@0.1.0(transitive)
+ Addedbenchmark@1.0.0(transitive)
+ Addedcommander@2.9.0(transitive)
+ Addedcomponent-emitter@1.2.0(transitive)
+ Addedcontent-disposition@0.5.1(transitive)
+ Addedcookie@0.1.5(transitive)
+ Addeddebug@0.7.4(transitive)
+ Addeddepd@1.1.2(transitive)
+ Addeddestroy@1.0.4(transitive)
+ Addedengine.io@1.6.8(transitive)
+ Addedengine.io-client@1.6.8(transitive)
+ Addedengine.io-parser@1.2.4(transitive)
+ Addedetag@1.7.0(transitive)
+ Addedexpress@4.13.4(transitive)
+ Addedfinalhandler@0.4.1(transitive)
+ Addedforwarded@0.1.2(transitive)
+ Addedfresh@0.3.0(transitive)
+ Addedgraceful-readlink@1.0.1(transitive)
+ Addedhas-binary@0.1.6(transitive)
+ Addedhttp-errors@1.3.1(transitive)
+ Addedipaddr.js@1.0.5(transitive)
+ Addedjson3@3.2.6(transitive)
+ Addedmerge-descriptors@1.0.1(transitive)
+ Addedmime@1.3.4(transitive)
+ Addedmime-db@1.12.0(transitive)
+ Addedmime-types@2.0.14(transitive)
+ Addednegotiator@0.4.90.5.3(transitive)
+ Addednodemailer-fetch@1.3.0(transitive)
+ Addednodemailer-shared@1.0.4(transitive)
+ Addedon-finished@2.3.0(transitive)
+ Addedparsejson@0.0.1(transitive)
+ Addedparseqs@0.0.2(transitive)
+ Addedparseuri@0.0.4(transitive)
+ Addedpath-to-regexp@0.1.7(transitive)
+ Addedproxy-addr@1.0.10(transitive)
+ Addedqs@4.0.0(transitive)
+ Addedrange-parser@1.0.3(transitive)
+ Addedsend@0.13.10.13.2(transitive)
+ Addedserve-static@1.10.3(transitive)
+ Addedsmtp-connection@2.3.1(transitive)
+ Addedsmtp-server@1.4.0(transitive)
+ Addedsocket.io@1.4.5(transitive)
+ Addedsocket.io-adapter@0.4.0(transitive)
+ Addedsocket.io-client@1.4.5(transitive)
+ Addedsocket.io-parser@2.2.22.2.6(transitive)
+ Addedstatuses@1.2.1(transitive)
+ Addedutf8@2.1.0(transitive)
+ Addedutils-merge@1.0.0(transitive)
+ Addedvary@1.0.1(transitive)
+ Addedwildstring@1.0.8(transitive)
+ Addedws@1.0.1(transitive)
+ Addedxmlhttprequest-ssl@1.5.1(transitive)
- Removedaccepts@1.3.31.3.8(transitive)
- Removedafter@0.8.2(transitive)
- Removedasync@1.5.2(transitive)
- Removedbase64-arraybuffer@0.1.5(transitive)
- Removedbase64id@1.0.0(transitive)
- Removedbody-parser@1.20.3(transitive)
- Removedbytes@3.1.2(transitive)
- Removedcall-bind-apply-helpers@1.0.1(transitive)
- Removedcall-bound@1.0.3(transitive)
- Removedcommander@2.20.3(transitive)
- Removedcomponent-emitter@1.2.1(transitive)
- Removedcontent-disposition@0.5.4(transitive)
- Removedcookie@0.3.10.7.1(transitive)
- Removeddebug@2.3.32.6.9(transitive)
- Removeddepd@2.0.0(transitive)
- Removeddestroy@1.2.0(transitive)
- Removeddunder-proto@1.0.1(transitive)
- Removedencodeurl@1.0.22.0.0(transitive)
- Removedengine.io@1.8.5(transitive)
- Removedengine.io-client@1.8.6(transitive)
- Removedengine.io-parser@1.3.2(transitive)
- Removedes-define-property@1.0.1(transitive)
- Removedes-errors@1.3.0(transitive)
- Removedes-object-atoms@1.1.1(transitive)
- Removedetag@1.8.1(transitive)
- Removedexpress@4.21.2(transitive)
- Removedfinalhandler@1.3.1(transitive)
- Removedforwarded@0.2.0(transitive)
- Removedfresh@0.5.2(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedget-intrinsic@1.2.7(transitive)
- Removedget-proto@1.0.1(transitive)
- Removedgopd@1.2.0(transitive)
- Removedhas-symbols@1.1.0(transitive)
- Removedhasown@2.0.2(transitive)
- Removedhttp-errors@2.0.0(transitive)
- Removedhttpntlm@1.6.1(transitive)
- Removedhttpreq@1.1.1(transitive)
- Removediconv-lite@0.4.24(transitive)
- Removedipaddr.js@1.9.1(transitive)
- Removedipv6-normalize@1.0.1(transitive)
- Removedmath-intrinsics@1.1.0(transitive)
- Removedmerge-descriptors@1.0.3(transitive)
- Removedms@0.7.22.0.02.1.3(transitive)
- Removednegotiator@0.6.10.6.3(transitive)
- Removednodemailer-fetch@1.6.0(transitive)
- Removednodemailer-shared@1.1.0(transitive)
- Removedobject-assign@4.1.0(transitive)
- Removedobject-inspect@1.13.3(transitive)
- Removedon-finished@2.4.1(transitive)
- Removedparsejson@0.0.3(transitive)
- Removedparseqs@0.0.5(transitive)
- Removedparseuri@0.0.5(transitive)
- Removedpath-to-regexp@0.1.12(transitive)
- Removedproxy-addr@2.0.7(transitive)
- Removedqs@6.13.0(transitive)
- Removedrange-parser@1.2.1(transitive)
- Removedraw-body@2.5.2(transitive)
- Removedsafe-buffer@5.2.1(transitive)
- Removedsend@0.19.0(transitive)
- Removedserve-static@1.16.2(transitive)
- Removedsetprototypeof@1.2.0(transitive)
- Removedside-channel@1.1.0(transitive)
- Removedside-channel-list@1.0.0(transitive)
- Removedside-channel-map@1.0.1(transitive)
- Removedside-channel-weakmap@1.0.2(transitive)
- Removedsmtp-connection@2.12.2(transitive)
- Removedsmtp-server@1.17.0(transitive)
- Removedsocket.io@1.7.4(transitive)
- Removedsocket.io-adapter@0.5.0(transitive)
- Removedsocket.io-client@1.7.4(transitive)
- Removedsocket.io-parser@2.3.1(transitive)
- Removedstatuses@2.0.1(transitive)
- Removedtoidentifier@1.0.1(transitive)
- Removedunderscore@1.7.0(transitive)
- Removedutils-merge@1.0.1(transitive)
- Removedvary@1.1.2(transitive)
- Removedwildstring@1.0.9(transitive)
- Removedws@1.1.5(transitive)
- Removedwtf-8@1.0.0(transitive)
- Removedxmlhttprequest-ssl@1.6.3(transitive)
Updatedasync@1.5.1
Updatedcommander@2.9.0
Updatedexpress@4.13.4
Updatedmailparser@0.5.3
Updatedopen@0.0.5
Updatedsimplesmtp@0.3.35
Updatedsmtp-connection@2.3.1
Updatedsmtp-server@1.4.0
Updatedsocket.io@1.4.5
Updatedwildstring@1.0.8