• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

A simple mail command line utility?

Ace69

Senior member
I want to be able to send a text file on the command line. I want to be able to do this in one line. I DON'T want to install sendmail, so mail -s "subject" email@domain.com < textfile will not work. Does anyone have any suggestions for a simply SMTP program that will do this for me?

btw, I am running Red Hat 7.1
 
Have you tried mailx you should find an rpm in the RH cds

From rpm -qi mailx


<<
Name : mailx Relocations: (not relocateable)
Version : 8.1.1 Vendor: Red Hat, Inc.
Release : 10 Build Date: Fri Feb 4 00:46:20 2000
Install date: Wed Jul 19 22:35:47 2000 Build Host: porky.devel.redhat.com
Group : Applications/Internet Source RPM: mailx-8.1.1-10.src.rpm
Size : 73465 License: BSD
Packager : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>
Summary : The /bin/mail program, which is used to send mail via shell scripts.
Description :
The mailx package installs the /bin/mail program, which is used to
send quick email messages (i.e., without opening up a full-featured
mail user agent). Mail is often used in shell scripts.

You should install mailx because of its quick email sending ability,
which is especially useful if you're planning on writing any shell
scripts.
>>



Good Luck!
 
/bin/mail is not part of sendmail. It is part of the mailx package, which you may already have installed, perhaps not.
 
but mailx uses sendmail, just found that out...... I tried it on my lappy and no go, it won't send the mail because
I don't have sendmail.....

Sorry ace 🙁
 
It should be easy to install Postfix and configure it with yours source domain, and it is compatible with sendmail.
 
There has to be some simple little shell script that I can use.

All I would have to do is have it let me specify the SMTP server, subject and give me the ability to attach a text file.
 
Well, I think you're just going to have to live with installing an MTA. sendmail, qmail, postfix, and exim are options.

Since you need access to port 25 (a privileged port), any script that might conceivably do what you want would probably have to have elevated privileges.

I searched Freshmeat to no avail.

Good luck.

(btw, is the objection to sendmail the space it takes up? security concerns? you just don't like sendmail? cpu/memory limitations?)
 
This is one that looked very good for my purposes. ---> smtpclient. It works great, but I can't attach the file, it looks like.

I don't want to mess with Sendmail because I believe that it is just overkill for what I am trying to do and it would be one less thing to load on bootup. I am going to install Sendmail eventually, but I just don't want to right now.
 
Here's a Perl module, I can't say how useful it would be to you.

Installing sendmail wouldn't be overkill. It takes up very minimal resources (at least on my box), and it's a snap to configure if you're used to it. It's much more of a help than a hassle.


 
Back
Top