Re-sending selected e-mail messages

2013-02-13 Thread Polytropon
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? :-)







-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Re-sending selected e-mail messages

2013-02-13 Thread Kurt Buff
On Wed, Feb 13, 2013 at 3:49 PM, Polytropon free...@edvax.de 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
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Re-sending selected e-mail messages

2013-02-13 Thread Lowell Gilbert
Kurt Buff kurt.b...@gmail.com writes:

 On Wed, Feb 13, 2013 at 3:49 PM, Polytropon free...@edvax.de 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. :-)

[...]

 Perhaps mini_sendmail? Seems fairly capable, and scriptable.

Or maybe procmail's tools (I'm thinking in particular of procmail,
although there are some other bits and bobs that might relate also) 
would serve the particular selection criteria?
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Re-sending selected e-mail messages

2013-02-13 Thread Waitman Gobble
On Feb 13, 2013 3:49 PM, Polytropon free...@edvax.de 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? :-)







 --
 Polytropon
 Magdeburg, Germany
 Happy FreeBSD user since 4.0
 Andra moi ennepe, Mousa, ...
 ___
 freebsd-questions@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to 
freebsd-questions-unsubscr...@freebsd.org

I'm working on an email related project, you might hack it to work for you.

https://github.com/waitman/elmboxo

check out pmess.c it can do a single message. (the easy way to feed pmess a
single message is actually to feed the single message to elmboxo as it is
coded)

anyway its built to stuff them in a mongodb db, but I.m working on a free
nosql solution that works for my project. you can just chuck all those bits.

an idea.

Waitman Gobble
San Jose California
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Re-sending selected e-mail messages

2013-02-13 Thread Robert Bonomi

 Date: Thu, 14 Feb 2013 00:49:13 +0100
 From: Polytropon free...@edvax.de
 To: FreeBSD Questions freebsd-questions@freebsd.org
 Subject: Re-sending selected e-mail messages

 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. 

 What is the easiest way to do this without reinventing the wheel,
 or should I? :-)

procmail is your friend.

  cat ~/sent* |procmail -f resendrc

where resendrc is:

   emailaddr=f...@bar.baz
 
   :0 
   *^To: *${emailaddr}
   *^Subject:\/.*$
   | formail -I Subject: {resend} ${MATCH} | $SENDMAIL -oi -t

Delete the 'formail' if you want the Subject: unmolested.


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org