LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   SMTP not configured ... why it still work? (https://www.linuxquestions.org/questions/linux-software-2/smtp-not-configured-why-it-still-work-136661/)

mikshaw 01-20-2004 07:17 AM

SMTP not configured ... why it still work?
 
I was messing around with various email clients, looking for the quickest way to send messages from console. I settled on nail, because all you need to do is
Code:

nail username@domain.poo
subject: subject line
some text
Ctrl-D

without needing to launch the client, see a list of messages, type m, blah blah, type q

So I was testing it out, and it works great.
The thing that puzzles me is that I never configured any SMTP settings...no server address, no username or password...it just gets sent through my ISP like any other packets apparently.
The information I received on the other end was just my IP address and my local email address (mik@bungle.local).

Funny stuff....

neilcpp 01-20-2004 07:30 AM

Could it be that no SMTP was needed as you were sending a message within your home (subnet) network? Maybe this is the default setting for this package??

Have you tried sending a email out to somewhere on the net??? - if this experiment works, I would be very interested to hear about it..

Thanks

mikshaw 01-20-2004 09:08 AM

That's what I did, which is why I'm curious about this. I sent a test message to my yahoo account and it was promptly delivered to its destination.
I'm thinking perhaps SuSE auto-configured a temporary setup for sendmail that would work from any location.

msh8r 01-20-2004 01:37 PM

mikshaw - I guess that you have sendmail or postfix installed and running. In either case you don't have to configure any SMTP settings - your machine simple is the SMTP server, i.e. it will send messages from your machine to any valid email address.

Just keep in mind that you always want this service allowed to local user only (relay rules, firewall settings), else you'd be running an open mail relay and sooner or later be (ab)used by spammers - resulting in all kind of nasty sideeffects.

mikshaw 01-20-2004 01:52 PM

Hmmm....just sent a message as root and it works. I guess that's not a good thing?
Funny that suse would configure it that way by default...or maybe I'm mistaken about what you mean? Perhaps it doesn't work for incoming mail....
I noticed that root doesn't have a mailbox, and I couldn't create one when mutt asked me if I wanted to do so.

Thanks for the heads-up.

msh8r 01-20-2004 02:06 PM

The main purpose for SMTP on your machine is that the system can send error messages, logs, etc. to the mail account associated with root. Any user who can locally log on to the machine should be able to send mail by default - using the "mail" program from the shell, for instance. Nothing wrong with that. Of course, root can and should always be able to send mail as well. You can also use "mail" without any parameters to see if there is any mail in your local mailbox (as root for the root user).
If you want the daily log messages that are being sent to root@localhost and have your machine connected to the Internet, you can change the alias for root (on my RedHat machines in /etc/aliases) to point to your "real" email address - expect a new email from your system in your inbox every morning that tells you how it's doing.
Test this with "mail root" from the shell.

What you want to be careful about though is that no-one from the outside can use your SMTP server, unless specifically allowed by you - that was what I meant with my open-relay warning.
If someone sets his mail-client's SMTP server to point to your machine, it should either not allow a connection at all (port 25 blocked by firewall), or reply with "relaying denied" message.
The exception would be if you wanted to run your own SMTP server and allow others to use it - in that case you'll have some home work to do before setting it up ;-)

mikshaw 01-20-2004 05:31 PM

On my system mail is a link to nail, so I guess I was already doing that. Also, during installation I was asked if I wanted to receive root's mail, and I thought that would be a good idea, so I suppose root must be an alias as you mentioned.

I'll have to do some more reading to make sure I'm as secure as I hope I am...which is still probably far from being truely secure, but I'm working on it.....

BTW....since I have nail instead of mail, I'm wondering how similar they are. Does mail have a -R flag to set a reply-to address?
The reason I ask is because I've written a script to make nailing remote addresses even simpler than it already is (using a nickname rather than an email address)...I'm curious if my -R inclusion will still work if I extend the script for use with mail as well as nail.

Thanks for your assistance.

edit: found the manpage for mail...apparently it doesn't have a reply-to flag, so I'll just leave this script as nail-only


All times are GMT -5. The time now is 12:55 PM.