LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   using mail form the command line (https://www.linuxquestions.org/questions/linux-newbie-8/using-mail-form-the-command-line-671370/)

Birdman48 09-21-2008 09:15 AM

using mail form the command line
 
Hi.
I am trying to better understand how email works under Linux and to use mail from the command line.
I don't know why I want to do this, I just do. I guess it would be convenient in a way.
My Unix books simply tell me how to use the "mail" program.
I have since learned that I probably need to configure my MTA (mail transfer agent) which is Postfix.
Postfix is installed with my OpenSuse distro. I can see my /etc/postfix/main.cf file.
Many of the lines are commented out with a "#", such as #myhostname = host.domain.tld, #myhostname = virtual.domain.tld, #mydomain = domain.tld, #inet_interfaces = all.
I suppose these lines need to be uncommented in order for me to use mail from the command line.
And they probablay need to be edited to fit my needs.
1) I would like any basic suggestions on configuring this file.
2) Also, if and when I get mail to work on the command line, is it safe? I understand mail to be a filterless program, so any spam or virus might get thru and opened if I'm not careful.
Thanks.

Mr. C. 09-22-2008 01:58 AM

Yes, you are correct - you need an MTA to have mail actually transferred.

The commented out lines are comments to help show you a) defaults and/or b) examples. Add similar values as appropriate for your site needs.

Start by reading:

http://www.postfix.org/BASIC_CONFIGURATION_README.html
http://www.postfix.org/SOHO_README.html
http://www.postfix.org/STANDARD_CONF...ON_README.html

The mail command is safe. The mail command uses the sendmail binary, which ultimately just drops the mail into the postfix mail queue. Postfix then handles delivery. Any filtering/antivirus scans you want to perform would be configured in Postfix. Since sendmail uses a different entrance path into Postfix, there are other controls that can be tuned, but you can get into that later.

Birdman48 09-27-2008 04:29 AM

Postfix
 
Woah. They don't dumb it down do they? I am looking for simple steps to configure this file and my computer so I can use mail. The documentation isn't very clear. I would think somewhere in there I'd have to put my email address. I have a dynamic ip address so I guess I don't have a real internet hostname. The example at http://www.postfix.org/SOHO_README.html isn't very clear to me.

billymayday 09-27-2008 04:45 AM

You can't dumb it down too much - running a mail server is serious business - get it wong and you're another spam rely.

What are you finding so hard about the postfix docs?

niceguy_81333 09-27-2008 05:30 AM

Hi
To configura a mail server involves following steps:
(a) Getting a domain name and the MX record for your domain on the DNS server points to the addresss of your mail server.
(b) Configure basic postfix setings (/etc/postfix/main.cf): Read the configuration file carefully. Add the following code at the end of the file
Code:

myhostname = hostname.example.com
mydomain = example.com
mydestination = $myhostname, $mydomain, localhost.$mydomain

(c) Now restart postfix with rcpostfix restart

rgds
bil

Mr. C. 09-27-2008 11:19 AM

The distros do the dumbing-down, but providing installation wizards that help configure some of the basic settings.

The postfix documentation is clear and precise, but like all documentation, must make some assumptions about the existing and prerequisite knowledge of its audience. The postfix documentation assumes minimally an understanding of SMTP mail terminology and some of the protocol.

There are multiple How To recipes in existence routinely referenced by others. Find one that's suitable for your distribution's particularities.

Of course, the better solution is always to gain an understanding of the software and services you install, as installation is the cheap and easy part - maintenance, troubleshooting, and tuning are the real expenses.

With a dynamic IP, you will have some difficulties running a mail server, as a large portion of remote MTAs will not accept email from dynamic or residential IPs.

You asked if the mail command line was safe. Perhaps the more important question is "can you safely run an MTA?"


All times are GMT -5. The time now is 08:18 PM.