The mail command

In the Bering root.lrp there is a mail command, which is one of the "POSIXness" script files. With this command you can send emails typed directly from the console or written as files. You can also send file attachment.

Warning

This command can only be used to send mail and differs substantially from the "real" linux mail command. In particular you cannot edit (read, delete, ..) mail from the firewall. As an alternative to this simple mail program you can use a real mailer program like qmail

The syntax of the Bering mail command is:

# mail
Usage: mail options to[,...]
Options: [-s subject] [-c cc[,...]] [-b bcc[,...]]
         [-a attachment[,...]] [-d domain] [-h smptserver]

Mail default settings are set in /etc/POSIXness.conf. Please refer to the Bering installation guide (System configuration section) for detailed instructions about default mail parameters

Through the System Configuration menu choose the (2) POSIXness Configuration entry. You will then be able to set the following options:

Important

Be careful about the MAIL_DOMAIN definition as lots of smtp servers will refuse mails with a name they cannot resolve to a valid IP. Others refuse to relay mails that cannot be delivered locally.

To mail a message to someone edit a file with the editor (e.g. ae message), type your text and save the message file. Then to send your message:

cat message | mail -s "I want to tell you" to yourfriend@hisdomain.com

or as an attachement:

mail -s "I want to send you" -a "message" to yourfriend@hisdomain.com

You can also type your mail directly from the console:

mail -s "I want to send you" to yourfriend@hisdomain.com

Once you hit return, the console will wait for a message to be typed in. Once you have finished with your message input, type CTRL-D.

To mail the log and alerts files to the Bering box admin, set lrp_MAIL_ADMIN to the email address you want your logfiles sent to you. This parameter is found in the Master LRP settings entry of the System configuration menu

Warning

To be able to send mail from the firewall, you will need to open port TCP/25 of the firewall. In the shorewall rules file you will need to include the following statement:

ACCEPT		fw	net	25	tcp