Half-Elf on Tech

Thoughts From a Professional Lesbian

Tag: email

  • Review: Spark Love for Your Gmail

    Review: Spark Love for Your Gmail

    Moving my email to Google Apps has, thus far, been interesting. I don’t regret it, and consolidating multiple emails down to three was a good choice. The learning curve of adding in email aliases so I can mail from all the accounts I use, and the limits of Gmails shitty filters so everything is funneled to the right place, has been tricky.

    As I mentioned before, I have a ton of aliases. Adding them in on the Google Admin back end (just renamed G Suite) is weird but easy enough. To be able to email from them, you have to also add them in via the normal Gmail web app. It’s tucked under Settings > Accounts, and under “Send mail as”, click Add another email address.

    But if you don’t want to use the web app (and I don’t), Gmail can be a bit of a turd. It doesn’t work great with the desktop Mail.app, and it works terribly with iOS’s mail. Gmail and Apple are just at odds with how email works. They both want to control your experience and redefine email in different ways. Frankly I prefer the Mac way, but that’s personal preference.

    What is a universal problem is that I needed a way to email from my aliases, and if you set up email as Google Mail in the iOS mail app … you can’t.

    Yes, you read that right. It is flat out impossible to set up email aliases for a Google mail account. If you want to use the iOS mail app and Goggle email and aliases, you have to set up Gmail as an IMAP app, and that’s sort of a shit show in the making. Gmail’s IMAP implementation is non-standard, to put it simply. Among other things, you can only use 15 connections to IMAP per account. If I had the desktop app open and my iPhone and iPad, weird shit happened.

    Now, there are solutions. You could use the Gmail app, but it sucks and doesn’t have an Apple Watch component. Also it’s ugly. Excuse me. It’s basic. You could also use Google’s Inbox app, but you have to use Inbox and the email filters aren’t as robust.

    This leads us to our final solution. Spark.

    This app was something I’d played with before, as it had email alerts on the Apple Watch, and I wanted to get pinged for some work emails while updating all DreamPress installs over at DreamHost. Sadly, the fault of the app not meeting that need is Gmail, again, which has no way to filter properly and send an alert only when an email meets specific criteria.

    What Spark does do is everything else. It has a Watch component, it syncs between my iPad and iPhone, it looks like an iOS app, it acts like a Google app, it pulls in the features people rave about Inbox, and it has email aliases that are simple to set up. Whew. The only thing it doesn’t do is show me a count for unread messages in my folders.

    I can live with that.

  • Moving cPanel email to Gmail

    Moving cPanel email to Gmail

    There should be a collective gasp here.

    It’s no big secret I dislike Google. I don’t trust them at all. I think Cory Doctorow’s story Scroogled is pretty much on the ball. But I also have been struggling with handling my server’s email and spam situations and if there’s one thing Google has turned out to be pretty good at, it’s spam. Also having my email separate from my hosting means if the site goes down, I’ll still get emails… Which is sort of important.

    So I bit the bullet, sorted out I needed to pay for three emails (making it $15 a month) and a boat load of secondary domains and filters. Since I’d dropped the cost of my hosting by $20 a month, this worked out alright.

    The Setup

    This part is the easy one. Go to https://apps.google.com and put in your information. If, like me, you have multiple domains, pick one to be your ‘master’ domain. I chose ipstenu.org because that’s my main domain in Multisite and there’s some parity going on here. Since this is geared to businesses, you do need to give your business a name. Sorry.

    Next you’ll pick your users. Like I said, I have three: Me, my wife, and my admin account. Why does admin need it’s own account? It doesn’t. But it might. For now I had them email me at my personal gmail (I can always resend later) since I don’t want them to be alerted to things just yet as I planned to import all their old email.

    Finally it does the “Verify your domain and set up email” step. Which failed. And took 50 minutes. Unfunny. Originally I did the TXT domain setup, and when that failed I did CNAME. Longest ‘about 50 minutes’ ever. And that failed too. Finally I did the damned ‘file verification’ which was ridiculous and stupid but that worked and it still took another 50 minutes to set up my emails.

    Eventually, after talking to Google, my web host, and my domain registrar, it turned out there was a glitch in my domain servers… There was no A record for my nameservers. Thank you Carol, Samuel, and Tatyana for helping that one.

    Migrating Data

    I mentioned I have three accounts. They have around 30 megs of email each. But I also have secondary accounts which are basically the same accounts only not… And to be honest I don’t know why I have so many. This was a chance to combine everything, so I set up those three accounts and then I used the IMAP importer to pull in everything. And it worked. That simple.

    Configuring Accounts

    Now that I have three accounts, I needed to add in my ‘other’ emails. I have a lot of weird aliases. I used to have separate accounts for each email but … well that’s a pain in the ass. So instead of that, I set up folders. I made a folder for each domain alias and then set up redirects. If email was sent to the halfelf.org domain, then it went to a folder called ‘HalfElf.’ Originally I had a whole mess of weird redirects going on, like if it was from WP then it went to a WordPress folder and so on, but unraveling that and going simple seemed like a wise choice.

    I went into the cPanel backups page and downloaded all my forwarder information as well and set up email forwards! Well. Not forwards. Aliases. Same idea really. And it was nice, since I added all my domains as aliases, ipstenu@[anydomain] would now work! I set up a lot of filters to keep things out of my inbox and in their proper, attention needing, spots.

    Blocking Users

    Finally it was time for my soon to be favorite step. Blocking users. Blocking senders for every domain is possible in Gmail and in my opinion, it’s huge. I have a list of 66 emails that I block on all my servers. This is for myriad reasons, but primarily is these are people who don’t know how the shut the hell up and leave me alone. Since I’m under no obligation to talk to these people, I blocked them.

    Exporting that list from cPanel was un-fun. You can either manually copy it out, line by line, or you can find the filter rules. They are, sadly, stored in the /etc/vfilters directory, so you need root access (which I have), but it’s not easy to get at. BUT! As of the latest version of cPanel, if you go into backups you can export your filters. They’re in a YAML format, but that’s easier than copy/pasta.

    Cleaning up cPanel

    So now that everything is on gmail, do I even need to run email on the server? Yes. I have to be able to send email. I did go through and delete all the accounts, though, freeing up a bit of space, and I turned off Greylisting (I know, I just did that!), and I hid the ability to add new accounts.

  • Greylist, RBLs, and Spam

    Greylist, RBLs, and Spam

    Recently I noticed I had 13 spam emails all from the same ‘company.’ The content was incredibly similar, though subtly different. The from email was always different, but you could tell by looking at it that it was the same. And even more damming, it all had ‘junk’ content and 100+ recipients. But for some reason, SpamAssassin wasn’t catching it!

    After 5 emails came in back to back, I decided to do something about it.

    At first I was trying to find a way to tell Spamassassin or Exim how to auto-turf the emails with 100+ people listed in the ‘To’ field. This proved to be a little more difficult and complicated than I wanted, and I was sure that these spammers would catch on to that sooner or later.

    What I really wanted was for Spamcop to pick up on this, but I’ve been sending them in to no avail for a while. That got me looking into how cPanel handles Spamcop in the first place.

    Real-Time Blackhole Lists

    cPanel uses RBLs, Real-time Blackhole Lists, to determine if an email sent to you is spam or not. By default, it comes with SpamCop and Spamhaus. That means it will reject mail at SMTP time if the sender host is in the bl.spamcop.net or zen.spamhaus.org RBL. Well that was well and good, but could I add more to that list?

    Of course. I pulled up cPanel’s documentation on RBLs and determined I could add as many as I wanted. On the top of the Basic EXIM Editor is a link to Manage Custom RBLs which is what I wanted. All I had to do was figure out what to add.

    After reading through WikiPedia’s comparison of DNS blacklists, I picked a few and tested the latest emails that had come through, looking for ones that caught them. Then I tested known good emails and made sure they weren’t caught. I ended up adding Barracudacentral and IPRange.

    Greylisting

    The next thing I did was introduce Greylisting to my email. They way Greylisting works is that if it doesn’t recognize the email, it will temporarily reject it and tell it to resend. If the email is real, the server tries to send it again after a little while. There are some downsides to this, as it’s possible for a legit email to be trapped for a few hours (or days) if someone’s set up their server poorly. On the other hand, within half an hour, I blocked 11 emails.

    I mean. I’m pretty sure monica@getoffherpes.com is spam. You know what I mean?

    This was super easy to do, too. I turned on Greylisting, I restarted Exim, I walked away.

    Okay no, I didn’t. I sat and watched it to see if anyone legit got caught (one did, it passed itself through properly).

    Result?

    A little less spam. I don’t expect this to work for everything, but it had an immediate impact on many of the spam emails that were annoying me.

  • Multisite Emails and Redirects

    Multisite Emails and Redirects

    I wrote a plugin that allows people to Join A Multisite on a Per-Site Basis.

    There are some things it doesn’t do that I have no intention of adding into the plugin, but people often ask me how to do them. Personally, I think people should always know they’re on a network, and hiding this will only lead to complaints later one, but my way is not the only way.

    That said. I am aware of things people try to do that my plugin won’t. All of these snippets should go in a file in mu-plugins. I’d name it multisite-registration.php personally. That way I know what it is right away.

    Emails By Site

    When you register for a network site, you always get emailed from the network. This means even if I go to halfelf.org to reset my password, the email always comes from ipstenu.org. To change the password reset emails to be from the one where you’ve actually pressed the reset link is pretty easy:

    add_filter( 'retrieve_password_message', function ($message, $key) {
      	return str_replace(get_site_url(1), get_site_url(), $message);
    }, 10, 2);
    
    add_filter( 'retrieve_password_title', function($title) {
    	return "[" . wp_specialchars_decode(get_option('blogname'), ENT_QUOTES) . "] Password Reset";
    });
    

    But when we talk about the activation it’s a little messier. If you’re using my plugin, you can have users sign up on a specific site. You probably want to have new user activations come from that site and if you do, you need to do this:

    add_filter( 'wpmu_signup_blog_notification_subject', function($subject) {
    	return "[" . wp_specialchars_decode(get_option('blogname'), ENT_QUOTES) . "] Activate Your Account";
    });
    
    add_filter( 'wpmu_signup_blog_notification_subject', function($subject) {
    	return "[" . wp_specialchars_decode(get_option('blogname'), ENT_QUOTES) . "] Activate Your Account";
    });
    

    That subject can, obviously, be changed.

    Redirect Lost Password Pages

    So you may have noticed that the lost password page on a network always points to the network and never the site you’re on.

    Screenshot of my login screen showing halfelf in the URL bar, but the reset link points to ipstenu.org

    That can actually be fixed by doing this:

    add_filter( 'lostpassword_url', function ($url, $redirect) {	
    	
    	$args = array( 'action' => 'lostpassword' );
    	
    	if ( !empty($redirect) )
    		$args['redirect_to'] = $redirect;
    	return add_query_arg( $args, site_url('wp-login.php') );
    }, 10, 2);
    
    add_filter( 'network_site_url', function($url, $path, $scheme) {
      
      	if (stripos($url, "action=lostpassword") !== false)
    		return site_url('wp-login.php?action=lostpassword', $scheme);
      
       	if (stripos($url, "action=resetpass") !== false)
    		return site_url('wp-login.php?action=resetpass', $scheme);
      
    	return $url;
    }, 10, 3 );
    

    This simply filters the URL and if you’re on a site’s login page, use that site for the URL.

    Redirect Logins to Their Site

    This one is messier. If you always want a user to be redirected to ‘their’ site, you have to know what their primary blog is on the network. You can do this, and for the most part, this works:

    add_filter('login_redirect', function ( $redirect_to, $request_redirect_to, $user ) {
        if ($user->ID != 0) {
            $user_info = get_userdata($user->ID);
            if ($user_info->primary_blog) {
                $primary_url = get_blogaddress_by_id($user_info->primary_blog) . 'wp-admin/';
                if ($primary_url) {
                    wp_redirect($primary_url);
                    die();
                }
            }
        }
        return $redirect_to;
    }, 100, 3);
    

    If they don’t have a primary_blog, they’ll be punted to the main for the network, as it should be.

  • Newsletters Are Still Cool

    Newsletters Are Still Cool

    It started with a mention:

    And I went and looked up TinyLetter

    It’s simple. It’s as easy as writing a blog post and boom, you’ve sent a mail. In so far as that goes, it’s awesome.

    It’s too simple. There isn’t a way to really automate it.

    It’s really cool. It just works and sends out a nice, easy to read, email.

    It’s really annoying. You have to get folks to sign up.

    I really want to like it and use it, but I’m not sure I have a use case. Thanks to Jetpack, I push to LinkedIn, Facebook, Twitter, etc, and my family sees the things. They sign up to Jetpack emails for in-boxes.

    But if I needed a newsletter, I’d use TinyLetter.

  • InBox Insanity

    InBox Insanity

    I get a lot of emails. I’m usually receiving and sending every hour or so. Most of the time they’re email alerts, sometimes conversations. While I’m a massive unsubsciber of email lists, I filter a lot of my emails into folders, where I’ll leave them unread until I have time, and then I delete them. Oh yes, I’m a member of Inbox Zero.

    Cat Face CloseupI started doing the Zero because I wanted to cut down on the stress in my digital life. An unread notification sits there, like a malignant ‘Deal with me!’ eye. And the thing is I do, I will, I always at least read the email. I don’t always reply, but I will read it. But what I don’t need is a five year old kicking my seat asking if we’re there yet.

    I’m not patient. I eat my bagels undercooked because if the dang thing isn’t done in the time it takes me to start the toaster, get my cream cheese, make a coffee, and go to the bathroom, then it’s getting eaten as is. I would never be a good chef because I don’t care if every slice and dice is the same, I care about eating. If it’s time to go and you’re dawdling, I hate you. I get annoyed when people can’t budget their time well and thus are always late. It’s a thing, it’s mine, and it’s what it is.

    Conversely, when it’s not food, or when its not a specific time event (like “I’ll meet you there between 4 and 5”) then I don’t stress about it. And when it’s email or Twitter, I’m seemingly negligent about serious replies because I may take a long time, and reply to other people frivilously, but in reality I’m thinking about the right reply. I have a couple emails in my drafts at any one point in time because I’m thinking.

    It’s funny, I know, that I get upset when people nag me about replying. But I understand that people need processing time, and while I’m terribly impatient when I wait for an email reply from someone (seriously, ask my wife, I’m really annoying), I try as hard as I can NOT to bother them about it! I may send them a little “Hi” note after a week or so, depending on the issue, but I’m usually asking someone for a special favor in the first place, and I try to respect their boundaries.

    Whew. Lots of me me me here!

    Also I like using desktop applications. I like email apps, and Twitter apps, over in their own thing that I can totally close out and ignore if I need to write or whatever. I’m not tempted to open twitter.com in my browser because I never do it. It’s good for me and my sanity, because I don’t get those ‘gotta clicks.’ The only ones I have in my browser are my RSS reader, Facebook, and Google Plus, none of which annoy me with alerts in my browser (well, not once I forcibly turned off all alerts).

    But email and Twitter, being a desktop tool on my Mac, need some settings changes too. Twitter has two places:

    Example of Twitter Settings

    On the first settings page, General, I set my menu bar icon to disabled, so nothing to pester me up there. On the Notifications page, I turn of nearly everything. The exceptions are mentions (which I keep as menu, just in case I change my mind… it’s been a month, I suspect not) and messages. Messages are important. Very few people DM me on Twitter, and when they do, it’s probably important or private, so it needs serious attention.

    Nothing else does.

    Email is weirder. How do you turn off the dock? Surprisingly easy. Go into your System Preferences and click on Notifications (first row, last column). In there, I always turn on “Do Not Disturb” settings from 9pm to 7am. If I’m up and coding at that hour, I’m in a zone and leave me alone. Otherwise I’ve left the laptop open, and either way I’m probably not in a mood to talk to people. The last thing I want is more alerts.

    Next scroll down to your email app (mine is Postbox) and turn off everything. Uncheck the boxes and set the style to ‘None’ and walk away:

    Notifications for PostBox

    Boom. No more red number.

    Don’t worry, I’m still checking mail.