Andee63
22nd June 2007, 09:44
I have a domain with several users/email addresses, ie andrew@mydomain.com I have forwarding setup so that any unknown email is forwarded to andrew@mydomain.com. I previously had two other users who were removed from my system now their emails are forwarded to andrew@mydomain.com. I can't seem to find a way of blocking or rejecting emails coming to these addresses. I am using postfix as the mail server.
Thanks in advance for any help
till
22nd June 2007, 12:16
Please have a look at the postfix access map feature:
http://www.postfix.org/access.5.html
Andee63
22nd June 2007, 13:55
Thanks Till for your reply.
I have added user@mydomain.com REJECT Address not known at this server to the bottom of /etc/postfix/access
I have also added smtpd_client_restrictions = check_client_access hash:/etc/postfix/access to main.cf
I have run postmap /etc/postfix/access and restarted postfix but the email address is still forwarded to my address
Any further help is apreciated
falko
23rd June 2007, 21:52
What's the output of postconf -n? Any erros in your mail log?
Andee63
23rd June 2007, 23:06
Thanks Falko
Output of postconf -n
[root@server1 ~]# postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
debug_peer_level = 2
html_directory = no
inet_interfaces = all
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = /etc/postfix/local-host-names
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.2.8/README_FILES
sample_directory = /usr/share/doc/postfix-2.2.8/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtp_host_lookup = native
smtp_tls_note_starttls_offer = yes
smtp_use_tls = yes
smtpd_client_restrictions = check_client_access hash:/etc/postfix/access
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject _unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain =
smtpd_sasl_security_options = noanonymous
smtpd_sender_restrictions = check_sender_access hash:/etc/postfix/access
smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
smtpd_tls_auth_only = no
smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt
smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
smtpd_use_tls = yes
tls_random_source = dev:/dev/urandom
unknown_local_recipient_reject_code = 550
output from mail log when message recieved but not rejected
Jun 23 20:56:43 server1 postfix/smtpd[9658]: connect from web86009.mail.ird.yahoo.com[217.146.188.8]
Jun 23 20:56:43 server1 postfix/smtpd[9658]: AB22A91DBC6: client=web86009.mail.ird.yahoo.com[217.146.188.8]
Jun 23 20:56:43 server1 postfix/cleanup[9663]: AB22A91DBC6: message-id=<785653.36388.qm@web86009.mail.ird.yahoo.com>
Jun 23 20:56:43 server1 postfix/qmgr[18792]: AB22A91DBC6: from=<ahastie@talk21.com>, size=1828, nrcpt=1 (queue active)
Jun 23 20:56:43 server1 postfix/smtpd[9658]: disconnect from web86009.mail.ird.yahoo.com[217.146.188.8]
Jun 23 20:56:46 server1 sendmail[9669]: l5NJuiI4009669: from=hastie.me.uk-andrew, size=135, class=0, nrcpts=1, msgid=<200706231956.l5NJuiI4009669@server1.elmtreedesign. co.uk>, relay=hastie.me.uk-andrew@localhost
Jun 23 20:56:46 server1 postfix/smtpd[9658]: connect from localhost.localdomain[127.0.0.1]
Jun 23 20:56:46 server1 postfix/smtpd[9658]: setting up TLS connection from localhost.localdomain[127.0.0.1]
Jun 23 20:56:46 server1 sendmail[9669]: STARTTLS=client, relay=[127.0.0.1], version=TLSv1/SSLv3, verify=FAIL, cipher=DHE-RSA-AES256-SHA, bits=256/256
Jun 23 20:56:46 server1 postfix/smtpd[9658]: TLS connection established from localhost.localdomain[127.0.0.1]: TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)
Jun 23 20:56:46 server1 postfix/smtpd[9658]: 54C5891E416: client=localhost.localdomain[127.0.0.1], sasl_sender=hastie.me.uk-andrew@server1.elmtreedesign.co.uk
Jun 23 20:56:46 server1 postfix/cleanup[9663]: 54C5891E416: message-id=<200706231956.l5NJuiI4009669@server1.elmtreedesign. co.uk>
Jun 23 20:56:46 server1 sendmail[9669]: l5NJuiI4009669: to=admispconfig@localhost.localdomain, ctladdr=hastie.me.uk-andrew (10025/10012), delay=00:00:02, xdelay=00:00:00, mailer=relay, pri=30135, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (Ok: queued as 54C5891E416)
Jun 23 20:56:46 server1 postfix/qmgr[18792]: 54C5891E416: from=<hastie.me.uk-andrew@server1.elmtreedesign.co.uk>, size=829, nrcpt=1 (queue active)
Jun 23 20:56:46 server1 postfix/smtpd[9658]: disconnect from localhost.localdomain[127.0.0.1]
Jun 23 20:56:46 server1 postfix/local[9680]: 54C5891E416: to=<admispconfig@localhost.localdomain>, relay=local, delay=0, status=sent (delivered to command: /usr/bin/procmail -f-)
Jun 23 20:56:46 server1 postfix/qmgr[18792]: 54C5891E416: removed
Jun 23 20:56:51 server1 postfix/local[9664]: AB22A91DBC6: to=<hastie.me.uk-andrew@mail1.bookowl.co.uk>, orig_to=<tom@hastie.me.uk>, relay=local, delay=8, status=sent (delivered to command: /usr/bin/procmail -f-)
Jun 23 20:56:51 server1 postfix/qmgr[18792]: AB22A91DBC6: removed
The email address I need rejecting is tom@hastie.me.uk. All unknown addresses are forwarded to my mail box andrew@hstie.me.uk
Thanks again
falko
24th June 2007, 20:59
Looks ok. I think you should rather add something like check_recipient_access hash:/etc/postfix/access to smtpd_recipient_restrictions and comment out the smtpd_client_restrictions line.
Andee63
24th June 2007, 21:58
Thanks Falko that fixed it.
vBulletin® v3.8.4, Copyright ©2000-2010, Jelsoft Enterprises Ltd.