
- #How to get the mail command in linux install#
- #How to get the mail command in linux password#
- #How to get the mail command in linux free#
You can use your account’s Gmail password, which is fine if you create a new account just for Postfix, but if you’re using your personal account, you’ll want to create an app password. Next, you’ll need to authenticate Postfix. In this example, without specifying the domain name, your emails will come from the Gmail account you have configured for Postfix. You don’t need a domain name to use Postfix, but you will need one to have your emails sent from that domain name. The next prompt will ask for your domain name.

At the first screen, select “Internet Site,” which will configure Postfix to use SMTP.
#How to get the mail command in linux install#
For Debian based systems like Ubuntu, that would be: sudo apt-get install postfix libsasl2-modulesĪs Postfix installs, it will prompt you for configuration. Install Postfix and libsasl2-modules, a package for managing SMTP authentication, from your distro’s package manager. Postfix can also run its own SMTP server, but it’s it’s harder to configure, and less compatible with external recipients unless you configure domain verification. If you need more than that, you can use Amazon SES or SendGrid, which should both be drop-in replacements for Gmail’s SMTP server in this example. Gmail is rate-limited to 100 emails per day, which is likely enough for simple email notifications.
#How to get the mail command in linux free#
The simplest solution for command line email is to use Postfix as a MTA, using a free SMTP server like Gmail. You can do this with Gmail, but if you’re sending out a lot of emails, you should be using a business solution like Amazon SES. This usually means verifying your domain with DKIM and SPF authentication, which proves you own the domain and aren’t spoofing your address. If you’re planning on sending emails out to end users, you’ll need to configure more information with your SMTP provider.

Then, the MTA will be able to act as you, and send emails from your account.
#How to get the mail command in linux password#
You’ll need to authenticate the MTA with the SMTP server, which is usually as simple as giving it your password or key. This app is called a Mail Transfer Agent (MTA), and handles communicating with the SMTP server. This is great for this use case, as you will only need to configure the command line app that does the sending.

The server that handles sending mail is called an SMTP server, and many free email providers (Gmail, Yahoo, etc.) provide SMTP servers for free. When email is traveling down the tubes of the Internet, it’s usually being sent over the Simple Mail Transfer Protocol, or SMTP. Command line email works similarly to personal email, and is easy to configure and use. Having your server send you emails is a simple way to get notifications from bash scripts, applications, and cron jobs.
