Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Apr 2013 02:12:05 +0200
From:      "Julian H. Stacey" <jhs@berklix.com>
To:        freebsd-questions@freebsd.org
Cc:        Polytropon <freebsd@edvax.de>, Ryan Frederick <ryanrfrederick@gmail.com>, Martin McCormick <martin@x.it.okstate.edu>
Subject:   Re: Procmail Decoding Mime Messages 
Message-ID:  <201304250012.r3P0C5NX037535@fire.js.berklix.net>
In-Reply-To: Your message "Thu, 25 Apr 2013 00:04:36 +0200." <20130425000436.5b999ba5.freebsd@edvax.de> 

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
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.



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?201304250012.r3P0C5NX037535>