
22nd June 2007, 08:44
|
|
HowtoForge Supporter
|
|
Join Date: Jan 2007
Location: Bradford, UK
Posts: 40
Thanks: 5
Thanked 0 Times in 0 Posts
|
|
How do I reject email?
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
Last edited by Andee63; 22nd June 2007 at 08:46.
|

22nd June 2007, 11:16
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 31,911
Thanks: 693
Thanked 4,198 Times in 3,213 Posts
|
|
Please have a look at the postfix access map feature:
http://www.postfix.org/access.5.html
|

22nd June 2007, 12:55
|
|
HowtoForge Supporter
|
|
Join Date: Jan 2007
Location: Bradford, UK
Posts: 40
Thanks: 5
Thanked 0 Times in 0 Posts
|
|
Thanks Till for your reply.
I have added
Code:
user@mydomain.com REJECT Address not known at this server
to the bottom of /etc/postfix/access
I have also added
Code:
smtpd_client_restrictions = check_client_access hash:/etc/postfix/access
to main.cf
I have run
Code:
postmap /etc/postfix/access
and restarted postfix but the email address is still forwarded to my address
Any further help is apreciated
|

23rd June 2007, 20:52
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,665
Thanks: 1,896
Thanked 2,595 Times in 2,446 Posts
|
|
What's the output of ? Any erros in your mail log?
|

23rd June 2007, 22:06
|
|
HowtoForge Supporter
|
|
Join Date: Jan 2007
Location: Bradford, UK
Posts: 40
Thanks: 5
Thanked 0 Times in 0 Posts
|
|
Thanks Falko
Output of postconf -n
Code:
[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
Code:
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
Last edited by Andee63; 23rd June 2007 at 22:10.
|

24th June 2007, 19:59
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,665
Thanks: 1,896
Thanked 2,595 Times in 2,446 Posts
|
|
Looks ok. I think you should rather add something like
Code:
check_recipient_access hash:/etc/postfix/access
to smtpd_recipient_restrictions and comment out the smtpd_client_restrictions line.
|
|
The Following User Says Thank You to falko For This Useful Post:
|
|

24th June 2007, 20:58
|
|
HowtoForge Supporter
|
|
Join Date: Jan 2007
Location: Bradford, UK
Posts: 40
Thanks: 5
Thanked 0 Times in 0 Posts
|
|
Thanks Falko that fixed it.
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT +2. The time now is 00:48.
|
|
Recent comments
23 hours 26 min ago
1 day 4 hours ago
1 day 8 hours ago
1 day 10 hours ago
2 days 55 min ago
2 days 1 hour ago
2 days 5 hours ago
2 days 12 hours ago
2 days 13 hours ago
2 days 14 hours ago