Sunday, September 21, 2008

Stripping Dada Mail

DaDa Mail is a great mailer program for Unix. I use it to send newsletters to over 50,000 subscribers and it's doing it's job very well. A while ago I gave MailChimp a go. Why? Because administering sendmail and MX-records is pretty nasty task. Cross mail agent compatibility? Pfft. SpamAssassin scores? Ugh! MailChimp delivers it all, using their own templates, they create emails that are both readable by all (major) agents AND with a very low possibility of false-positive spam detection. With that said, having 50,000 subscribers with a weekly newsletter would have cost me $2,000 a month. I decided to sit down, learn SpamAssassin and Sendmail, and make my Dada look more like my Chimp.

Removing the "Mailing List Powered by Dada Mail" banner

Whenever you're sending out an email, Dada adds a banner with a link back to their site. One way to remove it, is to pay $50 (per year) and get a new set of scripts. Another is just to change configuration and get it done today.

Edit DADA/Config.pm, and update these 4 variables to zero:


$GIVE_PROPS_IN_EMAIL = 0;
$GIVE_PROPS_IN_HTML = 0;
$GIVE_PROPS_IN_ADMIN = 0;
$GIVE_PROPS_IN_SUBSCRIBE_FORM = 0;


Having your own Subscribe and Unsubscribe pages

By default, Dada configures the subscribe and unsubscribe headers (List-Subscribe and List-Unsubscribe) to point to the mail.cgi script. I suggest that mail.cgi will be blocked behind a password protected directory. There is no reason for others to know which version you have installed, or to even to brute force their way in.

For dumpr, I have a nicer subscribe and unsubscribe pages than Dada offers. It knows the logged-in user, and if it has been subscribed before.

To configure the List-Subscribe/List-Unsubcribe and List-URL headers, first edit DADA/Config.pm again. Scroll all the way down to %EMAIL_HEADERS and change the undef default to your liking. For example, my List-Subscribe now has the value of "http://www.dumpr.net/subscribe.php".

For some reason these values are never referenced when sending out emails. So, now edit DADA/Mail/Send.pm and change these lines:


$lh{'List-URL'} = '<' . $DADA::Config::PROGRAM_URL . '/list/'.$self->{list} . '/>';
$lh{'List-Unsubscribe'} = '<' . $DADA::Config::PROGRAM_URL . '/u/' . $self->{list} . '/>';
$lh{'List-Subscribe'} = '<' . $DADA::Config::PROGRAM_URL . '/s/' . $self->{list} . '/>';


To:


$lh{'List-URL'} = '<'.$DADA::Config::EMAIL_HEADERS{'List-URL'}.'>';
$lh{'List-Unsubscribe'} = '<'.$DADA::Config::EMAIL_HEADERS{'List-Unsubscribe'}.'>';
$lh{'List-Subscribe'} = '<'.$DADA::Config::EMAIL_HEADERS{'List-Subscribe'}.'>';

The problem with this method, is that it will use one set of urls for all of your newsletters. So if you have more than one on the same dada instance, you'll have to get more creative.

Creating your own html template

When Dada sends out mail, it wraps it with some bad copy about the server and the owner of the list. This information is important for CAN-SPAM and I don't encourage you to just remove it. But when it comes down to it, it's just purely ugly. Dada lets you change the layout of emails, if you want your email to be identical to the html page you're sending, just Manage Copy -> Email Templates and change both Plain Text Message and HTML Message to this single line:


[message_body]


Controlling the Subscriber List Yourself

Dada's admin page allows you to easily add and remove subscribers. You can modify the list without transmitting an opt-in email (but be nice, don't abuse this.) I like to keep a single copy of my subscribers list. Under dada_files you will find a file suffixed with .list, mine is newsletter.list. It's a simple one-email-per-line flat database of your subscribers list. To make things easier for me, I have a short shell scripts that runs once a day and creates this list-file, to contain only valid emails of subscribed users.

Additional Changes: Tracking Bounces

Since Dada is a mailer that interfaces with sendmail or with a SMTP server, it cannot be notified back when an email it just sent has bounced or found invalid. I still haven't patched Dada to handle these cases, but I'll be working on it, and when I get it done I will post the sources here.

Additional Changes: Tracking Opens & Clicks

Another thing I'm interested in when it comes to my newsletter, is tracking and better understanding how my readers get my newsletter. Will my readers click more if I post 5 images or 3? Will my open rate be higher if I choose this rather than that. MailChimp has A/B testing feature that I haven't played with yet, but as I said, MailChimp is way expensive if you have over 50,000 subscribers. I am going to use Google Analytics for this, and use Urchin Tracker to create a custom channel per each image and copy. Then I will be able to better understand which copy and layout is better than the other, and see the Goal Funnel through email clicks. I will post sources when I'm done.

Image by Warm 'n Fuzzy

6 comments:

soyuz said...

hi,

thanks for the tutorial. it helps a lot. i too had plan to use Mail Chimp or Campaign Monitor. But i can't afford their prices.

I look forward to your next Dadamail related articles.

Thanks again.

Mike Sullivan said...

Great info, and I like your style. Thanks man.

Justin Europe said...

Check out Mystery Girl:

http://dadamailproject.com/support/documentation-dada-3_0_0/dada_bounce_handler.pl.html


for bounce handling and the Clickthrough Tracker:

http://dadamailproject.com/support/documentation-dada-3_0_0/clickthrough_tracking.cgi.html

for Clickthrough Tracking

Kaskudoo said...

mh, stripping out the banner with altering the config.pm didn't work for me - i got a 500 server error after i changed the config.pm ..... however, i changed the FormatMessegas.pm and changed the lines that fill in the web address and text ...

Pioneer Skies said...

Some very good tricks!
Tnx! ;)

J0hnsmith said...

Great post, thanks.