Linux - DesktopThis forum is for the discussion of all Linux Software used in a desktop context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have a Linux (Ubuntu) desktop workstation. I would like to be able to send messages to the DC server (which is also the mail server) from a shell script to e.g. notify of a backup completed or such-like, but I really don't want to configure a sendmail server or any other MTA on this workstation. It there a way to send an email without an MTA? I know I could pipe a message into `telnet host 25`, but that seems a bit crude.
I have a Linux (Ubuntu) desktop workstation. I would like to be able to send messages to the DC server (which is also the mail server) from a shell script to e.g. notify of a backup completed or such-like, but I really don't want to configure a sendmail server or any other MTA on this workstation. It there a way to send an email without an MTA? I know I could pipe a message into `telnet host 25`, but that seems a bit crude.
Mailx is one solution, but honestly if you've already got a mail server, you don't have to configure really ANYTHING on postfix or sendmail. Just a single line, defining the smart/relay host, and start the service. Any mail will be relayed to the smart host to deal with.
For sendmail, modify the line in sendmail.cf, look for the line that starts with a capital DS, typically blank on new installations:
Mailx is one solution, but honestly if you've already got a mail server, you don't have to configure really ANYTHING on postfix or sendmail. Just a single line, defining the smart/relay host, and start the service. Any mail will be relayed to the smart host to deal with.
For sendmail, modify the line in sendmail.cf, look for the line that starts with a capital DS, typically blank on new installations:
Code:
DSsome.hostname.com (or use IP address)
Postfix, in main.cf
Code:
relayhost = some.hostname.com
Start either service, and you're done.
So, I guess the answer is "no, you need an MTA". Yes, setting up sendmail is pretty easy, I've done it a-plenty on many systems. I was just hoping to avoid starting another service on this workstation -- and a rarely used one at that.
And, it's not quite true that I "don't have to configure really ANYTHING." I had to get the packages:
apt-get install sendmail heirloom-mailx
and add the following lines to as-shipped /etc/sendmail.mc to make it do what I want:
So, I guess the answer is "no, you need an MTA". Yes, setting up sendmail is pretty easy, I've done it a-plenty on many systems. I was just hoping to avoid starting another service on this workstation -- and a rarely used one at that.
Well, mailx will work in this scenario...I only mentioned postfix/sendmail, because (given your environment), you'd only have to set the one line, and it would be lightweight, given it's only sending the occasional email out.
Quote:
And, it's not quite true that I "don't have to configure really ANYTHING." I had to get the packages:
apt-get install sendmail heirloom-mailx
and add the following lines to as-shipped /etc/sendmail.mc to make it do what I want:
Oh wait! I get it! I could just use mailx and have e.g.
set smtp=my.smart.host
in my $HOME/.mailrc file, and not have sendmail running at all, right? I never tried that before, but I did just now and it seemed to work.
Or I suppose I could use `mailx -S smtp=my.smart.host` - that also works. I didn't realize that's what you guys were driving at. These ideas are actually better because I don't expect message to be received at this workstation.
Yeah, either will work fine. Mailx has a 'built-in' MTA, to let it talk directly to a smart host for relaying. Personally, just configuring the smart host in sendmail/postfix is my preferred solution, but that's just preference.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.