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
bash
zsh
- OS(s)
- any
*nix
[GNU+Linux
andUnix
]
- 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.10
sudo apt update sudo apt install python3
- MongoDB clusters' URI. Create an account on MongoDB Atlas and then create a cluster, give yourself access to that cluster and get the mongoDB connect URI.
- 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
-
The tool provides two methods of sending emails.
Why?
Because on campus LAN port465
(SMTP port) is blocked and if you want to host it on an internal server on the campus LAN, you will need another method than SMTP.
However, it is preferred to use SMTP when hosting on external server as SMTP is the easiest of the two.-
--smtp
- Create an app password for the senders' email.
- After creating app password use it as your
FROM_EMAIL_PASS
value 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_PASS
as it is in the next step.
-
-
Configuring environment variables
- Copy
env.example.py
asenv.py
. It looks like this:# ERP Credentials ROLL_NUMBER = "XXYYXXXXX" PASSWORD = "**********" SECURITY_QUESTIONS_ANSWERS = { "Q1" : "A1", "Q2" : "A2", "Q3" : "A3", } # EMAIL CREDENTIALS FROM_EMAIL = "abc@gmail.com" FROM_EMAIL_PASS = "**********" # OTHER PARAMETERS BCC_EMAIL_S = ["xyz@googlegroups.com", "abc@googlegroups.com"] # Multiple mails for bcc # BCC_EMAIL_S = ["xyz@googlegroups.com"] # This is how you can set single mail in a list MONGODB_URI = "%****%******%"
- 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 mails
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