lots of improvements
This commit is contained in:
@@ -31,11 +31,11 @@ interface ProviderBaseInterface extends ResourceProviderBaseInterface{
|
||||
* @since 2025.05.01
|
||||
*
|
||||
* @param string $tenantId Tenant identifier
|
||||
* @param string|null $userId User identifier for context
|
||||
* @param string $userId User identifier
|
||||
* @param string $address Email address to find service for
|
||||
*
|
||||
* @return IServiceBase|null Service handling the address, or null
|
||||
* @return ServiceBaseInterface|null Service handling the address, or null
|
||||
*/
|
||||
public function serviceFindByAddress(string $tenantId, ?string $userId, string $address): ?ServiceBaseInterface;
|
||||
public function serviceFindByAddress(string $tenantId, string $userId, string $address): ?ServiceBaseInterface;
|
||||
|
||||
}
|
||||
|
||||
@@ -9,6 +9,8 @@ declare(strict_types=1);
|
||||
|
||||
namespace KTXF\Mail\Provider;
|
||||
|
||||
use KTXF\Resource\Provider\ResourceServiceLocationInterface;
|
||||
|
||||
/**
|
||||
* Mail Provider Autodiscovery Interface
|
||||
*
|
||||
@@ -27,39 +29,24 @@ namespace KTXF\Mail\Provider;
|
||||
interface ProviderServiceDiscoverInterface extends ProviderBaseInterface {
|
||||
|
||||
/**
|
||||
* Discover service configuration
|
||||
*
|
||||
* Attempts to discover service configuration using provider-specific methods.
|
||||
* Each provider may use different discovery mechanisms:
|
||||
* - IMAP/SMTP: config database, DNS SRV, well-known URIs, common patterns
|
||||
* - JMAP: Well-known JMAP session discovery
|
||||
* - Provider-specific: Known configurations for popular providers
|
||||
*
|
||||
* @since 2025.05.01
|
||||
*
|
||||
* @param string $identity Identity to discover configuration for
|
||||
* @param array $options Provider-specific options (e.g., preferred protocols, timeout)
|
||||
* @param string $tenantId Tenant identifier
|
||||
* @param string $userId User identifier
|
||||
* @param string $identity Identity to discover configuration for (e.g., email address)
|
||||
* @param string|null $location Optional hostname to test directly (bypasses DNS lookup)
|
||||
* @param string|null $secret Optional password/token to validate discovered service
|
||||
*
|
||||
* @return array Discovery results in the format:
|
||||
* [
|
||||
* 'domain' => 'example.com',
|
||||
* 'provider' => 'gmail|outlook|generic|etc', // Optional detected provider
|
||||
* 'results' => [
|
||||
* [
|
||||
* 'protocol' => 'imap|smtp|jmap|etc',
|
||||
* 'host' => 'imap.example.com',
|
||||
* 'port' => 993,
|
||||
* 'security' => 'ssl|tls|starttls|none',
|
||||
* 'authentication' => ['plain', 'login', 'oauth2'], // Supported auth methods
|
||||
* 'confidence' => 'high|medium|low',
|
||||
* 'source' => 'mozilla|srv|wellknown|common|verified', // Discovery method used
|
||||
* ],
|
||||
* // ... more protocol results
|
||||
* ]
|
||||
* ]
|
||||
*
|
||||
* Returns empty results array if no configuration could be discovered.
|
||||
* @return ResourceServiceLocationInterface|null Discovered location or null if not found
|
||||
*/
|
||||
public function serviceDiscover(string $identity, array $options = []): array;
|
||||
public function serviceDiscover(
|
||||
string $tenantId,
|
||||
string $userId,
|
||||
string $identity,
|
||||
?string $location = null,
|
||||
?string $secret = null
|
||||
): ResourceServiceLocationInterface|null;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user