Email Client Configuration & Dovecot Quota/Monitoring Guide for DirectAdmin Users

This guide explains how to configure popular email clients (iPhone Mail, Thunderbird, Gmail POP/SMTP), enable Dovecot LMTP quota warnings, and check the last login time for all email accounts on a DirectAdmin server. It includes step by step instructions, recommended IMAP/SMTP settings, and useful administrative scripts.

Dovecot Quota

~4 min read · Updated Mar 1, 2026

1. Configuring Email on iPhone (Mail App)


To add your email account to the iPhone Mail app:

  1. Open SettingsAccounts & PasswordsAdd AccountOtherAdd Mail Account
  2. Enter:
  3. Tap Next

Incoming Mail Server (IMAP)


Host Name: mail.domain.com
User Name: [email protected]
Password: yourpassword

Outgoing Mail Server (SMTP)

Use the same settings as incoming:


Host Name: mail.domain.com
User Name: [email protected]
Password: yourpassword

Note: SMTP password is required.

Enable SSL for SMTP

Go to:


Settings → Accounts → [email protected] → Account → SMTP → Primary Server

Ensure:

  • Use SSL: ON
  • Authentication: Password
  • Server Port: 587

Enable SSL for IMAP

Go back to the account page → Advanced

  • Use SSL: ON
  • Authentication: Password
  • IMAP Path Prefix: /
  • Server Port: 993
---

2. Configuring Thunderbird Email Client


  1. Open ToolsAccount SettingsAccount ActionsAdd Mail Account
  2. Enter:
  3. Click Continue
  4. Click Manual config

Recommended Settings

TypeProtocolPortSSLAuth
IncomingIMAP993SSL/TLSNormal password
OutgoingSMTP587STARTTLSNormal password

Username (both incoming & outgoing): [email protected]

Use the hostname provided by your hosting provider (mail.domain.com or server.hostname.com).

If you see SSL warnings, you may accept them—usually the certificate hostname does not match the server name used.

---

3. Configuring Gmail (mail.google.com) to Fetch Emails via POP


  1. Login to https://mail.google.com
  2. Go to SettingsAccounts and Import
  3. Under Check mail from other accounts, click Add a mail account
  4. Enter [email protected]
  5. Select Import email from my other account (POP3)

POP Settings

OptionValue
Username[email protected]
Passwordyourpassword
POP Servermail.domain.com
Port995
SSLON

Click Add Account.

Sending mail as [email protected]

Choose Yes when asked:


Would you like to be able to send mail as [email protected]?

Recommended to avoid SPF issues.

SMTP Settings

OptionValue
SMTP Servermail.domain.com
Username[email protected]
Passwordyourpassword
Port587
SecurityTLS

Enter the verification code sent to your mailbox.

---

4. Enabling Dovecot LMTP Quota Warning Notifications


Dovecot can automatically notify users when their mailbox reaches 80%, 95%, or 100% of quota.

Step 1: Create quota warning config

File: /etc/dovecot/conf.d/91-quota-warning.conf

Dovecot 2.4.x:


quota "" {
  warning warn-100 {
    quota_storage_percentage = 100
    execute quota-warning {
      args = 100 %{user}
    }
  }
  warning warn-95 {
    quota_storage_percentage = 95
    execute quota-warning {
      args = 95 %{user}
    }
  }
  warning warn-80 {
    quota_storage_percentage = 80
    execute quota-warning {
      args = 80 %{user}
    }
  }
}

service quota-warning {
  executable = script /usr/local/bin/quota-warning.sh
  user = root
  unix_listener quota-warning {
    user = mail
    group = mail
    mode = 0660
  }
}

Dovecot 2.3.x:


plugin {
  quota_warning = storage=100%% quota-warning 100 %u %d
  quota_warning2 = storage=95%% quota-warning 95 %u %d
  quota_warning3 = storage=80%% quota-warning 80 %u %d
}
service quota-warning {
  executable = script /usr/local/bin/quota-warning.sh
  user = root
  unix_listener quota-warning {
    user = mail
    mode=0666
  }
}
---

Step 2: Create quota-warning.sh

File: /usr/local/bin/quota-warning.sh

Dovecot 2.4.x:


PERCENT=$1
USER=$2
FROM=$USER

cat << EOF | /usr/libexec/dovecot/dovecot-lda -d $USER -o "quota_enforce=no"
From: $FROM
Subject: Email Quota Usage: $PERCENT%

This is an automated notification letting you know that your account:
$USER

