I am developing a customized SMTP server, it is almost complete too. Other SMTP can now contact with my SMTP and I can successfully recive what they send to me. But now I am thinking is it responsibility of SMTP to store the received email OR I will have to pass recived values to any other program that stores these values(such as to,from,data) of recived emails. If so then what is that program ? If not then who will store received values, is that SMTP ??
2 Answers
What you've written is a Mail Transfer Agent (MTA). A piece of software that delivers mail to a user's mailbox is called a Mail Delivery Agent (MDA). The MDA can be a part of the MTA (that is, you can write code in your server that knows how to deliver to mbox, maildir, etc., as for instance Sendmail does), or it can be a separate program like procmail or maildrop.

- 223,387
- 19
- 210
- 288
-
From an SMTP point of view, you either relay a message or accept it at the final destination. How you do that (store in a database? Pass to an LDA? Send to the secretary's printer?) is basically site and application dependent. – tripleee Dec 28 '12 at 19:43
If you would like to model your custom SMTP server after Postfix (which happens to be the only SMTP server I have experience with), Postfix implements the storing of emails in text files using Postfix-maildrop in the mbox format located at /var/mail/[username] (in the Ubuntu/Debian universe, this is where they live anyway).
I found more details in another thread listed below: https://unix.stackexchange.com/questions/23277/where-does-postfix-store-email
Mbox format described: http://en.wikipedia.org/wiki/Mbox https://www.rfc-editor.org/rfc/rfc4155

- 1
- 1

- 1,538
- 2
- 13
- 15