Skip to main content
Version: 4.1

Emails

The following commands are available for HiTechCloud Enterprise users:

MailServer​

Using the hitechcloudcli email-server command you can install and manage the mailserver:

root@jane:~# hitechcloudcli email-server
Usage:

hitechcloudcli email-server status Show status
hitechcloudcli email-server config Show configuration
hitechcloudcli email-server install Install the email server
hitechcloudcli email-server start Start the email server
hitechcloudcli email-server stop Stop the email server
hitechcloudcli email-server restart Restart the email server
hitechcloudcli email-server queue Show mail queue
hitechcloudcli email-server flush Flush mail queue
hitechcloudcli email-server view <queue id> Show mail by queue id
hitechcloudcli email-server unhold <queue id> [<queue id>] Release mail that was put "on hold" (marked with '!')
hitechcloudcli email-server unhold ALL Release all mails that were put "on hold" (marked with '!')
hitechcloudcli email-server delete <queue id> [<queue id>] Delete mail from queue
hitechcloudcli email-server delete ALL Delete all mails from queue
hitechcloudcli email-server fail2ban [<ban|unban> <IP>] Interact with fail2ban
hitechcloudcli email-server fail2ban log Show fail2ban log
hitechcloudcli email-server ports Show published ports
hitechcloudcli email-server postconf Show postfix configuration
hitechcloudcli email-server logs [-f] Show logs. Use -f to 'follow' the logs
hitechcloudcli email-server login Run container shell
hitechcloudcli email-server supervisor Interact with supervisorctl
hitechcloudcli email-server pflogsumm Generate summary reports
hitechcloudcli email-server update-check Check for container package updates
hitechcloudcli email-server update-packages Update container packages
hitechcloudcli email-server versions Show versions

Install​

To install mailserver:

hitechcloudcli email-server install

Start​

To start the mailserver:

hitechcloudcli email-server start

Restart​

To restart the mailserver:

hitechcloudcli email-server restart

Stop​

To stop the mailserver:

hitechcloudcli email-server stop

Status​

To view current mailserver status:

hitechcloudcli email-server status

Example:

root@stefi:/usr/# hitechcloudcli email-server status
Container: Up 21 minutes (healthy)

Version: v14.0.0


Packages: Updates available

Ports: 25/tcp -> 0.0.0.0:25
25/tcp -> [::]:25
143/tcp -> 0.0.0.0:143
143/tcp -> [::]:143
465/tcp -> 0.0.0.0:465
465/tcp -> [::]:465
587/tcp -> 0.0.0.0:587
587/tcp -> [::]:587
993/tcp -> 0.0.0.0:993
993/tcp -> [::]:993

Postfix: Mail queue is empty

Supervisor: amavis RUNNING pid 910, uptime 0:20:23
changedetector RUNNING pid 949, uptime 0:20:23
cron RUNNING pid 803, uptime 0:20:25
dovecot RUNNING pid 813, uptime 0:20:25
mailserver RUNNING pid 8, uptime 0:21:06
opendkim RUNNING pid 848, uptime 0:20:24
opendmarc RUNNING pid 864, uptime 0:20:24
postfix RUNNING pid 876, uptime 0:20:24
rsyslog RUNNING pid 807, uptime 0:20:25
update-check RUNNING pid 822, uptime 0:20:24
clamav STOPPED Not started
fail2ban STOPPED Not started
fetchmail STOPPED Not started
mta-sts-daemon STOPPED Not started
postgrey STOPPED Not started
postsrsd STOPPED Not started
rspamd STOPPED Not started
rspamd-redis STOPPED Not started
saslauthd_ldap STOPPED Not started
saslauthd_mysql STOPPED Not started
saslauthd_pam STOPPED Not started
saslauthd_rimap STOPPED Not started
saslauthd_shadow STOPPED Not started

Config​

To view active mailserver configuration:

hitechcloudcli email-server config

Example:

root@stefi:~# hitechcloudcli email-server config
ACCOUNT_PROVISIONER='FILE'
AMAVIS_LOGLEVEL='0'
CLAMAV_MESSAGE_SIZE_LIMIT='25M'
DEFAULT_RELAY_HOST=''
DMS_VMAIL_GID='5000'
DMS_VMAIL_UID='5000'
DOVECOT_INET_PROTOCOLS='ipv4'
DOVECOT_MAILBOX_FORMAT='maildir'
DOVECOT_TLS='no'
ENABLE_AMAVIS='1'
ENABLE_CLAMAV='0'
ENABLE_DNSBL='0'
ENABLE_FAIL2BAN='0'
ENABLE_FETCHMAIL='0'
ENABLE_GETMAIL='0'
ENABLE_IMAP='1'
ENABLE_MANAGESIEVE='0'
ENABLE_OAUTH2='0'
ENABLE_OPENDKIM='1'
ENABLE_OPENDMARC='1'
ENABLE_POLICYD_SPF='1'
ENABLE_POP3='0'
ENABLE_POSTGREY='0'
ENABLE_QUOTAS='1'
ENABLE_RSPAMD='0'
ENABLE_RSPAMD_REDIS='0'
ENABLE_SASLAUTHD='0'
ENABLE_SPAMASSASSIN='0'

