Home - krviveka/TA-Mail GitHub Wiki

About this script

Provides interface to Mail programs such as Gmail - to help auto-evaluate and provide auto-feedback for course instructors and Teaching Assistants (TAs)

How to run

  • This script uses IMAP to access gmail - enable this in Gmail using Settings -> Forwarding and POP/IMAP -> Enable IMAP
  • Just install Perl in your machine (which is most likely already present if it's a UNIX machine).
  • Install the required packages - again trivial task
  • Download the file (download_mail.pl)
  • Make it executable ``

chmod 775 download_mail.pl ``

  • Change the username in the script file - see comments in the code!
  • Change search criteria - such as folder name (again should be obvious from comments in code)
  • Run it ``

./download_mail.pl ``

  • It will download and place all attachments of unread mails in the directory in which the script is run.
  • Enjoy!

Customization

  • The script can easily be modified to meet most requirements

Additional packages required

#!perl

Mail::IMAPClient; # -- For IMAP access into gmail - this is recommended over POP3 by Google
IO::Socket::SSL;  # -- For secure connection to gmail
Term::ReadKey;    # -- To read password from terminal without echoing onto prompt
Email::MIME 1.901;# -- To parse the mail

#Installing perl packages in ubuntu

For package "Term::ReadKey" sudo apt-get install libterm-readkey-perl

Suitably modify for other packages