Solved

How can I specify a write directory for metamail

Posted on 1997-10-22
5
275 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
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…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

863 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

20 Experts available now in Live!

Get 1:1 Help Now