Install the add-on

The complete, version-matched operator procedure.

This procedure is sourced from v0.3.0-rc.34, commit 2520d6aa32ada275b7b863f2bb16bcbef62e803c. Keep the application image, native adapter and examples at the same reviewed revision. Preserve existing installations and recovery material.

The guarded managed installer and updater remain a preview. The tagged installer includes custom application paths for fresh installations. Existing installations need the separately reviewed adoption/migration path.

/webmail/ is an example prefix. App URL, protected PHP base path, proxy locations, redirects and generated profile must agree. Native bridge/settings endpoints and open=webmail remain unchanged. See Choose the installation path.

Choose an installation#

Installation Address Mailbox sign-in Sign out
Integrated Mailcow instance https://mail.example.com/webmail/ Native Mailcow login, with eligible existing sessions opening the mailbox directly Ends aseMail and the current native Mailcow browser session
Separate instance with optional Mailcow sign-in A separate HTTPS hostname Regular IMAP/SMTP sign-in and optional Mailcow SSO Ends that aseMail session only

This walkthrough installs the integrated instance. For a separate server or non-Mailcow mail server, use the normal installation and optional Mailcow sign-in reference. Existing webmail applications remain available; none needs to be removed. For aseMail to connect independently of SOGo and Roundcube, follow the optional internal connection steps after the base installation.

Before you begin#

  • Have working Mailcow HTTPS, IMAP/SMTP, and a pilot mailbox. Each additional login hostname needs working DNS, HTTPS routing, and a valid certificate.
  • Use a Docker Compose version supporting include (2.20.3 or newer). Commands below use the Compose plugin, not the legacy docker-compose executable.
  • Obtain an aseMail source revision containing this guide and its integration files. Keep the image, adapter, and configuration examples from that same reviewed revision together.
  • Back up Mailcow's local override, custom web/nginx files, and databases. For an existing aseMail installation, back up its database and preserve its master, bootstrap, and Mailcow integration keys. Do not follow the fresh-secret steps below on an existing instance.
  • Review the installed Mailcow authentication code before enabling the optional adapter. The reference targets the 2026-09a authentication/schema family; compatibility is checked against the actual installed source hashes, not just a version label. Do not approve changed hashes without reviewing compatibility.

Unless noted otherwise, run commands as an operator with Docker access from the Mailcow directory containing mailcow.conf. Paths below assume /opt/mailcow-dockerized; adjust them for your installation. Do not enable shell tracing, print resolved Compose configuration containing secrets, or paste keys and bootstrap tokens into tickets or logs. Stop if any step fails.

Prepare the matching image and child configuration#

Set ASEMAIL_SOURCE to your reviewed aseMail checkout. Build from its root:

ASEMAIL_SOURCE=/opt/asemail-source
docker build --tag asemail:mailcow-preview "$ASEMAIL_SOURCE"
docker image inspect asemail:mailcow-preview --format '{{.Id}}'

Record that immutable local image ID for the child .env. When a published integration image is available, use its verified registry digest instead; private registry images require appropriate pull access. A mutable latest or beta tag is not an immutable deployment identity.

For a new installation, create data/conf/asemail/ with an operator-only secrets/ subdirectory. If this directory or any target file already exists, stop and reconcile it rather than overwriting configuration or keys. Copy these files from the same source checkout:

Source in the aseMail checkout Destination inside Mailcow
integrations/mailcow/compose.yaml data/conf/asemail/compose.yaml
integrations/mailcow/compose.sso.yaml data/conf/asemail/compose.sso.yaml
integrations/mailcow/compose.managed.yaml data/conf/asemail/compose.managed.yaml
integrations/mailcow/compose.webmail.yaml data/conf/asemail/compose.webmail.yaml
integrations/mailcow/compose.internal.yaml (optional) data/conf/asemail/compose.internal.yaml

Generate independent secrets without printing their values. The destination directory must be new; these commands must not replace an existing secret:

umask 077
openssl rand -hex 32 > data/conf/asemail/secrets/master-key
openssl rand -hex 32 > data/conf/asemail/secrets/bootstrap-token
openssl rand -hex 32 > data/conf/asemail/secrets/database-password
openssl rand -hex 32 > data/conf/asemail/secrets/mailcow-key

The API and worker run as UID/GID 10001. Give that user read access to the master/bootstrap files and the API's integration-key file, normally ownership 10001:10001 with mode 0400. Keep the parent host directory operator-only. The PostgreSQL secret must also be readable by its container's database user; a mode 0444 secret inside a host directory owned by root with mode 0700 is one option, since only its individually mounted file is exposed to PostgreSQL. Do not mount the entire secrets directory into every container.

Create two different protected environment files:

  1. data/conf/asemail/.env supplies Compose interpolation, such as the pinned ASEMAIL_IMAGE. Set loopback binding and port explicitly if needed:

    ASEMAIL_IMAGE=sha256:REPLACE_WITH_YOUR_LOCAL_IMAGE_ID
    ASEMAIL_BIND_ADDRESS=127.0.0.1
    ASEMAIL_PORT=3031
    
  2. data/conf/asemail/asemail.env supplies the API/worker runtime:

    ASEMAIL_DATABASE_URL=postgres://asemail:REPLACE_WITH_DATABASE_PASSWORD@asemail-database:5432/asemail
    ASEMAIL_PUBLIC_URL=https://mail.example.com/webmail/
    

    Use the same generated password as secrets/database-password. Hexadecimal generation avoids URL-escaping special characters. Keep this file mode 0600; do not commit it. asemail-database is the child service name, not Mailcow's MariaDB service.

Add the child model and isolated web proxy#

Merge the following into Mailcow's local docker-compose.override.yml. Preserve existing includes, services, networks, volumes, and add-ons; do not replace Mailcow's upstream Compose file.

include:
  - path:
      - ./data/conf/asemail/compose.yaml
      - ./data/conf/asemail/compose.webmail.yaml
      - ./data/conf/asemail/compose.local.yaml

services:
  nginx-mailcow:
    networks:
      mailcow-network: {} # Retain the existing native network/aliases.
      asemail-web:
        ipv4_address: 172.30.240.2

Create data/conf/asemail/compose.local.yaml with the following example. Choose an unused subnet first by checking Docker networks and host routes; 172.30.240.0/29 is only an example. Change its addresses consistently in both files. Trust only nginx's exact proxy IP, not an entire LAN or all forwarded headers:

services:
  asemail-api:
    environment:
      ASEMAIL_TRUST_PROXY: 172.30.240.2/32
    networks:
      asemail-web:
        ipv4_address: 172.30.240.3
  asemail-worker:
    environment:
      ASEMAIL_TRUST_PROXY: 'false'

networks:
  asemail-web:
    ipam:
      config:
        - subnet: 172.30.240.0/29

The supplied child files keep PostgreSQL and the worker on the separate asemail network. Only nginx and the API join asemail-web; do not attach nginx to the database network. The API's host port stays on loopback.

Install these nginx files from the checkout:

  • asemail-cookies.conf and asemail-proxy.inc from integrations/mailcow/ into data/conf/nginx/.
  • Copy site.asemail.custom.template there as site.asemail.custom, using the chosen application prefix in all locations and its trailing-slash redirect. The current template has no hostname placeholder; the API validates public hostnames from its configured URL and approved aliases.

