For Programmers: Free Programming Magazines  


Home > Archive > Unix Programming > October 2007 > looking for small SMTP lib?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author looking for small SMTP lib?
J de Boyne Pollard

2007-10-30, 7:12 pm

RW> Below is a part of a 'mail sending script' used for
RW> some time on the appliances I mostly work for:
RW>
RW> cd $temp
RW> printf "HELO lamer\r\n" >header
RW> printf "MAIL FROM: %s\r\n" "$addr" >>header
RW> printf "RCPT TO: %s\r\n" "$addr" >>header
RW> printf "DATA\r\n" >>header
RW>
RW> printf ".\r\nQUIT\r\n" >trailer
RW>
RW> cat header - trailer | nc "$server" 25
RW>
RW> It should be easy to adapt this for C.

JdeBP> ... and when you do, remember to fix the several bugs that it
JdeBP> has. [...]

RW> The point of this script was to send a mail to a
RW> particular mail server. Which it did.

It does not operate correctly. I pointed out the several problems,
one of which would corrupt messages and two of which are egregious
security holes that can potentially be exploited to create an open
relay, in the portion of the message that you skipped over above.
(There's a third security hole that I didn't point out, but that
people familiar with PHP scripts that send mail from web forms should
be familiar with.) The script simply does not implement the protocol
at all.

RW> This is called 'a quick hack', a concept you
RW> don't seem to be familar with.

I see that once again you have resorted to accusing the poster when
you lack any technical foundation for discussing the subject at hand.
A correct description for what you have above is not "quick hack", but
"yet another half-baked and incorrect SMTP client that contributes to
furthering Gresham's Law". It is an SMTP client that is broken and
should not be used, especially not as a model for other people to
develop SMTP clients of their own from.

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com