Python Forum
Yahoo email "search and destroy"!
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Yahoo email "search and destroy"!
#1
Heart 
Greetings friends,

My first post, very new to programing, and I must also tell you I'm fascinated and in love with Python!! Heart

My email account has been blasted lately from a specific user, with spoofed domain names, well over 50 per day, non stop for over 9 weeks now!! Yes, I could just place them in the Spam folder, but, it makes it hard to search for possible legit emails, and I want to use this as a Python learning process.

Want to search for user@wildcard domain, move users to folder called DUMP, then delete contents of DUMP.

Below are the 3 working sections I have:
CREDIT: Sunny Solanki in coderzcolumn.com

import imaplib
import time

################# IMAP SSL ################################
start = time.time()
try:
    imap_ssl = imaplib.IMAP4_SSL(host="imap.mail.yahoo.com", port=993)
except Exception as e:
    print("ErrorType : {}, Error : {}".format(type(e).__name__, e))
    imap_ssl = None

print("Connection Object : {}".format(imap_ssl))
print("Total Time Taken  : {:,.2f} Seconds".format(time.time() - start))


############### Login to Mailbox ######################
print("Logging into mailbox...")
try:
    resp_code, response = imap_ssl.login("[email protected]", "XXXXXXXXXXXXX")
except Exception as e:
    print("ErrorType : {}, Error : {}".format(type(e).__name__, e))
    resp_code, response = None, None

print("Response Code : {}".format(resp_code))
print("Response      : {}\n".format(response[0].decode()))


############### Needed section to "search and destroy"  ################






############### Logout of Mailbox ######################
print("\nLogging Out....")
try:
    resp_code, response = imap_ssl.logout()
except Exception as e:
    print("ErrorType : {}, Error : {}".format(type(e).__name__, e))
    resp_code, response = None, None

print("Response Code : {}".format(resp_code))
print("Response      : {}".format(response[0].decode()))
I would sincerely appreciate your knowledge/expertise in helping me create the needed code section above!
Please break down each piece of code, so I can try and understand what it does. Shy Heart Idea

Blessings,

LL
Reply


Messages In This Thread
Yahoo email "search and destroy"! - by Linh_lee - Aug-15-2022, 04:24 AM
RE: Yahoo email "search and destroy"! - by snippsat - Aug-15-2022, 10:14 AM
RE: Yahoo email "search and destroy"! - by Linh_lee - Aug-26-2022, 05:48 PM
RE: Yahoo email "search and destroy"! - by snippsat - Aug-26-2022, 07:17 PM
RE: Yahoo email "search and destroy"! - by Linh_lee - Aug-26-2022, 10:04 PM
RE: Yahoo email "search and destroy"! - by Linh_lee - Aug-27-2022, 01:17 AM
RE: Yahoo email "search and destroy"! - by Larz60+ - Aug-27-2022, 11:50 AM
RE: Yahoo email "search and destroy"! - by Linh_lee - Aug-27-2022, 04:05 PM
RE: Yahoo email "search and destroy"! - by snippsat - Aug-27-2022, 04:30 PM
RE: Yahoo email "search and destroy"! - by Linh_lee - Aug-27-2022, 05:15 PM
RE: Yahoo email "search and destroy"! - by snippsat - Aug-27-2022, 05:24 PM
RE: Yahoo email "search and destroy"! - by Linh_lee - Aug-27-2022, 05:38 PM
RE: Yahoo email "search and destroy"! - by Linh_lee - Aug-27-2022, 08:54 PM
RE: Yahoo email "search and destroy"! - by Linh_lee - Aug-27-2022, 11:35 PM
RE: Yahoo email "search and destroy"! - by Linh_lee - Aug-28-2022, 03:54 AM
RE: Yahoo email "search and destroy"! - by Linh_lee - Aug-28-2022, 06:59 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Why does [root.destroy, exit()]) fail after pyinstaller? Rpi Edward_ 4 713 Oct-18-2023, 11:09 PM
Last Post: Edward_
  Python help for yahoo finance! Zshanar 7 3,525 Jul-31-2022, 05:27 PM
Last Post: paulyan
  Real time pricing Yahoo finance nathanz 1 2,618 Aug-09-2018, 01:02 PM
Last Post: metulburr
  An email with inline jpg cannot be read by all email clients fpiraneo 4 4,143 Feb-25-2018, 07:17 PM
Last Post: fpiraneo
  Email - Send email using Windows Live Mail cyberzen 2 6,023 Apr-13-2017, 03:14 AM
Last Post: cyberzen
  how to destroy or remove object rendered with opengl from the screen? hsunteik 1 7,127 Apr-09-2017, 01:30 PM
Last Post: hsunteik

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020