procmail
[Top] [All Lists]

Re: Adding date to file name

1999-06-23 20:25:53


On Wed, 23 Jun 1999, era eriksson wrote:

On Sat, 19 Jun 1999 02:53:15 -0700 (PDT), Larry Wright
<lwright(_at_)netcom(_dot_)com> wrote:
 > I get one message a day from a particular source. I'd like to send that
 > email message to a different directory as a separate file, with the file
 > name being the source, with the date appended in YYMMDD format (example:
 > from JSmith(_at_)hisadd(_dot_)com --> filename JSmith990612). I'd prefer 
the date to
 > be the date of the message, but the local machine date would be OK if
 > easier to do. How can I add the formatted date, within procmail, to make
 > the file name? 

Grab it out of the From_ line. See recent messages to the list about
this. I also updated the FAQ with an answer to this question. See
<http://www.iki.fi/era/procmail/mini-faq.html>

I checked the past messages & the faq. They mostly address getting data
from the line. As I see it, the problem is in correctly getting and then
formatting the data one would get from the From_ line into YYMMDD format.
Any suggestions much appreciated. 

In a way, it's simpler to just use the same file all the time, and
then rename it to `date +name-%y%m%d` each night out of a cron job.

This may indeed be easier. I'm checking to see if we can run cron - my 
recollection is that we are no longer able to do this.

But if the messages always come from the
same source, it should certainly be doable.

They are, so this problem should be simpler (no Korean :-).

 > In the near future, the info I need will be in an attachment
 > (possibly as octet coded text) rather than the msg text. Is there a
 > way to get the info from the coded attachment, and save it as a
 > text file with the date?

I don't understand this. But the simple and straightforward answer is
that if you can do it (in this case, extract the data you need from
the attachment) from the Unix prompt, you can do the same thing from
within Procmail.

The info is in a MIME attachment. I can get these from within Pine, which
will write the attachment out as a file. Someone suggested uudeview, but
we don't have that pgm at my ISP. I'm not sure how to get the attachment
text, from the Unix prompt, with what we have. Any alternative suggestions
/ pgms much appreciated. 

Thanks much,

Larry

<Prev in Thread] Current Thread [Next in Thread>