Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Vector-013/mftp

 
 

Contributors Forks Stargazers Issues MIT License Wiki


MFTP - My Freaking Training & Placements

CDC Noticeboard on Your Mail: Where Automatic Updates Turn Chaos into Pleasure!
Report Bug · Request Feature

Table of Contents

About The Project


MFTP continuously monitors the CDC Noticeboard and forwards incoming notices to the configured email address, whether it's an individual account or a Google Group. It is also available as a service and as a cronjob on linux systems.

Warning

This tool is completely legal, but the way you use it can get you into legal trouble. Some things you cannot do are:

  • Use this tool to send CDC notifications to any non-KGPian.
  • Use this tool on a wide scale or publicise its running instance without consent from the Placement Committee.

Please use this tool responsibly and within ethical and legal bounds. We do not promote violating company policies or laws. The extent of the punishment may very from disciplinary action by the institute to blacklisting from CDC process.

(back to top)

Supports:

  1. Shells
    • bash
    • zsh
  2. OS(s)
    • any *nix[GNU+Linux and Unix]

(back to top)

Setup

To set up a local instance of the application, follow the steps below.

Prerequisites

The following requirements are to be satisfied for the project to function properly:

(back to top)

Installation

Now that the environment has been set up and configured to properly compile and run the project, the next step is to download and configure the project locally on your system.

  1. Clone the repository
    git clone https://github.com/metakgp/MFTP.git
    cd ./MFTP
  2. Install required dependencies
    pip3 install -r requirements.txt
  3. Sending Emails

Note

Since, port 465 (SMTP with SSL) on campus LAN is blocked and if you want to host mftp on an internal server on the campus LAN, it will need another method then SMTP.
However, it is preferred to use SMTP when hosting on external server as SMTP is the convenient of the two.

The tool provides two methods of sending emails.

  • Using SMTP

    --smtp

    • Create an app password for the senders' email.
    • After creating app password use it as your FROM_EMAIL_PASS value in next step.
  • Using GMAIL API

    --gmail-api

    • Follow this quick start guide to configure gmail api on the senders' mail.
    • After successfull configuration of gmail api, you can leave the value of FROM_EMAIL_PASS as it is in the next step.
  1. Configuring environment variables
    • Copy env.example.py as env.py. It looks like this:
      # ERP Credentials
      ROLL_NUMBER = "XXYYXXXXX" # Institute Roll Number
      PASSWORD = "**********" # ERP Password
      SECURITY_QUESTIONS_ANSWERS = { # ERP Secret Questions and their Answers
          "Q1" : "A1",
          "Q2" : "A2",
          "Q3" : "A3",
      }
      
      # EMAIL CREDENTIALS
      FROM_EMAIL = "[email protected]" # Notification Sender Email-id
      FROM_EMAIL_PASS = "**********" # App password for the above email-id
      
      # OTHER PARAMETERS
      BCC_EMAIL_S = ["[email protected]", "[email protected]"] # Multiple mails for bcc
      # BCC_EMAIL_S = ["[email protected]"] # This is how you can set single mail in a list
      KEEP_TOKEN_ALIVE_EMAIL = "[email protected]" # Email-id to send regular emails to keep the token alive
    • Update the values inside the double quotes ("). DO NOT CHANGE VAR NAMES.
  2. Configure the mftp service For linux systems MFTP is available as a service and as a cronjob. To configure it, execute the following commands after navigating into the root directory of the project (inside the mftp folder).
    cd service/
    ./configure-service.sh

(back to top)

Usage

It is mandatory to provide either of the following flags to the execution command.

  • --smtp
  • --gmail-api
python3 mftp.py --smtp        # Using SMTP for sending mails
python3 mftp.py --gmail-api   # Using GMAIL API for sending mails

Using MFTP as a Service

After configuring MFTP as a service, you can use the mftp command with several options to interact with the tool as a service.
Following is the help menu for the service.

Usage: mftp [OPTIONS]

Options:
  -h, --help               Display this help and exit
  logs [OPTIONS]           Display last 25 lines of log file
    Options:
      clear                 Clear the log file
      NUM                   Display last NUM lines of log file
  disable                  Disable mftp service
  enable                   Enable mftp service
  status                   Check status of mftp service
  restart                  Restart mftp service
  stop                     Stop mftp service
  start                    Start mftp service
  cronjob [OPTIONS]        Use mftp as a cronjob
    Options:
      enable [NUM]             Enable mftp cronjob after every NUM minutes (default is 2 minutes)
      disable                  Disable mftp cronjob
      status                   Check status of mftp cronjob

(back to top)

Maintainer(s)

(back to top)

Contact

📫 Metakgp - Metakgp's slack invite Metakgp's email metakgp's Facebook metakgp's LinkedIn metakgp's Twitter metakgp's Instagram

(back to top)

Additional documentation

(back to top)

About

CDC noticeboard at your mail inbox.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 67.3%
  • Shell 32.7%