Skip navigation.
Home
Now Shipping Version 7.0

Using Mail at command prompt


Posts: 486

Have a question, I have recently reinstalled Guarddog and am trying the following command

$ mail userx at yahoo.com
Subject: blah blah
message message
.
$

(used @ instead of "at" in command)

It seems to work on my end, but user never receives email.

Before I reinstalled firewall, it worked with settings that came default w/ Mepis 3.3.1.

What do I need to OK in firewall to get this back working, I have enabled all email stuff under "local" email protocols.

Travis

Jon Du Quesne's picture

Who's Your ISP?

Travis, before you reloaded Mepis, how did you have your system set up for your ISP? You can't send mail outside your box until you:
1) Set up your mail server
2) Set your mail server so that it can use your ISP.

The mail command, along with other tools like kmail and thunderbird, is a mail client.

A couple mail servers that you can set up are mailx and postfix. I believe the one used by the default install of SimplyMepis is mailx.

Jon

Thanks for your reply

Thanks for your reply Jon,

Here are some answers for you....

1)I only reinstalled Guarddog, not all of Mepis. I wanted to try the firewall Firestarter, but I successfully failed at getting it to work on my system. (i think it had something to do with 2.4 kernel i run) So I put Guarddog back in.

2)I have not installed any mailservers, so mepis default must be only one. I have never configured mailx either, I found the command (Linux Command Pocketguide) and it worked.

3)My ISP is Bellsouth, and if needed I can configure modem if needed.

4)Saying that, I will start researching mialx and guarddog on how to configure firewall to let email requests go thru.

Thanks,
Travis

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Maybe one day I'll be able to help if I ask enough questions.

Jon Du Quesne's picture

So Far, So Good

Hi Travis. Just 'cause I'm funny that way, I installed postfix for my internal mail server. Primarily so that I could see how it's done. I have not completed setting up a complete internal (home) mail system. That is for another day...

That being said, I can only provide hints to setting up mailx. It, and postfix, are essentially substitutes for sendmail, which has LOTS of configuration options. Most people who use "desktop" type Linux distros rely upon using a mail client such as kmail or thunderbird because they let their ISP handle the storing and forwarding of messages for them.

If Bellsouth is similar to Google's gmail, in that the have specific ports set up for sending/receiving, then you may have to set up "custom" values in guarddog to handle it. For instance, for incoming mail, gmail uses port 995 rather than 110 for the pop protocol. It uses port 587 for outgoing smtp. So I had to create a "custom" setting in guarddog called smtp.gmail that is set to port 587. I then set guarddog to "allow" that port.

I found the link to my (lengthy) comments on how to set up thunderbird and mailx to work together. That link is here:
http://www.mepis.org/node/6627

See if that helps Smiling

Jon

Jon, Got "mail" back working

Jon,
Got "mail" back working by opening email stuff in Guarddog, sorry I cant be more specific, I am not at box now.

Also, I made a finding, if I type (this is a user on same machine)

$ mail user1
subject: test
test message
.
$

The mail goes to /home/user1/Maildir file, it even gives error messages if something does go bad.

If I email someone external, the email says it is from ie, . Some ISP's block such anonymous data.

Travis

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Maybe one day I'll be able to help if I ask enough questions.

Jon Du Quesne's picture

Ah Ha!

Well, when you get back to your machine Travis, you will eventually need to make some changes Smiling

The way sendmail works is that every user on your box has a maildir directory in home. When you try to send outside of your box it has to have a legitimate host and domain name. You have not "named" your system so the default host name is "localhost". The default domain name is "localdomain". That is why a mail server such as mailx or postfix allows you to define a different name for you.

Is your Mepis box connected to other systems in your home that you need to connect to via SAMBA or that you want to give your box a real name. If so, start up the Mepis OS Center, enter the root password, go to the "System Tweaks" tab on the left. On the right, up above, is a section for "Computer Identification". Enter a value for "Computer name" and "Computer domain". DO NOT MAKE THESE THE SAME AS YOUR ISP.

Jon

Jon, My computer name is

Jon,
My computer name is "linux", pretty unique right. The domain is default mepis something. I will change mepis to something else and let you know the results.

Have a related question about domains. Now my ISP has my dsl modem on an dynamic internet ip address. So what I've done is use Noip2 to point a domain name to my IP, I have a client running on box that looks at internet ip and reports it to Noip website, they in turn update there DNS servers.... Saying that mouthful, should I make my domain name on box same as my noip domain?
My noip domain is jenkins.hopto.org, I have apache running and public can view it at http://jenkins.hopto.org , so should I make my pc domain jenkins.hopto.org? I am ignorant on domains, seems to get twisty when dealing with LAN and internet at same time...

Let me know..

Travis

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Maybe one day I'll be able to help if I ask enough questions.

Jon, I changed (in OS

Jon,
I changed (in OS center) domainname to jenkins.hopto.org and hit apply. But when I type the following commands, it didn't seem to take

$ hostname
linux
$ hostname -i (host ip address)
127.0.0.1
$ hostname -a (host alias name)
localhost linux
$ hostname -s (host short name)
localhost
$ hostname -f (host fully-qualified name)
localhost.localdomain
$ hostname -d (host DNS domain name)
localdomain
$ hostname -y (host NIS or YP domain name)
(none)

I am looking around in my host file stuff and trying to see what I can find, if you have any ideas, let me know.......

Ideally I would like my emails to be from "user1@linux.jenkins.hopto.org" instead of "user1@localhost.localdomain"

Travis

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Maybe one day I'll be able to help if I ask enough questions.

Jon, Done some researching

Jon,
Done some researching and found out that I could modify the /etc/hosts file to change fully qualified host name, so I added above localhost line the following code:
192.168.x.x linux.jenkins.hopto.org linux

And when I ran above commands, I got these results....

$ hostname
linux
$ hostname -i
192.168.x.x 127.0.0.1
$ hostname -a
linux localhost linux localhost.localdomain
$ hostname -s
linux
$ hostname -f
linux.jenkins.hopto.org
$ hostname -d
jenkins.hopto.org
$ hostname -y
(none)

BUT, when I use

$ mail userx at foo.com

then the user sees the email is still from "user1@localhost.localdomain"

So saying that I am guessing that I need to either configure "sendmail" or install postfix......

Will be back Smiling

Travis

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Maybe one day I'll be able to help if I ask enough questions.

Update... I went ahead and

Update...

I went ahead and installed postfix. It picked up domain name and all is well. When I send out a message, it says it is from .

Also, I use webmin and installed postfix module, that works great!

So to sum up, I can send externally, and cannot receive from external, which is desired.

BTW, installed postfix and webmin module via synaptics.

Travis

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Maybe one day I'll be able to help if I ask enough questions.

Jon Du Quesne's picture

Excellent News

Great job Travis. Glad to hear that things are working better now Smiling

I have been able to use postfix and webmin to maintain three servers for a client. The webmin "System and Server Status" module (under Other) is useful to set up "pings" and other tests of "remote" (ok, they're under my desk) systems. Postfix sends me pleasant messages when it can't see the other systems for whatever reason.

Jon

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.