ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Slackware 11.0 / 2.6.19.1 /Linux Mint
Posts: 124
Rep:
SMTP - Sockets / Specification file
Hi codrades.
I've undertaken a project in university, that(in a part) has to do with sending e-mail.
The technical part of implementation is not much of concern right now. I just want play a bit
with the smpt prot, getting aquanted with it.
Does anybody knows where can I find a spefication file on smtp protocol?
I dont mean the rfc's, available.
For example:
I wrote a simple prog in C, that works with the same logic as telneting an SMTP server.It connects to a spcific server and does nothing until it gets a 220 reply. Walking through existing API's (quit creepy) I found that the reply should be read as a LONG number...
Guess what... it didn't work! It connects but the reply was something scrappy...
Obviously I missing something... Thats why I need documentation on technical stuff like that (can I name it SMTP specification file? )
My ignorance don't let me be more specific, Im quite lost...
If anybody has gone through the same, please help a bit. Even a hint or a specific "keyword" will do.. (I know, some things cannot be explained, through forums.)
yea i can't figure out what you are saying either
i don't know what you mean reply is a long number ?
it replys a string and you have to use atoi() to get the number from the string
a snipit of code from a smtp class i wrote might help
FILE *rfp; // is the recieve socket
You can't understand SMTP without understanding the RFC's...
The heart of SMTP (and quite likely the gist of the exercise with "telnet" you mentioned) is the *protocol*. Not the networking, not any hypothetical API.
And it happens to be a *text* protocol (having nothing directly to do with "long's" or with C programs).
I agree with the previous two poster's: there's absolutely no better place to start out than with the RFC's:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.