procmail
[Top] [All Lists]

Detecting alpha address -- a regular expression question

1997-11-05 11:22:05
We are implementing a (shudder) mail-to-fax gateway.  The syntax is 
<faxnum>@server.domain.com

The rather head-injured fax beast gleefully passes alphabetic characters to the 
fax modem.  
I'm using the following recipe to attempt to filter out alpha characters.

:0
* ^To:(_dot_)*[a-zA-Z](_dot_)*(_at_)fax(_dot_)*
     | (formail -rA"Precedence: request" \
        -A"X-Loop: fax(_at_)phx-csc(_dot_)us(_dot_)dhl(_dot_)com";\
        echo "Your Fax could not be delivered $FROM";\
        echo "Fax number must be a telephone number";\
        echo "\n\t\tFormat #########(_at_)fax(_dot_)us(_dot_)dhl(_dot_)com"\
        ) | $SENDMAIL -oi -t
/tmp/faxfail

Looks great, but the trouble is that stuff sails right through it.

procmail: No match on "^To:(_dot_)*[a-zA-Z](_dot_)*(_at_)fax(_dot_)*"

I've also tried using ^TO, which expands quite impressively, but still does not 
match on a 
text address going to the faxserver.

procmail: No match on 
"(^((Original-)?(Resent-)?(To|Cc|Bcc)|(X-Envelope|Apparently(-Resent)?)-To):(.*[^a-zA-Z])?).*
[a-zA-Z](_dot_)*(_at_)fax(_dot_)*"

(my a-zA-Z construct is right there on the end)

Any suggestions, welcome.  

-------------------------------------------------------------------
Chris Knox                 |                      
cknox(_at_)us(_dot_)dhl(_dot_)com
DHL Airways, Inc.          |                        (602) 350-2026
1900 West University Drive | 
Tempe, Arizona  85281      |               
-------------------------------------------------------------------

<Prev in Thread] Current Thread [Next in Thread>