Help!

mailx (how is it able to send email?!?)

 
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> General Discussions (archive 2) RSS
Next:  cannot print on cups server  
Author Message
Beowulf
External


Since: Nov 29, 2006
Posts: 149



PostPosted: Sun Dec 24, 2006 3:08 pm    Post subject: mailx (how is it able to send email?!?)
Archived from groups: alt>os>linux (more info?)

I have mailx on my system, it was installed yesterday as part of the
package installation of aide.
sudo apt-get install aide
(mailx got installed as a dependency)

My question is I do not really understand how mailx is able to send me
email, and it does because I tested it:
echo "Hi" | mailx -s "A test email message"

How does the above work? I mean, when I set up an email account with
evolution or kmail I needed to specify my mail server of my ISP, username,
password, etc. Is mailx acting as a mail server, and does an ISP simply
allow such email generated by mailx to flow through the net, etc. I guess
this might be so simple I am missing it (my brain is slow on some things,
this must be one of those concepts). So in theory if I wanted to, could I
use mailx for all my email, have friends send me email somehow and then
read that email with mailx?
Back to top
Bit Twister
External


Since: Dec 19, 2004
Posts: 1966



PostPosted: Mon Dec 25, 2006 12:46 am    Post subject: Re: mailx (how is it able to send email?!?) [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Sun, 24 Dec 2006 10:08:47 -0600, Beowulf wrote:

> My question is I do not really understand how mailx is able to send me
> email, and it does because I tested it:
> echo "Hi" | mailx -s "A test email message"
>
> How does the above work?

Pretty sure as part of the mailx install, you were asked a few
questions for postfix setup. Most of your answers went into
/etc/postfix/main.cf setting up your Mail Transport Agent (MTA postfix)


For extra points: http://www.postfix.org
Back to top
Bit Twister
External


Since: Dec 19, 2004
Posts: 1966



PostPosted: Mon Dec 25, 2006 1:04 am    Post subject: Re: mailx (how is it able to send email?!?) [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Sun, 24 Dec 2006 19:46:12 -0600, Bit Twister wrote:
>
> Pretty sure as part of the mailx install, you were asked a few
> questions for postfix setup. Most of your answers went into
> /etc/postfix/main.cf setting up your Mail Transport Agent (MTA postfix)
>
>
> For extra points: http://www.postfix.org

You may want to
# cd /etc/postfix
# grep root: aliases
and change the root: postfix
to root: beowulf

Save your change

# postalias aliases
# postfix stop
# /bin/cp /dev/null /var/log/mail/errors
# /bin/cp /dev/null /var/log/mail/info
# /bin/cp /dev/null /var/log/mail/warnings
# postfix start

# cat /var/log/mail/info
# cat /var/log/mail/warnings
# cat /var/log/mail/errors

Fix any errors/warnings.


Now any mail sent to root (alarms, cron msg, audit results,...)
will show up in beowulf's mail box.

Check it out, click up a terminal in beowulf login
$ mailx -s "test root aliases" root < /dev/null

$ mail
1
d
q
Back to top
J.O. Aho
External


Since: Mar 26, 2004
Posts: 2266



PostPosted: Mon Dec 25, 2006 2:08 am    Post subject: Re: mailx (how is it able to send email?!?) [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Beowulf wrote:
> I have mailx on my system, it was installed yesterday as part of the
> package installation of aide.
> sudo apt-get install aide
> (mailx got installed as a dependency)
>
> My question is I do not really understand how mailx is able to send me
> email, and it does because I tested it:
> echo "Hi" | mailx -s "A test email message"
>
> How does the above work? I mean, when I set up an email account with
> evolution or kmail I needed to specify my mail server of my ISP, username,
> password, etc.

mailx tries to connect to the local SMTP (the one running on your computer),
at least on Unix and Unix like OS's there are some kind of SMTP installed,
they usually only listens to the localhost (127.0.0.1) and can deliver mail to
your local machine or send it to a remote SMTP, but won't accept mail from the
outside.

> So in theory if I wanted to, could I
> use mailx for all my email, have friends send me email somehow and then
> read that email with mailx?

Yes, if you have a SMTP running on your machine which is accessible from the
the internet and your ISP isn't blocking incoming traffic on port 25.


//Aho


--

//Aho
Back to top
s. keeling
External


Since: Nov 10, 2005
Posts: 230



PostPosted: Mon Dec 25, 2006 7:50 am    Post subject: Re: mailx (how is it able to send email?!?) [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Beowulf :
> I have mailx on my system, it was installed yesterday as part of the
> package installation of aide.
> [snip]
> How does the above work? I mean, when I set up an email account with
> evolution or kmail I needed to specify my mail server of my ISP, username,

Local mail (from a local user to another user on the same machine)
doesn't need to go out to your ISP. It uses the machine's Mail
Delivery Agent (MDA). Nowadays, that's procmail or "deliver" (on
Linux and other free OS's). It knows this because the mail's sent to
blah as opposed to blah@somewhere.else

> password, etc. Is mailx acting as a mail server, and does an ISP simply
...................^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Trivially speaking, yes, sort of. More like local mail doesn't need a
full blown mail server to sort out local delivery.

> allow such email generated by mailx to flow through the net, etc. I guess
> this might be so simple I am missing it (my brain is slow on some things,

Smile

MUA: Mail User Agent - Thunderbird, mutt, pine, kmail, balsa,
...

MDA: Mail Delivery Agent - procmail, deliver, ...

MTA: Mail Transport Agent (aka SMTP [Simple Mail Transfer
Protocol]) - Sendmail, Exim, Postfix, Qmail, ssmtp, ...

> this must be one of those concepts). So in theory if I wanted to, could I
> use mailx for all my email, have friends send me email somehow and then
> read that email with mailx?

Only for local mail, or mail from others with login IDs on the same
box.


--
Any technology distinguishable from magic is insufficiently advanced.
(*) http://www.spots.ab.ca/~keeling Linux Counter #80292
- - http://www.faqs.org/rfcs/rfc1855.html Please, don't Cc: me.
Spammers! http://www.spots.ab.ca/~keeling/emails.html
Back to top
Bit Twister
External


Since: Dec 19, 2004
Posts: 1966



PostPosted: Mon Dec 25, 2006 11:54 am    Post subject: Re: mailx (how is it able to send email?!?) [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Sun, 24 Dec 2006 20:04:18 -0600, Bit Twister wrote:
>
> You may want to
> # cd /etc/postfix
> # grep root: aliases
> and change the root: postfix
> to root: beowulf
>
> Save your change
>
> # postalias aliases
> # postfix stop
> # /bin/cp /dev/null /var/log/mail/errors
> # /bin/cp /dev/null /var/log/mail/info
> # /bin/cp /dev/null /var/log/mail/warnings
> # postfix start

Hmmm, downloaded kubuntu, and installed it.
Seems the location of the above files are defined in
/etc/postfix/postfix-files

Nothing like standardization of applications accross distributions. Sad
Back to top
J.O. Aho
External


Since: Mar 26, 2004
Posts: 2266



PostPosted: Mon Dec 25, 2006 8:10 pm    Post subject: Re: mailx (how is it able to send email?!?) [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Bit Twister wrote:
> On Sun, 24 Dec 2006 20:04:18 -0600, Bit Twister wrote:

> Nothing like standardization of applications accross distributions. Sad

Everyone thinks they know best. You have somewhat similarities when you play
with the same family and use official packages, but directly when comparing
distros from different families or using none official packages, then you see
a lot more differences. This is one of the reasons why GNU/Linux isn't as much
targeted as microsoft with all those viruses, scripts, trojans and so on.


--

//Aho
Back to top
Robert Hull
External


Since: Oct 31, 2004
Posts: 1219



PostPosted: Mon Dec 25, 2006 8:10 pm    Post subject: Re: mailx (how is it able to send email?!?) [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Monday 25 December 2006 14:10, J.O. Aho wrote in
alt.os.linux:

> Bit Twister wrote:
>> On Sun, 24 Dec 2006 20:04:18 -0600, Bit Twister wrote:
>
>> Nothing like standardization of applications accross distributions.
>> Sad
>
> Everyone thinks they know best. You have somewhat similarities when
> you play with the same family and use official packages, but directly
> when comparing distros from different families or using none official
> packages, then you see a lot more differences. This is one of the
> reasons why GNU/Linux isn't as much targeted as microsoft with all
> those viruses, scripts, trojans and so on.

The other reason being the more important one - they just plain can't
work
--
Robert HULL

Archival or publication of this article on any part of thisishull.net
is without consent and is in direct breach of the Data Protection Act
Back to top
Bit Twister
External


Since: Dec 19, 2004
Posts: 1966



PostPosted: Mon Dec 25, 2006 8:10 pm    Post subject: Re: mailx (how is it able to send email?!?) [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Mon, 25 Dec 2006 14:46:35 +0000, Robert Hull wrote:
>
> The other reason being the more important one - they just plain can't
> work

Well, security designed in up front beats security added on later. Smile

I would hate to think we are safer because of the variable location
of ascii configuration files. Sad

Security through obscurity has not seemed to have helped Micro$not very much.
Back to top
J.O. Aho
External


Since: Mar 26, 2004
Posts: 2266



PostPosted: Mon Dec 25, 2006 9:47 pm    Post subject: Re: mailx (how is it able to send email?!?) [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Bit Twister wrote:
> On Mon, 25 Dec 2006 14:46:35 +0000, Robert Hull wrote:
>> The other reason being the more important one - they just plain can't
>> work

Robert, thats just bull, trojans works as fine, no matter what OS, script
using bugs in software works as fine as viruses.


> I would hate to think we are safer because of the variable location
> of ascii configuration files. Sad

The variable location of things makes it more difficult to make a
script/program that affects all GNU/Linux distros, but there are those that
affects a number of distros, like the Ramen which did hit a number of RedHat
based distros, but not debian based. The more distros you have to consider in
a virus the lager it will be and the more difficult it's to hide.
Linux is safer if you don't go around logged in as root user all the time.


> Security through obscurity has not seemed to have helped Micro$not very much.

There are many big design flaws in microsoft, no matter what they do and keep
the backwards compability, it will be a security risk on each machine it's
installed. They could have started anew with the 64bit version, but no.

--

//Aho
Back to top
Robert Hull
External


Since: Oct 31, 2004
Posts: 1219



PostPosted: Tue Dec 26, 2006 2:45 pm    Post subject: Re: mailx (how is it able to send email?!?) [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Monday 25 December 2006 15:47, J.O. Aho wrote in
alt.os.linux:

> Bit Twister wrote:
>> On Mon, 25 Dec 2006 14:46:35 +0000, Robert Hull wrote:
>>> The other reason being the more important one - they just plain
>>> can't work
>
> Robert, thats just bull, trojans works as fine,

Trojans are not now, nor ever have been viruses. Neither would Trojans
depend upon the location of a configuration file; Which - although you
snipped it from your response - was your original suggestion for why
viruses are not written.

> no matter what OS,
> script using bugs in software works

Security exploits are not now nor ever have they been viruses Which -
although you snipped it from your response - was your original point to
which I was responding.

> as fine as viruses.
>
You are right that many of these work as well as viruses - i.e. not at
all - but unfortunately, there are also many which *do* work.

There is not one viable virus in the wild that can automatically run on
a Linux system. Since being able to run automatically - without user
intervention of any sort - and being able to self-replicate are
integral parts of the definition of a computer virus that means that
viruses don't work.

When you find someone who has managed to get beyond the security system
in Linux and make a virus that can be run without user intervention and
self-replicate into other parts of the system in such a way as to be
automatically executed then we can continue the discussion.

If you want to start new discussions about security exploits and Trojan
Horses, that's fine, but please stop trying to mix them up with
viruses.
--
Robert HULL

Archival or publication of this article on any part of thisishull.net
is without consent and is in direct breach of the Data Protection Act
Back to top
Display posts from previous:   
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> General Discussions (archive 2) All times are: Eastern Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum