Solved

How can I specify a write directory for metamail

Posted on 1997-10-22
5
299 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

When you do backups in the Solaris Operating System, the file system must be inactive. Otherwise, the output may be inconsistent. A file system is inactive when it's unmounted or it's write-locked by the operating system. Although the fssnap utility…
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

752 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