added idate to messages list

This commit is contained in:
Andris Reinman 2018-08-28 09:42:42 +03:00
parent 853b38a402
commit dc715b2093
6 changed files with 30 additions and 9 deletions

View file

@ -3,7 +3,7 @@
"indent": 0,
"no-await-in-loop": 0
},
"extends": "nodemailer",
"extends": ["nodemailer", "prettier"],
"parserOptions": {
"ecmaVersion": 2017
}

5
.prettierrc.js Normal file
View file

@ -0,0 +1,5 @@
module.exports = {
printWidth: 160,
tabWidth: 4,
singleQuote: true
};

View file

@ -2,7 +2,10 @@
'use strict';
const config = require('wild-config');
// FUTURE FEATURE
// this executable should generate and dispose access tokens for the API
//const config = require('wild-config');
const db = require('../lib/db');
const errors = require('../lib/errors');
const log = require('npmlog');

View file

@ -229,6 +229,7 @@ module.exports = (db, server, messageHandler) => {
limit,
query: filter,
fields: {
idate: true,
// FIXME: MongoPaging inserts fields value as second argument to col.find()
projection: {
_id: true,
@ -237,6 +238,7 @@ module.exports = (db, server, messageHandler) => {
mailbox: true,
'meta.from': true,
hdate: true,
idate: true,
subject: true,
'mimeTree.parsedHeader.from': true,
'mimeTree.parsedHeader.to': true,

View file

@ -44,7 +44,10 @@ class UserHandler {
options = options || {};
let wildcard = !!options.wildcard;
address = tools.normalizeAddress(address, false, { removeLabel: true, removeDots: true });
address = tools.normalizeAddress(address, false, {
removeLabel: true,
removeDots: true
});
let username = address.substr(0, address.indexOf('@'));
let domain = address.substr(address.indexOf('@') + 1);
@ -210,7 +213,10 @@ class UserHandler {
return callback(err);
}
if (addressData.user) {
return next(null, { query: { _id: addressData.user }, addressData });
return next(null, {
query: { _id: addressData.user },
addressData
});
}
return callback(null, false);
});
@ -224,7 +230,7 @@ class UserHandler {
this.users.collection('users').findOne(
data.query,
{
fields
projection: fields
},
(err, userData) => {
if (err) {
@ -2919,7 +2925,9 @@ class UserHandler {
if (!addressData || !addressData.user) {
// fall back to username formatted as an address
return callback(null, {
unameview: tools.normalizeAddress(address, false, { removeDots: true })
unameview: tools.normalizeAddress(address, false, {
removeDots: true
})
});
}

View file

@ -16,11 +16,14 @@
"author": "Andris Reinman",
"license": "EUPL-1.1+",
"devDependencies": {
"ajv": "^6.5.3",
"apidoc": "0.17.6",
"browserbox": "0.9.1",
"chai": "4.1.2",
"eslint": "^5.4.0",
"eslint-config-nodemailer": "1.2.0",
"grunt": "1.0.3",
"eslint-config-prettier": "^3.0.1",
"grunt": "^1.0.3",
"grunt-cli": "1.3.1",
"grunt-eslint": "21.0.0",
"grunt-mocha-test": "0.13.3",
@ -54,7 +57,7 @@
"mailsplit": "4.2.3",
"mobileconfig": "2.1.0",
"mongo-cursor-pagination": "^7.1.0",
"mongodb": "3.1.3",
"mongodb": "3.1.4",
"mongodb-extended-json": "1.10.0",
"node-forge": "0.7.6",
"nodemailer": "4.6.8",
@ -65,7 +68,7 @@
"restify": "7.2.1",
"restify-logger": "2.0.1",
"seq-index": "1.1.0",
"smtp-server": "3.4.6",
"smtp-server": "3.4.7",
"speakeasy": "2.0.0",
"tlds": "1.203.1",
"u2f": "0.1.3",