Files
wevads-platform/scripts/seed_imap_hosts.php
2026-02-26 04:53:11 +01:00

183 lines
8.4 KiB
PHP

<?php
/**
* GLOBAL IMAP HOSTS DATABASE - All ISPs Worldwide
* Used by Seed Factory & Brain Engine
*/
function getImapConfig($email) {
$domain = strtolower(substr($email, strpos($email, '@') + 1));
// Microsoft Family (ALL use same server)
$microsoft = ['hotmail.com', 'hotmail.fr', 'hotmail.de', 'hotmail.it', 'hotmail.es', 'hotmail.co.uk', 'hotmail.be', 'hotmail.nl',
'outlook.com', 'outlook.fr', 'outlook.de', 'outlook.it', 'outlook.es', 'outlook.co.uk', 'outlook.be', 'outlook.nl',
'live.com', 'live.fr', 'live.de', 'live.it', 'live.es', 'live.co.uk', 'live.be', 'live.nl',
'msn.com', 'passport.com'];
if (in_array($domain, $microsoft)) {
return ['host' => 'outlook.office365.com', 'port' => 993, 'isp' => 'MICROSOFT'];
}
// Google Family
$google = ['gmail.com', 'googlemail.com'];
if (in_array($domain, $google)) {
return ['host' => 'imap.gmail.com', 'port' => 993, 'isp' => 'GMAIL'];
}
// Yahoo Family
$yahoo = ['yahoo.com', 'yahoo.fr', 'yahoo.de', 'yahoo.it', 'yahoo.es', 'yahoo.co.uk', 'yahoo.ca', 'yahoo.com.br',
'ymail.com', 'rocketmail.com', 'yahoo.co.jp', 'yahoo.co.in'];
if (in_array($domain, $yahoo)) {
return ['host' => 'imap.mail.yahoo.com', 'port' => 993, 'isp' => 'YAHOO'];
}
// AOL Family
$aol = ['aol.com', 'aol.fr', 'aol.de', 'aim.com', 'love.com', 'ygm.com', 'games.com', 'wow.com'];
if (in_array($domain, $aol)) {
return ['host' => 'imap.aol.com', 'port' => 993, 'isp' => 'AOL'];
}
// German ISPs
$german = [
't-online.de' => ['host' => 'secureimap.t-online.de', 'port' => 993, 'isp' => 'T-ONLINE'],
'gmx.de' => ['host' => 'imap.gmx.net', 'port' => 993, 'isp' => 'GMX'],
'gmx.net' => ['host' => 'imap.gmx.net', 'port' => 993, 'isp' => 'GMX'],
'gmx.at' => ['host' => 'imap.gmx.net', 'port' => 993, 'isp' => 'GMX'],
'gmx.ch' => ['host' => 'imap.gmx.net', 'port' => 993, 'isp' => 'GMX'],
'web.de' => ['host' => 'imap.web.de', 'port' => 993, 'isp' => 'WEB.DE'],
'freenet.de' => ['host' => 'mx.freenet.de', 'port' => 993, 'isp' => 'FREENET'],
'1und1.de' => ['host' => 'imap.1und1.de', 'port' => 993, 'isp' => '1UND1'],
'ionos.de' => ['host' => 'imap.ionos.de', 'port' => 993, 'isp' => 'IONOS'],
'posteo.de' => ['host' => 'posteo.de', 'port' => 993, 'isp' => 'POSTEO'],
'mailbox.org' => ['host' => 'imap.mailbox.org', 'port' => 993, 'isp' => 'MAILBOX'],
];
if (isset($german[$domain])) return $german[$domain];
// French ISPs
$french = [
'orange.fr' => ['host' => 'imap.orange.fr', 'port' => 993, 'isp' => 'ORANGE'],
'wanadoo.fr' => ['host' => 'imap.orange.fr', 'port' => 993, 'isp' => 'ORANGE'],
'free.fr' => ['host' => 'imap.free.fr', 'port' => 993, 'isp' => 'FREE'],
'sfr.fr' => ['host' => 'imap.sfr.fr', 'port' => 993, 'isp' => 'SFR'],
'neuf.fr' => ['host' => 'imap.sfr.fr', 'port' => 993, 'isp' => 'SFR'],
'laposte.net' => ['host' => 'imap.laposte.net', 'port' => 993, 'isp' => 'LAPOSTE'],
'bbox.fr' => ['host' => 'imap.bbox.fr', 'port' => 993, 'isp' => 'BOUYGUES'],
];
if (isset($french[$domain])) return $french[$domain];
// Dutch ISPs
$dutch = [
'ziggo.nl' => ['host' => 'imap.ziggo.nl', 'port' => 993, 'isp' => 'ZIGGO'],
'kpnmail.nl' => ['host' => 'imap.kpnmail.nl', 'port' => 993, 'isp' => 'KPN'],
'xs4all.nl' => ['host' => 'imap.xs4all.nl', 'port' => 993, 'isp' => 'XS4ALL'],
'hetnet.nl' => ['host' => 'imap.hetnet.nl', 'port' => 993, 'isp' => 'HETNET'],
];
if (isset($dutch[$domain])) return $dutch[$domain];
// Italian ISPs
$italian = [
'libero.it' => ['host' => 'imapmail.libero.it', 'port' => 993, 'isp' => 'LIBERO'],
'virgilio.it' => ['host' => 'in.virgilio.it', 'port' => 993, 'isp' => 'VIRGILIO'],
'alice.it' => ['host' => 'in.alice.it', 'port' => 993, 'isp' => 'ALICE'],
'tin.it' => ['host' => 'box.tin.it', 'port' => 993, 'isp' => 'TIN'],
'tiscali.it' => ['host' => 'imap.tiscali.it', 'port' => 993, 'isp' => 'TISCALI'],
'fastweb.it' => ['host' => 'imap.fastweb.it', 'port' => 993, 'isp' => 'FASTWEB'],
];
if (isset($italian[$domain])) return $italian[$domain];
// Spanish ISPs
$spanish = [
'telefonica.net' => ['host' => 'imap.telefonica.net', 'port' => 993, 'isp' => 'TELEFONICA'],
'movistar.es' => ['host' => 'imap.movistar.es', 'port' => 993, 'isp' => 'MOVISTAR'],
];
if (isset($spanish[$domain])) return $spanish[$domain];
// Canadian ISPs
$canadian = [
'videotron.ca' => ['host' => 'imap.videotron.ca', 'port' => 993, 'isp' => 'VIDEOTRON'],
'bell.net' => ['host' => 'imap.bell.net', 'port' => 993, 'isp' => 'BELL'],
'rogers.com' => ['host' => 'imap.rogers.com', 'port' => 993, 'isp' => 'ROGERS'],
'shaw.ca' => ['host' => 'imap.shaw.ca', 'port' => 993, 'isp' => 'SHAW'],
];
if (isset($canadian[$domain])) return $canadian[$domain];
// UK ISPs
$uk = [
'btinternet.com' => ['host' => 'mail.btinternet.com', 'port' => 993, 'isp' => 'BT'],
'sky.com' => ['host' => 'imap.tools.sky.com', 'port' => 993, 'isp' => 'SKY'],
'virginmedia.com' => ['host' => 'imap.virginmedia.com', 'port' => 993, 'isp' => 'VIRGIN'],
'talktalk.net' => ['host' => 'imap.talktalk.net', 'port' => 993, 'isp' => 'TALKTALK'],
];
if (isset($uk[$domain])) return $uk[$domain];
// Polish ISPs
$polish = [
'wp.pl' => ['host' => 'imap.wp.pl', 'port' => 993, 'isp' => 'WP'],
'onet.pl' => ['host' => 'imap.poczta.onet.pl', 'port' => 993, 'isp' => 'ONET'],
'interia.pl' => ['host' => 'poczta.interia.pl', 'port' => 993, 'isp' => 'INTERIA'],
'o2.pl' => ['host' => 'poczta.o2.pl', 'port' => 993, 'isp' => 'O2PL'],
];
if (isset($polish[$domain])) return $polish[$domain];
// Russian ISPs
$russian = [
'mail.ru' => ['host' => 'imap.mail.ru', 'port' => 993, 'isp' => 'MAILRU'],
'yandex.ru' => ['host' => 'imap.yandex.ru', 'port' => 993, 'isp' => 'YANDEX'],
'yandex.com' => ['host' => 'imap.yandex.com', 'port' => 993, 'isp' => 'YANDEX'],
'rambler.ru' => ['host' => 'imap.rambler.ru', 'port' => 993, 'isp' => 'RAMBLER'],
];
if (isset($russian[$domain])) return $russian[$domain];
// Brazilian ISPs
$brazilian = [
'uol.com.br' => ['host' => 'imap.uol.com.br', 'port' => 993, 'isp' => 'UOL'],
'bol.com.br' => ['host' => 'imap.bol.com.br', 'port' => 993, 'isp' => 'BOL'],
'terra.com.br' => ['host' => 'imap.terra.com.br', 'port' => 993, 'isp' => 'TERRA'],
'ig.com.br' => ['host' => 'imap.ig.com.br', 'port' => 993, 'isp' => 'IG'],
];
if (isset($brazilian[$domain])) return $brazilian[$domain];
// Japanese ISPs
$japanese = [
'nifty.com' => ['host' => 'imap.nifty.com', 'port' => 993, 'isp' => 'NIFTY'],
'biglobe.ne.jp' => ['host' => 'mail.biglobe.ne.jp', 'port' => 993, 'isp' => 'BIGLOBE'],
];
if (isset($japanese[$domain])) return $japanese[$domain];
// Australian ISPs
$australian = [
'optusnet.com.au' => ['host' => 'mail.optusnet.com.au', 'port' => 993, 'isp' => 'OPTUS'],
'bigpond.com' => ['host' => 'imap.telstra.com', 'port' => 993, 'isp' => 'TELSTRA'],
];
if (isset($australian[$domain])) return $australian[$domain];
// ProtonMail / Tutanota (encrypted - special handling)
if (in_array($domain, ['protonmail.com', 'proton.me', 'pm.me'])) {
return ['host' => null, 'port' => null, 'isp' => 'PROTON', 'note' => 'Bridge required'];
}
if (in_array($domain, ['tutanota.com', 'tutamail.com', 'tuta.io'])) {
return ['host' => null, 'port' => null, 'isp' => 'TUTANOTA', 'note' => 'No IMAP'];
}
// iCloud
if (in_array($domain, ['icloud.com', 'me.com', 'mac.com'])) {
return ['host' => 'imap.mail.me.com', 'port' => 993, 'isp' => 'ICLOUD'];
}
// Zoho
if (strpos($domain, 'zoho') !== false) {
return ['host' => 'imap.zoho.com', 'port' => 993, 'isp' => 'ZOHO'];
}
// Default: try common patterns
return [
'host' => 'imap.' . $domain,
'port' => 993,
'isp' => strtoupper(explode('.', $domain)[0]),
'guessed' => true
];
}
// Export for CLI usage
if (php_sapi_name() === 'cli' && isset($argv[1])) {
print_r(getImapConfig($argv[1]));
}