- Integrated Systems
- About Us
- Integrated Systems
- About Us
09-08-2004 04:27 AM
We have an application that creates a file in a MS Word format on an HPUX 11.x server. The file is mailed by mailx to users on several mail systems. All users except those running Microsoft Exchange are able to receive the file as an attachment and open it succesfully. The Excange users open the attachment but get garbled text.
The command we use to mail the file is:
uuencode file.doc file2.doc | mailx -s"subject" mail.group
Has anyone else seen this problem?
09-08-2004 04:32 AM
Have you tried with a .mailrc file containing:
# set mimeheader=yes
all the best
09-08-2004 05:28 AM
I found this DOC...
All the best
Command-line mailing with subject, body text and attachments DocId: KBAN00000679 Updated: 20010420
Customer wants to be able to create a script to email a binary file to a
distribution list, with a subject line so recipients can readily identify it,
and body text explaining what the attachment is and what to do with it. To do
that, they need a method of creating and sending such a message.
The method involves assembling a message from two separate parts, consisting of
a header which contains the body text and of a uuencoded attachment, then
sending it using the "-t" sendmail flag, which causes sendmail to scan the
message body for such things as addresses and the subject.
The first part of the message is a header, which looks like this:
Then beginning on this line, you write the body text you want to include.
As you can see, the customer could easily put together a template header file
with variables in key positions, so a script to create and send the messages
could just grab the template and substitute the necessary values for the
variables. It's not necessary to include bcc or cc lines if they're not going
to be used.
Creating the message, then, is a matter of appropriately modifying a copy of
the header, and writing it to a temporary file. Then uuencode the attachment
file and ">>" redirect it to the same temporary file. Now send the contents of
that temporary file to sendmail, using the "-t" flag.
For example, let's say you have a report that you always send to the same
people, always using the same body text and subject line. For that you could
create a fixed header file, called "header" in this example. To distribute the
# cp header > /var/tmp/mailtemp
# uuencode /path/datafile datafile >> /var/tmp/mailtemp
# cat /var/tmp/mailtemp | sendmail -t
# rm /var/tmp/mailtemp
That's all. Because of the "-t" flag, sendmail will read the header for
addressing and subject information. Uuencoded files with a ".csv" suffix sent
in testing arrived at an Outlook client as attachments which called up Excel
just as they should, while the body text part of the header file arrived as
Aliases were mentioned above in the description of the header. This is part of
sendmail, and works whether you're sending mail using sendmail alone, or with
ELM or mail or mailx or any client using sendmail as a transport vehicle.
In /etc/mail there's a file called "aliases," and in it you can define both
individual aliases and mailing lists. The basic format can be seen by just
looking at the file or consulting the man page for aliases(5). To define a
list, you start the line with the alias for the list, then after a ":"
delimiter, list the addressees (full address or alias) separated by commas.
It's okay to add a space after the comma for clarity. All addresses have to be
on the same line as the alias for the list; a new line is taken as the end of
the list. Sendmail doesn't usually use the aliases file itself, though, but
rather "aliases.db," so after you're done editing the aliases file you have to
issue the command "newaliases" to re-read the aliases file and re-write the
09-08-2004 06:00 AM
uuencode file.doc file2.doc | mailx -m -s "subject" mail.group
live free or die
10-01-2007 08:22 AM
What could I be missing?
10-01-2007 08:36 AM
Here is a guide with an internal link that will permit you to do one of two things:
1) Use our working script (sendmail sorry)
2) Fix your code.
Owner of ISN Corporation
11-02-2007 08:40 AM
Attached is an in house doc we use for attachments plus using mailx. I believe Harry's suggestion should have worked, and the -m is an important key as is ux2dos.
Best of luck on this.
11-02-2007 03:13 PM
nothing, but if I _were_ doing it, I'd almost
certainly be trying to use a MIME program
like mpack (which has been around for a dozen
years) instead of uuencode. I would assume
that modern e-mail software expected MIME
encapsulation, and might easily have stopped
caring whether uuencode encapsulation still
worked, even if it were done correctly.