diff --git a/plinth/modules/email_server/__init__.py b/plinth/modules/email_server/__init__.py index 0a1b014f9..de8b5a798 100644 --- a/plinth/modules/email_server/__init__.py +++ b/plinth/modules/email_server/__init__.py @@ -3,13 +3,12 @@ import logging +from django.urls import reverse_lazy from django.utils.translation import gettext_lazy as _ import plinth.app -import plinth.daemon -import plinth.frontpage -import plinth.menu -from plinth import actions +from plinth import actions, frontpage, menu +from plinth.daemon import Daemon from plinth.modules.apache.components import Webserver from plinth.modules.config import get_domainname from plinth.modules.firewall.components import Firewall @@ -23,6 +22,10 @@ clamav_packages = ['clamav', 'clamav-daemon'] clamav_daemons = ['clamav-daemon', 'clamav-freshclam'] _description = [ + _('This is a complete email server solution using Postfix, Dovecot, ' + 'Rspamd and ClamAV. Postfix sends and receives emails. Dovecot allows ' + 'email clients to access your mailbox using IMAP and POP3. Rspamd deals ' + 'with spam. ClamAV identifies viruses and malware.'), _('Roundcube app provides web ' 'interface for users to access email.'), _('During installation, any other email servers in the system will be ' @@ -44,23 +47,26 @@ class EmailServerApp(plinth.app.App): super().__init__() info = plinth.app.Info( - app_id=self.app_id, version=self._version, name=_('Email Server'), - icon_filename='roundcube', - short_description=_('Postfix, Dovecot & Rspamd'), - description=_description, manual_page='EmailServer', - clients=manifest.clients, + app_id=self.app_id, version=self._version, + name=_('Postfix/Dovecot'), icon_filename='roundcube', + short_description=_('Email Server'), description=_description, + manual_page='EmailServer', clients=manifest.clients, donation_url='https://rspamd.com/support.html') self.add(info) - menu_item = plinth.menu.Menu( - 'menu_' + self.app_id, # unique id - info.name, # app display name - info.short_description, # app description - 'roundcube', # icon name in `static/theme/icons/` - 'email_server:index', # view name - parent_url_name='apps') + menu_item = menu.Menu('menu-email-server', info.name, + info.short_description, info.icon_filename, + 'email_server:index', parent_url_name='apps') self.add(menu_item) + shortcut = frontpage.Shortcut( + 'shortcut-email-server', info.name, + short_description=info.short_description, icon=info.icon_filename, + description=info.description, + configure_url=reverse_lazy('email_server:index'), + clients=info.clients, login_required=True) + self.add(shortcut) + # Other likely install conflicts have been discarded: # - msmtp, nullmailer, sendmail don't cause install faults. # - qmail and smail are missing in Bullseye (Not tested, @@ -80,22 +86,22 @@ class EmailServerApp(plinth.app.App): listen_ports = [(25, 'tcp4'), (25, 'tcp6'), (465, 'tcp4'), (465, 'tcp6'), (587, 'tcp4'), (587, 'tcp6')] - daemon = plinth.daemon.Daemon('daemon-postfix', 'postfix', - listen_ports=listen_ports) + daemon = Daemon('daemon-email-server-postfix', 'postfix', + listen_ports=listen_ports) self.add(daemon) listen_ports = [(143, 'tcp4'), (143, 'tcp6'), (993, 'tcp4'), (993, 'tcp6'), (110, 'tcp4'), (110, 'tcp6'), (995, 'tcp4'), (995, 'tcp6'), (4190, 'tcp4'), (4190, 'tcp6')] - daemon = plinth.daemon.Daemon('daemon-dovecot', 'dovecot', - listen_ports=listen_ports) + daemon = Daemon('daemon-email-server-dovecot', 'dovecot', + listen_ports=listen_ports) self.add(daemon) listen_ports = [(11332, 'tcp4'), (11332, 'tcp6'), (11333, 'tcp4'), (11333, 'tcp6'), (11334, 'tcp4'), (11334, 'tcp6')] - daemon = plinth.daemon.Daemon('daemon-rspamd', 'rspamd', - listen_ports=listen_ports) + daemon = Daemon('daemon-email-server-rspamd', 'rspamd', + listen_ports=listen_ports) self.add(daemon) port_names = ['smtp', 'smtps', 'smtp-submission', 'imaps', 'pop3s']