Solved

How can I specify a write directory for metamail

Posted on 1997-10-22
5
264 Views
Last Modified: 2010-04-22
I trying to mail files to a user which has the following entry in his .forward file:
"|/usr/bin/metamail -d -e -q -w -x"
However any files I attach to my message get saved in /tmp.

How can I specify where metamail should save the files?
0
Comment
Question by:mag062397
  • 2
  • 2
5 Comments
 
LVL 5

Accepted Solution

by:
n0thing earned 150 total points
ID: 2007545
Hi,

  From the man pages:

 METAMAIL_TMPDIR
        If set, this variable overrides "/tmp" as the name
        of the directory in which metamail and associated
        programs will create temporary files on UNIX.

 So if you're using csh just do
   "setenv METAMAIL_TMPDIR /home/myid/mymail" in your .cshrc
 or Bourne shell
"set METAMAIL_TMPDIR=/home/mydir/mymail; export METAMAIL_TMPDIR

Regards,
Minh Lai

0
 

Author Comment

by:mag062397
ID: 2007546
Okay, however, I'm not using a shell (directly). Or, I'm not sure were to set that env variable for use in a user's .forward file.

I guess, if you can't specify the directory on the command line, the question now becomes how can I set the env variable in the .forward file and still pipe the input into the metamail command.

Does that make sense?

Just keep in mind that sendmail is the one calling metamail, so I need to specify the directory in some way or set then unset the env variable.

0
 
LVL 84

Expert Comment

by:ozo
ID: 2007547
"|METAMAIL_TMPDIR=/home/mydir/mymail; export METAMAIL_TMPDIR; /usr/bin/metamail -d -e -q -w -x"
0
 
LVL 84

Expert Comment

by:ozo
ID: 2007548
Or you could have a .mailcap entry like
text/plain; cat >home/mydir/mymail/%{name};
0
 

Author Comment

by:mag062397
ID: 2007549
The answer in conjunction with ozo's 1st comment will solve my problem.

Thanks alot to both of you.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (http://www.experts-exchange.com/articles/OS/Unix/Solaris/Installing-the-Solaris-OS-From-the-Flash-Archive-on-a-Tape.html), discussed installing the Solaris Operating S…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now