Queue​

To view current mail queue:

hitechcloudcli email-server queue

Flush Queue​

To flush current mail queue:

hitechcloudcli email-server flush

View​

To view mail by queue id:

hitechcloudcli email-server view <queue id>

Unhold​

To release a specific mail that was put "on hold" (marked with '!'):

hitechcloudcli email-server unhold <queue id> [<queue id>]

To release ALL mails that are put "on hold" (marked with '!'):

hitechcloudcli email-server unhold ALL

Delete​

To delete specific mail from queue:

hitechcloudcli email-server delete <queue id>

To delete multiple mails from queue using their queue IDs :

hitechcloudcli email-server delete <queue id> [<queue id>] [<queue id>] [<queue id>]

To delete ALL mails from queue:

hitechcloudcli email-server delete ALL

Fail2Ban​

To interact with fail2ban:

hitechcloudcli email-server fail2ban

To ban IP address using fail2ban:

hitechcloudcli email-server fail2ban ban <IP>

To unban IP address using fail2ban:

hitechcloudcli email-server fail2ban unban <IP>

To view fail2ban logs:

hitechcloudcli email-server fail2ban log

Postfix​

To view current postfix configuration:

hitechcloudcli email-server postconf

Example:

root@stefi:~# hitechcloudcli email-server postconf
2bounce_notice_recipient = postmaster
access_map_defer_code = 450
access_map_reject_code = 554
address_verify_cache_cleanup_interval = 12h
address_verify_default_transport = $default_transport
address_verify_local_transport = $local_transport
address_verify_map = btree:$data_directory/verify_cache
address_verify_negative_cache = yes
address_verify_negative_expire_time = 3d
address_verify_negative_refresh_time = 3h
address_verify_pending_request_limit = 5000
address_verify_poll_count = ${stress?{1}:{3}}
address_verify_poll_delay = 3s
address_verify_positive_expire_time = 31d
address_verify_positive_refresh_time = 7d
...

Logs​

Display mailserver logs:

hitechcloudcli email-server logs

Use -f to 'follow' the logs:

hitechcloudcli email-server logs -f

pflogsumm​

Generate HTML reports from mail logs:

hitechcloudcli email-server pflogsumm

Supervisor​

Interact with the supervisor:

hitechcloudcli email-server supervisor

Example:

root@stefi:~# hitechcloudcli email-server supervisor
amavis RUNNING pid 910, uptime 0:38:23
changedetector RUNNING pid 949, uptime 0:38:23
clamav STOPPED Not started
cron RUNNING pid 803, uptime 0:38:25
dovecot RUNNING pid 813, uptime 0:38:25
fail2ban STOPPED Not started
fetchmail STOPPED Not started
mailserver RUNNING pid 8, uptime 0:39:06
mta-sts-daemon STOPPED Not started
opendkim RUNNING pid 848, uptime 0:38:24
opendmarc RUNNING pid 864, uptime 0:38:24
postfix RUNNING pid 876, uptime 0:38:24
postgrey STOPPED Not started
postsrsd STOPPED Not started
rspamd STOPPED Not started
rspamd-redis STOPPED Not started
rsyslog RUNNING pid 807, uptime 0:38:25
saslauthd_ldap STOPPED Not started
saslauthd_mysql STOPPED Not started
saslauthd_pam STOPPED Not started
saslauthd_rimap STOPPED Not started
saslauthd_shadow STOPPED Not started
update-check RUNNING pid 822, uptime 0:38:24

Login​

Login as root user to the mailserver container:

hitechcloudcli email-server login

Ports​

Display ports currently in use by the mailserver:

hitechcloudcli email-server ports

Example:

root@stefi:~# hitechcloudcli email-server ports
Published ports:

25/tcp -> 0.0.0.0:25
25/tcp -> [::]:25
143/tcp -> 0.0.0.0:143
143/tcp -> [::]:143
465/tcp -> 0.0.0.0:465
465/tcp -> [::]:465
587/tcp -> 0.0.0.0:587
587/tcp -> [::]:587
993/tcp -> 0.0.0.0:993
993/tcp -> [::]:993

Update Check​

Check for container package updates:

hitechcloudcli email-server update-check

Update Packages​

Update container packages:

hitechcloudcli email-server update-packages

Versions​

Display versions:

hitechcloudcli email-server versions

Example:

root@stefi:~# hitechcloudcli email-server versions
Mailserver: v14.0.0

amavisd-new: 1:2.13.0-3
clamav: 1.0.3+dfsg-1~deb12u1
dovecot-core: 1:2.3.19.1+dfsg1-2.1
fail2ban: 1.0.2-2
fetchmail: 6.4.37-1
getmail6: 6.18.11-2
rspamd: 3.8.4-1~93fa4f6dc~bookworm
opendkim: 2.11.0~beta2-8+deb12u1
opendmarc: 1.4.2-2+b1
postfix: 3.7.10-0+deb12u1
spamassassin: 4.0.0-6
supervisor: 4.2.5-1

Uninstall​

To uninstall the mailserver:

