procmail
[Top] [All Lists]

Re: ^M in .procmailrc file

2000-07-20 02:38:43
From: Glen Lee Edwards <GLEdwards(_at_)uswest(_dot_)net>

The problem is that my users are using Windows to modify the
.procmailrc file, and then uploading the modified file to $HOME.  It
there any way on their end to have the \r deleted, or do I have to
periodically go through all the .procmailrc files on my system and
remove them?

Well, I suppose you could have the system-wide rc file check, with
<brainstorm mode> something like (untested, though the grep test was):

     lognameRC = `ksh -c "echo ~$LOGNAME/.procmailrc"`

     :0 fiw  # I can't remember if we actually want the `f' flag here
     * ! ^X-Loop: systemRC
     * test -f $lognameRC && grep -q 
 $lognameRC
     {
        :0 Whic  # I think the `W' would be quite important here!
        | mv -f $lognameRC $lognameRC.BAD

                 # Be careful! Test this one carefully against looping
        :0 hic   # warn the user in mail
        | formail -s sendmail $LOGNAME < badRCmsg

        :0  # deliver to user's normail inbox
        $ORGMAIL

        HOSTNAME = bogus   # if you want to be sure to end all action
                           # from this rc here
     }


Then, the file that would be mailed, badRCmsg, would contain something
like:

--------------------  snip contents of badRCmsg ----------------------
From: root(_at_)nomotek(_dot_)com
Priority: high
X-Loop: systemRC
Subject: Bad RC-FILE

Fix the ^M's!!!!!! Your mail is being saved locally on the
spool until you do. Your .procmailrc has been renamed `.procmailrc.BAD.

-- 
root(_at_)nomotek(_dot_)com
--------------------  snip contents of badRCmsg ----------------------

</brainstorm mode>
However, I am philosophically of the opinion that this is too much
hand-holding of users.  They should simply be warned in a FAQ when
they are told that procmail is available on the system.

-- 
    \     .-.     .-.     .-.     .-.     .-.     .-.     .-.     /
     \-d-/-m-\-a-/-n-\-(_at_)-/-n-\-e-/-t-\-c-/-o-\-m-/-.-\-c-/-o-\-m-/
      '-'     '-'     '-'     '-'     '-'     '-'     '-'     '-'

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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