procmail - notification when recipe creates new mail folder

procmail - notification when recipe creates new mail folder

am 24.05.2005 19:54:04 von Hans Kirchmeyr

Hi,

I have created the following procmail recipe:

# mailing lists
:0:
* ^X-list: \/.*
$MATCH/

Does the following:
-------------------
If there's a "X-list" header entry (most of my subscribed lists have one)
then the mail will be moved to the mail folder with the matched part of the
x-list header entry. If the folder doesn't already exist, procmail
automatically creates it.

And here comes the problem:
---------------------------
As long as the user doesn't synchronise the folders in his webmail or IMAP
client he wont ever see, that there are new folders with mails waiting...

Question:
---------
Can I tell procmail somehow to send the user an email notification when it
created a new mail folder during execution of the recipe above? Or do you
have any other idea to accomplish this task? (Preferredly in a way even a
part-time unix user like me understands ;-)

thanks for your help
hans

Re: procmail - notification when recipe creates new mail folder

am 24.05.2005 21:39:52 von Alan Connor

On comp.mail.misc, in <3fh81sF7r8qcU1@individual.net>, "Hans Kirchmeyr" wrote:
>
>
> Hi,
>
> I have created the following procmail recipe:
>
> # mailing lists

:0:
* ^X-list: \/.*
{
:0 c
${MATCH}/

:0 f
| formail -r -I"Subject: You have new mail in ${MATCH}" -i"From "

:0
usersmainbox/

}

But see below.

>
> Does the following:
> ------------------------------------------------------------ ---
> If there's a "X-list" header entry (most of my subscribed lists
> have one) then the mail will be moved to the mail folder with
> the matched part of the x-list header entry. If the folder
> doesn't already exist, procmail automatically creates it.
>
> And here comes the problem:
> ------------------------------------------------------------ ---
> As long as the user doesn't synchronise the folders in his
> webmail or IMAP client he wont ever see, that there are new
> folders with mails waiting...
>
> Question:
> ------------------------------------------------------------ ---
> Can I tell procmail somehow to send the user an email
> notification when it created a new mail folder during execution
> of the recipe above? Or do you have any other idea to
> accomplish this task? (Preferredly in a way even a part-time
> unix user like me understands ;-)
>

I don't get this at all, Hans. Just who is it that is subscribing
these people to new mailing lists without consulting them?

Involuntary subscription to mailing lists is called "spam".

Assuming that you are actually referring to yourself, then
a good solution here is to use Mutt, which is very good
with mailing lists.

You have subscribed to the list, so at the same time, put the
list in your ~/.muttrc using the lists and subscribe commands:

lists mailinglist@wherever.org list2@somewhereelse.net
subscribe mailinglist@wherever.org list2@somewhereelse.net

Then use the mailboxes command to have Mutt notify
you when there is new mail in that box:

mailboxes =mailinglist =list2

Now, when Mutt is called, a menu will come up displaying
all the folders listed in in the mailboxes command, and
indicating whether they have new mail or not.

Mail in any box will be threaded, and they can reply to a
particular post on the list just by hitting "L".

comp.mail.mutt

I'd make a seperate procmail recipe for each list:

:0
* ^Sender: mailinglist@whatever.org
* ^Return-Path: you@whatevermailing.list
thislist/

The way that you are trying to do it is much too generalized,
IMO.

AC

--
alanconnor AT earthlink DOT net
Use your real return address or I'll never know you
even tried to mail me. http://tinyurl.com/2t5kp
~

Re: procmail - notification when recipe creates new mail folder

am 24.05.2005 22:23:03 von Andre Kostur

Alan Connor wrote in
news:cqLke.2265$oT1.1893@newsread1.news.pas.earthlink.net:

> On comp.mail.misc, in <3fh81sF7r8qcU1@individual.net>, "Hans
> Kirchmeyr" wrote:
>> Question:
>> ------------------------------------------------------------ ---
>> Can I tell procmail somehow to send the user an email
>> notification when it created a new mail folder during execution
>> of the recipe above? Or do you have any other idea to
>> accomplish this task? (Preferredly in a way even a part-time
>> unix user like me understands ;-)
>>
>
> I don't get this at all, Hans. Just who is it that is subscribing
> these people to new mailing lists without consulting them?

