Download the PHP package accountdesk/mail-autodetect without Composer

On this page you can find all versions of the php package accountdesk/mail-autodetect. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package mail-autodetect

Mail-AutoDetect

Latest Version Total Downloads License PHP Version CI

Mail server discovery on autopilot

PHP library for automatic detection of IMAP and SMTP server settings for any domain.

Installation

Option 1: Composer

Option 2: Manual

Copy src/AutoDetector.php into your project and include it:

Requirements:

Usage

Output:

Configuration

Logging (PSR-3)

Log levels:

Caching

DNS and HTTP results are automatically cached (in-memory per request). Multiple queries for the same domain won't trigger duplicate requests.

Detection Strategies

The library uses multiple strategies in descending reliability:

# Strategy Score Description
1 Mozilla ISPDB 95 Thunderbird autoconfig database
2 Known MX 92 Known providers (Gmail, Outlook, etc.) via MX pattern
3 Microsoft Autodiscover 92 Exchange/Office 365 (requires email)
4 DNS SRV 90 RFC 6186 service records
5 Domain Autoconfig 90 autoconfig.domain/mail/config-v1.1.xml
6 MX Heuristic 75-80 MX record + SPF parsing + TCP check
7 Standard Hosts 55-70 imap.domain, smtp.domain + TCP check

Score calculation:

Response Format

Each candidate contains:

Field Type Description
host string Server hostname
port int Port (993, 465, 587, ...)
ssl string ssl, starttls, or plain
auth string|null Auth method (if known)
source string Primary source
sources array All sources that found this server
score int Confidence score (0-100)
match_count int Number of sources

Security Considerations

Important: This library detects mail server configurations but does NOT validate them.

Before using detected settings with real credentials:

  1. Always confirm with the user - Show the detected hostname/port and ask for explicit confirmation
  2. Don't auto-connect - Never automatically test connections with real passwords
  3. Validate the domain - Ensure the detected hosts belong to the expected domain

Example secure implementation:

Why this matters: A malicious domain could configure autoconfig/autodiscover to point to an attacker-controlled server, potentially capturing credentials.

License

MIT

Testing

This library uses static analysis (Mago) instead of unit tests. Network-dependent libraries like this are better validated through real-world usage than mocked tests.


All versions of mail-autodetect with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
ext-curl Version *
ext-simplexml Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package accountdesk/mail-autodetect contains the following files

Loading the files please wait ...