Mac Mail – Ghost Unread Count


So, after having the problem with ghost unread mail appearing on my iPhone, I then had to deal with this on the Mac Mail app.

This has happened before, and can usually be simply fixed by clicking on the offending folder (usually Inbox), then clicking on ‘Mailbox’ in the menu bar, then clicking on ‘Rebuild’

it takes a little while but usually resolves the issue, this also works pretty well if the inbox is showing no messages at all, just a blank window, anyway, back to the problem, so this time, this didn’t work, so I had to resort to a more drastic rebuild.

First, quit Mail

Once it is no longer running, click on Finder

then press SHIFT, CMD, G

then paste in the following location and click on Go


In that folder you need to remove all files starting with Envelope (usually Envelope Index, Envelope Index-shm, Envelope Index-wal), normally, I move these to the Desktop until everything is all working again

Once there are no files starting with Envelope in that location, then click on Mail to Rebuild the Index, Once this has finished, your mail should be back to normal, no missing unread items.


Create a Hidden Administrator

I like to hide the administrator account from prying eyes, this helps add to the security of your machine by not making it obvious what accounts are on the machine.

To do this you need to do a number of things, first of all log in to the Mac with an admin account.

Go to System Preferences, then Accounts, then click on Login Options & change the following options

Display login window as : Name and password
Disable Automatic Login

Next you can either create a new admin account to hide, or you can edit and hide an existing one

Now, right-click (CTRL Click) on the account you wish to hide and choose Advanced Options

Set the User ID to a number less than 500, I usually do between 490 and 499 as there are a few system accounts that use earlier numbers

Now change the Home directory to something someone wouldn’t think to look, a lot of people use /var/

It’s also a good idea to put a . in front of your home folder to hide it further, so the path would be /var/.admin

Now you need to move and rename your actual home folder, to do this it’s easiest to use the Terminal, so open that up and type the following

sudo mv /Users/admin /var/.admin
sudo chown -R admin /var/.admin

Now you need to remove the Public and Sites folders from your home folder, as you already have a Terminal window open then you can enter the following to remove them

sudo rm -R /var/.admin/Public /var/.admin/Sites

OK, now thats all done you need to make some changes to the loginwindow preferences, this can also be done in the Terminal, so enter the following

sudo defaults write /Library/Preferences/ Hide500Users -bool TRUE
sudo defaults write /Library/Preferences/ HiddenUsersList -array admin

This will hide any account with a User ID under 500 and add your ‘admin’ account to the hidden users list

Test this by rebooting and logging in as a non-admin user, go to System Preferences and then Accounts, if all is well then the admin account will not show up

Now log out and log in as the hidden admin user, I tend to put some applications on the Desktop of this hidden account, just ones that I’d rather the end user of the machine not use as they have the potential to break their machines if not used correctly (I once had a user use OnyX to display hidden files and then they deleted the mach.kernel as they didn’t recognise the file and thought it could be a virus) so I now keep this out of their reach

Unhide the Library folder in Lion

By default, the Library folder in your user account is hidden in Lion
To switch this you need to enter the following in a Terminal window

chflags nohidden ~/Library

now reopen a Finder window, click on your home folder and you will see the newly restored Library folder

A video highlighting this can be viewed here 

Hide a volume

To hide a volume in Mac OS X 10.6 you will need to do the following

First, Install the Developer Tools (You can find these on the Mac OS X Installation Disc that came with your machine, or you can download Xcode from the Mac App Store).

Once you have done this Open a Terminal Window and type the following

sudo SetFile -a V /Volumes/VolumeName

replace VolumeName with the name of the volume you wish to hide

then type

sudo reboot

when the machine has rebooted you will notice that the volume no longer appears either on the desktop, or in a Finder window

to reveal a previously hidden volume just type the same command but use a lower case v


sudo SetFile -a v /Volumes/VolumeName

A common use for this would be to hide a volume with sensitive data on, although this will not encrypt any data so is not the best method for confidential items.

Hide a Bootcamp volume from OS X

To hide a bootcamp volume in Mac OS X 10.6 you will need to do the following

First, Open Disk Utility, highlight the Windows partition, click on info and note down the UUID

Open TextEdit & create a file called fstab.txt & save it to the root of the OS X partition, enter the following text into it

UUID=EnterUniqueIdentifierHere none ntfs ro,noauto 0 0

For FAT32 formatted partititons, replace ‘ntfs’ with ‘msdos’

Save & quit TextEdit

Open Terminal, rename & move the file to /etc, do this by typing the following

cd /
sudo mv fstab.txt /etc/fstab

Reboot the machine & log in, you should no longer see the Boot Camp partition on the desktop