

If it is missing, we will get the error message like " send-mail: Cannot open mail:25". The postfix asks DNS, the destination where to deliver the mail, DNS replies a list of mail servers and creates an SMTP connection. It means that a postfix that contains an smtp server should be running on our machine for using the mail command. You can forward a message as an attachment to a new. It connects to the local MTA, which is a local running SMTP server that supports mails on port 25. When you receive an email, you can forward it to other individuals or groups that might be interested. The mail command of the mailutils package invokes the standard sendmail binary to send the mail to a specified destination. It is important to know how the command is working.
#LINUX MAIL FORWARD INSTALL#
After selecting the postfix option, it will successfully install the mailutils package on your machine. Postfix interacts with the server to process requests. To select your desired option, scroll the option by using ARROW keys, and select it by using TAB+ ENTER keys. There four postfix options are available for installation. It will start a daemon process and ask for the postfix configuration, select your desired postfix option. It will verify the installation, type 'y' to confirm the installation.

The above command will ask for a system password, type the password, and press ENTER key. To install the mailutils package, execute the below command: It supports the mail command to send the emails. First make sure that the IP forwarding is enabled on Linux following the Enable Linux IP forwarding Section in Setting Up Gateway Using iptables and route on Linux.
#LINUX MAIL FORWARD MANUAL#
We will install the mailutils package, the most popular way to send emails from the command line. Command to display forward manual in Linux: man 5 forward NAME forward - email forwarding information file DESCRIPTION Users may put a. For example, the heirloom-matrix package is capable of using an external smtp server for sending messages, while the rest two servers use the local smtp server. The mail command can be installed by various packages such as:Įach package facilitates with different features and options. In this section, we will focus on the mail command. However, many other commands are available in Linux that can be used to send the emails from the command line such as sendmail, mutt, SSMTP, telnet, and more. The mail command can be used directly by the terminal as well as the Shell script. It will be quite useful to send emails from the command line if we want to generate emails programmatically from shell scripts or web applications. Linux mail command is a command-line utility that allows us to send emails from the command line.
