Solved

How can I specify a write directory for metamail

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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
CPU monthly average? 12 120
linux  centos   virtualization network quetion 6 81
cron job says it ran, no results 25 119
Unix Command -- Challenging  question 7 92
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 promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
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.

832 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