Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Run Mail as another user Apps
I couldn't find this in your hint site, so thought I'd add it to show off some of the cool UNIX goodness in OS X, even for GUI guys like myself. I maintain two accounts on my machine, one for home, and one for work. I like to track my email throughout the day for the other account, regardless of which one I'm working in. Here's how you can do it:
  1. Launch a shell
  2. Type su other_acct_name
  3. Enter the password for that account. Now you're a user for that account.
  4. Type /Applications/Mail.app/Contents/MacOS/Mail and hit Enter.
Voila, Mail for the other account will launch and use the library, preferences, etc. for that other account. That way I can track mail from both accounts and still keep them separate.

Probably not much of an achievement for a UNIX propellor head, but for a GUI guy like me, this is seriously cool.
    •    
  • Currently 3.50 / 5
  You rated: 4 / 5 (4 votes cast)
 
[6,489 views]  

Run Mail as another user | 10 comments | Create New Account
Click here to return to the 'Run Mail as another user' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Shorter
Authored by: daeley on Nov 14, '03 12:33:35PM
You could probably just type open -a Mail and hit Enter for step 4. Saves a bit of typing.

[ Reply to This | # ]
this does not work!
Authored by: housemaister on Nov 14, '03 01:44:48PM

with open always the user of the GUI is choosen!!
so you have to execute the binary in the Mail.app folder.



[ Reply to This | # ]
try sudo
Authored by: anourkey on Nov 14, '03 01:11:30PM
You may have to set up your /etc/sudoers file ahead of time, but the following should work
sudo -u other_user open /Applications/Mail.app

[ Reply to This | # ]
try sudo
Authored by: elmimmo on Nov 15, '03 08:13:23PM

It is curious that I explicitely tried that in Jaguar like 6 months ago and it did not work because aparently the new user did not have permissions to use the window server started by the first user.



[ Reply to This | # ]
Run Mail as another user
Authored by: mark hunte on Nov 14, '03 01:21:52PM

I get

kCGErrorIllegalArgument : initCGDisplayState: cannot map display interlocks.
kCGErrorIllegalArgument : CGSNewConnection cannot get connection port
INIT_Processeses(), could not establish the default connection to the WindowServer.Abort

in the term window, not sure whats wrong here anyone..?

---
mh



[ Reply to This | # ]
Run Mail as another user
Authored by: hap on Nov 14, '03 01:54:53PM

Why not just use fast user switching and change to th other account.



[ Reply to This | # ]
Run Mail as another user
Authored by: Bookman on Nov 14, '03 04:48:26PM

The hint isn't just for Panther, I think (correct me if I'm wrong), but will work in previous versions of Mac OS X as well.

But, you are right--if you have Panther, it seems that about the same amount of typing would allow you to switch users using Fast User Switching, which is *seriously awesome,* IMHO. :-)

--Books



[ Reply to This | # ]
Run Mail as another user
Authored by: elmimmo on Nov 15, '03 08:16:26PM
No. I did try sudo -u second_user /Applications/Mail.app/Contents/MacOS/Mail in Jaguar like 6 monts ago, but second_user does not ave permissions to use first_user's windows server.

[ Reply to This | # ]
Run Mail as another user
Authored by: Baggins on Nov 14, '03 11:11:54PM

The problem with fast user switching is that your iChat disconnects, your iTunes stops playing, and you have to type two passwords every time mail comes that you need to check: one to get to the other account, and one to get back.



[ Reply to This | # ]
Run Mail as another user
Authored by: mdzorn on Nov 14, '03 08:15:33PM

You an also add the mail accounts in Mail to both user accounts. Inbox becomes a folder containing the various account inboxes. Just do "Mailbox>New".

My inbox tracks email from 8 different accounts. They all show up in one list, with the name of the account on the side. Junk mail, deleted Messages, Sent, etc. are kept separate for each account. Replying to an email Mail picks the sender associated with that account.



[ Reply to This | # ]