Differences between revisions 17 and 18
Revision 17 as of 2009-01-14 22:57:25
Size: 3292
Editor: fenris
Comment: goodbye Frame parser
Revision 18 as of 2009-01-14 22:59:27
Size: 3291
Editor: fenris
Comment: goodbye Frame parser
Deletions are marked like this. Additions are marked like this.
Line 5: Line 5:
<div style="float: right;"> <div style="float: left;">

2008-07-31 12-35 Should have used my own script

image.png

Okay, this probably won't increase our share price or make us look like these really cool people (that we actually are), but here's a story from the real world. I and Jani were talking about our Summer Campaign and it seemed that Apple's Mail.app didn't send the email to all the intended recipients. So, we decided to complete the mission with a quick script. But which one of us could do it quicker? I started modifying a Python script and Jani decided it would be a better idea to make a simple shell script. Few seconds (oh well okay, it was minutes) later Jani won with this:

myerr() {
 echo $* 1>&2
 exit 1
}

PATH=$PATH:/usr/sbin
[ $# -eq 2 ] || myerr  "Usage: $0 <emailaddress-file> <content> "

while read emailaddress
do
 (echo To: $emailaddress; cat $2) | sendmail $emailaddress
done < $1
{{{#!html
</div>

I came a good second with this one:

import sys
import time
import smtplib

me = "sales@clarifiednetworks.com"

text = open("test-what").read()
addresses = open("test-who").readlines()

for line in addresses:

    msg = ""
    msg += 'Content-Type: text/plain; charset="iso-8859-1"\n'
    msg += 'MIME-Version: 1.0\n'
    msg += 'Content-Transfer-Encoding: 8bit\n'
    msg += 'Subject: Summer Campaign at Clarified Networks\n'
    msg += 'From: %s\n' % me
    msg += 'To: %s\n' % line
    msg += 'Cc: %s\n' % me
    msg += 'Reply-To: %s\n' % me
    msg += "\n" + text
    print "sending mail to " + line

    s = smtplib.SMTP()
    s.connect()
    s.sendmail(me, line, msg)
    s.close()
{{{#!html
</div>

So, I sent the group email (also known as spam) with Jani's script, but I forgot to edit the default Subject: line which was hardcoded in my own script. So now a good number of people will receive email from Clarified Networks titled "final test". How professional is that! Well, maybe it's the final test before our big release of Clarified Analyzer (artist previously known as Tia) in two months.

Anyway... The campaign is really cool! Please send us email to contact@clarifiednetworks.com if you want to be a part of it. Let's just say that the winner will get utterly cool prizes that will make you look and feel good while analysing your network.

Disclaimer: We are not part of the coder team, they actually know how to do this stuff.

Have fun,

-- jyrki 2008-07-31 12:56:11

No no no, it was actually 'final test' before sending the actual spam. :) We take everything seriously. We even don't send spam before we test it thoroughly. We will soon send the actual mail. We wanted to test our script with as realistic material as possible, so our actual mail will just have different subject.

-- jani 2008-07-31 13:08:51

This is a perfect example what happens when corporation does not concentrate on it's core competence. This service could easily have been outsourced to Russia.

-- jani 2008-07-31 13:20:35


return to the blog ...