Check that your Mailcow nginx version includes asemail-cookies.conf at the HTTP level and site.asemail.custom inside its servers. Do not add a duplicate include. The proxy strips Mailcow's native session cookie and forwards only aseMail's own default-named cookies. It does not replace existing webmail or native /api routes. On HTTPS, the primary browser session cookie is __Host-asemail_session with Secure, Path=/, and no Domain; the proxy forwards that name over HTTPS. Local HTTP fixtures retain the unprefixed cookie. Existing unprefixed HTTPS sessions must sign in again after this update. The bundled proxy requires ASEMAIL_SESSION_COOKIE=asemail_session (the configuration base name and default). compose.webmail.yaml sets ASEMAIL_MAILCOW_WEBMAIL_PROXY=true, which makes the API reject custom cookie names at startup with an explicit error. Keep the matching API and overlay together during upgrades. Standalone installations with their own proxy retain custom cookie-name support. The API and bundled proxy accept JSON requests up to 40 MiB, allowing base64 encoding of the 25 MiB aggregate attachment limit plus message content. Any outer proxy must allow the same request size; decoded attachments above 25 MiB are still rejected. See the subpath reference for deployment paths.

For an existing hostname retained as a redirect, configure ASEMAIL_LEGACY_HOSTS with bare DNS names, without ports. Requests on those names also match when the old origin uses a non-default port. GET/HEAD redirects preserve the public prefix and query; unsafe methods require restarting from the new origin. See the migration reference.

Prepare all files before starting aseMail. The final start command appears after the adapter and automatic profile generation below. Adding a network can recreate nginx and briefly interrupt web access. It should not restart SMTP/IMAP or tear down Mailcow. Later nginx file-only changes need configuration validation and a graceful reload, not a stack-wide restart.

Automatic aseMail setup#

Skip the aseMail setup wizard and administration page. The installer helper below reads the protected Mailcow adapter configuration and generates a read-only profile file. Before accepting requests, the API creates that profile in its own database and enables the normal Mailcow sign-in screen.

In app_password mode, the generated profile uses the bridge hostname for IMAP port 993 and SMTP port 465, both with implicit TLS. In internal mode it uses the private aliases documented below, preserving the public certificate name for TLS validation. Approved domains and the profile ID come from the same adapter configuration; you do not copy an ID out of aseMail administration. The generated profile is named Mail server by default; an explicit asemail_server_profile.name override retains its configured name. For custom ports, private routing, or a private CA, set asemail_server_profile overrides in that protected configuration before generating the file. Certificate verification remains enabled.

Install the native sign-in adapter#

Install the following files, preserving other add-ons and Mailcow branding:

Source in integrations/mailcow/ Destination inside Mailcow
asemail-auth.php data/web/asemail-auth.php
bridge-lib.php data/web/inc/lib/asemail-bridge.php
asemail-internal-mail.php data/web/inc/lib/asemail-internal-mail.php
portal-apps.inc.php data/web/inc/asemail-apps.inc.php
native-session.php data/web/inc/lib/asemail-native-session.php
login-banner.twig data/web/templates/asemail-login-banner.twig

Create a protected data/conf/asemail/mailcow-adapter/ directory outside data/web/. Copy config.example.php into it as config.php, and copy the same integration-key bytes from secrets/mailcow-key into it as key. Never use the master key, a mailbox password, or a global mail-server master credential here. Copy integrations/mailcow/configure-asemail.php into that protected adapter directory too. It runs only from the command line, never as a public endpoint.

Determine the native PHP worker's group rather than assuming it matches the aseMail UID:

docker compose exec -T php-fpm-mailcow id www-data

Make the adapter directory readable/traversable by that group (normally mode 0750) and its config/key readable only by root and that group (normally 0440). Merge this read-only mount into the existing PHP-FPM service override:

services:
  php-fpm-mailcow:
    volumes:
      - ./data/conf/asemail/mailcow-adapter:/etc/asemail-mailcow:ro

In the protected config.php, set:

  • enabled => true, asemail_origin => 'https://mail.example.com', asemail_base_path => '/webmail'.
  • bridge_url => 'https://mail.example.com/asemail-auth.php'. For a fresh managed installation retain the example's instance-local profile_id; the API creates it automatically. Existing installations must retain their original profile ID. Keep key_file => '/etc/asemail-mailcow/key'.
  • allowed_domains to your approved domains; use allowed_mailboxes for the initial pilot if desired. Leave sieve_access => false unless ManageSieve has been configured and deliberately authorized.
  • portal_sso => true, reuse_connection => true, and passkey_login => true.
  • portal_auto_connect => true only if you, as the operator, approve first-use mailbox connections from the native own-mailbox launcher without individual consent. Leave it false to ask each user once. Neither setting reverses a revoked or manually changed connection.

Fill auth_source_sha256 from the reviewed installed authentication files listed in the example. Hash them inside PHP-FPM with sha256sum /web/...; do not copy another installation's hashes or blindly regenerate them after updates. If installing the native passkey hook below, record the final patched handler's hash after reviewing the change. Missing or changed hashes disable the optional adapter, not Mailcow itself.

Check source-file readability as the native PHP worker, not only as root. For example, docker compose exec -T --user www-data php-fpm-mailcow php -r 'exit(is_readable("/web/inc/functions.auth.inc.php") ? 0 : 1);' checks the worker's access without printing file contents. A permission failure disables the adapter; it must not print PHP warnings before the response headers. Restore the affected native file's intended ownership and permissions before reviewing its hash. Keep the adapter keys and configuration protected. After a Mailcow upgrade, review both the authentication-file pins and, in internal mode, internal_auth_source_sha256 for the final patched mail-auth handler. Retaining the hooks does not preserve their old hashes. Mailcow's shared-mailbox flag also denies direct aseMail connection credentials; members must use the mail server's approved sharing path. If native PHP disables OPcache timestamp validation, activate the reviewed PHP and configuration changes with a graceful PHP-FPM reload. Then verify a signed sign-in request from aseMail reaches native login; CLI hash checks alone do not prove that web workers have loaded the new files.

For the portal app and native passkey hook, follow the exact insertion points in One-click launch from the Mailcow portal. The passkey hook must run after successful native mailbox assertion verification, never before it. It can reuse proof only when the native verifier actually required both user presence and user verification. An eligible remembered Mailcow session can reuse its existing approved connection without another connection or passkey prompt, even when this evidence is missing or expired. It must not be treated as fresh MFA verification by assumption: independently enabled aseMail MFA still applies when trusted provider evidence is absent. First-use automatic connection creation from an older passkey session still requires fresh verification or explicit connection consent.

For the login-required banner, include {% include 'asemail-login-banner.twig' ignore missing %} inside the existing $(document).ready(function() { ... }) callback in data/web/templates/base.twig, after the page's language/global variables are initialized. Do not put it at the top of the script block: on stock 2026-09a, the native mailcow_alert_box fallback is not available until document ready. Preserve other banners and customizations. Adding the protected directory mount requires recreating only PHP-FPM; later PHP file-only updates need a graceful PHP-FPM reload to refresh its opcode cache. A CLI opcode-cache reset is not sufficient. Template changes can also require refreshing the compiled Twig template cache; use your Mailcow version's procedure and verify the banner actually appears. On the disposable 2026-09a installation, Twig's auto_reload was disabled; removing only the compiled entries for base.twig and asemail-login-banner.twig under data/web/templates/cache, followed by a graceful PHP-FPM reload, made the corrected template visible. Do not clear unrelated application data or assume a PHP reload alone recompiles Twig.

Generate the managed profile and enable Mailcow sign-in#

