<<< Date Index >>>     <<< Thread Index >>>

Re: How to modify the content type of a file from the command line



Hello Steven,

Am 2006-05-25 11:56:01, schrieb Steven Lamb:
> I am attempting to release email files from quarantine. However it is clear
> that when I send the message that the content type is coming up as plain
> text where I believe what I want is to send it as a message/rfc822. to my
> knowledge that is how you package an email for something like a bounced
> message. That is at least my desired result. I am attempting to do this all
> from a script, and am running Linux RedHat fedora core 4. 

----8<--------------------------------------------
#!/bin/bash

TMP=`mktemp -t XXXXXX`

MSG=$1

echo "\
From: Steven-Daemon@xxxxxxxxxxxxx
To: `formail -x To: <$MSG`
Date: `date -R`
Subject: QUARANTINED MESSAGE [`formail -x Subject: <$MSG`]
Message-ID: <`date -R`@somdomain.net>
Content-Type: multipart/digest; boundary=steves-daemon-boundary

--steves-daemon-boundary
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

    This was a quarantined message

--steves-daemon-boundary
Content-Type: message/rfc822
Content-Disposition: inline

`cat $MSG`

--steves-daemon-boundary--
" >$TMP

/usr/sbin/sendmail -t <$TMP

if [ $? -eq 0 ] ; then
  rm -f $TMP
fi
----8<--------------------------------------------

> Any help is appreciated 
> 
> Steven Lamb 

Greetings
    Michelle Konzack


-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
##################### Debian GNU/Linux Consultant #####################
Michelle Konzack   Apt. 917                  ICQ #328449886
                   50, rue de Soultz         MSM LinuxMichi
0033/6/61925193    67100 Strasbourg/France   IRC #Debian (irc.icq.com)