---
# System prepended metadata

title: BFCAI Project 2023

---

># BFCAI Project 2023
----------------
># Setup our project in the env.
----------------
# Beginning of creation
Determine the email system and protocol that the company uses. For example, they might use Microsoft Exchange, Gmail, or another email system.

## Configuration
Configure the email server to route a copy of incoming emails to our program, we will need to set up email forwarding rules or configure the server to use SMTP relaying.
| Email Forwarding Rules                                                                                                                                          | SMTP Relaying                                                                                                                                                                                                                                              |
|:--------------------------------------------------------------------------------------------------------------------------------------------------------------- |:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| We can set up email forwarding rules on the email server so that when an email is received, it is automatically forwarded to the program.                       | SMTP relaying allows our program to receive all incoming email directly from the internet before it reaches the email server.                                                                                                                              |
| For example, you might configure the email server to forward all email from a specific sender or with a specific subject line to your spam email filter program | program receives all incoming email directly from the internet before it reaches the email server. This allows our program to analyze the email and mark it as spam or not spam before the email is delivered to the recipient's inbox. |
| Email forwarding rules are typically more specific than SMTP relaying and are used to route particular types of email to a specific destination.                | SMTP relaying is typically used when you want to process all incoming email, rather than just email for specific users or domains.                                                                                                                         |
> SMTP relaying is more comprehensive and allows you to analyze all incoming email, while email forwarding rules are more specific and can be used to route particular types of email to a specific destination.

If the email is marked as **spam**, the program can either delete the email or move it to a quarantine area. The exact steps for quarantining spam email is to move the spam email to a separate folder or mailbox that is only accessible to administrators or security personnel.

If the email is **not** marked as **spam**, the program can forward the email to the email server, which will then deliver it to the recipient's inbox as usual.

## Example
> Assume that your company domain name is **@company.com** and you have multiple employees for example emp1@company.com. 
> 
> If a customer with the domain customer@gmail.com communicates with emp1@company.com the email will received by the email server for @company.com and is directed to the inbox of emp1@company.com. 
> 
> Before the email is delivered to emp1@company.com, the email server routes a copy of the email to **our program**. Our program receives the copy of the email and performs its spam checks.
>
> If the email is identified as **spam**, it will be marked as such and either deleted or sent to a quarantine area. If the email is **not identified as spam**, Our program will allow it to be delivered to the inbox of emp1@company.com, and emp1@company.com will receive the email as usual.
>
> ![](https://i.imgur.com/PAaVsll.png)



# Things to be in the env.
## MTA
First of all, we need a working [MTA](https://en.wikipedia.org/wiki/Message_transfer_agent) (mail transfer agent) that can send and receive email for the domain using SMTP protocol. 

| Email Gateway                                                                                                                             | MTA                                                                                                                                                                                                                                                                                                                                                                | Spam e-mail filters                                                                                                                                                                                  |
| ----------------------------------------------------------------------------------------------------------------------------------------- |:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| An email gateway is a network device or software application that enables email messages to be exchanged between different email systems. | MTA is responsible for routing emails between mail servers. When you send an email, your MTA sends it to the recipient's MTA, which then delivers it to their inbox.                                                                                                                                                                                               | Spam email filters, on the other hand, are designed to analyze the content of emails to identify and block unwanted messages.                                                                        |
| It is responsible for routing, filtering, and sometimes performing security scans on incoming and outgoing email messages.                | MTAs don't typically analyze the content of emails for spam or other unwanted messages, but they can be configured to reject or quarantine messages based on certain criteria, such as the sender's IP address or the format of the email.                                                                                                                         | They use a variety of techniques to determine whether an email is spam, including: analyzing the sender's reputation, checking for spammy keywords or phrases, and scanning attachments for malware. |
| Email gateways can also provide other features like message archiving and encryption.                                                     | I is responsible for transporting email messages between different email servers. It acts as the middleman that receives email messages from a sender's email client, routes them through the internet, and delivers them to the recipient's email server. MTAs use various protocols, such as SMTP (Simple Mail Transfer Protocol), to accomplish this task. | Spam filters can be implemented on both the server side and the client side, and they are often used in conjunction with MTAs to provide more comprehensive email security.                          |

> **Question**: *are you responsible to create the MTA, or you should make your project conform with the one in the company ??*

> [Open Source Project](https://github.com/viridIT/vSMTP)

# Installing process

