procmail
[Top] [All Lists]

Re: Another trapping problem

2000-08-07 21:21:46
At 20:36 2000-08-07 -0700, Eric Hilding wrote:

Here is another jewel I'm trying to trap and axe (MYDOMAIN)...
but it is only the name WITHOUT the .com that shows up from
bogus subscriptions made by forgery punks.  This is all I
got from the log.  Tnx.

> owner-nolist-19690*me**MYDOMAIN*-COM(_at_)MAIL(_dot_)ZDLISTS(_dot_)COM

Well, uh, a snippet from your log isn't going to prove helpful. One needs to see it within the message/headers itself. What parts of this have you obscured? Just the name of the domain, or the addition of asterisks as well?

From appearances, it looks like you have the ".com", it's just translated (hmm, "@" = "**", and "." = "*-" ?)

* ^Received:.*\*mydomain\*\-com

(assuming that the asterisks are indeed part of the original, and that this is appearing in a received header).

Looks like you should get yourself a regex reference, perhaps the excellent ORA _Mastering Regular Expressions_

Given the earlier confision about basic mail loops, it might be adviseable to use standalone procmail scripts to test with manually, rather than experimenting with your live mail stream. In such a config, you would take a procmail rcfile and run it against a mailbox like so:

        formail -s procmail -m procmailrcfile < mboxfile

This would allow you to test your rc files against a message, or series of messages, without affecting your inbound mail spool (assuming that your rcfile isn't set up to toss data out to it).

At the top of your development wrapper rcfile, put something like:

        VERBOSE=ON
        LOGFILE=./test.log
        DEFAULT=./testmbox

        INCLUDERC=./mytestrc

(where mytestrc is your test rc file)

DEFAULT could be a mailbox file you want "default" messages to fall through to, and often for testing, /dev/null is useful, since you have less to cleanup (running a large test multiple times could eventually lead to a large junk file). VERBOSE=ON dumps more verbose logging information (including details on just what regexp's match), which help you figure out what part of your script is failing you. Tweak the script, re-run the data against the rcfile, repeat.

Keep in mind that program invocations and forward rules will still execute - so either tinker with test addresses, or remark out forwards and just do a mailbox delivery instead. As was demonstrated earlier, your forward to the output of the perl script wasn't inoperative - you were suffering from mail looping.

Which is another benefit manual testing has - it will demonstrate that the script itself is capable of performing it's task without suffering from looping problems. Of course, if you receive the test message into your inbox, you'll know (or should pay attention) that the script would be receiving an additonal copy of the message. I'm sure you have a newfound respect for mail loops anyway, and will be watching for them. if not now, then later when you're working with more bandwidth and discover just how fast a hard disk will fill up when you're not around. THEN you'll respect them...

---
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.

 Sean B. Straw / Professional Software Engineering
 Post Box 2395 / San Rafael, CA  94912-2395


_______________________________________________
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>