PDA

View Full Version : Can I make a email box 'invalid' and have a global alias at the same time?


dave
10-17-2005, 08:58 PM
HI everyone,

I got a global alias going and I'm cool with that... However, I had one user who must of signed up with 1000 spambots. I am no longer providing email for this person. Leaving it full, creates tons of error messages to my root email. If I delete the account... All the spam will go to the alias mail account which I don't want to happen...

Can I have a server side autokill or even more preferable, send an 'invalid user' error for this one account name?

Thanks,

Dave

datasavant
10-18-2005, 07:38 AM
See http://www.hardhathosting.com/community/forums/showthread.php?t=127&highlight=procmailrc

dave
10-18-2005, 12:23 PM
:confused: Ok.... So I got the basics of this:

:O :
* ^To:.*specificemailaccount@mydomain.com
# I want to send a custom message to the sender.
# I want to delete the incomming msg.

:O :
$DEFAULT

How do I send a msg?
Do I need any variables at the top like PATH, etc?

-- Dave

datasavant
10-18-2005, 01:57 PM
Change: # I want to send a custom message here.
to: /dev/null

Then send an emtil to the account in question -- it should not get through

dave
10-22-2005, 01:27 PM
Then send an email to the account in question

:eek: :confused: You say that like I know what I'm doing... I asure you I don't.

Do I make some text file or can I write it as part of the script or what?

-- Dave

dave
10-22-2005, 01:42 PM
After careful consideration, I was to expand my script....

Even though I have a mailbox on my local machine that I use to recieve and delete incomming emails, for some reason I'm still getting administrative 'mail_daemon' letter about the box being full....

So instead of just the 'To:' field, I want to delete all messages that contain 'user@mydomain.com' anywhere in the email.

Thanks for your help,

Dave

datasavant
10-22-2005, 04:10 PM
edit /etc/procmailrc to add


####>>>>>> delete any email with specificemailaccount@mydomain.com
:0
* specificemailaccount@mydomain.com
/dev/null
###

dave
10-25-2005, 04:32 PM
edit /etc/procmailrc to add


####>>>>>> delete any email with specificemailaccount@mydomain.com
:0
* specificemailaccount@mydomain.com
/dev/null
###

I added this and it's not working... Is there something I need to add to the rule above it (the spam assassin rule)? Like change the ':O' to ':O C'?

Thx,

Dave

datasavant
10-25-2005, 04:42 PM
I'm not sure, all the examples I can find look for addresses in specific fields, i.e. 'TO:' But this should have worked.

TurboWebs
10-25-2005, 11:52 PM
If you want all the emails going to johndoe@mydomain.com to just disappear than can't you use the aliases file to kill them? Basically just delete the account johndoe and then edit your /etc/aliases and add the following line:

johndoe:/dev/null

Then save the file and run 'newaliases'

Just brainstorming but maybe this won't work in conjunction with the global alias.

TurboWebs
10-26-2005, 12:13 AM
I just tried it on my server and the alias won't work if you have a catch-all setup. But looking into procmailrc I think that you may have made a mistake in your code above. Look at this:


# ^TOjohndoe is satisfied if johndoe
# appears in any recipient header To: Cc: Bc:.
# This avoids sending auto replies to messages that
# were addressed to an alias or maillist, but not
# explicitly to johndoe.


So I was thinking that when you put:

* ^To:.*specificemailaccount@mydomain.com

You should try this instead:

* ^TOspecificemailaccount

Just my interpretation.