For a fresh internal-mode installation, complete steps 1–5 of the internal connection section first, so the generator selects the correct private transport on its first run.

Apply the protected adapter mount to PHP-FPM. Generate the profile without printing any secrets or replacing an existing file:

docker compose up -d --no-deps php-fpm-mailcow
(
  umask 077
  set -C
  docker compose exec -T php-fpm-mailcow php /etc/asemail-mailcow/configure-asemail.php \
    > data/conf/asemail/managed-profile.json
)

Stop on an error. A failed command can leave an empty file; inspect and replace only that failed output before retrying. Give UID/GID 10001:10001 read access to the generated file, normally ownership 10001:10001 and mode 0400, inside the operator-only directory. The file contains connection settings, not keys or mailbox passwords. Keep the master and bootstrap secrets protected.

Append ./data/conf/asemail/compose.sso.yaml followed by ./data/conf/asemail/compose.managed.yaml to the child's include.path list, before compose.local.yaml. Add these non-secret interpolation values to data/conf/asemail/.env:

ASEMAIL_MAILCOW_SSO_URL=https://mail.example.com/asemail-auth.php
ASEMAIL_MAILCOW_SSO_ONLY=true
ASEMAIL_MAILCOW_SSO_TRUST_MFA=true
ASEMAIL_MAILCOW_SSO_MANAGED_DOMAINS=false
ASEMAIL_MAILCOW_SSO_MANAGED_ALIASES=false

The API gets its profile ID from managed-profile.json. Remove an obsolete ASEMAIL_MAILCOW_SSO_PROFILE_ID override or ensure it matches the adapter ID; mismatched IDs, origins, native-domain policy, or malformed files stop startup. The generated public URL includes a trailing slash and must match ASEMAIL_PUBLIC_URL exactly. When using all_active_domains => true, also set ASEMAIL_MAILCOW_SSO_MANAGED_DOMAINS=true. Mailcow then supplies the actual approved domain in each signed handoff; the generated seed domain does not enable direct login.

Use canonical URLs in both aseMail and PHP configuration: lowercase hostnames, no explicit HTTPS default port (:443), and no dot segments such as /a/../. This applies to the public URL, bridge URL, aliases and settings URL; an explicit non-default port is supported when it matches on both sides. aseMail rejects non-canonical forms at startup so signatures and encrypted handoffs agree.

Links to folders, messages, Calendar views, and Contacts remain under your public prefix. For example, /webmail/calendar/view/month opens the Month view. If prompted to sign in from a link, start native sign-in from that page and use the same tab to return to the intended workspace.

SSO_TRUST_MFA=true means you deliberately trust Mailcow's verified native factor evidence. It avoids a second aseMail factor prompt; it does not disable MFA or permit administrator impersonation. Missing evidence falls back to aseMail's factor check. Existing aseMail administrators retain their local recovery sign-in at /webmail/?login=manual. A fresh integrated installation does not create an administrator or a shared default password. Local administration is optional: an operator with the protected bootstrap token can use the existing bootstrap API to create the first local administrator later. This is not required for Mailcow sign-in or mailbox access.

Validate and recreate only the affected services:

docker compose config --quiet
docker compose up -d --no-deps php-fpm-mailcow
docker compose up -d --wait asemail-database asemail-api asemail-worker
docker compose up -d --no-deps nginx-mailcow
docker compose exec -T nginx-mailcow nginx -t
docker compose exec -T nginx-mailcow nginx -s reload

The integration key is mounted into the API and PHP-FPM, not the worker. Normal mailbox-password and local aseMail mailbox-passkey login are disabled only on this integrated instance. Mailcow still performs native authentication.

On restart the API reuses the same managed profile. Its administration API rejects edits/deletion of this profile; maintain its configuration on the Mailcow side. To change names or domains, regenerate to a separate candidate file, review it, preserve the previous file, install it with the same ownership, then recreate only the API. Transport, TLS trust, or profile-ID changes require an explicit migration and are rejected on an already managed profile.

Adopting an existing installation: keep its profile ID and transport settings. Use asemail_server_profile overrides to match its name, domains, endpoints, TLS names, CA and private-network policy. The API adopts a matching profile and disables its direct password login. It leaves administrators, mailboxes, encrypted credentials and unrelated profiles intact. A conflicting profile stops startup without modifying it. Removing compose.managed.yaml and restoring the original explicit profile-ID configuration returns an existing installation to manual profile management. On a new installation without an administrator, the ordinary bootstrap gate applies again.

Connect independently of other webmail applications#

The optional internal connection follows the native webmail authentication route without using SOGo, Roundcube, their databases, or their shared password. Mailcow authenticates browser sessions; a separate aseMail key derives a different mail credential for each mailbox. No app_passwd record is created in this mode. The default app_password connection remains supported for existing installations and for aseMail hosted outside Mailcow's private networks.

