Tuesday, June 3, 2008

More Recognition For Readers' Suggested Improvements On Earlier Scripts

Hey There,

Today, I thought we'd take some time out to recognize folks on all the different boards and networking sites who've made excellent suggestions for improvement on some of the shell/Perl scripts and one-liners we've put out here over time (We've posted these before, usually in the form of updates to previous posts, which may or may not get any more attention than this, but the suggestions for improvement were welcomed warmly, and instated gladly, as they are today).

Firstly, I'll comment on the "no-comment" policy of this blog. It has nothing to do with conflict avoidance, as we check the boards regularly and have, even before this, made significant changes to posts based on user feedback. The problem is with the place that hosts our blog (guess? ;) and comment-spam. It was determined, after enabling it for a few days a few months ago, that we were getting slaughtered with CAPTCHA-savvy spam posts about various "escort" services, which directly conflicted with our insistence that the blog contained absolutely no "adult" content.

It was decided, instead to create a forum where people could sign up and leave remarks. But, even though it's still around, that still seems a little too close to opt-in mailing list tactics, and we wanted people to be able to comment without fear of having their information sold or used by any third-party hosting the forum (although I don't believe they do this as I never receive any mail from them about anything ;)

The next step was to plaster our main email (eggi@comcast.net) on every script so that any user could email us, and any spammer could spam us, without it causing a problem with the blog host. We also check "talkbacks" and comments from posts of our posts on other sites whenever we get the chance.

With that in mind, we'll get on to the first suggested improvement made by folks via email and on the boards over at linuxtoday.com, LXer.com and fsdaily.com (There are others out there, that we'll be giving propers to, and, hopefully, for those remaining out there, we'll find them eventually, also :). Since our policy regarding privacy is to regard everyone's privacy as sacrosanct, no names will be mentioned unless specifically requested, and if nicknames and/or screen-names have been used in "talkbacks" we'll only indirectly refer to them by referring back to the original "talkbacks" which are already out there.

Our first improvement was brought to our attention via email regarding our post on using the bash shell to send mail. While, the systems we tested on worked well with the published script, this alteration made the program work more consistently and reliably on a number of different flavours of Linux (while maintaining on the already-tested versions), including Cygwin for Windows:

exec 9<>/dev/tcp/$mailserver/25
echo "HELO $domain" >&9

was changed to add an additional "read" in case the file-descriptor buffer backed up and needed to be flushed of the initial mailserver connect message, so that the following HELO would get picked up okay and the script wouldn't sprint ahead of itself.

exec 9<>/dev/tcp/$mailserver/25
read -r temp <&9
echo "$temp"
echo "HELO $domain" >&9

and, near the final part of the script, where the data gets sent, the script was modified from:

cat $mailtext >&9
echo "." >&9
read -r temp <&9


cat $mailtext >&9
echo -e ".\r" >&9
read -r temp <&9

since Cygwin (for one) wasn't accepting the single line "dot" finale with a standard echo newline.

It should also be noted that this problem could not be fixed on a number of Linux and Unix flavours, since the default bash file system did not come with the /dev/tcp and /dev/udp pseudo-filesystem compiled in. I believe Ubuntu is one such distro. And, they're not doing anything "wrong" by not including it by default. Technically, although it's fun to goof with, this functionality raises some legitimate security concerns.

Over the course of the next few posts (interrupted by more spurts of semi-original thought ;), we'll be posting other significant suggestions and improvements.

And we'll end today's post with a big "Thank you" to anyone and everyone who's helpful criticism has added fresh perspective to this blog and, more significantly, provided better help for the folks who use it as a place to stop by and dig on some useful information :)


, Mike