The user may wish to be notified on the first list email that comes in so
that they are now aware that this new folder exists and is worth looking
into. (Beyond the "oh look.. a new folder was created... ")

> You have subscribed to the list, so at the same time, put the
> list in your ~/.muttrc using the lists and subscribe commands:

That's an extra, unneccessary step (IMHO). If the system can autocreate
the folder when it becomes useful, that's one less step that the user needs
to do.

Re: procmail - notification when recipe creates new mail folder

am 24.05.2005 23:08:48 von Nobody

Hans Kirchmeyr asked in <3fh81sF7r8qcU1@individual.net>:

| Can I tell procmail somehow to send the user an email notification when it
| created a new mail folder during execution of the recipe above?

Let's see:

:0 # a local lockfile is unnecessary on write to a directory
* ^X-list: \/.+
"$MATCH/../$MATCH/"
:0e
{
:0c
"$MATCH/"

:0fwh
| formail -I "Subject: new folder $MATCH created" \
-I "From: $LOGNAME@$HOST"

:0fwbi
| echo "new folder $MAILDIR/$MATCH created"

:0:
$DEFAULT
}

There is a tiny chance of a race condition if the first two messages for a
folder arrive at nearly the same time, so you might get two notifications;
not worth coding around.

--
David W. Tamkin

The reply address is bluelighted until 0500 UTC on 01Jun2005.

Re: procmail - notification when recipe creates new mail folder

am 26.05.2005 10:04:21 von Hans Kirchmeyr

Alan Connor wrote:

> I don't get this at all, Hans. Just who is it that is subscribing
> these people to new mailing lists without consulting them?
> Involuntary subscription to mailing lists is called "spam".

For example think of an association where communication between the board
members or members of project teams is done via mailing (distribution)
lists. There it can easily happen from time to time that you get subscribed
to new lists according to the positions you currently fulfill.

hans

Re: procmail - notification when recipe creates new mail folder

am 26.05.2005 10:04:53 von Hans Kirchmeyr

DWT wrote:

> Hans Kirchmeyr asked in <3fh81sF7r8qcU1@individual.net>:
>
>| Can I tell procmail somehow to send the user an email notification when it
>| created a new mail folder during execution of the recipe above?
>
> Let's see:

[...]

That is *exactly* what I was looking for!
Thank you very very much for your help, DWT - really great! :-)))

cheers
hans

Re: procmail - notification when recipe creates new mail folder

am 26.05.2005 11:04:46 von Alan Connor

On comp.mail.misc, in <3fle85F8deg1U1@individual.net>,
"Hans Kirchmeyr" wrote:

> Alan Connor wrote:
>
>> I don't get this at all, Hans. Just who is it that
>> is subscribing these people to new mailing lists
>> without consulting them? Involuntary subscription
>> to mailing lists is called "spam".
>
> For example think of an association where
> communication between the board members or members
> of project teams is done via mailing (distribution)
> lists. There it can easily happen from time to time
> that you get subscribed to new lists according to the
> positions you currently fulfill.
>
> hans

Thanks. Makes sense.

-------------------------------------------------

I like David's checking for the existence of the
folder. Missed that one.

And I should have used procmail's "h" command instead
of formail's "-r" to remove the body, and that way I
could have gotten the From line like his (I tried! :-)

But he's gone overboard, especially with the redundant
message in the body. It's already in the Subject
and there is no need for the user to even have to
open a mail like this.

Especially to read the same message that is on the
Subject line!

And there's no need for "w" or "i" in simple, straightforward
filters like this.

---------------

So...Now they have a new mailbox with mail in it. You've
notified them once.

What are they going to do now? Check it manually every time they
check their mail?

If they are doing that, then what's the point in the procmail
rigamarole? If they are just going to have to bring up a menu
with all of their mailboxes in it every time they check their
mail, then they are going to SEE any new boxes anyway.

You didn't even bother to respond to my Mutt suggestions.

I think I am glad that I am not one of your users.

AC

Re: procmail - notification when recipe creates new mail folder

am 26.05.2005 12:55:22 von Hans Kirchmeyr

Alan Connor wrote:

> I think I am glad that I am not one of your users.

So am I.

ha;)ns

Re: procmail - notification when recipe creates new mail folder

am 26.05.2005 13:54:57 von Alan Connor

On comp.mail.misc, in <3flo8qF8h9a1U1@individual.net>,
"Hans Kirchmeyr" wrote:

