Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

reject mail for specific address

Status
Not open for further replies.

nix45

MIS
Nov 21, 2002
478
US
Postfix 2.0.x

I have a "catch-all" set up for my domain so that all mail for @foo.org is delivered to the same account (using the virtual table). I started getting spammed at this one address, spam@foo.org. How can I reject any mail sent to spam@foo.org? I want the spammers to receive an NDR about the address not existing.

Thanks,
Chris
 
Sure you can do that.

1. Edit your main.cf
Include the following line
smtpd_sender_restrictions = hash:/etc/postfix/access

2. Edit your /etc/postfix/access
Follow the instructions in the file, and include a line like
somebuddy@nowhere.com 550 REJECT

3. Create your hash table with command
postmap /etc/postfix/access

4. Reload your main.cf with command
postfix reload

5. Test it with a good friend's email address, or a spare one of your own.

6. Check your logs regularly to make sure the offending email is being bounced, and NOTHING else.

ßG

(If your postfix is an "off-line" server, there's a few other potential steps to deal with fetchmail, but you get the idea.)


 
Ooops sorry,
I've re-read your question and realise that I misunderstood.
Will give your problem some more thought.
 
you can use
a) header_checks
b) smtpd_recipient_restrictions (check_recipient_access)
c) this config i found once on inet (not tested):
Code:
[i]
/etc/postfix/master.cf: 
        ... 
        discard unix - n n - - pipe user=nobody argv=/bin/cat /dev/null 

/etc/postfix/transport: 
        ...
        # All mail to the domain "discard.invalid" is discarded. 
        # 
        discard.invalid discard 


/etc/postfix/virtual: 
        ... 
        # Discard specific user in example.org 
        # 
        userexample.org discard.invalid 


        # Discard all recipients in example.net 
        # 
        example.net discard.invalid 


/etc/postfix/main.cf: 
        ... 
        virtual_maps = hash:/etc/postfix/virtual 
        transport_maps = hash:/etc/postfix/transport 
[/i]
 
I figured it out...

/etc/postfix/main.cf:

smtpd_recipient_restrictions
check_recipient_access hash: /etc/postfix/unwanted_recipients
check_relay_domains


/etc/postfix/unwanted_recipients:

spam@foo.org REJECT


Then I ran...

postmap /etc/postfix/unwanted_recipients
postfix reload



Chris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top