LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 06-04-2012, 04:23 AM   #1
newbie.my
LQ Newbie
 
Registered: Jun 2012
Posts: 6

Rep: Reputation: Disabled
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

Last edited by newbie.my; 06-04-2012 at 04:25 AM.
 
Old 06-04-2012, 11:23 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,159
Blog Entries: 54

Rep: Reputation: 2796Reputation: 2796Reputation: 2796Reputation: 2796Reputation: 2796Reputation: 2796Reputation: 2796Reputation: 2796Reputation: 2796Reputation: 2796Reputation: 2796
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?
 
Old 06-04-2012, 08:42 PM   #3
newbie.my
LQ Newbie
 
Registered: Jun 2012
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by unSpawn View Post
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.
 
Old 06-05-2012, 12:15 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,159
Blog Entries: 54

Rep: Reputation: 2796Reputation: 2796Reputation: 2796Reputation: 2796Reputation: 2796Reputation: 2796Reputation: 2796Reputation: 2796Reputation: 2796Reputation: 2796Reputation: 2796
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/.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
formail fails on virtual user [qmail,vpopmail,procmail,formail] jonavogt Linux - Networking 2 01-15-2009 09:29 AM
formail with procmail priyesh Programming 2 10-22-2003 11:01 PM
Procmail and formail aBl_tR3kr Linux - Software 1 03-26-2003 10:15 AM
procmail and formail aBl_tR3kr Linux - Networking 1 03-26-2003 10:02 AM
procmail and formail aBl_tR3kr Linux - Newbie 0 03-26-2003 09:41 AM


All times are GMT -5. The time now is 04:37 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration