Sudo mail always remember

A common issue!

When you use sudo to run a command, it temporarily switches to the root user's environment. This means that any settings or configurations you had in your regular user account are not carried over to the root user's environment.

In the case of mail, this can cause issues because the mail command is usually configured to use the user's default email client and settings. When you run sudo mail, it will use the root user's default email client and settings, which may not be what you want.

To avoid this issue, you can use the following workarounds:

  1. Use sudo -u your_username mail: This will run the mail command as your regular user, rather than the root user. Replace your_username with your actual username.
  2. Use sudo -E mail: This will preserve your environment variables, including your email client settings, when running the mail command as root.
  3. Configure your email client to use a specific user: If you're using a specific email client, you can configure it to use a specific user account. For example, if you're using mutt, you can add the following line to your ~/.muttrc file: set from="[email protected]".

By using one of these workarounds, you should be able to avoid the issue and use sudo mail as expected.