Half-Elf on Tech

Thoughts From a Professional Lesbian

Tag: email

  • Google Apps Ain’t Free

    Google Apps Ain’t Free

    gmaildollarA lot of my friends tout Google Apps for email. I use them on three sites, mostly as an experiment.

    Google Apps for Business isn’t free anymore. You used to be able to go to their pricing and click on free to set everything up for a few users. No more.(Irony, Google Apps doesn’t accept Google Checkout for currency.)

    What does this mean? Well a lot of people will have to run their own mail servers again. It’s not surprising to me, given how hard Google had been making it to find the free version, but it is a bit of a dick move to say “And now we’re charging.” I would have thought dropping the number of free from whatever it is now to five, or even one, email account would have been better. Actually, what would be great is if Google had a just email domain mapping you could do, but they don’t.

    This sucks a lot for a lot of people, including me as I was thinking it’d be nice to have all my friends who are hosted here using Google for email – they know it and are used to it.

    ETA: As Otto pointed out, the no-longer-free is only for new people. Anyone with an existing account is fine. So don’t make any more domains! (And now we see how IP addresses will last…)

  • Google Apps

    Google Apps

    Google AppsI don’t like Google very much. However when my grandmother had a request for something to be added to her website, I realized Google’s email would actually be much easier for them, especially since her domain, taffys.org, is mapped to this server as a part of my Multisite network. Oh, it’s not terribly hard to make emails for her, but she wanted someone local to do that.

    There’s a minor story behind that, but the shortest version is she’s doing some totally awesome not-for-profit work with Parkinsons patients. One of the things she wants is an email, used by many people, to ‘collect’ messages like ‘I’ll be there.’ While I could do this on my site, it’s actually easier to get this up on Google, where I can tell people login to go to http://mail.google.com/a/taffys.org or http://mail.taffys.org and it’s something they know.

    I chose to do this by command line, for the experience. If I wanted to do it via cpanel and WHM, you’d go in to edit the DNS zone for the server and add in the mx records.

    MX Records

    The command dig mx taffys.org tells me what I have right now, which I knew was self referential.

    ; <<>> DiG 9.3.6-P1-RedHat-9.3.6-20.P1.el5_8.5 <<>> mx taffys.org
    ;; global options:  printcmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 20605
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 1
    
    ;; QUESTION SECTION:
    ;taffys.org.			IN	MX
    
    ;; ANSWER SECTION:
    taffys.org.		14010	IN	MX	0 taffys.org.
    
    ;; AUTHORITY SECTION:
    taffys.org.		78943	IN	NS	ns1.ipstenu.org.
    taffys.org.		78943	IN	NS	ns2.ipstenu.org.
    
    ;; ADDITIONAL SECTION:
    taffys.org.		6943	IN	A	50.28.84.96
    
    ;; Query time: 11 msec
    ;; SERVER: 69.167.128.254#53(69.167.128.254)
    ;; WHEN: Tue Nov 13 08:09:06 2012
    ;; MSG SIZE  rcvd: 104
    

    Looks like that for all my stuff. Okay, no problem, I go in and edit /var/named/taffys.org.db and find this:

    taffys.org. IN MX 0 taffys.org.
    

    Change it to this:

    ; Original
    ; taffys.org. IN MX 0 taffys.org.
    
    ; Gmail
    taffys.org.             14400   IN      MX      10 ASPMX.L.GOOGLE.COM.
    taffys.org.             14400   IN      MX      30 ASPMX2.GOOGLEMAIL.COM.
    taffys.org.             14400   IN      MX      20 ALT1.ASPMX.L.GOOGLE.COM.
    taffys.org.             14400   IN      MX      30 ASPMX4.GOOGLEMAIL.COM.
    taffys.org.             14400   IN      MX      30 ASPMX5.GOOGLEMAIL.COM.
    taffys.org.             14400   IN      MX      20 ALT2.ASPMX.L.GOOGLE.COM.
    taffys.org.             14400   IN      MX      30 ASPMX3.GOOGLEMAIL.COM.
    

    And then I ran /usr/sbin/rndc reload taffys.org to refresh it. But ... wait. Why does it still say I'm on taffys.org? Per usual, I didn't bother to change my TTL. As everyone always reminds me, if you make a change to DNS without lowering your TTL values, you're gonna have a bad time. Since I'm (rarely) in a rush for this stuff, meh. Besides, it takes 24-48 hours from changing TTL for it to be usable, and then I can make my change. Followed by waiting again, and then changing it back? DNS is pretty zippy these days. 72 hours max, and usually less, so I just don't.

    While I waited on that, I went ahead and made a Google Apps account for taffys.org. When you go to Google Apps they only show you business and education. I'm neither (though I suppose what I'm doing for Taffy would be non-profit). Really they're trying to sell, which makes sense. If you go to their pricing model, you'll see the free option. Unless you're running a business, click that.

    The rest of the directions are really straight forward, and Google shows you what to do. It's really just set up the account stuff from there out. The directions to make mail.yourdomain.com are under Create a custom web address.

    If you want to do it with a GUI, it's even easier. I went into my DNS management setup on cpanel and did this:

    Will I do this for other domains? Maybe. I think I'll be doing this for hosting going forward, since the people I host rarely (ever?) use cPanel. Congrats, Taffy! You're the first! Liv's the second.

    Now I have to fix up Taffy's site.

  • Contact Form 7 and Anti-Spam

    DreamHost has a fairly simple anti-spam policy, which can be summed up as this: You cannot send email from an address that isn’t your domain.

    If that was greek to you, don’t worry. What that means is that my WordPress blog here can only send emails as elftest.net. That poses a small problem if you’re not using your domain-name to send email (a rare occurrence in WordPress), and a large one if you happen to be using the popular Contact Form 7 plugin.

    Contact Form 7 lets you create robust contact forms for your site, however it has one minor ‘flaw’ (and I hesitate to use that word). When it sends email, it sends it from the user who submits the form. DreamHost, naturally, doesn’t like this. joe@gmail.com isn’t an elftest user!

    Thankfully there’s a work-around for you, and it’s really easy. For most people, the plugin SMTP Configure, once installed and activated, will automatically fix this for you! It’s written by a reliable and trusted programmer, and I highly recommend it. Remember! Once you install the plugin, just activate it. For the vast majority of people, this was it. Everything magically worked.

    Then there were some people who came and said “No, this does not work.” I’ve yet to reproduce it, but one person told me that after putting in his SMTP credentials, just like you would setting up email clients, it worked perfectly.

    Additional: If you’re using Jetpack’s contact form, and you’ve changed the ‘to’ email address, you will also need this plugin. You’ll know you’re using that option because you’ll see this in your contact form shortcode:

    to="me@myotherdomain.com"
  • Mailman Newsletter Widget

    Mailman Newsletter Widget

    I read How to Add a Newsletter Signup Box After Your Posts by Brian Gardner and thought to myself “Self,” I said, “I really would love to be able to add a signup widget for my mailman newsletter.”

    And so I did. The following code is plain HTML. Just drop it into a text widget wherever you want it to show up, and magically it will. If you’re using a Genesis theme, this is your replacement for Step 3.

    &lt;div id=&quot;newsletter&quot;&gt;
        &lt;div class=&quot;white-border&quot;&gt;
            &lt;div class=&quot;newsletter-wrap&quot;&gt;
                &lt;h4&gt;Newsletter&lt;/h4&gt;
                &lt;p&gt;Get my awesome newsletter!&lt;/p&gt;
                &lt;form action=&quot;http://example.com/mailman/subscribe/newsletter_example.com&quot; method=&quot;post&quot; id=&quot;mc-embedded-subscribe-form&quot; name=&quot;mc-embedded-subscribe-form&quot; class=&quot;validate&quot; target=&quot;_blank&quot;&gt;
                &lt;input type=&quot;email&quot; value=&quot;&quot; name=&quot;email&quot; class=&quot;email&quot; id=&quot;mce-EMAIL&quot; placeholder=&quot;Email Address&quot; required&gt;
    			&lt;input name=&quot;pw&quot; type=&quot;password&quot; class=&quot;password&quot; id=&quot;mce-PASSWORD&quot; placeholder=&quot;Enter Password&quot; required&gt;
    			&lt;input name=&quot;pw-conf&quot; type=&quot;password&quot; class=&quot;password&quot; id=&quot;mce-PASSWORD&quot; placeholder=&quot;Confirm Password&quot; required&gt;
    			&lt;input type=&quot;hidden&quot; name=&quot;digest&quot; value=&quot;No&quot;&gt;
                &lt;input type=&quot;submit&quot; value=&quot;Sign Up&quot; name=&quot;subscribe&quot; id=&quot;mc-embedded-subscribe&quot; class=&quot;button&quot;&gt;
                &lt;/form&gt;
            &lt;/div&gt;
        &lt;/div&gt;
    &lt;/div&gt;
    

    One important thing to note here, I wanted everyone to get the emails as they happened, no digest, so I set this: . If you want to make it an option, the down and dirty way is to use this:

    Digest: &lt;select name=digest&gt;
    &lt;option value=1&gt;Yes&lt;/option&gt;
    &lt;option value=0&gt;No&lt;/option&gt;
    &lt;/select&gt;
    

    The rest is pretty much Brian’s CSS, tweaked a little since my size requirements were different. Don’t change the ‘name’ values, as it makes Mailman cry. And how does it look?

    Looks nice, don’t it?

  • Make An RSS Powered Email List

    Make An RSS Powered Email List

    Sometimes the problems we have are insanely more complicated than they should be, because our heads get trapped in a space they shouldn’t be. For years, I used FeedBurner to manage my RSS feeds. Then I realized I didn’t care that much, I didn’t need to know who was accessing my feeds, and really the only benefit was that I could put ads in my feeds (which … no one clicked on anyway) and 12 people could subscribe via email. Well, with some research I found that I could put ads in my feeds with some WordPress functions (I’ve since removed them) and I could use Subscribe2 as a plugin to email when I had new posts. Don’t get me wrong, I really like Subscribe2 except I didn’t like the interface. It’s on the back end of WordPress. My site is a BuddyPress site. Everything is on the front end for my users, and I like it that way. It all looks ‘branded.’ The plugin dev was, fairly, under the idea of ‘Works how I want it.’ I thought about forking, but as I looked at the code, I thought that I really didn’t need WordPress to handle this. I needed a way to email an RSS feed to a mailing list. A proper, opt-in, stable, mailing list, that wouldn’t affect my blog while processing.

    I found an answer that can be applied to any site, WordPress or not.

    What?

    The problem:
    I have an RSS feed I want to be able to email to people who don’t like RSS, and I don’t want to use FeedBurner, MailChimp or any external process.

    The solution:

    • Setup a MailMan list for your emails and configure as needed
    • Install and configure rss2email
    • Setup a cron job

    Why?

    Why not use [this product]? When I presented this to people the first thing they said was ‘Just use FeedBurner!’ or ‘Use MailChimp!’ I get that I can use those third-party vendors, but I don’t want to. I like to self-host because then, if things go wrong, I have the ability to do something about it. This is also how I increase my IT toolkit. I have a need, I find a solution. Sometimes I write the code, and sometimes I just master a new tool.

    Why Mailman? Mailman (or properly GNU Mailman) is installed on my server and while it may be old, the current stable version is 2.1.14, and that came out September 2010. It’s still updated, maintained and supported. And it works. I’m familiar with it, I’m comfortable with it, and there’s no reason not to. I did experiment with phpList, which claims to be able to handle RSS feeds as ‘source’ on it’s own. The problem, as my Twitter buddy @JohnPBloch warned me, is it’s not friendly. He said “I don’t care much for phpList. I always felt like the software was working against me instead of with me.” And he’s right. It took 5 minutes of setup for me to gag and delete it.

    Why rss2email? I don’t think RSS is dead. In fact, I still prefer it to email (or Twitter). My unread RSS list (currently run via Google Reader) sits, quietly, patiently, waiting my attention. I don’t get spam or junk feeds, and if I decided to mark all my Fail Blog feeds as read without reading them, no one knows but me. I don’t have to reply to anything, and I can go back to using my email for communication. That said, I know a lot of people who like to get updates in their email, so I have to take that into consideration when running a site. Sometimes, when you make a site, you cater to yourself. Sometimes you cater to your audience.

    Why cron? I’m on Linux. That’s what you do when you want to schedule things.

    How?

    Bear in mind that my details are going to be specific to my situation.

    Mailman is the easiest. You make a mailing list. I wanted an announcement mailing list, so under Privacy options -> Sender Filters I set up that all users were moderated by default and to discard their emails. Then added my email under “List of non-member addresses whose postings should be automatically accepted.” I knew I was going to have emails sent from a specific address, and I didn’t want that address to GET the emails, so by putting it on that list, I don’t have to worry about approving posts. That’s pretty much all the ‘special’ customization I did. If I’d wanted to put a reject to other people’s emails to the list, instead of a discard, I’d have added this “This is an announcement only list. Your post has been rejected.”

    rss2email was the hardest, but only because it was new. The install process is really straightforward. I made very minor tweaks to the config.py file, based on a first run when I realized that my mailing list would strip HTML. I set HTML_EMAIL and USE_CSS_STYLING to 0 to get it all to plain text. I changed my DEFAULT_FROM and OVERRIDE_FROM to ‘pretty’ versions of my domain information. Then I had to customize my SMTP stuff, since it requires authentication and is on a special port (not 25).

    cron was the most surprising. Since I have to run rss2email out of the same folder it’s in (Python…) I wrote a quick shell script called rss2email.sh that has two steps. It changes directory to my install of rss2email and then it calls the command ./r2e run. Then I called it with a twice-daily (0 and 12) cron job with /home/USERNAME/rss2email.sh and it’s done. I’m not going to give you a blow by detail on how to do cron stuff. It’s way too complicated to try and overview here.

    Satisfied?

    Pretty well. I’m still massaging the output a bit. The HTML output of a full RSS entry was weird. After changing my WordPress feed to excerpts, I ended up with some weird lines in my emails:

    This was caused by some old functions I had in my theme to insert ads into my feeds (mentioned above). I took that out, called ./r2e reset to clean out the database, and then re-ran the script. Worked fine! I admit, I had some moments where I didn’t like putting the excerpt in. I use a custom crafted excerpt in every single post on this site as part of my layout, and while I prefer to avoid ‘read more!’ type things in my feeds, I realized my custom excerpts would be ‘good enough’ for anyone who cared. I do wish WordPress would make two feeds, one excerpt and one none, but that’s a job for another day. At least I’ve managed to semi-customize my Mailman digest header (via manually editing masthead.txt).

    After all my testing, I deleted the mailing list and reset everything, did a clean build, and voila! Works like a champ, without putting extra stress on things!

  • Filtering Emails via cPanel

    Filtering Emails via cPanel

    Sometimes you get emails that you just don’t want to read. Maybe it’s a person you like who’s driving you batshit. Maybe it’s someone who’s actually harassing you. If you use Gmail, you can filter emails and they go into a folder or your trash-bin, and you don’t have to read them ever again! If you self-host, though, the steps are a little different.

    The first thing I do is make a new folder to hold these emails. I have some filters set up to auto-turf spam and viruses. But for people who harass me, I like to save their emails for review and reporting. Yes, I report them to the authorities when needed, and I save them so I can have their IP and routing info. Because of that, I have a built in folder on my email accounts for ‘Harassment.’

    Obviously you can teach your email client how to do this, and there are tutorials galore about how to get Mail.app, Thunderbird and Outlook to filter emails. But me, I like to have the filter happen before I open my email box, so I don’t have to even consider it.

    Once you’ve made the folder, go into cPanel and click on User Level Filtering. This allows you to make a filter per-email on your server. If you want to filter all emails for all emails on your account, there’s Account Level Filtering, which I use for the aforementioned spammers and virus senders. Also for all mail in non-English encoding. I’m hopelessly mono-lingual.

    Next, select the account you want to add the filter for. This one is pretty obvious, no?

    This screen will show you all your filters. I happen to have an existing one to filter someone’s constant requests for information. Since we want to create a new filter, click the Create a new Filter button.

    Now we’re getting started! Give the filter a useful name. I used ‘Harassment’ since I’m going to be adding in all the emails who harass me, and just dump them into one folder. The email I’ve added is one someone made up. It’s not real so don’t bother spamming it. There are a lot more options under the Rules section, but this one is pretty straightforward for me. I want all emails from jorjafox@gmail.com to be dumped into Harassment.

    Actions, which is just below the rules, is where you decide what happens. You can have multiple actions, the default of which is to discard the email. This means it gets deleted. You never see it. I don’t want this, I want to Deliver to Folder

    Once I’ve picked the action, I have to actually tell it which folder. This is where I pick Harassment.

    Put together, the whole thing looks like this:

    There are a lot more actions you can perform. One of them is NOT ‘Mark as Read’, which annoys me sometimes since my mail app will show my unread count, and I like to keep that low. I have no more than 10 emails, total, in my many inboxes at any one point in time, and the only ones unread are ones I have yet to answer or action (i.e. I have to do something before the email’s ‘done’). You can, however, add as many emails as you want. Just make sure you use OR and not AND for the emails.

    Once you’re happy with your settings, click activate and you’re done! Now that annoying person will be chump-dumped into a folder and stop cluttering your inbox!