> I'm not sure how well AT&T filters emails, but T-Mobile's SMS Gateway
> doesn't clean up some header fields very well. Additionally, the
> "Subject:" and "From:" headers count against your total character count.
Let me see if I understand this properly (I'm still getting used to
procmail so I want to make sure I know what's happening). I'll insert
comments below, please tell me if I'm off base.
> :0E
> * < 1024
Why are we limiting to emails under 1K (or 50K in your follow up email)?
> * ^From: \/.*
So the "\/" stores whatever matches the regexp immediately following it
to the variable MATCH?
> {
> # Grab the from address from \/ match above
> FROM=$MATCH
Simple variable assignment right?
> # Send copy to final destination
> :0c
> ! myuserid at server.com
Send the copy to my "real" address first so we can beat up the message
going to my cell phone?
> # Generate autoreply -- strips headers, and keep body.
> # Override "From: "
> :0 fw
> | formail -r -k -I "From: $FROM"
So we're reformatting the email to remove all headers except for "From"
which we saved earlier using the MATCH variable?
> # Now, let's cut the body down to 150 bytes (one byte/char)
> :0 abfw
flags here feed the body to the piped filter and wait if the previous
succeeded?
> | head -c 150
gives us the first 150 bytes of the body back?
> # Cut out the "Subject:" & "To:" headers -- may not be
> # necesary
> #:0 ahfw
> #| sed -e '/^\(To\|Subject\):.*/ d'
Are these commented out because the formail line above already removed
all headers but "From"? If I wanted to keep both From and Subject could
I do...
| sed -ne '/^\(From\|Subject\):.*/ p'
instead of the formail statement above? Is there an easier/better way
to do that with formail?
> # and send it on its way -- not important if body snip
> # didn't work
> :0
> ! <myphonenumber>@mobile.att.net
Now we send the filtered message to my phone.
> } #CAUTION, UNTESTED
So, have I followed this correctly? By the way, thank you Chad for all
your help. I think I'm starting to catch on and that's due greatly to
your advice here.
Thank you!
Ben.
_______________________________________________
TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
http://www.mn-linux.org tclug-list at mn-linux.org
https://mailman.real-time.com/mailman/listinfo/tclug-list