Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 308
  • Last Modified:

How can I specify a write directory for metamail

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
mag062397
Asked:
mag062397
  • 2
  • 2
1 Solution
 
n0thingCommented:
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
 
mag062397Author Commented:
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
 
ozoCommented:
"|METAMAIL_TMPDIR=/home/mydir/mymail; export METAMAIL_TMPDIR; /usr/bin/metamail -d -e -q -w -x"
0
 
ozoCommented:
Or you could have a .mailcap entry like
text/plain; cat >home/mydir/mymail/%{name};
0
 
mag062397Author Commented:
The answer in conjunction with ozo's 1st comment will solve my problem.

Thanks alot to both of you.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now