WHM: List Largest Emails In An Account With Subject

I recently needed to find the largest emails in various email accounts and share the size and subject. Not if it was a single email account which I had access too there are likely much simpler options using webmail or an email client to get the same outcome.

It looks like this hasn’t been written about before so I pieced together various tutorials to end up with the final solution.

This guide assumes you know what you’re doing on the command line prompt and that you have the permissions to view the files and folders below. It also assumes you have the permissions to go poking around in people’s email accounts, so be sure to ask for that before you start outputing private email subjects from their accounts

The first step is to check you have the following results for a list of files in the chosen CPanel account’s mail folder:

$ls -a /home/[account]/mail

The above should show you a folder for each domain, but hopefully also a symlink for each account. In my case:


The above actually points to example.com/email but we’ll be using it in our code.

This code also expects emails to be stored in files ending with ,Sab or ,RSab or ,S or ,RS so check that too.

So here is the full example which I’ll then break down below. You’ll need to update it to suit your needs:

find /home/[account]/mail/.email\@example_com/ -type f ( -iname "*,Sab" -or -iname "*,RSab" -or -iname "*,S" -or -iname "*,RS" ) -size +1M -exec grep "Subject: " {} \; -printf '%s B - ' | sort -nr | head -10

First we use the find command to list files which match our email file name (end with 4 options) and have a file size of greater than 1M:

find /home/[account]/mail/.email\@example_com/ -type f ( -iname "*,Sab" -or -iname "*,RSab" -or -iname "*,S" -or -iname "*,RS" ) -size +1M

We then trigger an exec on that which will eventually return their subject as part of the output, and also print their file size in bytes (%s) followed by a B and a hyphen with -printf

-exec grep "Subject: " {} \; -printf '%s B - '

We then sort the list:

sort -nr

and finally only return the first 10:

head -10

Offboarding as a priority

There is nothing quite like the heart sinking feeling other team members get when a developer announces they’ll be leaving a small team.

Mild panic sets in, and everybody looks to each other for reassurance. Yet that moment is the right time to switch mindsets to focused offboarding. Ensuring the remaining members are left in the best state possible to continue their great work.

Team size is critical here. One developer leaving a team of five often has a huge impact relative to a developer leaving a team of 20. Small teams need to run offboarding in a way that acknowledges this size frailty and mitigates the short and long term risks associated with developer churn.

Continue reading “Offboarding as a priority”

Fuelling Your Team

What we eat plays an important role in our ability to focus. Our choices around what and when we eat and drink affects our productivity, energy and general mood. It directly impacts the quality and quantity of our output at work. It compounds within small teams and has an even greater effect.

It’s been shown that those who form new habits around drinking plenty of water and eating the right foods see a better version of themselves within just a few days. Measurably better.

These simple insights into diet aren’t new information though. Most people are already aware that more water, less salt and less sugar are recommended for health and mood. People don’t do their body damage intentionally, but through choosing the path of least resistance when it comes to workplace food and drink habits.

The moral dilemma is of course, do we have any right influencing these choices and the diets of those we work with?

Continue reading “Fuelling Your Team”

Setting up Google 2FA using an app not SMS

Google appear to be intentionally hiding the option to use an authenticator app such as Google Authenticator, 1Password and LastPass to store and generate 2FA codes for your Google Account login.

You can use them, but it’s not clear how, and you have to temporarily submit a mobile number you have access to before you’ll find the option available to you.

  • Head to manage your account.
  • Choose to add 2FA
  • Select to do it via SMS
  • Submit your number
  • Enter the code they send you
  • On the next screen select to add an authenticator app
  • Follow the steps and submit the code you can now access
  • View the backup codes and store them somewhere safely
  • Finally you can remove your mobile number from the list of option

So to not use your mobile number and SMS (which is vulnerable to hijacking) you first have to submit your mobile number ¯\_(ツ)_/¯