# Mail-Spam über Localhost



## Brainfood (28. Sep. 2013)

```
Return-Path: <admin@andjake.com>
Delivered-To: MAILTO@BRAINFOOD
Received: from localhost (localhost [127.0.0.1])
    by MYSERVER.DOMAIN.TLD (Postfix) with ESMTP id D1348AE005B
    for <MAILTO@BRAINFOOD>; Fri, 27 Sep 2013 18:45:14 +0200 (CEST)
X-Virus-Scanned: Debian amavisd-new at MYSERVER.DOMAIN.TLD
X-Spam-Flag: YES
X-Spam-Score: 9.91
X-Spam-Level: *********
X-Spam-Status: Yes, score=9.91 tagged_above=1 required=4.5
    tests=[BAYES_99=3.5, HTML_MESSAGE=0.001, MIME_HTML_MOSTLY=0.428,
    MPART_ALT_DIFF=0.79, RCVD_IN_PSBL=2.7, RDNS_NONE=0.793,
    SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_DBL_SPAM=1.7]
    autolearn=no
Received: from MYSERVER.DOMAIN.TLD ([127.0.0.1])
    by localhost (MYSERVER.DOMAIN.TLD [127.0.0.1]) (amavisd-new, port 10024)
    with ESMTP id qiG7vR4BP2Ul for <MAILTO@BRAINFOOD>;
    Fri, 27 Sep 2013 18:45:14 +0200 (CEST)
Received: from andjake.com (unknown [91.218.115.56])
    by MYSERVER.DOMAIN.TLD (Postfix) with SMTP id 1F019AE005A
    for <MAILTO@BRAINFOOD>; Fri, 27 Sep 2013 18:45:13 +0200 (CEST)
Received: from admin@andjake.com(andjake.com [127.0.0.1]) by andjake.com with SMTP id bqzp.130927124530.357..ZHJraWRyZXNkZW5AZHJraS5kZQ==.1 for MAILTO@BRAINFOOD; Fri, 27 Sep 2013 12:45:30 -0400
Message-ID: <bqzp.130927124530.357..ZHJraWRyZXNkZW5AZHJraS5kZQ==.1@andjake.com>
Reply-To: admin@andjake.com
From: Psychology Programs <admin@andjake.com>
To: MAILTO@BRAINFOOD
Date: Fri, 27 Sep 2013 12:45:30 -0400
Content-Type: multipart/alternative; boundary="MAI-alt-1376050239"
MIME-version: 1.0
Subject: ***SPAM***Learn about psychology degree programs here
```
An der vordefinierten ISPConfig /etc/postfix/main.cf scheint etwas nicht Rund zu laufen, ein Test hat es bestätigt.

Wenn man in einem Mailclient einfach ein Konto mit "Absendername" + "Serveradresse" und wieder gleicher "Zieladresse" angibt, lassen sich Mails (SPAMs) ohne SMTP-AUTH verschicken.

ich schau mir gerade mal verify_transport_maps/verify_relay_host OPTIONS an, irgendwo drückt da der Schuh in der ISPConfig vom Postfix/MySQL MAPS check


----------



## Brainfood (28. Sep. 2013)

/etc/postfix/main.cf


```
### postfix - main.cf ###

smtpd_banner = $myhostname ESMTP
biff = no

append_dot_mydomain = no

delay_warning_time = 6h
bounce_queue_lifetime = 12h
maximal_queue_lifetime = 12h

readme_directory = /usr/share/doc/postfix

smtpd_tls_cert_file = /etc/postfix/smtpd.cert
smtpd_tls_key_file = /etc/postfix/smtpd.key
smtpd_use_tls = yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

myhostname = MYSERVER.DOMAIN.TLD

alias_maps = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases
alias_database = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases

myorigin = /etc/mailname
mydestination = MYSERVER.DOMAIN.TLD, localhost, localhost.localdomain
relayhost = 

mynetworks = 127.0.0.0/8 [::1]/128 [fe80::]/10 XXX.XXX.XXX.YYY XXX.XXX.XXX.ZZZ

mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all

###smtp_bind_address = XXX.XXX.XXX.XXX
smtp_bind_address6 = 2a01:XXXX:XXXX:XXXX::25

html_directory = /usr/share/doc/postfix/html
virtual_alias_domains = 
virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, proxy:mysql:/etc/postfix/mysql-virtual_email2email.cf, hash:/var/lib/mailman/data/virtual-mailman
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
virtual_mailbox_base = /var/vmail
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000

smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
smtpd_sasl_authenticated_header = yes

smtpd_recipient_restrictions =
        permit_mynetworks,
        permit_sasl_authenticated,
        check_recipient_access mysql:/etc/postfix/mysql-virtual_recipient.cf,
        reject_unauth_destination,
        reject_invalid_hostname,
        reject_non_fqdn_sender,
        reject_non_fqdn_recipient,
        reject_unknown_sender_domain,
        reject_unknown_recipient_domain,
        reject_unverified_recipient,
        reject_rbl_client zen.spamhaus.org

smtpd_tls_security_level = may

transport_maps = hash:/var/lib/mailman/data/transport-mailman, proxy:mysql:/etc/postfix/mysql-virtual_transports.cf
relay_domains = mysql:/etc/postfix/mysql-virtual_relaydomains.cf
relay_recipient_maps = mysql:/etc/postfix/mysql-virtual_relayrecipientmaps.cf
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps
smtpd_sender_restrictions = check_sender_access mysql:/etc/postfix/mysql-virtual_sender.cf
smtpd_client_restrictions = check_client_access mysql:/etc/postfix/mysql-virtual_client.cf
smtpd_client_message_rate_limit = 100
maildrop_destination_concurrency_limit = 1
maildrop_destination_recipient_limit = 1
virtual_transport = dovecot

header_checks = regexp:/etc/postfix/header_checks
mime_header_checks = regexp:/etc/postfix/mime_header_checks
nested_header_checks = regexp:/etc/postfix/nested_header_checks
body_checks = regexp:/etc/postfix/body_checks
owner_request_special = no
dovecot_destination_recipient_limit = 1
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth

content_filter = amavis:[127.0.0.1]:10024
receive_override_options = no_address_mappings
message_size_limit = 0

smtpd_tls_exclude_ciphers = SSLv2, aNULL, ADH, eNULL

smtpd_tls_ciphers = high

strict_rfc821_envelopes = yes
resolve_numeric_domain = no

smtpd_helo_required = yes
smtpd_helo_restrictions = reject_invalid_hostname

smtp_helo_name = $myhostname

inet_protocols = all

# Outlook - fix broken clients
smtpd_command_filter=pcre:/etc/postfix/smtpd_command_filter_fix_broken_clients.pcre

# EOF
```


----------

