import sys import time from mailpile.config.base import PathDict from mailpile.config.base import ConfigRule as c from mailpile.config.base import CriticalConfigRule as X from mailpile.config.base import PublicConfigRule as p from mailpile.config.base import KeyConfigRule as k _ = lambda string: string DEFAULT_SENDMAIL = '|/usr/sbin/sendmail -i %(rcpt)s' CONFIG_PLUGINS = [] CONFIG_RULES = { 'version': p(_('Mailpile program version'), str, APPVER), 'homedir': p(_('Location of Mailpile data'), False, '(unset)'), 'timestamp': [_('Configuration timestamp'), int, int(time.time())], 'master_key': k(_('Master symmetric encryption key'), str, ''), 'sys': p( _('Technical system settings'), False, { 'fd_cache_size': p(_('Max files kept open at once'), int, 500), 'minfree_mb': p(_('Required free disk space (MB)'), int, 1024), 'history_length': (_('History length (lines, <0=no save)'), int, 100),
MOTD_URL_DEFAULT = 'https://www.mailpile.is' + MOTD_MARS MOTD_URL_TOR_ONLY = 'http://clgs64523yi2bkhz.onion' + MOTD_MARS MOTD_URL_NO_MARS = 'https://www.mailpile.is' + MOTD_NO_MARS MOTD_URL_TOR_ONLY_NO_MARS = 'http://clgs64523yi2bkhz.onion' + MOTD_NO_MARS MOTD_URLS = { "default": MOTD_URL_DEFAULT, "tor-only": MOTD_URL_TOR_ONLY, "generic": MOTD_URL_NO_MARS, "tor-generic": MOTD_URL_TOR_ONLY_NO_MARS, "unknown": "", "none": "" } _plugins.register_config_variables('prefs', { 'motd_url': p(_('URL to the Message Of The Day'), 'str', 'unknown') }) class MessageOfTheDay(Command): """Download and/or display the Message Of The Day""" SYNOPSIS = (None, 'motd', 'motd', '[--silent|--ifnew] [--[no]update|--check]') ORDER = ('Internals', 6) CONFIG_REQUIRED = False IS_USER_ACTIVITY = False @classmethod def _disable_updates(cls, session): # Don't auto-update the MOTD if the user hasn't configured any # accounts yet - no point bothering the user or the MOTD server. #
import sys import time from mailpile.config.base import PathDict from mailpile.config.base import ConfigRule as c from mailpile.config.base import CriticalConfigRule as X from mailpile.config.base import PublicConfigRule as p from mailpile.config.base import KeyConfigRule as k _ = lambda string: string DEFAULT_SENDMAIL = '|/usr/sbin/sendmail -i %(rcpt)s' CONFIG_PLUGINS = [] CONFIG_RULES = { 'version': p(_('Mailpile program version'), str, APPVER), 'homedir': p(_('Location of Mailpile data'), False, '(unset)'), 'timestamp': [_('Configuration timestamp'), int, int(time.time())], 'master_key': k(_('Master symmetric encryption key'), str, ''), 'sys': p(_('Technical system settings'), False, { 'fd_cache_size': p(_('Max files kept open at once'), int, 500), 'history_length': (_('History length (lines, <0=no save)'), int, 100), 'http_host': p(_('Listening host for web UI'), 'hostname', 'localhost'), 'http_port': p(_('Listening port for web UI'), int, 33411), 'http_path': p(_('HTTP path of web UI'), 'webroot', ''), 'http_no_auth': X(_('Disable HTTP authentication'), bool, False), 'postinglist_kb': (_('Posting list target size in KB'), int, 64), 'sort_max': (_('Max results we sort "well"'), int, 2500), 'snippet_max': (_('Max length of metadata snippets'), int, 250), 'debug': p(_('Debugging flags'), str, ''),
import sys import time from mailpile.config.base import PathDict from mailpile.config.base import ConfigRule as c from mailpile.config.base import CriticalConfigRule as X from mailpile.config.base import PublicConfigRule as p from mailpile.config.base import KeyConfigRule as k _ = lambda string: string DEFAULT_SENDMAIL = '|/usr/sbin/sendmail -i %(rcpt)s' CONFIG_PLUGINS = [] CONFIG_RULES = { 'version': p(_('Mailpile program version'), str, APPVER), 'homedir': p(_('Location of Mailpile data'), False, '(unset)'), 'timestamp': [_('Configuration timestamp'), int, int(time.time())], 'master_key': k(_('Master symmetric encryption key'), str, ''), 'sys': p( _('Technical system settings'), False, { 'fd_cache_size': p(_('Max files kept open at once'), int, 500), 'history_length': (_('History length (lines, <0=no save)'), int, 100), 'http_host': p(_('Listening host for web UI'), 'hostname', 'localhost'),
import time from mailpile.config.base import PathDict from mailpile.config.base import ConfigRule as c from mailpile.config.base import CriticalConfigRule as X from mailpile.config.base import PublicConfigRule as p from mailpile.config.base import KeyConfigRule as k _ = lambda string: string DEFAULT_SENDMAIL = '|/usr/sbin/sendmail -i %(rcpt)s' CONFIG_PLUGINS = [] CONFIG_RULES = { 'version': p(_('Mailpile program version'), str, APPVER), 'homedir': p(_('Location of Mailpile data'), False, '(unset)'), 'timestamp': [_('Configuration timestamp'), int, int(time.time())], 'master_key': k(_('Master symmetric encryption key'), str, ''), 'sys': p(_('Technical system settings'), False, { 'fd_cache_size': p(_('Max files kept open at once'), int, 500), 'minfree_mb': p(_('Required free disk space (MB)'), int, 1024), 'history_length': (_('History length (lines, <0=no save)'), int, 100), 'http_host': p(_('Listening host for web UI'), 'hostname', 'localhost'), 'http_port': p(_('Listening port for web UI'), int, 33411), 'http_path': p(_('HTTP path of web UI'), 'webroot', ''), 'http_no_auth': X(_('Disable HTTP authentication'), bool, False), 'ajax_timeout': (_('AJAX Request timeout'), int, 10000), 'postinglist_kb': (_('Posting list target size in KB'), int, 64), 'sort_max': (_('Max results we sort "well"'), int, 2500),
MOTD_URL_DEFAULT = 'https://www.mailpile.is' + MOTD_MARS MOTD_URL_TOR_ONLY = 'http://clgs64523yi2bkhz.onion' + MOTD_MARS MOTD_URL_NO_MARS = 'https://www.mailpile.is' + MOTD_NO_MARS MOTD_URL_TOR_ONLY_NO_MARS = 'http://clgs64523yi2bkhz.onion' + MOTD_NO_MARS MOTD_URLS = { "default": MOTD_URL_DEFAULT, "tor-only": MOTD_URL_TOR_ONLY, "generic": MOTD_URL_NO_MARS, "tor-generic": MOTD_URL_TOR_ONLY_NO_MARS, "unknown": "", "none": "" } _plugins.register_config_variables( 'prefs', {'motd_url': p(_('URL to the Message Of The Day'), 'str', 'unknown')}) class MessageOfTheDay(Command): """Download and/or display the Message Of The Day""" SYNOPSIS = (None, 'motd', 'motd', '[--silent|--ifnew] [--[no]update|--check]') ORDER = ('Internals', 6) CONFIG_REQUIRED = False IS_USER_ACTIVITY = False @classmethod def _disable_updates(cls, session): # Don't auto-update the MOTD if the user hasn't configured any # accounts yet - no point bothering the user or the MOTD server. #