What Is Mailx?


Author: Artie
Published: 23 Jun 2022

Message Retrieval by Invocation

mailx can be used to send a message to more than one person, and it can be invoked with arguments about who the mail will be sent to. The user is expected to type in his message, followed by a control-D at the beginning of the line, which signals the end of the message and implicit approval to send it. The character used on the terminal is not necessarily the same as the one used on outgoing messages.

The character set being used in an outgoing text message must be declared in the message'sheader. The sendcharset variable is separated by commas and mailx tries each of the values in order. The message will not be sent and the text will be saved to a file if it contains characters that are not in the character sets.

Messages with NUL are not converted. If the outgoing attachments are plain text, they are converted. If the sendcharset variable contains more than one character set name, the tilde escape will ask for the character sets for individual attachments.

It is useful to read the messages in your mailbox in order. You can read the next message by typing a newline. You can type a newline as your first command to mailx to type the first message.

The deletion command can be used to remove a message from the mail folder. mailx will not let you type deleted messages either. The message will disappear along with its number.

Mailx: a tool for sending mails from command line

If your recipient is at gmail.com, the MTA would be the smtp server. You need to install an smtp server for the local MTA. Most cases, a basic installation of Postfix would work.

Other tools like smtp-cli and sucks can be used to send mails from command line and support features like specifying smtp server and adding attachments. The mailx command is available in the default repositories of most common distributions. The mail command has a similar structure to that of the mail command which makes it a drop in replacement.

Messages from the author

There will be problems with sending emails. To get details of the problem, you need to use the debugger. For both mail and mailx commands. The -v option can be used to modify the operation.

Messages in POP3 mailboxe

The message with the message-ID in the 'In-Reply-To:' field or the last entry of the 'References:' field is the parent message. In threaded mode, you can choose the message addressed with x, where x is any other message specification, and all messages from the thread that begins at it. The thread beginning with the current message is selected if x is not present.

The message is presented in windowfuls under the command. The command scrolls to the next message. The window to use is specified if an argument is given.

The window is calculated in relation to the current position if the number is '+' or '-'. A number without a prefix is the absolute window number, and a '$' is the last window of messages. The message should be printed out and followed by an attachment list.

The message text is piped through the pager if it is longer than the screen size. The copy command is the same as the save command is used to make a copy of a message in a folder without it being removed from the system mailbox. If you prefer to store messages in a different form, you should consider it.

If you lose your private key, anyone who has access to your mail folders can't read them, but you might be unable to read them yourself later. The save, copy, and move commands leave messages ciphered while the speach command saves them in their original form. It is not possible to change messages in POP3 mailboxes.

Configuration Profiles

There are at least two ways to do this: using all-in-one command or putting configurations into profile. The all-in-one-command way requires no other configurations except the command line itself, while the way using configuration has a clearer command.

-r option on debian with the BSD_mailx package installed

The -r option does not work on debian where bsd-mailx is installed by default. You can use mailx -s subject recipient@abc.com instead. You can specify sendmail options after that.

Click Penguin

X Cancel
No comment yet.