The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Quick Python Script to assist with troubleshooting email

Discussion in 'E-mail Discussions' started by nickn, Apr 13, 2005.

  1. nickn

    nickn Well-Known Member
    PartnerNOC

    Joined:
    Jun 15, 2003
    Messages:
    619
    Likes Received:
    1
    Trophy Points:
    18
    Hi folks -

    Wrote this script last night mostly for myself, but thought others here might appreciate it.

    Basically it allows you to quickly test a client's POP3/IMAP/IMAP-SSL account and verify whether the username/password work, and if it does, how much mail is in the account.

    Good initial test with client's email accounts when they claim it doesn't work, if it doesn't work, it'll give you the error message returned.

    Script can be found here:
    http://aviator.elinuxservers.com/mailtroubleshoot.py

    Quick example:

    Code:
    nick@teleri/ttyp0(~)%] ./mailtroubleshoot.py
    
                            ---------------------------------------
                            POP3 / IMAP / IMAP-SSL Troubleshooter.
                            ---------------------------------------
    
    Please enter protocol you wish to check :imap
    Please enter server: httpme.com
    Please enter account: nick+httpme.com
    Please enter password:
    
    
    Attempting to login using username nick+httpme.com ....
    LOGIN failed
    
    or, if it works...

    Code:
     [nick@teleri/ttyp0(~)%] ./mailtroubleshoot.py 
      
                             --------------------------------------- 
                             POP3 / IMAP / IMAP-SSL Troubleshooter. 
                             --------------------------------------- 
      
     Please enter protocol you wish to check :imap-ssl 
     Please enter server: httpme.com 
     Please enter account: nick+httpme.com 
     Please enter password: 
      
      
     Attempting to login using username nick+httpme.com .... 
     Login successful to httpme.com using IMAP-SSL 
     This mailbox has 2448 messages, totaling 37393268 bytes. 
    
    Mostly written to help me learn the pop3 and imap libs of Python, but should be useful regardless.
     
    #1 nickn, Apr 13, 2005
    Last edited: Apr 13, 2005

Share This Page