Exemple #1
0
 'sys': p(_('Technical system settings'), False, {
     'fd_cache_size':  (_('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',            ''),
     '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,                      ''),
     'gpg_keyserver':  (_('Host:port of PGP keyserver'),
                        str, 'pool.sks-keyservers.net'),
     'gpg_home':      p(_('Override the home directory of GnuPG'),
                        'dir', None),
     'gpg_binary':    p(_('Override the default GPG binary path'),
                        'file', None),
     'local_mailbox_id': (_('Local read/write Maildir'), 'b36',         ''),
     'mailindex_file': (_('Metadata index file'), 'file',               ''),
     'postinglist_dir': (_('Search index directory'), 'dir',            ''),
     'mailbox':        [_('Mailboxes we index'), 'bin',                 []],
     'plugins':        [_('Plugins to load on startup'),
                        CONFIG_PLUGINS, []],
     'path':           [_('Locations of assorted data'), False, {
         'html_theme': [_('Default theme'),
                        'dir', os.path.join('mailpile', 'www', 'default')],
         'vcards':     [_('Location of vcards'), 'dir', 'vcards'],
         'event_log':  [_('Location of event log'), 'dir', 'logs'],
     }],
     'lockdown':       [_('Demo mode, disallow changes'), bool,      False],
     'login_banner':   [_('A custom banner for the login page'), str,   ''],
     'proxy':          [_('Proxy settings'), False, {
         'protocol':   (_('Proxy protocol'),
                        ["tor", "socks5", "socks4", "http", "none"],
                        'none'),
         'fallback':   (_('Allow fallback to direct conns'), bool, False),
         'username':   (_('User name'), str, ''),
         'password':   (_('Password'), str, ''),
         'host':       (_('Host'), str, ''),
         'port':       (_('Port'), int, 8080)
     }],
 }),
Exemple #2
0
import sys
import time

from mailpile.config import PathDict
from mailpile.config import ConfigRule as c
from mailpile.config import CriticalConfigRule as X
from mailpile.config import PublicConfigRule as p
from mailpile.config 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),
Exemple #3
0
 p(
     _('Technical system settings'), False, {
         'fd_cache_size': (_('Max files kept open at once'), int, 500),
         'history_length':
         (_('History length (lines, <0=no save)'), int, 100),
         'http_port':
         p(_('Listening port for web UI'), int, 33411),
         '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, ''),
         'gpg_keyserver':
         (_('Host:port of PGP keyserver'), str, 'pool.sks-keyservers.net'),
         'gpg_home':
         p(_('Override the home directory of GnuPG'), 'dir', None),
         'http_host':
         p(_('Listening host for web UI'), 'hostname', 'localhost'),
         'local_mailbox_id': (_('Local read/write Maildir'), 'b36', ''),
         'mailindex_file': (_('Metadata index file'), 'file', ''),
         'postinglist_dir': (_('Search index directory'), 'dir', ''),
         'mailbox': [_('Mailboxes we index'), 'bin', []],
         'plugins': [_('Plugins to load on startup'), CONFIG_PLUGINS, []],
         'path': [
             _('Locations of assorted data'), False, {
                 'html_theme': [
                     _('Default theme'), 'dir',
                     os.path.join('mailpile', 'www', 'default')
                 ],
                 'vcards': [_('Location of vcards'), 'dir', 'vcards'],
                 'event_log': [_('Location of event log'), 'dir', 'logs'],
             }
         ],
         'lockdown': [_('Demo mode, disallow changes'), bool, False],
         'login_banner': [_('A custom banner for the login page'), str, ''],
     }),
Exemple #4
0
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.
        #
Exemple #5
0
# Details:
#  https://github.com/mailpile/Mailpile/wiki/Mailpile-Analytics-Reporting-System
#
MOTD_MARS    = '/motd/%(ver)s-%(os)s/motd.json?lang=%(lang)s&py=%(py)s'
MOTD_NO_MARS = '/motd/latest/motd.json'
#
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


_plugins.register_config_variables('prefs', {
    'motd_url': p(
        _('URL to the Message Of The Day'),
        'url',
        MOTD_URL_DEFAULT
    )
})


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
Exemple #6
0
import sys
import time

from mailpile.config import PathDict
from mailpile.config import ConfigRule as c
from mailpile.config import CriticalConfigRule as X
from mailpile.config import PublicConfigRule as p
from mailpile.config 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'),
Exemple #7
0
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.
        #