wildduck/lib/consts.js

142 lines
4.7 KiB
JavaScript
Raw Normal View History

'use strict';
module.exports = {
2017-11-15 21:59:37 +08:00
SCHEMA_VERSION: '1.0',
// how many modifications to cache before writing
BULK_BATCH_SIZE: 150,
// how often to clear expired messages
2017-11-23 17:51:37 +08:00
GC_INTERVAL: 15 * 60 * 1000,
// artificail delay between deleting next expired message in ms
2017-11-15 21:59:37 +08:00
// set to 0 to disable
2017-11-17 19:37:53 +08:00
GC_DELAY_DELETE: 0,
2017-07-17 21:32:31 +08:00
2017-11-17 19:37:53 +08:00
// default
2017-07-17 21:32:31 +08:00
MAX_STORAGE: 1 * (1024 * 1024 * 1024),
MAX_RECIPIENTS: 2000,
MAX_FORWARDS: 2000,
MAX_RCPT_TO: 400,
2017-07-18 16:17:36 +08:00
JUNK_RETENTION: 30 * 24 * 3600 * 1000,
2018-10-11 16:48:12 +08:00
// how long to keep messages of deleted users before deleting
DELETED_USER_MESSAGE_RETENTION: 14 * 24 * 3600 * 1000,
2017-07-21 02:33:41 +08:00
MAILBOX_COUNTER_TTL: 24 * 3600,
2017-11-08 22:22:07 +08:00
// how much plaintext to store in a full text indexed field
2017-11-15 21:59:37 +08:00
MAX_PLAINTEXT_INDEXED: 1 * 1024,
2017-11-08 22:22:07 +08:00
// how much plaintext to store before truncating
MAX_PLAINTEXT_CONTENT: 100 * 1024,
2017-07-21 02:33:41 +08:00
2017-11-15 21:59:37 +08:00
// how much HTML content to store before truncating. not indexed
MAX_HTML_CONTENT: 640 * 1024,
2017-07-30 23:07:35 +08:00
2018-01-12 16:16:16 +08:00
MAX_AUTOREPLY_INTERVAL: 4 * 3600 * 1000,
2017-07-30 23:07:35 +08:00
2017-08-05 20:39:31 +08:00
MAX_AUTOREPLIES: 2000,
DEFAULT_HASH_ALGO: 'pbkdf2', //either 'pbkdf2' or 'bcrypt'
2018-05-14 15:14:44 +08:00
BCRYPT_ROUNDS: 11, // bcrypt.js benchmark async in a VPS: 261.192ms, do not want to take it too long
PDKDF2_ITERATIONS: 25000,
PDKDF2_SALT_SIZE: 16,
PDKDF2_DIGEST: 'sha256', // 'sha512', 'sha256' or 'sha1'
// how many authentication failures per user to allow before blocking until the end of the auth window
2018-04-13 10:22:49 +08:00
USER_AUTH_FAILURES: 12,
// authentication window in seconds, starts counting from first invalid authentication
2018-04-13 10:22:49 +08:00
USER_AUTH_WINDOW: 120,
// how many authentication failures per ip to allow before blocking until the end of the auth window
2018-11-05 15:25:43 +08:00
//IP_AUTH_FAILURES: 10,
IP_AUTH_FAILURES: 0, // disable IP rate limiting for now as too many false positives occurred while scanners use unique IPs
2018-04-13 10:22:49 +08:00
// authentication window in seconds, starts counting from first invalid authentication
IP_AUTH_WINDOW: 300,
// how many TOTP failures per user to allow before blocking until the end of the auth window
TOTP_FAILURES: 6,
// TOTP authentication window in seconds, starts counting from first invalid authentication
2017-11-06 23:32:45 +08:00
TOTP_WINDOW: 180,
2017-11-10 21:04:58 +08:00
SCOPES: ['imap', 'pop3', 'smtp'],
// Refuse to process messages larger than 64 MB. Allowing larger messages might cause jumbo chunks in MongoDB
2018-12-04 20:45:41 +08:00
MAX_ALLOWED_MESSAGE_SIZE: 64 * 1024 * 1024,
2017-11-17 19:37:53 +08:00
2019-03-26 22:41:43 +08:00
// Refuse to process attachments larger than 64 MB
MAX_ALLOWED_ATACHMENT_SIZE: 25 * 1024 * 1024,
2017-11-17 19:37:53 +08:00
// how long to keep deleted messages around before purgeing
2018-08-15 15:17:02 +08:00
ARCHIVE_TIME: 25 * 24 * 3600 * 1000,
// merge similar authlog events into 6 hour buckets instead of storing each separately
// this is mostly needed for IMAP clients that make crazy amout of connections and thus logins
2018-10-10 21:19:20 +08:00
AUTHLOG_BUCKET: 6 * 3600 * 1000,
2021-09-05 19:11:24 +08:00
AUTHLOG_TIME: 30 * 24 * 3600 * 1000,
2018-10-10 21:19:20 +08:00
// start processing tasks 5 minues after startup
2022-05-16 17:11:41 +08:00
TASK_STARTUP_INTERVAL: 1 * 60 * 1000,
2018-10-10 21:19:20 +08:00
// if no tasks were found, wait 2 seconds
TASK_IDLE_INTERVAL: 2 * 1000,
2018-10-11 16:48:12 +08:00
2021-06-21 15:49:31 +08:00
TASK_LOCK_INTERVAL: 1 * 3600 * 1000,
2021-06-20 18:40:04 +08:00
2021-06-22 20:10:23 +08:00
// unlock pending tasks in every 5 minutes
TASK_RELEASE_DELAYED_INTERVAL: 5 * 60 * 1000,
2021-06-22 01:32:25 +08:00
2021-06-20 18:40:04 +08:00
// renewal interval, must be lower than TASK_LOCK_INTERVAL
2021-06-21 15:49:31 +08:00
TASK_UPDATE_INTERVAL: 10 * 60 * 1000,
2019-01-25 21:19:51 +08:00
TEMP_PASS_WINDOW: 24 * 3600 * 1000,
// mongdb query TTL limits
2020-09-08 15:00:17 +08:00
DB_MAX_TIME_USERS: 3 * 1000,
DB_MAX_TIME_MAILBOXES: 3 * 1000,
DB_MAX_TIME_MESSAGES: 2 * 60 * 1000,
2019-04-05 20:08:46 +08:00
2019-05-10 18:32:49 +08:00
// what is the max username part after wildcard
MAX_ALLOWED_WILDCARD_LENGTH: 32,
2019-04-05 20:08:46 +08:00
// access token default ttl in seconds (token ttl time is extended every time token is used by this value)
ACCESS_TOKEN_DEFAULT_TTL: 14 * 24 * 3600,
// access token can be extended until max lifetime value is reached in seconds
2019-08-23 03:47:36 +08:00
ACCESS_TOKEN_MAX_LIFETIME: 180 * 24 * 3600,
TOTP_WINDOW_SIZE: 6,
// how often to send processing updates for long running commands
LONG_COMMAND_NOTIFY_TTL: 1 * 60 * 1000,
// when paging through a large list, how many entries to request per page
2022-03-06 06:08:48 +08:00
CURSOR_MAX_PAGE_SIZE: 2500,
// challenge timeout in seconds
WEBAUTHN_CHALLENGE_TTL: 1 * 60 * 60,
// Default maximum application password limit
// Outlook limits to 40
// https://support.microsoft.com/en-gb/account-billing/manage-app-passwords-for-two-step-verification-d6dc8c6d-4bf7-4851-ad95-6d07799387e9
2022-07-05 16:57:57 +08:00
MAX_ASP_COUNT: 50,
// default max IMAP download size
MAX_IMAP_DOWNLOAD: 10 * 1024 * 1024 * 1024,
// default max POP3 download size
MAX_POP3_DOWNLOAD: 10 * 1024 * 1024 * 1024,
// default max IMAP upload size
MAX_IMAP_UPLOAD: 10 * 1024 * 1024 * 1024,
// maximum number of filters per account
MAX_FILTERS: 400,
// maximum amount of mailboxes per user
MAX_MAILBOXES: 1500
};