Local acceptance on a fresh Mailcow 2026-09a installation covered native password and virtual-passkey sign-in, remembered sessions, internal IMAP/SMTP, controlled delivery, rollback and revocation without SOGo or Roundcube. Production acceptance, physical authenticators, ManageSieve and migration from legacy public mail endpoints remain unverified. Pilot it before replacing your current webmail. Keep backups of Mailcow's configuration and the original native handler.

  1. Prepare the base files and native adapter above, including the source review and separate bridge key. For a fresh installation complete steps 1–5 here before generating its managed profile or starting aseMail. Copy compose.internal.yaml into data/conf/asemail/ and add it to the child's include.path list before compose.local.yaml. It gives only the API and worker access to a separate asemail-mail network; PostgreSQL and nginx do not join it.

  2. Choose an unused subnet. The child defaults to 172.30.241.0/29, with API .3 and worker .4. Merge these additions into the parent override, preserving both services' existing native networks and settings:

    services:
      dovecot-mailcow:
        networks:
          mailcow-network: {}
          asemail-mail:
            ipv4_address: 172.30.241.2
            aliases: [asemail-imap]
      postfix-mailcow:
        networks:
          mailcow-network: {}
          asemail-mail:
            ipv4_address: 172.30.241.5
            aliases: [asemail-smtp]
    

    If changing this subnet, set ASEMAIL_INTERNAL_SUBNET, ASEMAIL_INTERNAL_API_IP, and ASEMAIL_INTERNAL_WORKER_IP in the child's interpolation .env, and change the parent addresses to match. Do not publish any additional ports. With connection_mode => 'internal', the installer automatically selects asemail-imap:993 (implicit TLS) and asemail-smtp:587 (STARTTLS), with TLS server name set to the bridge hostname, such as mail.example.com, for both. Certificate verification stays enabled. Optional ManageSieve uses the same private Dovecot route and its verified TLS name. Public mail-host routing/NAT does not satisfy the source-IP restrictions.

  3. Generate a new, independent internal key in the protected adapter directory. This key is for PHP-FPM only; never mount it in the API, worker, or browser:

    umask 077
    openssl rand -hex 32 > data/conf/asemail/mailcow-adapter/internal-key
    

    Apply the native PHP worker group and 0440 permissions described above. Copy mail-auth-hook.php into that same protected directory. The installed asemail-internal-mail.php library must accompany asemail-bridge.php, even when retaining app-password mode.

  4. Review the installed data/conf/dovecot/auth/mailcowauth.php, its native Dovecot passwd-verify.lua and dovecot.conf, and nginx's private port-9082 auth listener. The supported insertion is after native helper loading and before $isSOGoRequest =. The existing PHP-FPM mount exposes this handler at /mailcowauth/mailcowauth.php. Confirm that your version uses that layout and that nginx passes the real Dovecot peer through FastCGI REMOTE_ADDR. Do not expose port 9082 publicly or rewrite its peer address from client headers.

    Prepare a new file using the reviewed original's SHA-256:

    node prepare-internal-auth.mjs \
      data/conf/dovecot/auth/mailcowauth.php \
      data/conf/asemail/mailcow-adapter/mailcowauth.prepared.php \
      REPLACE_WITH_REVIEWED_ORIGINAL_SHA256
    

    The helper is in integrations/mailcow/; run it using its actual checkout path (Node is only needed for this preparation step). It rejects a different, already patched, or unsupported source and will not overwrite its output. Review the diff and run php -l on the prepared copy. Back up the original outside the web root, then install the reviewed copy at data/conf/dovecot/auth/mailcowauth.php, preserving the original ownership and permissions. The prepared file's restrictive mode is for review; copying that mode over the native handler can prevent PHP-FPM from reading it. Check readability and syntax as the native PHP worker user, not only as root. This preserves ordinary Mailcow password/app-password authentication; only reserved asemail1_ credentials enter the new branch. A failed internal check cannot fall through to another authentication method.

    Also disable Dovecot's authentication-result cache. Cached approvals can keep accepting a previous password after a change, or bypass a changed internal-connection policy. Prepare a reviewed configuration copy:

    node prepare-internal-auth.mjs --dovecot \
      data/conf/dovecot/dovecot.conf \
      data/conf/asemail/mailcow-adapter/dovecot.prepared.conf \
      REPLACE_WITH_REVIEWED_DOVECOT_CONF_SHA256
    

    Review the diff: auth_cache_size = 10M must become auth_cache_size = 0. The helper also retains the earlier source-address protection by changing cache_key=%s:%u:%w to cache_key=%s:%u:%w:%{real_rip} when necessary; that key alone does not solve stale password acceptance. It supports the reviewed Dovecot 2.3 stock and earlier client-address-key layouts and rejects unknown, duplicate or already disabled cache configurations. Back up the original, install the reviewed copy preserving ownership and permissions, validate with doveconf, and require docker compose exec -T dovecot-mailcow doveconf -h auth_cache_size to report 0; an included configuration override must not re-enable caching. Reload Dovecot and flush existing authentication cache entries before enabling internal mode. Reload Postfix after Dovecot so its SMTP workers reconnect to the authentication service; existing workers can otherwise report a lost authentication-server connection. No cached approval from the old configuration may remain. Each new authentication now checks the current backend; existing open sessions remain connected, and backend outages cannot use cached password approvals. Expect additional authentication-backend work. Recheck this setting after each Mailcow upgrade.

  5. Set these protected config.php values, replacing addresses with the actual peers in your installation:

    'connection_mode' => 'internal',
    'administrator_login_as' => true, // Set false to disable administrative handoff.
    'internal_key_file' => '/etc/asemail-mailcow/internal-key',
    'internal_auth_source_sha256' => 'REPLACE_WITH_REVIEWED_PATCHED_HANDLER_SHA256',
    'internal_auth_proxy_ips' => ['172.22.1.250'], // Dovecot on mailcow-network.
    'internal_client_ips' => ['172.30.241.3', '172.30.241.4'], // API and worker.
    'portal_only_webmail' => false, // Keep the other installed webmail choices.
    

    Administrative handoff additionally requires reviewed hashes for inc/triggers.global.inc.php and inc/functions.acl.inc.php in auth_source_sha256. Keep the flag false until those pins are verified; the managed installer obtains them from its matched compatibility profile.

    The handler fingerprint is for the patched file. Native auth-source pins are also checked on every uncached authentication. IP lists accept exact addresses only, not subnets or forwarded headers. Existing domain/mailbox allowlists, active mailbox/domain checks, required account setup and native IMAP/SMTP/Sieve access flags still apply. Missing protocol flags fail closed. Keep sieve_access => false unless explicitly enabling server filters.

    Choosing internal mode authorizes direct own-mailbox entry from a valid native session, including a remembered session and first use. It does not require another connection-consent or passkey screen. Native pending login, forced password/2FA setup and impersonation checks still apply. It does not manufacture fresh factor evidence: separately enabled aseMail MFA retains its existing policy. Sharing with another aseMail user still requires the mailbox owner's explicit consent.

  6. For a fresh install, return to the managed profile generation/start section above now. Validate the merged Compose configuration and PHP syntax before applying the changed network memberships to API, worker, Dovecot and Postfix. Reload PHP-FPM to refresh opcode caches. If the native handler is mounted as a single file and was replaced by renaming a new file over it, a reload retains the old mounted inode. Recreate only php-fpm-mailcow with its existing image, then compare the host handler hash with /mailcowauth/mailcowauth.php inside PHP. Wait for native authentication to be ready before flushing Dovecot's auth cache; flushing while PHP is starting can cache a temporary failure. Check both IMAP and SMTP afterward. Use the change window appropriate to your server: recreating Dovecot/Postfix can briefly interrupt mail connections.

    Keep portal_only_webmail => false to offer aseMail alongside installed SOGo and Roundcube. Internal authentication does not depend on either application, and ASEMAIL_MAILCOW_SSO_ONLY controls aseMail's login method, not portal choices. Only set portal_only_webmail => true if you explicitly want to hide their portal links; this preserves unrelated apps, services, databases and volumes. If you separately decide to retire those applications, omit the optional Roundcube add-on and use your Mailcow release's SKIP_SOGO=y setting for SOGo. Upstream currently labels that switch experimental, unsupported and not fully implemented; it also disables SOGo DAV/ActiveSync features. Check your release's behavior rather than assuming it removes every container. aseMail's internal connection itself needs no SOGo service. Existing deployments should migrate any needed calendar/contact data before retiring those apps.

  7. Test fresh native login, remembered-session entry, logout, API and worker IMAP access, one controlled SMTP delivery and Sent copy, optional Sieve, and denial from an unapproved container address after warming the cache with an allowed client, as well as with an empty cache. Successful authentications appear as ASEMAIL in Mailcow's connection history. A healthy HTTP page alone does not verify this connection.

This configuration supports one integrated internal-mode aseMail instance per Mailcow installation. A second independently keyed external instance can retain the existing app-password adapter.

Existing installations: switch the approved profile to the private TLS endpoints, then sign in again as each mailbox owner to replace that account's encrypted stored credential. Existing app-password records are left untouched; retain them during the pilot for rollback, then revoke only the obsolete aseMail records after successful verification. In internal mode their revocation no longer controls the new connection.

Revocation and rotation: add an address to internal_disabled_mailboxes to deny new handoffs and mail authentication. Increment its positive integer in internal_mailbox_versions to invalidate only its old credentials before a new owner sign-in; do this before reusing a deleted mailbox address. Rotating internal-key invalidates all internal credentials and requires owner sign-ins again. Mailcow's authentication cache and existing IMAP sessions can outlive a configuration change: refresh PHP-FPM, flush the affected Dovecot auth-cache entry and disconnect that user's active connections when immediate revocation is required. Revoking aseMail sharing grants remains a separate per-user operation.

Upgrade/rollback: review the native handler and Lua/nginx auth path after each Mailcow upgrade. Changed source pins block the optional connection; never refresh them without review. For rollback set connection_mode => 'app_password', restore the reviewed original handler, restore the prior profile/network/portal configuration (including the backed-up Dovecot cache configuration), reload PHP-FPM/Dovecot, flush affected auth caches and reload Postfix. Sign in again to restore stored per-account app credentials. Keep data and keys backed up until rollback is verified; no database migration or deletion is needed.

