procmail - can it send a notification email?

David Fletcher kubuntu-users at thefletchers.net
Sun Dec 30 22:57:38 UTC 2007


The situation:-

I've got a machine currently running Dapper server. This is my first attempt 
at a mail server but it's almost doing everything I initially want, which 
is:-
to use fetchmail to collect email for everybody in the house from a single POP 
account
sort it into the correct mbox files using procmail
provide POP service for collecting mail using Dovecot

One of the people here gets email but only occasionally, and does not bother 
to log in every day (or every week!) so will not know if there is mail 
waiting for collection. So, what I want to do is get procmail to send a 
notification email to me so that I can tell her that she has mail. I can get 
it to carbon copy the mail to my mbox - that's no problem - it's clearly 
documented and simple to do, but I don't feel that making the system copy her 
mail to my account is the proper way to do it.

What I have had a play with this afternoon is a command line package called 
sendEmail which does exactly what it says on the tin. Using the command

sendEmail -f me at example.com -t you at example.com -u "Notification" -m "Your wife 
has new email" -s auth.smtp.example.com -xu userid -xp password

from bash on the server "just works" and sends the email to me via my service 
provider. What I want to do if possible is work this command into a 
procmailrc recipe so that procmail notifies me that she has email, without 
saying what the email is or where it's from. That's her business.

What I have at the moment is this:-

:0
* ^To.*wife@
{
 :0:
 wife

 :0 A
 (sendEmail \
  -f procmail at example.com \
  -t me at example.com \
  -u "Notification" \
  -m "Your wife has new email" \
  -s auth.smtp.example.com \
  -xu userid -xp password)
}

which is made up from what I've found in the man pages and google. The message 
gets delivered to the mail box, but I can't get it to send the notification. 
Am I taking a reasonable approach or is this completely wrong?

Any help appreciated, thanks.

Dave


-- 
Registered Linux user number 393408

I use and recommend the email service at 1 & 1
For domain registration, email and web hosting please visit:
http://oneandone.co.uk/xml/init?k_id=6389763




More information about the kubuntu-users mailing list