hitechcloudcli email-server uninstall

Webmail​

Display current webmail domain:

hitechcloudcli email-webmail

Set 'webmail.example.com' as a webmail domain:

hitechcloudcli email-webmail domain webmail.example.com

Emails​

hitechcloudcli email-setup command is used to create and manage email accounts.

To view a list of all available sub-commands:

hitechcloudcli email-setup help

List emails​

To view a list of all email addresses on server:

hitechcloudcli email-setup email list

Create email​

To create new email account:

hitechcloudcli email-setup email add <EMAIL ADDRESS> [<PASSWORD>]

Change password​

To change password for email account:

hitechcloudcli email-setup email update <EMAIL ADDRESS> [<PASSWORD>]

Delete email​

To delete an email account:

hitechcloudcli email-setup email del [ OPTIONS... ] <EMAIL ADDRESS> [ <EMAIL ADDRESS>... ]

Restrict email​

To suspend sending or receiving of emails for an email account:

hitechcloudcli email-setup email restrict <add|del|list> <send|receive> [<EMAIL ADDRESS>]

Aliases​

The hitechcloudcli email-setup alias command is used to manage email aliases:

List Aliases​

To list all email aliases:

hitechcloudcli email-setup alias list

Add Alias​

To create a new email alias:

hitechcloudcli email-setup alias add <EMAIL ADDRESS> <RECIPIENT>

Delete Alias​

To delete existing email alias:

hitechcloudcli email-setup alias del <EMAIL ADDRESS> <RECIPIENT>

Quotas​

The hitechcloudcli email-setup quota command is used to manage email quotas:

Set Quota​

To set quota for email account:

hitechcloudcli email-setup quota set <EMAIL ADDRESS> [<QUOTA>]

Remove Quota​

To remove quota for email account:

hitechcloudcli email-setup quota del <EMAIL ADDRESS>

Dovecot Master​

Dovecot Master accounts are used to auto-login from HiTechCloud interface to any email address.

hitechcloudcli email-setup dovecot-master

List Dovecot Master​

To list all dovecot-master accounts:

hitechcloudcli email-setup dovecot-master list

Add Dovecot Master​

To create a new dovecot-master account:

hitechcloudcli email-setup dovecot-master add <USERNAME> [<PASSWORD>]

Update Dovecot Master​

To change password for existing dovecot-master account:

hitechcloudcli email-setup dovecot-master update <USERNAME> [<PASSWORD>]

Add Dovecot Master​

To delete an dovecot-master account:

hitechcloudcli email-setup dovecot-master del [ OPTIONS... ] <USERNAME> [ <USERNAME>... ]

DKIM​

To manage DKIM use hitechcloudcli email-setup config command:

Setup DKIM​

To setup DKIM:

hitechcloudcli email-setup config dkim [ ARGUMENTS... ]

Email Relay​

To setup email relay use hitechcloudcli email-setup relay command:

Add Auth​

To add auth to email relay:

hitechcloudcli email-setup relay add-auth <DOMAIN> <USERNAME> [<PASSWORD>]

Add Domain​

To add auth domain to email relay:

hitechcloudcli email-setup relay add-domain <DOMAIN> <HOST> [<PORT>]

Exclude Auth​

To exclude auth from email relay:

hitechcloudcli email-setup relay exclude-domain <DOMAIN>

Fail2Ban​

Fail2Ban is used for restricting and blocking access to email accounts.

To display available options:

hitechcloudcli email-setup fail2ban

Ban IP​

To ban IP address from accessing mail server:

hitechcloudcli email-setup fail2ban ban <IP>

UnBan IP​

To unban IP address and allow it to access mail server:

hitechcloudcli email-setup fail2ban unban <IP>

View Log​

To view the fail2ban log:

hitechcloudcli email-setup fail2ban log

View Status​

To view the fail2ban status:

hitechcloudcli email-setup fail2ban status

Debug​

For debugging emails the following commands are available:

Fetchmail​

Fetchmail is a powerful tool that can be used to debug email:

hitechcloudcli email-setup debug fetchmail

Login​

To troubleshoot email address login:

hitechcloudcli email-setup debug login <COMMANDS>

Mail Logs​

To view the mailserver logs:

hitechcloudcli email-setup debug show-mail-logs

Send limits​

Per-mailbox outbound send limits: how much each mailbox has sent in the last hour, what its limit is, and what happens when it is passed.

hitechcloudcli email-sendlimit <show|status|set|unset|default|enforce>
SubcommandWhat it does
showEvery mailbox's limit.
statusEach mailbox's limit, what it has sent in the last hour, its state, and where the limit came from.
setSet the limit for one mailbox.
unsetRemove a mailbox's override, putting it back on the default.
defaultShow or change the server-wide default.
enforceCount from the mail log and act — this is what the cron job runs.

The counting is done from the mail log rather than by postfwd, because postfwd is optional and is not wired into Postfix on every server. The per-domain hourly limit, which is postfwd's, is hitechcloudcli email-ratelimit.

Both sides have pages: Send Limits in HiTechAdmin, and Sending Limits in the hosting panel.

Was this helpful?