Optional mailbox settings inside aseMail#

Install the matching settings adapter only when you want Settings → Mail server to manage native mailbox-user options. It is disabled by default and requires the Mailcow SSO configuration above. Shared aseMail mailboxes do not gain native settings access.

Source in integrations/mailcow/ Destination inside Mailcow
asemail-settings.php data/web/asemail-settings.php
user-settings-lib.php data/web/inc/lib/asemail-settings.php
user-security-lib.php data/web/inc/lib/asemail-security.php
  1. Review the installed native settings functions against the supported 2026-09a source behavior. In the protected adapter configuration, set settings_url => 'https://mail.example.com/asemail-settings.php' and fill every settings_source_sha256 entry from the reviewed installed files. Retain the existing auth_source_sha256 pins. Missing or changed hashes disable this endpoint until compatibility is reviewed again.
  2. Set settings_enabled => true. Keep the existing domain/mailbox allowlists; each request also checks that the native mailbox and domain are active and reloads the mailbox user's native ACL.
  3. Add ASEMAIL_MAILCOW_SETTINGS_URL=https://mail.example.com/asemail-settings.php to the child's interpolation .env. The endpoint must use the same HTTPS origin as ASEMAIL_MAILCOW_SSO_URL. compose.sso.yaml forwards it only to the API. The standalone compose.mailcow.yaml overlay also forwards this optional variable to its API service. The worker needs none of these settings or the integration key.
  4. Exclude request bodies, signatures, and query strings on the settings endpoint from proxy, PHP, tracing, and error-reporting logs. Verification URLs contain a short-lived signed challenge. Do not enable CORS or send a Mailcow API key. This endpoint receives signed server-to-server requests and browser verification visits; keep its normal HTTPS routing available to the aseMail API.
  5. Build/recreate the matching aseMail API/worker image as appropriate for your installation and gracefully reload PHP-FPM after copying PHP files. The API startup applies additive migration 026_mailcow_account_links. Existing accounts have no implicit native settings grant: sign in through Mailcow once as the mailbox owner to create the link. Before enabling native Security password changes, apply the reviewed prepare-internal-auth.mjs --dovecot configuration procedure above, including auth_cache_size = 0, validation, reload and removal of existing cached approvals. This is required even when internal connection mode is disabled; the stock password cache can otherwise accept the old password after a successful native change. If that configuration is already installed, review it rather than running the preparer on an already disabled cache.
  6. For native Mailcow forms in Security, set ASEMAIL_MAILCOW_SECURITY_ENABLED=true in the child's interpolation .env. Both Compose overlays forward it to the API. This requires the integrated same-origin HTTPS route (for example, https://mail.example.com/webmail/ and https://mail.example.com/asemail-settings.php). Startup rejects a separate origin. Keep it false (the default) to show aseMail's own Security controls. This selects the UI provider; it does not disable existing authentication methods or change their MFA policy. Copy the matching PHP adapter and recreate the API when changing this setting. In a test deployment, open Settings → Mail server and Settings → Privacy & security → Security. The matching active Mailcow mailbox session connects automatically; no separate Verify to edit step is needed. Only owned, linked mailboxes are eligible. The account selector appears when more than one owned mailbox is available. A different mailbox, administrator/dual-login session, or incomplete authentication cannot authorize changes. If no matching session exists, choose Sign in to Mailcow and complete its normal authentication. Settings do not show a persistent connection-status banner; unavailable native forms offer their own sign-in or retry action.
  7. The Mailcow Security controls are native aseMail forms, with one settings scroll area and no iframe. They offer password and recovery-address changes, authenticator apps, WebAuthn/Yubico two-factor methods, and FIDO2/passkey registration, rename and removal. The Security page groups these controls under Sign-in, Two-factor, Passkeys, App passwords and Activity. A key added as a two-factor method is separate from a passkey used to sign in. Mailcow's current-password checks, password policy, ACLs, required-2FA and last-key rules remain authoritative. Two-factor has a method submenu for authenticator apps, WebAuthn security keys and Yubico OTP. Registered sign-in passkeys appear in a name/action table. App-password services have individual descriptions and retain the same native permission choices. Activity displays MM-DD-YYYY and 12-hour time in the viewer's local time zone when the updated settings adapter supplies UTC timestamps. Deploy the matching user-settings-lib.php with the web UI; an older adapter's timezone-free connection values can only be displayed as wall time. Secrets and registration data go directly from the browser to Mailcow, never through the aseMail API or browser storage. Native JSON reads require the matching Mailcow session and a signed audience on the same origin. Do not enable CORS. Passkey registration also requires an origin accepted by Mailcow's configured relying party.
  8. Settings grants remain bound to the aseMail session and linked mailbox for five minutes. The client renews the grant while open and replaces its signed invitation before expiry, clearing temporary form/enrollment values when the invitation changes. Every native POST checks the Mailcow session, Origin and CSRF token. If another tab rotates that token, only an explicitly rejected, unapplied request retries once. Uncertain changes are not replayed. Expired or disconnected forms are hidden. Test session expiry, native logout, current password failures and overlapping actions as well as successful changes. The Mail server pages retain their invisible session connection frame; the Security tab uses direct same-origin requests instead.
  9. Under Mail server → Alerts & devices → Device setup, verify the four Apple-profile links: Mail, Mail/calendars/contacts, and each with an app password. App-password downloads create a credential in the downloaded file; keep it private. Open the manual configuration guide and check that its standard email ports and only the enabled protocols appear. Check that the hostname matches the opened Mailcow /webmail/ alias, or the connected Mailcow host for a standalone aseMail page. When CalDAV/CardDAV is enabled, its SOGo addresses must use that host and the selected mailbox. Rendering links and settings is not proof of device installation or successful client connection.
Tab Native mailbox options
Overview Name, quota, message count, protocol availability and shortcuts
Mail flow Plus-address tags, incoming/outgoing TLS policy, spam thresholds, allowed/blocked senders, quarantine notification frequency/category and aseMail server rules
Addresses Mail server → Server settings → Mailbox addresses shows administrator-managed addresses. Mail server → Temporary addresses manages temporary alias creation, expiry and deletion.
Sync Import jobs, advanced options, run-now, redacted logs and deletion
Security Full native mailbox password, recovery, MFA and passkey controls, plus app passwords and connection history
Alerts & devices Pushover settings/connection validation when permitted, four direct native Apple-profile downloads, a manual client setup guide, and permitted ActiveSync cache and SOGo resets

Settings → Mail automation → Automatic replies uses ManageSieve vacation replies when the mailbox's optional Sieve access and server capability are available. Existing server vacation rules are left to their current editor. If server vacation is unavailable, a mailbox owner can use aseMail's app-managed fallback through the configured IMAP/SMTP connection. While enabled, the worker schedules an Inbox sync every minute, IMAP IDLE can trigger sync earlier, and completed syncs and a one-minute timer enqueue a deduplicated reply-scan job. This is not an exact delivery guarantee. It sends only for directly addressed, non-automated mail received after activation, at most once per sender every seven days. The worker requires one valid, nonempty delivery Return-Path and never falls back to From. Verify that the receiving MTA strips sender-supplied Return-Path headers and inserts its own; this trust assumption needs an approved mail-delivery test. Missing, duplicate or malformed Return-Path values suppress replies. Replies use a null SMTP reverse path, with at most 20 reservations per account per hour, including failed attempts. Messages over the hourly limit are marked processed and do not receive a delayed fallback reply. The worker backs off failed message fetches so later messages can proceed. It must remain running, and SMTP failures can mean no reply for that message. Do not enable the fallback alongside a vacation rule managed outside the available Sieve connection.