has used $PERCENT% of its available space.

EOF

Dovecot 2.3.x:


#!/bin/bash
PERCENT=$1
USER=$2
FROM=$USER

cat << EOF | /usr/libexec/dovecot/dovecot-lda -d $USER -o "plugin/quota=maildir:User quota:noenforcing"
From: $FROM
Subject: Email Quota Usage: $PERCENT%

This is an automated notification letting you know that your account:
$USER

has used $PERCENT% of its available space.

EOF
---

Step 3: Make script executable


chmod 0755 /usr/local/bin/quota-warning.sh

Step 4: Restart Dovecot


systemctl restart dovecot
---

5. Checking Last Login for All Email Accounts


Create script: /root/last_login.sh


#!/bin/sh
DAUSER=*
DOMAIN=*
EMLUSER=*

LOGIN_CACHE=/tmp/last_login.cache
echo -n '' > $LOGIN_CACHE
chmod 600 $LOGIN_CACHE

for c in `ls /home/$DAUSER/imap/$DOMAIN/$EMLUSER/Maildir/dovecot.index.log`; do
{
       LL=`stat $c | grep 'Change: ' | cut -d' ' -f2,3`
       U=`echo $c | cut -d/ -f3`
       D=`echo $c | cut -d/ -f5`
       E=`echo $c | cut -d/ -f6`
       echo "$LL=user=$U&domain=$D&email=$E" >> $LOGIN_CACHE
};
done;

cat $LOGIN_CACHE | sort -n
rm -f $LOGIN_CACHE

exit 0;

Run it:


cd /root
chmod 755 last_login.sh
./last_login.sh

To show only the oldest 10 accounts:


./last_login.sh | head -n 10

Output example:


2019-10-07 01:31:08=user=fred&domain=fred.com&email=sales

Note: This checks the timestamp of dovecot.index.log, which updates only when activity occurs—not during idle IMAP sessions.

Written & researched by Dr. Shahin Siami

Related Articles

Troubleshooting Dovecot in DirectAdmin – Fixing IMAP Errors, Authentication Issues, and SSL Certificate Checks

Dovecot is the IMAP/POP3 server used by DirectAdmin. Sometimes users encounter errors such as “Connection dropped by IMAP server” or “unknown user” during authentication. This guide explains how to fix corrupted Dovecot indexes, understand authentication logs, hide unnecessary warnings, and manually inspect SSL certificates on IMAP ports 143 and 993.

Continue

DNS Troubleshooting in DirectAdmin – When named is Running but Domains Do Not Resolve

Sometimes the named (BIND) service runs normally, yet DNS queries fail or domains do not resolve from outside. This guide provides a complete troubleshooting workflow for checking named listeners, firewall rules, named.conf configuration, DNS propagation issues, subdomain problems, resolv.conf errors, and common Apache/Nginx misconfigurations.

Continue

Managing DNS Records in DirectAdmin – Complete Practical Guide for Administrators

DirectAdmin provides a powerful DNS management system that allows administrators to control TTL values, create SRV records, enable DNSSEC, manage subdomain delegation, automate TLSA records, and perform mass DNS updates. This guide explains all essential DNS operations in DirectAdmin with real-world examples and best practices.

Continue

DNS and Nameservers in DirectAdmin – Complete, Practical, and Professional Guide

DNS is the backbone of the internet, responsible for translating domain names into IP addresses. DirectAdmin allows you to create private nameservers (ns1/ns2), manage DNS zones, configure DNS clustering, use external DNS, and troubleshoot common issues. This guide provides a complete, clear, and practical explanation of DNS concepts and their implementation in DirectAdmin.

Continue

CustomBuild in DirectAdmin – Complete Guide to Installation, Updates, Configuration, and Advanced Customization

CustomBuild is DirectAdmin’s primary software management system. It installs, updates, configures, and rebuilds essential services such as Apache, Nginx, PHP, MariaDB/MySQL, Exim, Dovecot, FTP servers, and more. Because most components are compiled from source, CustomBuild offers exceptional flexibility, fast access to new versions, and optimized performance.

Continue

The Evolution Skin in DirectAdmin – Complete Guide, Features, Customization, and Professional Tips

Evolution is DirectAdmin’s modern, responsive, and fully JSON powered interface. It is not just a visual redesign—it introduces a new communication layer, advanced customization options, plugin friendly architecture, and a significantly improved user experience. This guide explains how Evolution works, how to enable it, how to customize it, and how to manage translations and legacy skins.

Continue