CDC Noticeboard on Your Mail: Where Automatic Updates Turn Chaos into Pleasure!
Report Bug
·
Request Feature
Table of Contents
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.
- Shells
bashzsh
- OS(s)
- any
*nix[GNU+LinuxandUnix]
- any
To set up a local instance of the application, follow the steps below.
The following requirements are to be satisfied for the project to function properly:
- python3
>=python3.10sudo apt update sudo apt install python3
- This project depends on ERP Login module by Arpit Bhardwaj for the ERP Login workflow. Read its documentation and setup your environment for it.
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.
- Clone the repository
git clone https://github.com/metakgp/MFTP.git cd ./MFTP - Install required dependencies
pip3 install -r requirements.txt
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.
-
--smtp- Create an app password for the senders' email.
- After creating app password use it as your
FROM_EMAIL_PASSvalue in next step.
-
--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_PASSas it is in the next step.
- Configuring environment variables
- Copy
env.example.pyasenv.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.
- Copy
- 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
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 mailsAfter 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