New Install on CentOS at Digital Ocean, working great!

Use this forum for questions regarding installation, upgrading and configuration of OpenEMM

Moderator: moderator

New Install on CentOS at Digital Ocean, working great!

Postby jim_frey » Tue Jan 03, 2017 7:50 pm

I just did a new install of OpenEMM on some cloud space at DigitalOcean.com
It'd be nice if OpenEMM could be one of the one-click applications like these
https://www.digitalocean.com/products/one-click-apps/

Once I got it all set up and configured properly, it was great to be able to take a snapshot of the installation and a minute later have a second installation working that just needed some of the config files altered for the different domain name.

I have everything working, DKIM, SPF, DMARC and all.
A few notes from the install -

*************************************************************************************************************
From section 3.3 of the OpenEMM-2015_InstallAdminGuide_1.3.pdf
I am using the Internal SMTP of OpenEMM which relays to sendmail for the DKIM signing. To disable sendmail in OpenEMM you enter:
Code: Select all
/home/openemm/bin/sendmail-disable.sh

Then create a relay file so OpenEMM relays to sendmail:
Code: Select all
echo "127.0.0.1" > /home/openemm/conf/smart-relay

And I have OpenDKIM installed on sendmail

*************************************************************************************************************
From section 8.5 of the OpenEMM-2015_InstallAdminGuide_1.3.pdf
It was working on their $10 a month hosted plan, but after a while of sending emails it seemed the 1G of memory wasn't enough (Java wants more.) So now I have it at the $20 a month plan with 2G of RAM and so far so good.

*************************************************************************************************************
From section 13.3 of the OpenEMM-2015_InstallAdminGuide_1.3.pdf
I couldn't get 13.3 part A to work, but I think that's because the OpenEMM SMTP is picking up the mail and not sendmail so the /etc/alias file isn't used. I was able to get 13.3 part B to work which is pretty simple. Create the file -
Code: Select all
/home/openemm/conf/bav/bav.conf-local

With the information of the relay address you want to use
Code: Select all
noreply@mydomain.com alias:ext_1@mail.mydomain.com


*************************************************************************************************************
For the unsubscribe embedded link in the email header
change the file
/home/openemm/conf/semu/semu.cfg
To include the proper url of an unsubscribe link which I create at
Code: Select all
uri: http://www.mydomain.com/form.do?agnCI=1&agnFN=remove

That link is created by making a form in OpenEMM which subscribes the email with a status of zero (so it's actually unsubscribing)
The form name is "remove", it has no action, and it looks like this
Code: Select all
<html>
<head>
<title>Remove</title>
</head>
<body>
<p>
<form action="form.do" method="post">

<input type="hidden" name="agnCI" value="1">
<input type="hidden" name="agnFN" value="removedone">

<input type="hidden" value="1" name="agnMAILINGLIST">
<input type="hidden" value="0" name="agnSUBSCRIBE">

<b>Enter your email address to be removed</b><br>
<input type="text" value="$!requestParameters.email" name="EMAIL" size="30"><br>

<input type="submit" value="submit">

</form>
</p>
</body>
</html>


Then there is the form "removedone" that has the action of "Subscribe"
The "removedone" success form just says "You have been removed."
The "removedone" error form just says "You are not on the list."

The action of "Subscribe" looks like this, you will need to adjust this for which list numbers you want to have the email address unsubscribed from
Code: Select all
    ##unsubscribe script for more mailinglists

    ##set Company ID
    #set($company = 1)

    ##Check the availability of the customer
    #if($customerID != 0)
      $BindingEntry.setCustomerID($customerID)

      ##define second mailinglist
      $BindingEntry.setMailinglistID(3)

      #if($BindingEntry.getUserBindingFromDB($company) == true)
         #if($BindingEntry.getUserStatus() == 1)
           $BindingEntry.setUserStatus(3)
           $BindingEntry.setUserRemark("Opt-Out by Script")
           $BindingEntry.updateBindingInDB($company)
           #set($result1="checked out from list B")
         #else
           #set($result1="not active on list B")
         #end
      #else
         #set($result1="without binding to list B")
      #end

      ##define third mailinglist
      $BindingEntry.setMailinglistID(4)

      #if($BindingEntry.getUserBindingFromDB($company) == true)
         #if($BindingEntry.getUserStatus() == 1)
           $BindingEntry.setUserStatus(3)
           $BindingEntry.setUserRemark("Opt-Out by Script")
           $BindingEntry.updateBindingInDB($company)
           #set($result1="checked out from list B")
         #else
           #set($result1="not active on list B")
         #end
      #else
         #set($result1="without binding to list B")
      #end

    #else
      #set($result="not a customer of our mailings")
      #set($result1="not a customer of our mailings")
    #end

    ##necessary for a successful result
    #set($scriptResult="1")


*************************************************************************************************************
Also change some of the email header formats to match your domain
Open the file
Code: Select all
/home/openemm-2015/webapps/openemm/WEB-INF/classes/emm.properties

Change the settings on:
Code: Select all
system.url=http://www.mydomain.com
mailgun.ini.domain=mydomain.com
mailgun.ini.mailer=My Company Name


*************************************************************************************************************

I hope my notes might help someone else too. And who knows, maybe Digital Ocean can have OpenEMM as a one click install someday soon too!
OpenEMM Moderator
jim_frey
 
Posts: 113
Joined: Wed Nov 29, 2006 11:32 pm
Location: Middle Caicos, Turks and Caicos Islands

Re: New Install on CentOS at Digital Ocean, working great!

Postby jim_frey » Wed Jan 11, 2017 12:59 pm

It's also a good idea to add in a crontab that deletes the archives of the daily mailings, otherwise they just fill disk space.

Open crontab to edit
Code: Select all
crontab -e

Add in this line
Code: Select all
0 1 * * * rm -rf /home/openemm/var/spool/ARCHIVE/$(date +'\%Y\%m\%d' -d "yesterday")
OpenEMM Moderator
jim_frey
 
Posts: 113
Joined: Wed Nov 29, 2006 11:32 pm
Location: Middle Caicos, Turks and Caicos Islands

Re: New Install on CentOS at Digital Ocean, working great!

Postby jim_frey » Wed Jan 11, 2017 1:15 pm

And create a init.d file so you can start and stop openemm by just calling
Code: Select all
service openemm start
service openemm stop


create the file /etc/init.d/openemm (thanks to another forum post for this one)
Code: Select all
#! /bin/sh
#
# chkconfig: 345 80 20
# description: OpenEMM server
# processname: openemm
#
# System startup script for OpenEMM
#
openemmbin=/home/openemm/bin/openemm.sh

case "$1" in
    start)
        echo -n "Starting OpenEMM"
        su - openemm -c "$openemmbin start"
        ;;
    stop)
        su - openemm -c "$openemmbin stop"
        ;;
    *)
        echo "Usage: $0 {start|stop}"
        exit 1
        ;;
esac
OpenEMM Moderator
jim_frey
 
Posts: 113
Joined: Wed Nov 29, 2006 11:32 pm
Location: Middle Caicos, Turks and Caicos Islands


Return to Installation & Upgrades

Who is online

Users browsing this forum: No registered users and 2 guests

cron