Native permissions remain authoritative. The Pushover card is hidden when Mailcow disables that capability; unavailable device-reset actions are hidden. The configured Mailcow sign-in profile never uses aseMail's automatic Trash cleanup. If this Mailcow installation has a user-page Trash purge plugin, set ASEMAIL_MAILCOW_TRASH_PURGE_LINK=true in the child Compose interpolation environment to show Settings → Mail automation → Trash cleanup → Open Trash purge settings. That shortcut opens the current approved Mailcow hostname's /user page; the user chooses the plugin's Trash purge tab there. Without the plugin, keep this option off. Ordinary non-Mailcow accounts on the same aseMail instance use a separate policy: an aseMail administrator must enable its default-off global switch under Administration → Trash purge before any aseMail cleanup runs. An expired verification grant still shows permitted controls for re-verification. Pushover keys and existing sync/app passwords are never sent back to the browser. A newly generated app password is shown once; save it before closing the dialog. Sync deletion options can permanently remove messages. Reset SOGo profile deletes calendars, contacts, preferences and sharing data; export anything needed before confirming. Mailcow administration, quarantine message management and SOGo preferences remain in their existing applications.

Local checks now include the installed Mailcow PHP sources running against disposable databases: password/TOTP/virtual-passkey verification, settings writes and database reset isolation passed. Desktop/phone checks also exercised the aseMail UI through its real API and this adapter. These are local results; provider synchronization, notification delivery, physical passkeys, device behavior and a clean-stock installation remain unverified. Complete the settings-specific manual checks in the verification record before promoting this integration. To disable it, unset the API's settings URL and set settings_enabled => false; retain the SSO files/configuration if still used.

Add other domains and login aliases#

You can keep an explicit domain/hostname list, or opt into native policy:

  • Set PHP all_active_domains => true and API ASEMAIL_MAILCOW_SSO_MANAGED_DOMAINS=true to use active Mailcow domain/mailbox rows instead of maintaining another SSO domain list.
  • Set PHP managed_aliases => true and API ASEMAIL_MAILCOW_SSO_MANAGED_ALIASES=true to derive exact native login hosts from active domains/alias domains and Mailcow's generated server names. Ensure PHP-FPM can read the configured server_names_file read-only.
  • For explicit aliases instead, keep both managed-alias settings off and match PHP bridge_aliases with API ASEMAIL_MAILCOW_SSO_ALIASES, using complete HTTPS URLs ending in the same /asemail-auth.php path.

For integrated /webmail/ hosting, set PHP preserve_webmail_host => true to keep the browser on the Mailcow hostname it opened. With managed_aliases enabled, this includes all configured exact native login hostnames; with an explicit list, it includes only bridge_aliases. Install the matching API, adapter and nginx include, then rerun the managed-profile generator in PHP-FPM and recreate the aseMail API and worker as described above. The generated publicAliases list approves at most 128 additional HTTPS origins. Regenerate it whenever the native hostname list changes. No aseMail administration form is needed. Leave this option off for a separate standalone webmail origin.

This does not provision DNS, certificates, or virtual hosts. Test each hostname you intend to offer. Sign-in, callbacks, settings verification and webmail stay on the approved alias. Each hostname has its own browser cookies; sessions are not shared across domains. Mailbox credentials and the provider identity stay canonical, and sign-out returns to the session's verified native hostname. While that redirect loads, aseMail shows Signing out… without flashing its local sign-in form. A failed sign-out request retains a still-authenticated mailbox with error feedback; an expired session returns to sign-in. Standalone sign-out without a native redirect still opens aseMail login. Unknown Host headers and forwarded-host hints cannot add public origins.

If repeated callback attempts are throttled, wait for the Retry-After period and start a new sign-in. The callback returns HTTP 429 with RATE_LIMITED, not an internal-server error. Changing aliases does not reset the attempt budget.

For a Google mailbox, select Google under Add an account in Settings → Accounts when the operator has enabled Google OAuth for your webmail hostname. Sign in on Google's page and approve mail access. Gmail opens as a secondary mailbox with a Google badge in the folder sidebar. Your Mailcow sign-in stays active. If Google access is revoked, aseMail shows a sign-in warning. Expand the linked Google mailbox and select Reconnect to restore sync, or Disconnect to remove the link. See the Gmail configuration reference.

The matching adapter/API source includes Settings → Accounts → Link another mailbox. A user signed in as A can request access to B. B authenticates in Mailcow and explicitly approves sharing with A, then A confirms the link back in aseMail. B remains the owner; A's main mailbox and session stay unchanged. Read-only access is the default, organizing is optional, and sending as B is a separate permission. B can revoke the share in aseMail's Sharing settings.

Without a dedicated linking hostname, if Mailcow is already signed in as a different mailbox, switch its account and retry the pending link. Linking never uses the ordinary callback to sign A in as B. B's local aseMail MFA remains enforced unless the configured provider-MFA trust policy accepts verified native evidence. See the linking reference for the session binding, permission checks and revocation behavior.

To keep A signed in while B approves a link, including when both addresses use the same email domain, configure an optional dedicated linking hostname. Use a separate hostname because a path such as /link-acct on the main Mailcow hostname would still use the existing native session cookie. Give a separate HTTPS name such as link.mail.example.com to the existing Mailcow web server, with working DNS and a certificate, then add its exact https://link.mail.example.com/asemail-auth.php URL to PHP bridge_aliases and API ASEMAIL_MAILCOW_SSO_ALIASES. Also set PHP linking_bridge_url and API ASEMAIL_MAILCOW_LINKING_URL to that same URL. Even with managed_aliases, list this dedicated URL explicitly on both sides. The installer exports it as linkingBridgeUrl but excludes it from aseMail's publicAliases webmail origins. Regenerate the managed profile and recreate the API after changing the configuration. An existing Mailcow installation keeps its normal login page: the separate hostname gives that page a separate native session cookie. The installed login-banner template identifies this as a mailbox-link approval sign-in. No second password, two-factor, or passkey implementation is installed. Mailcow must use host-only session cookies; the adapter rejects a dedicated link request if its native cookie is domain-wide. It ends B's temporary native session after B approves or chooses Cancel and sign out. Leave these settings unset to keep the current account-switch flow.

Start a disposable A-to-B link from the normal webmail hostname. Confirm that B signs in and approves on the dedicated hostname, A confirms back on the original aseMail hostname, and only the dedicated hostname prompts for sign-in again. Repeat with cancellation, two mailboxes on one email domain, and an approved webmail alias. This local source change has not completed those live checks.

Upgrade the API, asemail-auth.php, bridge-lib.php, login-banner.twig, asemail-internal-mail.php, asemail-cookies.conf and asemail-proxy.inc as one reviewed change. The proxy must forward the new host-only linking cookie while keeping the native Mailcow session private. The additive 027_mailcow_link_challenges migration applies only to aseMail's database. Back up and test restoration before any real upgrade. The 2026-10-19 scoped native follow-up exercised B consent, retained A sign-in, read-only folder access and owner revocation. Post-revocation delegate denial and connection-credential cleanup still need independent verification; see the acceptance report.

