Skip to content

Suport doamin without a dot. #1141

Open

Description

@ChenPi11

The PostfixAdmin only support doamin without a dot like foo.bar, server.local.
But some local private server's hostname do not contains a dot like server1
And localhost is also a valid domain name if I deploy the PostfixAdmin in my local pc.

Can PostfixAdmin support doamin without a dot?

The problem is in check_domain(). Even with emailcheck_resolve_domain=false, the domain still needs to match the regex on functions.inc.php:234:
if (!preg_match('/^([-0-9A-Z]+\.)' . '([-0-9A-Z]){1,13}$/i', ($domain))) {

Activity

  1. TrapoSAMA commented on Sep 1, 2026

    @TrapoSAMA
    Contributor

    Thanks for the report. The current check_domain() validation does require at least one dot even when emailcheck_resolve_domain is disabled.

    Before changing this globally, we need to distinguish the hostname used to access PostfixAdmin from the mail domain managed by PostfixAdmin. Running the web interface on localhost does not by itself require creating addresses such as user@localhost. In addition, unqualified local names are not suitable for public SMTP use, and check_domain() is also used outside domain creation, for example when validating Fetchmail source servers.

    Could you please provide:

    • the relevant Postfix values for myhostname, mydestination, and virtual_mailbox_domains;
    • the exact domain you want PostfixAdmin to manage;
    • whether these addresses will remain inside an isolated local mail system or will appear in SMTP traffic outside it;
    • the Postfix lookup/maps that consume the PostfixAdmin domain and mailbox tables;
    • one example of a complete intended delivery flow, such as user@server1 from submission through final delivery?

    With that information we can decide whether this should be supported through an explicit opt-in setting, disabled by default, rather than weakening domain validation for every installation. I would not make emailcheck_resolve_domain implicitly enable single-label domains because DNS resolution and accepted syntax are separate concerns.

  2. ChenPi11 commented on Sep 2, 2026

    @ChenPi11
    Author
    myhostname = laptop2
    mydomain = laptop2
    mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain, mail.$mydomain, www.$mydomain, ftp.$mydomain
    
    • I want to use email address like chenpi11@laptop2.
    • The email will traffic in the local mail system and NEVER appear on the Internet.
    • I haven't found my lookup maps, it's using mydestination and hostname.
  3. TrapoSAMA commented on Sep 2, 2026

    @TrapoSAMA
    Contributor

    Thanks for the additional information. With laptop2 listed in mydestination, Postfix treats it as a local domain and delivers its recipients through local_transport, normally using system accounts, /etc/aliases, and local_recipient_maps. The domains and mailboxes stored by PostfixAdmin are not involved in that delivery path.

    Therefore, allowing laptop2 in the PostfixAdmin domain form would not make chenpi11@laptop2 work with the configuration shown. You would normally create a local system user or local alias for this use case.

    PostfixAdmin-managed mailboxes require a virtual mailbox configuration using virtual_mailbox_domains, virtual_mailbox_maps, and the corresponding Dovecot or delivery-agent database integration. A virtual mailbox domain must not also be listed in mydestination.

    If you already have another component reading the PostfixAdmin database, please provide the relevant output from postconf -n, the configured virtual_mailbox_* and virtual_alias_* maps, and the applicable Dovecot passdb/userdb configuration. Otherwise, this appears to be a local Postfix configuration use case rather than a PostfixAdmin validation defect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions