Apple Mail - changing subject headers

Discussion in 'Mac Apps and Mac App Store' started by Bedawyn, Jan 22, 2006.

  1. Bedawyn macrumors regular

    Jul 17, 2003
    Asheville, NC
    I switched from Entourage to Apple's Mail a few months ago and am mostly happy with the change, but there's still a few tweaks that I'm missing. I want to set up a rule or three that will change the subject headers of incoming mail messages. Specifically, I'm looking to add a listname tag to a few mailing lists that don't use them and similar tags for some other criteria. Entourage did this easily, but it's not one of the standard options for Mail and I haven't had any luck searching for a tweak. Found lots of other Mail tweaks... but not that one. It seems like it ought to be fairly simple, though? Anyone have any suggestions? Could it be done with an AppleScript? I could tweak a script to my own uses if I had a working sample to base it on, but don't know enough AppleScript to start from scratch.

  2. MacMedix macrumors newbie

    Jan 3, 2009
    Changing Subject of incoming received Apple Mail message

    Yes, you can change the subject of an incoming received message (and everything else too), but it's not convenient.

    I'm writing this up in the hopes that maybe someone will make an AppleScript to do this more easily. Mail keeps all it's messages as slightly disguised text files (in packages). This applies only to Leopard Mail, version 3.5, I don't know how this compares to other versions.

    Here's how to change an email subject in Apple Mail 3.5 (not convenient, but possible):

    Open the folder: /Users/Home/Library/Mail/
    Look for the account. It will be a folder that looks something like;
    Inside there can be several files, the one we want is probably "INBOX.mbox".

    Command-click that to "Show package contents" and inside the "Messages" folder you will see all the messages as text files. They are all named with a number, and names all end in ".emlx". Each of these files is a separate email message, and you'll have to figure out which one is the one you want to change the subject of. Do not double-click these. Won't hurt anything, but it's not helpful to open these in Apple Mail right now. Instead; drag & drop the emlx file(s) onto the free TextWrangler from
    to open. As a hint to more quickly locate a certain message, In Mail; drag that message into an empty Mailbox. Then go look for it in the Finder. It will be the only emlx file in that folder.

    Looking at the emlx file in TextWrangler;
    Somewhere in the first several dozen lines of headers you will find a line starting with "Subject:".
    Change it here, and save. Even if Mail is running. Now go to Mail & click the message. Your new subject will show up in the message, but not in the list view, because Mail caches that somewhere else. To make your new subject show up in the list view just click that mailbox, then pull the Mailbox menu to "Rebuild".

    There you go! :)

    Note that the date/time and sender remain unchanged. (hooray!) So the statement that these are unchangeable business records is not true. (Not that anyone here said exactly that). Anyone with a text editor can change their email. Someone who is having their email subpoenaed by a court may have the motivation to alter their received email, so nothing is really gained by making it laborious or seemingly impossible for the rest of us who prefer to have a useful subject line rather than "No Subject". (Note to liars & crooks: the modified date/time of that emlx file will reflect when it was last saved, so you're still going to get busted, even if Mail still shows the original time/date).

    If this concept was made into an AppleScript, it could be activated from the "Scripts Menu" in the menu bar (near clock). if you don't already have your Scripts menu visible you can click the checkbox in the AppleScripts (found in your Utilities folder).

    Hope this helps.

    Dave Nathanson
    Mac Medix
    Jan 03-2009

Share This Page