I am struggling with configuring two mails for two different users in Ubuntu. Like if I login with User1 then whenever I use the command mail, it should send mail from user1@gmail.com.

And when User2 logins with its credentials then it should send mail from user2@gmail.com.

Currently I've changed my /etc/ssmtp/ssmtp.conf for my Gmail id. But when I send mail from a different user, the same mail id is been used.

Can anyone please provide any pointer or links?


If you're using the mail command (aka mailx) you should be able to add this to the ~/.mailrc file for each user:

set from="user1@gmail.com"

mutt follows the same syntax except ~/.muttrc is the file you edit.

  • 1
    :Thank this worked for me ,you made my day cheers – Gaurav Soni May 22 '14 at 18:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.