Connect a SOGo address book#

To offer contacts and calendars during the existing Mailcow mailbox approval, use matching aseMail and Mailcow adapter builds, set dav_auto_connect => true in the protected adapter configuration, and include the reviewed hash of inc/functions.acl.inc.php in auth_source_sha256. Mailcow must allow both DAV and app passwords for the mailbox. On the approval screen, the mailbox owner can choose Allow mail, contacts and calendars to connect both services through one DAV-only app password created by Mailcow.

In Contacts, My contacts opens the signed-in mailbox's personal SOGo address book when its DAV connection is active. aseMail contacts opens the address book stored in aseMail. Use Address book account to switch accounts. To connect manually, select the account and choose Connect CardDAV, then use a Mailcow app password with DAV access. For a shared mailbox, have its owner share the address book in SOGo with your main mailbox. If the book is missing from the Address book picker, ask the owner to open Links to this Address Book in SOGo and share the CardDAV URL. In aseMail select your main mailbox, open Shared address books, and add that link once. Use the URL on your configured Mailcow host. SOGo handles address-book permissions independently of mail-folder access.

Use New contact when the book grants creation access and Edit contact when it grants modification access. A contact can have several email addresses. The primary address is used for the Gravatar and the default compose recipient. In SOGo sharing settings, grant the member permission to modify cards to enable editing for that member. Directory books such as the Global Address List (GAL) are read-only. Their availability depends on the Mailcow domain configuration. If an older SOGo server returns HTTP 501 for a directory query, aseMail can fetch up to 1,000 directory cards in batches with the same DAV credentials. Use Search contacts to filter the selected directory by name or email address. See Mailcow issue #7646. Manage connection → Disconnect removes the stored DAV credential from aseMail.

Open SOGo calendars in aseMail#

In Calendar, My calendar opens the signed-in mailbox's personal SOGo calendar when connected. My calendars and Linked/Shared calendars group the available calendars in the sidebar. On a phone, open Dates & calendars to find these controls. An existing DAV connection from Contacts also works here. For a new connection, use a Mailcow app password with DAV access. Share or subscribe to calendars in SOGo so they appear for the connected mailbox.

Open an event to view its details. On a shared calendar, your SOGo permission to modify public, private or confidential events determines which events you can edit. Editable events support updating the title, time, location and description. For a recurring event, edits apply to the selected occurrence. New event opens a panel in the calendar. SOGo calendars with creation access accept one-time events with title, time, location and description. Use SOGo to set recurrence, manage invitations or delete SOGo events. Calendar connections → Manage → Disconnect removes the credential used for both SOGo calendars and address books.

In Settings → Sharing, mailbox owners can edit an existing mail grant's folder scope, access level, and sending permission. Under Calendar and Contacts access, delegates can send an in-app request to a mailbox owner. The owner opens Share in SOGo, grants access to the appropriate resources there, and can mark the request reviewed in aseMail. SOGo controls which calendars and address books the recipient can see or edit.

Verify the complete flow#

Use a pilot mailbox, not an administrator impersonation. Test all of the following before opening the integration to other users:

  1. A signed-out /webmail/ visit reaches the native Mailcow login page and shows Please log in to use aseMail.
  2. Native password plus configured two-factor authentication returns to the correct inbox. A saved Mailcow passkey also returns to that mailbox; a person must complete the device's verification prompt.
  3. The Mailcow portal's aseMail button opens the current own mailbox without an extra Continue screen when its authentication and connection policy permit.
  4. Reading and folder synchronization work, including selectable mailboxes under a non-selectable Shared parent. Namespace containers themselves are skipped. If an earlier build quarantined an account on such a container, explicitly retry that account's synchronization after updating. Send only an explicitly authorized test message to a controlled recipient and confirm its Sent-folder copy.
  5. The dedicated connection appears under Mailcow App passwords with IMAP/SMTP only unless extra access was explicitly approved. Repeat sign-in reuses it.
  6. Sign out reaches the native login page and reopening /webmail/ stays signed out. Repeat from every supported native login alias and verify the return hostname. Sessions created before hostname tracking need a fresh sign-in through their intended alias.
  7. A fresh managed installation opens native sign-in without an aseMail setup wizard or administrator. If a local recovery administrator already exists, verify its sign-in separately. If you also run a separate aseMail instance, its sign-in, data, and independent connection are unchanged.
  8. Revoke a disposable test connection and verify that sign-in cannot silently restore or expand it. Do not revoke real users' connections as an installation smoke test.

/webmail/health/ready checks the database and worker heartbeat. It is not proof of native authentication, mailbox synchronization, mail delivery, or revocation.

Upgrade and roll back#

Before every upgrade, back up the aseMail PostgreSQL database, keys, environment files, native adapter, local overrides, nginx snippets, and any optional native hook changes. Record the current immutable image and actual Mailcow version. Review migration compatibility and test restoration on an isolated database.

The standalone and Mailcow Compose files pin PostgreSQL 17-alpine by digest. An application owner must deliberately update those pins for a PostgreSQL 17 minor release or Alpine rebuild; pulling the tag alone does not update the pinned image. Review the PostgreSQL release notes, including any extension or collation requirements, and test the candidate with an isolated copy of the database first. Preserve the existing data volume and PostgreSQL major version. Keep any Dockhand-managed copy of the Compose file in sync with the approved pin; do not use a stack-wide update for this database-only change. A database major upgrade requires a separate migration plan.

Update the image and matching integration files together. Review changes to native authentication files and reapply optional hooks only at their reviewed locations. Do not automatically approve new source hashes. Recreate only aseMail's services; recreate native services only when their mounts/networks change, or gracefully reload them for file-only updates. Retest the complete flow above, including fresh passkey login and logout on supported aliases.

A Mailcow update can change pinned native authentication files even when the aseMail image stays unchanged. After reviewing the exact native source changes, update only the affected auth_source_sha256, settings_source_sha256 and internal_auth_source_sha256 pins. Preserve every other adapter setting, key and transport option. Hash the original file bytes without converting line endings. Check every approved pin as the native PHP service account, not just root. If PHP-FPM disables OPcache timestamp validation, activate the reviewed configuration with a graceful PHP-FPM reload; a CLI OPcache reset does not refresh the serving workers. Verify the native portal handoff, authenticated aseMail inbox and logout before completing maintenance.

To roll back, restore the previous compatible image and saved adapter/proxy configuration. Keep the current database and encryption keys unless a reviewed restore is necessary. Additive migrations can be compatible with the old image; do not delete columns or restore a whole Mailcow database merely to undo a route. Never run docker compose down -v or replace PostgreSQL's data volume as an upgrade step. For an existing-instance move, follow the Compose migration reference.

Disabling the adapter does not revoke existing mailbox connections. Do not delete its key until the rollback/reconnection plan is resolved. If also using SSO_ONLY, disable that setting when deliberately returning to ordinary mailbox login; the configuration requires an enabled integration while SSO-only is set. If keeping /webmail/ for regular aseMail login, also remove the optional no-session native-launch redirects from the two exact /webmail and /webmail/ locations in site.asemail.custom. Retain its ordinary proxy/canonical-host rules and cookie filtering, validate nginx, and retest manual recovery before disabling the native adapter. Disabling PHP alone does not remove those redirects.

Troubleshooting#

Folder loading and Refresh all#

