Operating System - HP-UX
1824069 Members
3015 Online
109668 Solutions
New Discussion юеВ

Mailx with attachments / versions

 
SOLVED
Go to solution
Beverly Wixon
Advisor

Mailx with attachments / versions

Hello,

I really am sorry about yet another post regarding using mailx to force attachments. I have read about 20 other posts regarding this -- and checked all the links for other threads on it. I have tried all the solutions out there. I still get the supposed attachment merged into the message.

I have noticed that many of you have stated that one needs a current copy of ELM or a particular patch or whatever. I am not the Unix sysadm, but have been tasked with finding out how to force attachment from HP-UX 10.20 and 11.0 boxes. Since I am not the sysadm, I really don't know where to find the info concerning versions of the mailx, or elm, or any of the other items. That info alone might help me to solve my issue.

I know we use mailx and elm does not seem to be set up. I tried to use elm from an 11.0 box and received this message:
------------------------------------------------------------------------
Notice:
This version of ELM requires the use of a .elm directory to store your
elmrc and alias files. I'd like to create the directory .elm for you
and set it up, but I can't in "batch mode".
Please run ELM in "normal mode" first.
------------------------------------------------------------------------
From a 10.20 box, I received "Mail sent!" The problem is I haven't received it yet.

Please note, I have tried the [include xxxxx] line; uuencode; etc.

I have not tried any third party tools, although I have seen that mpack seems to be rather popular. If anyone could give me more info on mpack or how to find the information regarding elm versions and pathces, I would greatly appreciate it.

My task is basically research and discovery. The decision will be from above.

Thanks a bunch.

Beverly


6 REPLIES 6
Rita C Workman
Honored Contributor
Solution

Re: Mailx with attachments / versions

Hi Beverly,

You have a few issues here. But maybe (along with others support also) we can get you started.
First.
Sendmail is the internet mail transport software.
...so this must be configured properly to get email in/out properly. Files as ~/sendmail.cf ~/resolv.conf ~/nsswitch.conf are important files to ensure they are set up right based on your inhouse mailing needs.
Next.
Mailx is a message processing utility....but....
elm is mail processing software with user inferace screens. (Which is why I generally say...elm)

So if your message said sent and you didn't get it...why?
You may want to test that your Sendmail on your UNIX servers is working...(now I'm no expert on setting up senmail..)
But to test:
#sendmail -v -s"test message" user@email.com

type your message on each
line as you see here
and when your all done
type a period to end your message
.

You should see the full details of your message and how it is route (or if it is just hanging...). So if this works that will show your mail is setup ok on your UNIX box. If not, you can either post another thread to work through that issue...or maybe someone else will jump in here to help you set up those files I mentioned above, etc.

Now for that issue about elm needs directories. You should be logged in as yourself (with a home account) and when you type 'elm' on the command line and see this message...check ok to create. Once created and you type elm the interface mail screen will appear or you could still mail using command line like this:
elm -s"subject" user@email.com
Hope this give you something to get you started,
Rita

John McAloon
Advisor

Re: Mailx with attachments / versions

Bev-

We "wrap" the attachment between a MIME header file and a trailer file. The header file tells the mail system that this will be a multi-part message, includes a brief part to be in-line (inside the mail message) explaining how to handle this, definition of how the parts are seperated, and the header for the part where the attachment will be. The header file is cat'ed with the attachment file and the trailer and piped to mailx.

The header looks like this:
MIME-Version: 1.0
Content-type: multipart/text; boundary="xxxx"
Content-Transfer-Encoding: 7bit

--xxxx
Content-Type: text/plain; charset=US-ASCII; name="BDY.TXT"
Content-Disposition: inline; filename="BDY.TXT"
Content-Transfer-Encoding: 7bit

Unix generated report is attached.

** Please LAUNCH this attachment; do not use VIEW. **

NOTE: For best printing of a 132 column report, when
in WORDPAD, go to Page Setup on the File menu, change
the orientation to Landscape and change both the right
and left margins to 0 (don't worry when they change
automatically to .2). You also will need to change the
font to print the full 132. Go to the Edit menu and
choose "Select All". Go to the Format menu and choose
"Font". Change the font size from 10 to 9.

--xxxx
Content-Type: text/plain; charset=US-ASCII; name="REPORT.WRI"
Content-Disposition: attachment; filename="REPORT.WRI"
Content-Transfer-Encoding: 7bit

And the trailer looks like this:

--xxxx--



Chris Calabrese
Valued Contributor

Re: Mailx with attachments / versions

This is usually done by having metamail bundle up all the headings and such for you.

HP-UX bundles pieces of metamail, but not enough of it to do what you want. You can pick up the rest of it from ftp://thumper.bellcore.com/pub/nsb/mm2.7.tar.Z
Brainbench MVP for Unix Administration and Internet Security, SANS Review Editor, and Center for Internet Security HP-UX Benchmark project leader
Beverly Wixon
Advisor

Re: Mailx with attachments / versions

Thank you all for your comments and suggestions. I passed the information to my Sr. DBA.

I was able to get elm to work. Thank you, Rita. I just didn't want to mess up any configurations, so it was nice to find out that just saying "yes" would not create havoc.

But, now I have another question. We use HP's and Suns here. Is elm available for both? Or is it only available in HP's Unix?

Again, thank you all so very much.

Rita C Workman
Honored Contributor

Re: Mailx with attachments / versions

I have only touched a couple Sun boxes...never 'really' worked on them....so.... I believe Sun has sendmail and mailx....but I can't say for a certain it has elm...
If someone (who knows 100%) doesn't respond here, you might repost the question on it's own merits.

Regards,
Rita
Satish Y
Trusted Contributor

Re: Mailx with attachments / versions

No, As far as I know elm is not available in SUN's prior versions, I am not aware of latest version.

Cheers...
satish.
Difference between good and the best is only a little effort