Page 1 of 1

Nice App - New install tweaked with perl for apache

Posted: Thu Jan 11, 2007 11:52 pm
by jim_frey
I installed OpenEMM on a CentOS 4 machine. I first installed http://www.webmin.com then OpenEMM and I had no problems. OpenEMM was actually one of the easiest open source applications I've ever installed. The instructions are very well written.

I did run into a problem when I started to send out test emails from OpenEMM. With the default install, OpenEMM sends tracking links over port 8080. So when an email is sent to a Yahoo email, and a person clicks on a link in the email, Yahoo throws up a warning about the link because it might be harmful because it's not a "normal" link.

The solution would be to change OpenEMM to use port 80 and avoid the warning message, which is easy to do. There are full instructions on how to do it, but then you can't run apache on port 80... (or if someone knows how to make the two work together well, please let me know.)

So instead of changing OpenEMM's port, what I did was just change the redirect link to go to http://www.duncecapjokes.com/cgi-bin/r and then I just have a little perl script there that redirects people to http://www.duncecapjokes.com:8080/r?uid=xxxxxx

This way I can run apache on port 80 and OpenEMM on port 8080 and not have the warning messages come up anymore. People just get automatically redirected from the perl cgi script over to the OpenEMM script. I can see that I need to write a few of these perl scripts if I want to take full advantage of this idea. Does anyone else have a better solution? This is just something I came up with as a quick patch.

Thanks for a really nice application, I have it running http://www.duncecapjokes.com sending out about 17k emails a day and it's working great.

Thank you!

Posted: Fri Jan 12, 2007 9:33 am
by maschoff
Hi Jim,

thank you for your warm words and for posting your hint!

Posted: Tue Jan 23, 2007 10:03 pm
by jim_frey
Here's where I'm at with the code for "r"

Code: Select all

#!/usr/bin/perl -wT

# use strict;
use CGI qw/:standard/;
my $thisenv = $ENV{'QUERY_STRING'};

# Create a user agent object
use LWP::UserAgent;
$ua = LWP::UserAgent->new;
$ua->agent("MyApp/0.1 ");

# Create a request
my $postaddy = 'http://www.spidercement.com:8080/r?'.$thisenv;
my $req = HTTP::Request->new(POST => $postaddy);
$req->content_type('application/x-www-form-urlencoded');
$req->content('query=libwww-perl&mode=dist');

# Pass request to the user agent and get a response back
my $res = $ua->request($req);

print redirect($res->header('location'));