How do I reject email?

Discussion in 'General' started by Andee63, Jun 22, 2007.

  1. Andee63

    Andee63 New Member

    I have a domain with several users/email addresses, ie [email protected] I have forwarding setup so that any unknown email is forwarded to [email protected]. I previously had two other users who were removed from my system now their emails are forwarded to [email protected]. 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: Jun 22, 2007
  2. till

    till Super Moderator Staff Member ISPConfig Developer

  3. Andee63

    Andee63 New Member

    Thanks Till for your reply.

    I have added
    Code:
    [email protected] 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
     
  4. falko

    falko Super Moderator Howtoforge Staff

    What's the output of
    Code:
    postconf -n
    ? Any erros in your mail log?
     
  5. Andee63

    Andee63 New Member

    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=<[email protected]>
    Jun 23 20:56:43 server1 postfix/qmgr[18792]: AB22A91DBC6: from=<[email protected]>, 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=<[email protected]>, 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], [email protected]
    Jun 23 20:56:46 server1 postfix/cleanup[9663]: 54C5891E416: message-id=<[email protected]>
    Jun 23 20:56:46 server1 sendmail[9669]: l5NJuiI4009669: [email protected], 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=<[email protected]>, 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=<[email protected]>, 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=<[email protected]>, orig_to=<[email protected]>, 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 [email protected]. All unknown addresses are forwarded to my mail box [email protected]
    Thanks again
     
    Last edited: Jun 23, 2007
  6. falko

    falko Super Moderator Howtoforge Staff

    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.
     
  7. Andee63

    Andee63 New Member

    Thanks Falko that fixed it.
     

Share This Page