MailKit provides a SOCKS5 client directly through its mail-service connection interface. Set ProxyClient before calling Connect:

using MailKit.Net.Pop3;
using MailKit.Net.Proxy;
using MailKit.Security;

using var client = new Pop3Client();
client.ProxyClient = new Socks5Client("proxy.example.net", 1080);

client.Connect("pop.example.net", 995, SecureSocketOptions.SslOnConnect);
client.Authenticate(mailUser, mailPassword);

Console.WriteLine(client.Count);
client.Disconnect(true);

Replace the example hosts with the actual SOCKS and mail endpoints. In the no-proxy-account constructor shown, an entry from the SOCKS5 proxy list may supply the proxy address for an allowed public POP3S route; it must permit the mail host and actual port. The mailUser and mailPassword values come from the application’s mailbox credential handling. This example counts messages; it does not download or mark any for deletion.

The shown API is documented in MailKit 4.17.0. Socks5Client also has a constructor accepting a System.Net.NetworkCredential when the SOCKS server requires credentials.

Port 995 with SslOnConnect selects TLS immediately for the POP3 connection. Keep the mail server’s hostname in Connect so its certificate can be checked normally. For a provider that requires STLS on port 110, select SecureSocketOptions.StartTls explicitly and use that provider’s documented endpoint.

Allakkat attuumassuteqartut