procmail
[Top] [All Lists]

sending new mail notification to mobile phones

1999-05-29 11:05:55
Thanks for the help to all who responded to my last email!

My aim is to write a .procmailrc script which upon recieving an email
will:

1. Cut out the From: and Subject: header from the email (using formail).

2.  Append an already prepared email header (from file) to the top of
the
formail output (using cat), so the email recieved's headers are now the
body of the new email.
3. Sendmail this to my mobile phone's address which will display up to
120
chars of the body of an email sent to it.  (so effectivly I can have
notification anywhere of email including sender and subject)
4. But also place the email in my mailbox file, so I can read
the whole email later!



My .forward file: (which seems to pipe the emails to
procmail fine)
===========================================

/usr/local/bin/procmail


My .procmailrc file:
============

VERBOSE = off
MAILDIR = $HOME/mail
DEFAULT = /homes/jpr298/.email
PMDIR = $HOME/.procmail
LOGFILE = $PMDIR/log

:0
| ( cat $HOME/.procmail/header ; formail -X "From:" -X "Subject:" ) \
                | /usr/sbin/sendmail -t


and the $HOME/.procmail/header file is as follows:
=================================

To: mymobile(_at_)phonecompany(_dot_)co(_dot_)uk
Subject: New mail notification.


(there is a newline at the end of it)



If I pipe an email into the command in my .procmailrc file from the
Linux prompt, it works (ie. I
see the subject and sender on my phone)

cat any-email-here | ( cat $HOME/.procmail/header ) ; formail -X "To:"
-X
"Subject:" ) | /usr/sbin/sendmail -t

Which is why I'm confused as to why piping in the output of procmail
doesn't do the same job.
Is it possibly because the .procmailrc file is trying to run formail and

cat on the mail server, under my uid, and because I don't have a shell
account on
the mail server it won't let the processes execute?

Thanks for the help!


Regards, Jonathan Rylands.





-=-=-=-=-=-=-
jonathan(_dot_)rylands(_at_)ic(_dot_)ac(_dot_)uk
Dept. of Computing, Imperial College, London.


<Prev in Thread] Current Thread [Next in Thread>
  • sending new mail notification to mobile phones, Jonathan Rylands <=