How to set the Reply-To in Apple Mail exactly

emailmail.app

I am trying to figure out the possible files that may affect the headers of outgoing emails when using Apple Mail. In particular I want to modify the Reply-To part.

I know that there are numerous solutions on the web, but apparently each one of the solutions that I have found is still missing some information that would work in my case.

Straightforward (manual) and terminal-based (automated solution) is the following. Basically the automated is the elegant solution which includes the command defaults write com.apple.mail UserHeaders '{"Reply-To" = "reply-to@address"; }' The above one is based on the solutions:

However, it turns out that in the past the above methods were not really working for me, so I had to follow a different route. (As background info: I was working at an organization where employees would get a strange username by default, something like, jsmit1234 for someone called John Smith, and then I wanted to have a more human-friendly email address in the reply-to part of the email, with something like: john_smith@…) Clearly I am writing this email because by now (4 years later) I can not remember how I did it back then.

Anyway, another idea is to do factory reset to the Mail app. According to the information found here, under ~/Library/ one should be able to delete the following files/directories:

(directory) Caches/com.apple.mail — I can cd and view all the files. I assume I can delete the files as well.

(directory) Saved Application State/com.apple.mail.savedState — I can cd into it, but I can not do ls. Interestingly I can not do ls, not even after changing to superuser with sudo su. In fact, if I perform the sudo su while being on the above directory I get the error message:
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Operation not permitted

(file) Application Support/AddressBook/MailRecents-v4.abcdmr — There is however lots of files in the directory AddressBook and there is two more files like the above one, ending in -shm and -wal (where the latter is an SQLite Write-Ahead Log file according to the command file).

(directory) Containers/com.apple.mail — I can cd into it, but I can not even perform ls, not even as root.

(directory) Mail — I can cd into it, but I can not even performls`, not even as root.

(file) Preferences/com.apple.mail.plist — I can view the contents. Interestingly though, there is another file called com.apple.mail-shared.plist under the Preferences directory and I can not view that file with less, not even as root.

(file) Preferences/com.apple.mail.searchhistory.plist — There is no such file in my system.

For the record I am running macOS Mojave 10.14.6 and the Mail app is version 12.4 (3445.104.11).

Now, I would really like to avoid doing a factory reset, because this way I would lose about 4 years of emails from my previous organization. So, the question to you is the following: What other files or commands can affect the Reply-To part of the emails? (When I made the change in the past it was another terminal command because the above one did not work as expected even back then.)

I would appreciate any help on resolving this issue and I want to thank you in advance for your time on thinking about this matter and suggesting solutions.

Best Answer

This worked for me: https://www.youtube.com/watch?v=Skwoo8RjHSw

I deleted com.apple.mail savedState, and moved com.apple.mail and com.apple.MailServiceAgent to the desktop, as the video suggested. After restarting, the Mail App stopped its autocopy that I had set up.