From owner-freebsd-questions@FreeBSD.ORG Wed Feb 13 23:56:14 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DDF86725 for ; Wed, 13 Feb 2013 23:56:14 +0000 (UTC) (envelope-from kurt.buff@gmail.com) Received: from mail-ea0-f176.google.com (mail-ea0-f176.google.com [209.85.215.176]) by mx1.freebsd.org (Postfix) with ESMTP id 7972B8C7 for ; Wed, 13 Feb 2013 23:56:14 +0000 (UTC) Received: by mail-ea0-f176.google.com with SMTP id a13so757040eaa.35 for ; Wed, 13 Feb 2013 15:56:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=8ctd7AK8YWzcJmmlNWh7t+yy4C1OTLJ64hCxvJ99UfA=; b=RiMrG/2FQZb3DClx2hRhpOWPmdFdCYX7NGCO3yBRAC7hw1BfTBldZcVqnvXAoDmZoR w6Dlbbn0aHBmps9sln3zbhcnt5wdBwYmtdyCTqtADdPF51oDIzNJXICXO78M5cEljJwc 4AKh8tN4pkfJy01bRPRoAFgS1/cAK0zOhdWrR42mn5zdfS2lDCW2k/a7a/hKABCOXwt8 uiuH0Ng3fi+upMQQxuuvtd4C0yozrw25zTfU4NmQBb/qEQrPc4Dzg7RO+0loTKRaFmSq ePK4pciYjqqkkICWt6ejAsaZfPS/mTeWvUbdj4TRT6pSPEogu1R5iFyZOx4gOC+s95Gr GktA== MIME-Version: 1.0 X-Received: by 10.14.175.70 with SMTP id y46mr79864577eel.6.1360799767034; Wed, 13 Feb 2013 15:56:07 -0800 (PST) Received: by 10.14.99.14 with HTTP; Wed, 13 Feb 2013 15:56:06 -0800 (PST) In-Reply-To: <20130214004913.a89dc042.freebsd@edvax.de> References: <20130214004913.a89dc042.freebsd@edvax.de> Date: Wed, 13 Feb 2013 15:56:06 -0800 Message-ID: Subject: Re: Re-sending selected e-mail messages From: Kurt Buff To: Polytropon Content-Type: text/plain; charset=UTF-8 Cc: FreeBSD Questions 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: Wed, 13 Feb 2013 23:56:14 -0000 On Wed, Feb 13, 2013 at 3:49 PM, Polytropon wrote: > I need a way to automatically re-sent stored e-mail messages > according to some criteria and like to ask for advice or > suggestions for an already existing solution before I start > reinventing the wheel. :-) > > The messages in question are stored in MH format. This is a > tree where a mailbox equals a directory, and the individual > files in that directory equal the messages. They are numbered > 1, 2, 3, 4, ..., and so on. Each message is in > > Content-Type: text/plain; charset=ISO-8859-1 > Content-Transfer-Encoding: quoted-printable > > or > > Content-Type: text/plain; charset=US-ASCII > Content-Transfer-Encoding: 7bit > > or maybe even > > Content-Type: text/plain; charset=UTF-8 > Content-Transfer-Encoding: 8bit > > text format. Some of them might contain an attachment, which > is "included" in the file with something like > > --Multipart=... > Content-Type: ...; > name="..." > Content-Disposition: attachment; > filename="..." > Content-Transfer-Encoding: base64 > --Multipart=...--- > > Some messages are "fully multipart". > > So when iterating on ~/Mail/sent/1,2,3,4,5,... I get all the > messages. Each third line, "To:", is the criteria to look at. > If it matches a given recipient, the mail should be sent again. > This can easily be done by the system's mailer which is properly > configured (and uses ISP's MX), so | mail -s "maybe new subject" > is possible. The message should already be properly pre-composed. > > What is the easiest way to do this without reinventing the wheel, > or should I? :-) Perhaps mini_sendmail? Seems fairly capable, and scriptable. Kurt