LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-21-2008, 10:15 AM   #1
Birdman48
Member
 
Registered: Aug 2008
Location: Southern Maryland
Distribution: ubuntu 14.04 LTS
Posts: 93

Rep: Reputation: 0
Cool 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.
 
Old 09-22-2008, 02:58 AM   #2
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 61
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.
 
Old 09-27-2008, 05:29 AM   #3
Birdman48
Member
 
Registered: Aug 2008
Location: Southern Maryland
Distribution: ubuntu 14.04 LTS
Posts: 93

Original Poster
Rep: Reputation: 0
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.
 
Old 09-27-2008, 05:45 AM   #4
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
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?
 
Old 09-27-2008, 06:30 AM   #5
niceguy_81333
Member
 
Registered: Mar 2008
Location: India
Distribution: RHEL5
Posts: 34

Rep: Reputation: 15
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
 
Old 09-27-2008, 12:19 PM   #6
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 61
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?"
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Command line arguments -- what form are they? bioinformatics_guy Linux - Newbie 8 09-12-2008 09:16 AM
Submit web form from command line? dbc001 Linux - Networking 2 10-15-2006 04:59 AM
shell script works form command line but not form crontab saifee General 1 10-14-2004 11:27 AM
how do I copy a whoel folder form one directory to another form the command line? zwyrbla Linux - Newbie 8 08-24-2004 07:40 PM
instant message form command line jonfa Linux - General 4 03-10-2004 10:45 PM


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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration