[Mimedefang] Help with bouncing e-mails to group of users

John Rudd john at rudd.cc
Fri Sep 30 11:42:57 EDT 2005


On Sep 30, 2005, at 8:16 AM, Joseph Brennan wrote:

>
>
> --On Friday, September 30, 2005 9:47 -0400 "McKinlay, Ken" 
> <Ken.McKinlay at curtisswright.com> wrote:
>
>> Greetings,
>>
>> I am hoping for either a simple sendmail or Mimedefang solution for a
>> group of invalid addresses being used for joe-jobs. It appears that 
>> one
>> of our e-mail addresses is sort of being used as the base of the 
>> "from"
>> address in spam. The user component of the address is in the format of
>> "jdow????", where the "?"s are a series of random letters. To populate
>> an access.db file for sendmail to deny all the possible combinations
>> just for that one example would need more than 450,000 entries.
>>
>> Can anyone help me either in creating a sendmail or Mimedefang routine
>> that will bounce the message with a 5XX error when the recipient is in
>> that format?
>
>
> in filter_begin()
>
> foreach $recipient (@Recipients) {
> 	if ($recipient =~ /^jdow.*\@curtiswright\.com) {
> 		# some action
> 	}
> }
>
>

Actually, I think he said jdow is legit.  So, if it's literally 
"jdow????" (always 4 characters), then you want the if line to be this:

if ($recipient =~ /^jdow....\@curtiswright\.com$/) {

(note: you forgot the $/ at the end of the regex)

If it's not just random characters, but a random number of characters, 
then I would do this:

if ( ($recipient =~ /^jdow.+\@curtiswright\.com$/)
      && ($recipient !~ /^jdow\@curtiswright\.com$/) ) {

(I know, it shouldn't be able to match both, but I'm a little paranoid 
sometimes)




More information about the MIMEDefang mailing list