0% found this document useful (0 votes)
82 views4 pages

SMTP Server Project Details

The document describes an SMTP server project that requires developing a concurrent SMTP server daemon in C/C++ on Linux. The server must implement SMTP commands like HELO, MAIL FROM, RCPT TO, DATA, RSET, NOOP, and QUIT according to RFC 2821. It must check sender/recipient domains and emails against ban lists, save email messages to user mailboxes based on a configuration file, and respond with appropriate SMTP response codes. A sample client-server interaction is provided.

Uploaded by

Gabriel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
82 views4 pages

SMTP Server Project Details

The document describes an SMTP server project that requires developing a concurrent SMTP server daemon in C/C++ on Linux. The server must implement SMTP commands like HELO, MAIL FROM, RCPT TO, DATA, RSET, NOOP, and QUIT according to RFC 2821. It must check sender/recipient domains and emails against ban lists, save email messages to user mailboxes based on a configuration file, and respond with appropriate SMTP response codes. A sample client-server interaction is provided.

Uploaded by

Gabriel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

SMTP Server Project Details (20191212)

Objectives:
Main objective of this project to develop concurrent SMTP server daemon.

Recommendations & Rules:


• The applications must be written in C/C++ on Linux Platform.
• Application should operate in concurrent mode. (So application serve more than one
user at a time)
• Only listed library can be used for file parsing. Using other libraries or classes
prohibited. Write your own functions if it’s necessary.
• Unless otherwise explicitly specified, all written assignments or code that is submitted
is to be entirely the student’s own work. Using any code or copying any assignment
from others is strictly prohibited without advance prior permission from the instructor.
• All students’ work is their own. Students who do share their work with others are as
responsible for academic dishonesty as the student receiving the material.
• Students who encourage others to cheat or plagiarize, or students who are aware of
plagiarism or cheating and do not report it are also participating in academically
dishonest behavior.
• In this case (academically dishonest behavior), students to be punished with no grade.

Allowed Libraries:
• Standart POSIX socket library.
• Ini parser, https://github.com/ndevilla/iniparser

Project Details:
1) Server should bind (listen) port that defined in application configuration file. This port
uses for command exchange and data transfer purpose. All data exchange should use TCP
transport layer protocol for reliability.

2) Server must have a configuration file (.ini file). This file includes configuration
parameters of server. Configuration file example given in Appendix section (server.ini).

3) SMTP Server application should operate as defined in RFC 2821.


In initiation stage implement following command:
HELO

In mail transactions;
MAIL FROM
RCPT TO:
DATA
RSET
NOOP
In closure;
QUIT
Should implement.

4) Appropriate response codes should be implemented. (According to RFC)


5) Client must have a configuration file (ini file). This file includes configuration parameters
of server. Configuration file example given in Appendix section (config.ini).
6) Following figure represent typical client server interaction.

Requirements
1) When client first connected to server, server should send greeting message (defined in
server.ini as ServerName) to client.
2) After client sent sender domain with HELO request server should check if this domain is
allowed to access to server from ban_domain.cfg. If domain not listed in this file server
pass next step if it’s listed it should give error message and close connection.
3) Client sends MAIL FROM to server. In this case server should check if sender email
allowed sending mail to server from ban_email.cfg file. If email not listed in this file
server pass next step if it’s listed it should give error message and close connection.
4) Client sends RCPT TO to server. In this case server should check for domain name
(defined in server.ini as DomainName) and if this user listed in users section of server.ini
file. If domain name is matched and user listed in server.ini file pass next step; if it’s user
not listed or domain not correct it should give error message and may wait other user e-
mail address.
5) Client sends DATA command to server. Server should give response code (Ex: 354 )
then client should put line by line mail messages that given to client input. Server get all
message until to reach find mail end command “.”. Then server should save mail message
into user mailbox (defined server.ini) with name YearMonthDayHoutMinSec.mbox
format (Ex: 20110510231101.mbox). Saved file should looks following format:
Return-Path: <[email protected] >
Received: from host.ciu.edu.tr ([212.175.150.10])
by db.ciu.edu.tr with SMTP
for < [email protected] >
To: [email protected]
Subject: This is test message for SMTP server
From: Example Sender< [email protected] >
Date: Thu, 12 Dec 2019 21:03:26 +0200

This is test message.

Typical Client Server interaction should given below:

S: 220 My Beautiful server <foo.com>


C: HELO bar.com
S: 250 Hello bar.com, pleased to meet you
C: MAIL FROM: <[email protected]>
S: 250 [email protected]... Sender ok
C: RCPT TO: <[email protected]>
S: 250 [email protected] ... Recipient ok
C: DATA
S: 354 Enter mail, end with "." on a line by itself
C: To: [email protected]
C: Subject: This is test message for SMTP server
C: From: Example Sender< [email protected] >
C: Date: Thu, 12 Dec 2019 21:03:26 +0200
C:
C: This is test message.
C: .
S: 250 Message accepted for delivery
C: QUIT
S: 221 foo.com closing connection

Assume that mail send to [email protected]. So this mail should put in to following location:
/data/home/20110500/smtp/bob/201912121119.mbox
APPENDIX
server.ini:
-----------------------------------------------------------------------------------------------------------------
# This is SMTP server configuration file. Its have several attributes.
# The lines begin with # accepted as comment line.
# Start for server section
[server]
# ListenIp defines listen ip address of application
ListenIp=All ; If its defined as All its listen all ip address or if defined ip address its only listen this ip
address
# ListenPort defines listening port of application
ListenPort=25

# ServerHomeDirectory defines server root directory


ServerRoot=/data/home/20110500/smtp

# ServerName defines server host name


ServerName=”My Beautiful server”

# DomainName defines default server domain


DomainName=”foo.com”

[users]
joe=/joemaildir
jane=/janemaildir
bob=/bobmaildir
#end file

ban_domain.cfg
spammer.com
pirate.com

ban_email.cfg
[email protected]
[email protected]

You might also like