Very impressive - that's what you call lightweight - it uses around 22 kb disk space in total!

I had to hack it a bit to get it to work on Win32, and even then it behaved slightly strangely. I had to comment out:

if((getpwuid($>))[0] ne "root") { # how is this handled on Microsoft +systems? print STDERR "You are ", (getpwuid($>))[0], " and $0 must be run a +s root.\n"; exit(1); }
as my version of Perl doesn't implement getpwuid().

Then when I ran it I got this warning:

readline() on closed filehandle main::ALIASES at smtp.pl line 77.
. I first tried telnetting to it, then I couldn't remember all the commands (just tried HELO foo) and then quit the telnet prog).

Boy, smtp.pl didn't like that! I got tons of warnings:

Use of uninitialized value in exists at smtp.pl line 107, <GEN1> line +1. Use of uninitialized value in chomp at smtp.pl line 100, <GEN1> line 1 +. Use of uninitialized value in substitution (s///) at smtp.pl line 101, + <GEN1> l
etc., you get the idea!

But, it did send e-mail. Very nice little script.


In reply to RE: An SMTP server in Perl by SuperCruncher
in thread An SMTP server in Perl by strredwolf

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.