LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Read line in procmail by using formail (https://www.linuxquestions.org/questions/linux-server-73/read-line-in-procmail-by-using-formail-948405/)

newbie.my 06-04-2012 04:23 AM

Read line in procmail by using formail
 
Hi there.
Does anyone know how to extract body of email by using formail in Procmail?the only thing that i can work on right now is this command in my procmail recipe:


Code:

:0fwb
| formail -I "" >> path/to/my/file.txt

but this command will also read the bogus "Content-type" such as this one :

Code:

--20cf3079bcb6f4074904c1a181f1
Content-Type: text/plain; charset=ISO-8859-1

this is the content of email

--20cf3079bcb6f4074904c1a181f1
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

this is the content of email
--20cf3079bcb6f4074904c1a181f1--

I only want the content file.
Can somebody help me?thanks

unSpawn 06-04-2012 11:23 AM

Why not use Multipart MIME Content-.* headers like they should be used and pipe the message through OpenSSL in base64 mode, mmencode, mimencode, metamail, mimeexplode or ripmime to get the actual attachments?

newbie.my 06-04-2012 08:42 PM

Quote:

Originally Posted by unSpawn (Post 4695255)
Why not use Multipart MIME Content-.* headers like they should be used and pipe the message through OpenSSL in base64 mode, mmencode, mimencode, metamail, mimeexplode or ripmime to get the actual attachments?

How can i do this?Can you show me some example please?
Thanks.

unSpawn 06-05-2012 12:15 AM

It's the same kind of pipe recipe as you've used already. The switches you need, "-i -" and "-d /path/to/extraction_directory" minimally, are documented at the ripMIME site: http://www.pldaniels.com/ripmime/.


All times are GMT -5. The time now is 02:22 AM.