On 10/05/2010 11:46 AM, Eric Shubert wrote:
Rob wrote:

I want to generate sms for email received for certain users. Had
anyone tried the same. Basically want to generate SMS with following
details:
1) From Id
2) Subject

Install procmail and formail (if they are not there already) and filter incoming messages to inject a new message to the users phonenum...@sms-messaging-address (available from their carrier) that just has the Subject line. An example .procmailrc in the user's directory would be:

# .procmailrc
# routes incoming mail to appropriate mailboxes
PATH=/usr/bin:/usr/local/bin
MAILDIR=/path-to/vpopmail/domains/DOMAIN/USER/Maildir
DEFAULT=/path-to/vpopmail/domains/DOMAIN/USER/Maildir/new
LOGFILE=/path-to/vpopmail/domains/DOMAIN/USER/procmail.log
SHELL=/bin/sh
VERBOSE=yes
SUBJ=`/usr/bin/formail -c -xSubject:`

:0
* $ ^to_u...@domain
{
 :0
  | /usr/bin/formail -X "" \
      -A"X-Loop: u...@domain" \
      -I"Subject: ${SUBJ}" \
      -i"Content-Type:" \
      -i"Content-Length:" \
      -I"From: User's Name <u...@domain>" \
      -I"To: phonenum...@sms-messaging-address \
      -I"Return-Receipt-To:" \
  | /path-to/qmail-inject
}

Procmail will take some tweaking for your environment and testing but I thought I would send this since I have done essentially the same thing ... good luck.

PS> I just realized I did not add the From: line but you can parse that using formail just as I did with the Subject line and add that to the outgoing message somewhere.


Ok, I'll ask the apparently obvious and probably ignorant question.
Why wouldn't you want to simply forward the entire message? SMS length limit perhaps? If that's the case, would SMS truncate or reject the message?


I believe most SMS messages are limited to 160 characters.
Before I had my Blackberry, I used to send alerts to myself somewhat like this. I sent them to my number and the carrier address, as has been detailed before (ie:[email protected])

---------------------------------------------------------------------------------
Qmailtoaster is sponsored by Vickers Consulting Group 
(www.vickersconsulting.com)
   Vickers Consulting Group offers Qmailtoaster support and installations.
     If you need professional help with your setup, contact them today!
---------------------------------------------------------------------------------
    Please visit qmailtoaster.com for the latest news, updates, and packages.
To unsubscribe, e-mail: [email protected]
    For additional commands, e-mail: [email protected]


Reply via email to