> Alan Connor wrote:
>
>> I think I am glad that I am not one of your users.
>
> So am I.
>
> ha;)ns

Yes. It would be awkward having a user that was a mere amateur
that knew 10X as much about system administration as you do.

AC

Re: procmail - notification when recipe creates new mail folder

am 26.05.2005 15:00:44 von Peter Peters

On Thu, 26 May 2005 11:54:57 GMT, Alan Connor wrote:

>> Alan Connor wrote:
>>
>>> I think I am glad that I am not one of your users.
>>
>> So am I.
>
>Yes. It would be awkward having a user that was a mere amateur
>that knew 10X as much about system administration as you do.

No problems. I have professors as customer. And some even teach
networkadministration, security and more of the stuff I manage on a
daily basis. But the problem with most "amateurs" that know so much more
is they don't have any hands-on experience with a network with over
10.000 users (of which most think they know more about network than I or
those professors). It took some some years and some read faces (on their
side) but at least most professors know the don't have the practical
experience.

--
Peter Peters, senior netwerkbeheerder
Dienst Informatietechnologie, Bibliotheek en Educatie (ITBE)
Universiteit Twente

Beavis, the sysadmin guru (was Re: procmail - notification when recipe creates new mail folde

am 26.05.2005 15:21:44 von Sam

This is a MIME GnuPG-signed message. If you see this text, it means that
your E-mail or Usenet software does not support MIME signed messages.

--=_mimegpg-commodore.email-scan.com-5160-1117113703-0003
Content-Type: text/plain; format=flowed; charset="US-ASCII"
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

Beavis writes:

> On comp.mail.misc, in <3flo8qF8h9a1U1@individual.net>,
> "Hans Kirchmeyr" wrote:
>
>> Beavis wrote:
>>
>>> I think I am glad that I am not one of your users.
>>
>> So am I.
>>
>> ha;)ns
>
> Yes. It would be awkward having a user that was a mere amateur
> that knew 10X as much about system administration as you do.

Beavis, would you mind sharing some of your amazing knowledge of system
administration with us?

Let's start with an easy one: you trashed your bootloader. You know that
your filesystem itself is ok, but grub or LILO (take your pick) is busted
and you can't boot.

What now?

We anxiously await your advice and wisdom on solving this conundrum. Time
is of essence.



--=_mimegpg-commodore.email-scan.com-5160-1117113703-0003
Content-Type: application/pgp-signature
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQBClc1nx9p3GYHlUOIRAqS/AJ4hRAB630zO0TcEkoFHLDFZppHYegCf XqbK
IhSGCGBBoVntvLA/CC8tQEo=
=MZ+I
-----END PGP SIGNATURE-----

--=_mimegpg-commodore.email-scan.com-5160-1117113703-0003--

Re: Beavis, the sysadmin guru (was Re: procmail - notification when recipe creates new mail

am 26.05.2005 17:02:55 von NetworkElf

On Thu, 26 May 2005 08:21:44 -0500, Sam wrote:
>
> Beavis writes:
>
>> On comp.mail.misc, in <3flo8qF8h9a1U1@individual.net>,
>> "Hans Kirchmeyr" wrote:
>>
>>> Beavis wrote:
>>>
>>>> I think I am glad that I am not one of your users.
>>>
>>> So am I.
>>>
>>> ha;)ns
>>
>> Yes. It would be awkward having a user that was a mere amateur
>> that knew 10X as much about system administration as you do.
>
> Beavis, would you mind sharing some of your amazing knowledge of system
> administration with us?
>
> Let's start with an easy one: you trashed your bootloader. You know that
> your filesystem itself is ok, but grub or LILO (take your pick) is busted
> and you can't boot.
>
> What now?
>
> We anxiously await your advice and wisdom on solving this conundrum. Time
> is of essence.

Ooooooh! Ooooooooo! I know this one:

1) Complain about sock posters.
2) Ask Bigfoot.
3) Ask Xena, Warrior Princess.
4) Assume everyone is Sam and there are only two users on the Internet.
5) Ask Alien abductors.
6) Use magic copy of slrn to divine answer.

Am I right? Did I get it?

--
_________________________________________
NetworkElf: Super Genius, Computer Guy, Harley Owner!
Blindly serving the covert purposes of the criminal-minded
maniac behind Spews since 2003. Certified since 2005.