aseMail reads folder names/counts and the open folder's current messages directly from Mailcow over IMAP. You do not have to wait for a whole-account sync, and there is nothing extra to configure in aseMail administration. Unified Inbox checks each accessible Inbox; Refresh all checks those Inboxes, folder lists and the currently open folder. The first page also checks every 60 seconds; mailbox events and manual refresh reconcile loaded pages. New messages, flags and deletions are reconciled with Mailcow on each read.

The standard Mailcow-only installation automatically allows eight simultaneous mailbox requests per signed-in user and 32 across the API instance. Short bursts wait up to five seconds for a slot, so opening identities or settings while folders load does not immediately fail at the old two-request limit. There is nothing to configure in aseMail administration. The queue is bounded to 16 waiting requests per user and 128 per instance; if it fills or the wait expires, retry after the current operations finish. Hostname aliases share these limits. Sign-in protections, action-specific limits and request timeouts still apply. Optional SSO without Mailcow-only mode retains the standalone limits; see the technical reference for the exact scope.

The list starts with 50 messages per folder and loads more as you approach the bottom. Older pages are fetched directly from IMAP, including messages beyond the background cache window. Unified Inbox pages each accessible Inbox (up to 20). Conversation grouping can make the row count smaller than a folder's message total. An unavailable server's initial page uses saved messages with a warning. If an older page fails to load, existing rows remain visible and the footer offers retry or Refresh list. A quarantined background sync does not itself block folder browsing. Evicting a cached summary does not disable a recently displayed message: its small routing record remains available for opening and actions for seven days after its last fetch, and longer while cached or queued for a change.

Trash, archive, moves, read/unread and stars update on screen immediately, with a small saving indicator. Accepted actions are stored in PostgreSQL and finish in the worker even after the user closes the page. A leave-page warning protects submissions that have not yet been accepted; it clears after acceptance, even while the worker is still processing. Completion notifications include message counts. The worker claims each user's queued actions in creation order while giving users whose actions have not started recently a turn ahead of a user with a long backlog. Only conflicting actions on the same messages are blocked. Automatically marking an opened message as read keeps its toolbar available. A follow-up move, star or unread change updates the screen immediately and waits for that read to finish before submission. The leave-page warning remains until the follow-up has been accepted; pending moves still prevent duplicate changes. Mailbox refreshes also keep the current reader's actions available. Failures restore the server view and offer retry. Copies and permanent deletes still wait for confirmation. Keep the aseMail worker running; no extra Mailcow configuration is needed.

Remote content is automatically allowed for a single sender whose exact email domain belongs to the enabled Mailcow integration profile or has been established by a signed Mailcow mailbox sign-in link. Other senders retain the existing remote-content controls. Subdomains, display names and ambiguous From headers do not inherit this trust. The message menu identifies automatic Mailcow domain trust; HTML sanitization and the message sandbox still apply.

Use the filter button in the search bar for sender, recipient, subject, words, exclusions, dates, read/starred status, attachments, and folder selection. Search runs against IMAP in authorized folders, with Inbox as the default. All mail includes Junk and Trash. With several accounts, its shortcut says All mail (all accounts). The default Inbox scope is reflected by the folder checkboxes, without a separate Inbox shortcut. Expand account groups, ordered and named like the sidebar, to choose exact folders with checkboxes. The account checkbox chooses all its selectable folders. The All accounts group lists folder names found in at least two accounts; folders unique to one account stay under that account. Archive in All accounts selects Archive in every accessible account that has it. Selecting Archive under one account searches only that account. A parent checkbox selects that folder itself; children are selected separately. IMAP containers that cannot hold messages are shown but cannot be selected. Search accepts up to 1,000 folders across at most 20 accounts, retains the newest 50 matches per account across the selected folders, and uses one 30-second deadline. Attachment filtering inspects the latest 500 matches per folder. This is a supported subset of Gmail-style operators, not Gmail labels, categories, or Boolean expression syntax.

Personal signatures are under Settings → Accounts → Signatures, beside Sending identities. Select a sending address and plain text or formatted HTML; the modal has its own Save button. Existing signatures stay plain text. HTML supports the same text formatting and links as Compose. Use Insert signature when writing a message. These personal preferences do not change Mailcow aliases or require administration setup.

Opening folders and Refresh all no longer request whole-account sync jobs or use their 15-minute allowance. The separate background-recovery API retains an unlimited allowance for the standard SSO-only installer-managed Docker profile at asemail-imap, and five requests per user/account every 15 minutes for other connections. Ordinary request and connection-concurrency protections remain. Update the API and web client together if an older build still queues account syncs or reports a refresh limit from the sidebar button.

CrowdSec bans while loading contact photos#

Older avatar URLs can look like repeated missing pages to CrowdSec when contacts have no Gravatar photo. The avatar fix serves a cached transparent image so initials stay visible and uses image-style URLs. Keep the compatible legacy route for browsers with an older page open.

If CrowdSec is installed, the optional integrations/mailcow/crowdsec-asemail-avatars.yaml parser protects those older pages from this false positive. With approval for the host change, install it as /etc/crowdsec/parsers/s02-enrich/zz-asemail-avatars.yaml, run crowdsec -t, and reload CrowdSec after validation succeeds. It marks only GET/HEAD requests to the exact legacy avatar path with a valid 64-character hexadecimal hash and no query string as images. Other paths, malformed hashes, query strings, and other HTTP methods retain their normal classification. Existing bans require a separate, targeted removal after checking their cause; do not disable CrowdSec or whitelist the whole /webmail/ path.

If sign-in stays blank at /asemail-auth.php, record the response status/title and whether the callback POST occurs. The automatic handoff briefly has no visible controls; a persistent blank page needs PHP-response and browser CSP/JavaScript checks. Source-pin denial should return a visible 403. Readiness alone does not verify this flow.

After an authentication outage, check for accounts quarantined by repeated sync failures. Activating corrected source pins does not clear that durable state. Confirm the affected accounts against the maintenance checkpoint and test their existing credentials before requesting a supported resync. Require a fresh successful sync before continuing; preserve credentials, access grants and new error diagnostics.

Symptom What to check
Invalid sign-in origin Exact HTTPS origin/base path/bridge match, matching integration key, and the adapter's strict-origin form policy. Do not accept Origin: null to bypass the check.
Two-factor code rejected Which application is asking. A Mailcow code is not an aseMail code. Review native proof/trust settings rather than disabling MFA.
Email shows [email protected] Use the API build with scoped Cloudflare email opt-out markers on the two-step form. Its no-script security policy stays in place.
Another passkey prompt or consent screen Check that the updated adapter and reuse_connection are enabled and the connection is active and unchanged. First use still follows consent policy; missing native proof can require independently enabled aseMail MFA.
Adapter disabled after a Mailcow update Review the changed pinned authentication files, the optional hook, and compatibility before updating hashes.
Sign out returns to the primary hostname A session from before hostname tracking has no saved native host. Sign in once through the intended alias and retest.
New PHP files appear unchanged Refresh PHP-FPM's opcode cache with a graceful reload; do not rely on a CLI cache reset.
nginx cannot reach the API Matching proxy-network membership/alias, chosen subnet/IPs, and nginx configuration validation. Do not expose the database network as a workaround.

Tested behavior and remaining checks#

This website refresh checked the tagged documentation and captured the client with synthetic data. It did not repeat native mailcow login, passkey, MFA, external delivery or upgrade acceptance. Read the tagged verification record and full operator evidence for the exact environments, dates and limitations. Verify the complete flow in your own reviewed pilot before wider use.

Search all guides. Use ↑ ↓ to move through results.

aseMail screenshot