From owner-freebsd-questions@FreeBSD.ORG Thu Apr 25 00:12:21 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3CC71674 for ; Thu, 25 Apr 2013 00:12:21 +0000 (UTC) (envelope-from jhs@berklix.com) Received: from flat.berklix.org (flat.berklix.org [83.236.223.115]) by mx1.freebsd.org (Postfix) with ESMTP id B9714153C for ; Thu, 25 Apr 2013 00:12:20 +0000 (UTC) Received: from mart.js.berklix.net (p5DCBF1E4.dip0.t-ipconnect.de [93.203.241.228]) (authenticated bits=128) by flat.berklix.org (8.14.5/8.14.5) with ESMTP id r3P0BJAM039714; Thu, 25 Apr 2013 02:11:20 +0200 (CEST) (envelope-from jhs@berklix.com) Received: from fire.js.berklix.net (fire.js.berklix.net [192.168.91.41]) by mart.js.berklix.net (8.14.3/8.14.3) with ESMTP id r3P0CQWG005844; Thu, 25 Apr 2013 02:12:26 +0200 (CEST) (envelope-from jhs@berklix.com) Received: from fire.js.berklix.net (localhost [127.0.0.1]) by fire.js.berklix.net (8.14.4/8.14.4) with ESMTP id r3P0C5NX037535; Thu, 25 Apr 2013 02:12:10 +0200 (CEST) (envelope-from jhs@fire.js.berklix.net) Message-Id: <201304250012.r3P0C5NX037535@fire.js.berklix.net> To: freebsd-questions@freebsd.org Subject: Re: Procmail Decoding Mime Messages From: "Julian H. Stacey" Organization: http://berklix.com BSD Unix Linux Consultancy, Munich Germany User-agent: EXMH on FreeBSD http://berklix.com/free/ X-URL: http://www.berklix.com In-reply-to: Your message "Thu, 25 Apr 2013 00:04:36 +0200." <20130425000436.5b999ba5.freebsd@edvax.de> Date: Thu, 25 Apr 2013 02:12:05 +0200 Sender: jhs@berklix.com Cc: Polytropon , Ryan Frederick , Martin McCormick X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2013 00:12:21 -0000 Polytropon wrote: > On Wed, 24 Apr 2013 16:07:35 -0500, Martin McCormick wrote: > > Is there a filter that one can run in procmail in which > > base64 encoded data go in and text comes out so one can allow > > procmailrc to do its work? Good question, I havent tried that yet, (but should), but I have been demiming both to help majordomo on servers, & via procmail on local (to reduce bulk on my future archives of personal mail). 2 tools worth knowing in /usr/ports/mail/ : demime emil A few notes from my http://berklix.com/~jhs/src/bsd/fixes/freebsd/ports/jhs/mail/Makefile.local (where I've also more notes on eg much hated quoted-printable ) -------- SUBDIR += emil # A candidate to be assesed for stripping quoted-printable from # majordomo on server, to help cluless people. # Something needed to replace demime as demime has been removed. # SUBDIR += mime4j # "It won't do any decoding of base64 or quoted-printable # encoded header fields and bodies." SUBDIR += demime # For majordomo on list servers, # For all the many lazy & incompetents who cant turn off sending # HTML to mail lists, despite having had a decade to learn. # (& for a few people who do understand they should, have tried to, but # can''t find where to turn off their HTML, if their ISP even allows. # Missing in FreeBSD-9.1-RELEASE so see also SUBDIR += mail/emil -------- > > Is there anything which will take a raw email message > > and spit out linear strings which can be processed like normal > > text? See man emil ; man demime PS Trying to get procmail to work with a macro with a pipe defined after + $RCVSTOREUNSEEN, was a long pain & I failed so I use a longer version below which works, appended for syntax example. RCVSTORE=/usr/local/libexec/nmh/rcvstore RCVSTOREUNSEEN="$RCVSTORE -nounseen" # A 2nd copy, just text, stripped of MIME enclosures is # stored in $PRI_MAIL by $RCVSTOREUNSEEN # The 2nd copy is stored with $RCVSTORE -nounseen so I dont have to # click the archive copy from within exmh. NOMIME="/usr/local/bin/demime -8 -" # Demime is not in current after 9.1-RELEASE # To not demime instead use NOMIME=cat # NOMIME=cat # NOMIME=/usr/local/bin/emil # Emil converts a .jpg MIME to a uuencoded appended without MIME # I can not seem to achieve something like this: # XYZ="$NOMIME | $RCVSTOREUNSEEN" { :0 cw | $NOMIME | $RCVSTOREUNSEEN +$PRI_MAIL/my/archive :0 wc | $RCVSTORE +$INBOX_PLAIN } Cheers, Julian -- Julian Stacey, BSD Unix Linux C Sys Eng Consultant, Munich http://berklix.com Reply below not above, like a play script. Indent old text with "> ". Send plain text. No quoted-printable, HTML, base64, multipart/alternative.