PDA

View Full Version : No .redirect File -- How to Bounce?



lobstershell
09-09-2003, 01:54 PM
So now that I've been moved to version -2.0 (it is more of a downgrade at this time), the .redirect file that I had set up no longer works. Now I can deal with the offsite aliases that I had to set up manually when Westhost didn't tell me they were moving me this weekend, but I used to have a couple of addresses that I specifically bounced (everything else is catch-all). The syntax in the .redirect file was:

spambaitaddress user_unknown

I would love to keep it like that so that any possibly legit mailers could get a valid bounce message. How do I do this with the lack-of-control panel? Is it a command? A specific e-mail address I send it to?

Sending it to /dev/null would do in a pinch, but it is NOT a longterm fix. Bounce is preferred.

Talk amongst yourselves. Let me know what you think.

Crabbily yours,
lobstershell

FZ
09-12-2003, 09:10 PM
I was wondering how to do this as well. I have finally figured it out - took me a while! Sure, what I am doing may be redundant/long-winded but it works... And until WestHost tells us what the short way to do it is, this should do.

Create a new file. Name it .procmailrc - yes, just an extension, no file name. If Windows doesn't let you, it does not matter... Just give it that extension and any name for now. In this file, paste the following code:


SHELL=/bin/sh

:0
* ^TO_spambaitaddress@yourdomain.com
{
EXITCODE=67
:0
/dev/null
}

:0:
${DEFAULT}


Save the file, and then FTP it to your / directory - upload it in ASCII format. Make sure the name is correct (just an extension...) then CHMOD it 644. Alternatively, you could do all this with SSH if you know how. If you want to do this for more than one address, just add lines in this format after the *^TO_... bit (on the same line and no leading or trailing spaces, note the | which means this is an OR condition):


|^TO_anotherbouncingaddress@youdomain.com

Send yourself a test e-mail to the address(es) you defined and watch it magically bounce ;)

Let me know if that helps or not.

lobstershell
09-18-2003, 01:11 PM
It seems to bounce everything (including good addresses) with that. Is it supposed to be

|^TO_
or

| ^TO_
I have the former. I know spaces sometimes don't matter where pipes are involved, but procmail might be different.

FZ
09-18-2003, 02:08 PM
You've misunderstood my post. Don't worry about the second bit of code. Just look at (and use) that first chunk. The second part was just explaining how you would do an OR condition to bounce more than one address:


* ^TO_spambaitaddress@yourdomain.com|^TO_anotheraddr ess@yourdomain.com|^TO_thirdaddress@yourdomain.com

For now, see if you can get the first chunk up and "running". Only then worry about adding more addresses.

Let me know how it goes.

lobstershell
09-19-2003, 01:03 PM
I don't think that's the issue. Do I have to define the

${DEFAULT}
variable? I think that might be it, but I dunno how.

FZ
09-19-2003, 02:34 PM
Assuming your domain is lobstershell.com, this is all that would go in /.procmailrc


SHELL=/bin/sh

:0
* ^TO_spambaitaddress@lobstershell.com
{
EXITCODE=67
:0
/dev/null
}

:0:
${DEFAULT}

i.e. you do not need to define anything explicitly. Make sure to copy and paste exactly as above - don't add any extra whitespace or linebreaks. Also, don't forget to CHMOD this file 644 (and put it in /). If it still does not work, then we can enable logging and see if we can't grab some debugging info from that.

FZ
09-22-2003, 04:07 PM
Any luck?

avila
09-22-2003, 05:02 PM
Fayez, I'm hoping Lobstershell had as much luck with your script as I've had. Thanks a million - you've really helped me out.

FZ
09-22-2003, 05:41 PM
Avila,

I'm very pleased to hear that this has helped at least one person :) It was my pleasure.

lobstershell
10-13-2003, 03:16 PM
I finally figured out my issue. Once I properly "whitespaced" and backslashed" the piped OR statements, it worked like a charm. You rock Fayez!

FZ
10-13-2003, 03:38 PM
You're welcome ;)