Batch delete all email from POP server via Python #

#! /usr/bin/env python
import poplib
M = poplib.POP3_SSL("mail.example.com", 995)
M.user("user@example.com")
M.pass_("password")
for i in range(M.stat()[0], 0, -1):
  M.dele(i)
M.quit()

/nix | Aug 04, 2020


Subscribe or visit the archives.