$handle = curl_init('imaps://mail.example.com/INBOX/;UID=1');
curl_setopt_array($handle, [
    CURLOPT_PROXY => 'socks5h://203.0.113.10:1080',
    CURLOPT_USERNAME => getenv('MAIL_USER'),
    CURLOPT_PASSWORD => getenv('MAIL_PASSWORD'),
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CONNECTTIMEOUT => 5,
    CURLOPT_TIMEOUT => 20,
]);

This configures an existing application's mail transfer; PHP's cURL runtime must be linked to libcurl with IMAP support. Its presence alone does not establish every built protocol. Replace the endpoints and mailbox UID. For a publicly reachable mail server where public intermediaries are permitted, the SOCKS5 proxy list offers candidates for the credential-free proxy URL shown; confirm access to the actual mail host and port while retaining the mail account and TLS settings.

CURLOPT_USERNAME/CURLOPT_PASSWORD authenticate to the mail server. A SOCKS account, when required, uses separate supported proxy credential options. The PHP IMAP extension is another client and is not configured by these settings.

Keep certificate and hostname verification enabled for the IMAPS destination. Disabling both is not a routing prerequisite.

During the application's transfer/result handling, identify the failed stage: SOCKS negotiation, mail TLS, IMAP login or mailbox selection. A reachable proxy does not show that UID 1 exists.

ХӀокхунах тера йаззамаш