postfix und clamavstmp

foexle

foexle

Kaiser
Hallo Jungs
ich kämpfe hier mit postfix und dem viren/antispam herum...
Ich habe mich dazu entschieden clamav zu benutzen, weil dieser beides enthält also virenscan und spamfilter (soweit ich gelsen habe). Die andere variante mit spamassasin habe ich erst mal aussen vor gelassen.

Also zu meinem problem. Postfix und clamavsmtp laufen wohl richtig. Allerdings werden die mails an einem falchen ort ab gespeichert. Diese kommen unter /var/mail/<benutzer> an (was default ist)
Ich habe aber in dovcot eingestellt das diese unter /home/vmail/<domain>/<benutzer> abgelegt werden sollen.

meine main.cf von postfix
Code:
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${queue_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${queue_directory}/smtp_scache

#smtpd_resipient_restrictions = permit_sasl_authenticated,
#       permit_mynetworks,
#       reject_unauth_destination,
#       check_policy_service inet:127.0.0.1:60000

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

myhostname = vserver5
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = vserver5.example.de, vserver5, localhost.example.de,  localhost, localhost.localdomain
relayhost =
mynetworks = 127.0.0.0/8
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf
virtual_alias_maps = mysql:/etc/postfix/mysql-virtual-alias-maps.cf,mysql:/etc/postfix/mysql-email2email.cf
virtual_transport = dovecot
dovecot_destination_recipient_limit = 1
smtp_recipient_restrictions = permit_mynetworks,permit_mx_backup
#virtual_transport = procmail
#procmail_destination_recipient_limit = 1
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
content_filter = scan:127.0.0.1:10025
receive_override_options = no_address_mappings
und maine master.cf
Code:
smtp      inet  n       -       n       -       -       smtpd
pickup    fifo  n       -       -       60      1       pickup
cleanup   unix  n       -       -       -       0       cleanup
qmgr      fifo  n       -       n       300     1       qmgr
#qmgr     fifo  n       -       -       300     1       oqmgr
tlsmgr    unix  -       -       -       1000?   1       tlsmgr
rewrite   unix  -       -       -       -       -       trivial-rewrite
bounce    unix  -       -       -       -       0       bounce
defer     unix  -       -       -       -       0       bounce
trace     unix  -       -       -       -       0       bounce
verify    unix  -       -       -       -       1       verify
flush     unix  n       -       -       1000?   0       flush
proxymap  unix  -       -       n       -       -       proxymap
smtp      unix  -       -       -       -       -       smtp
# When relaying mail as backup MX, disable fallback_relay to avoid MX loops
relay     unix  -       -       -       -       -       smtp
        -o fallback_relay=
#       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq     unix  n       -       -       -       -       showq
error     unix  -       -       -       -       -       error
discard   unix  -       -       -       -       -       discard
local     unix  -       n       n       -       -       local
virtual   unix  -       n       n       -       -       virtual
lmtp      unix  -       -       -       -       -       lmtp
anvil     unix  -       -       -       -       1       anvil
scache    unix  -       -       -       -       1       scache
maildrop  unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
uucp      unix  -       n       n       -       -       pipe
  flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
#
ifmail    unix  -       n       n       -       -       pipe
  flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp     unix  -       n       n       -       -       pipe
  flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient
scalemail-backend unix  -       n       n       -       2       pipe
  flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
mailman   unix  -       n       n       -       -       pipe
  flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
  ${nexthop} ${user}

dovecot   unix  -       n       n       -       -       pipe   flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -d ${recipient}
#spamfilter unix -      n       n       -       -       pipe    flags=Rq user=spamfilter argv=/usr/local/bin/spamfilter.sh -f ${sender} -- ${recipient}
#procmail  unix -       n       n       -       -       pipe -o flags=R user=vmail argv=/usr/bin/procmail -t -f ${sender} -m RECIPIENT=${recipient} /home/vmail/procmail/common.procmailrc

# ClamSMTP anti virus
scan    unix    -       -       n       -       16      smtp
        -o smtp_send_xforward_command=yes
# For injecting mail back into postfix from the filter
127.0.0.1:10026 inet  n -       n       -       16      smtpd
   -o content_filter=
   -o receive_override_options=no_unknown_recipient_checks,no_header_body_checks
   -o smtpd_helo_restrictions=
   -o smtpd_client_restrictions=
   -o smtpd_sender_restrictions=
   -o smtpd_recipient_restrictions=permit_mynetworks,reject
   -o mynetworks_style=host
   -o smtpd_authorized_xforward_hosts=127.0.0.0/8
dovcot.conf

Code:
protocols = imap imaps pop3 pop3s
disable_plaintext_auth = no
log_timestamp = "%Y-%m-%d %H:%M:%S "
mail_location = maildir:/home/vmail/%d/%n
mail_extra_groups = mail

protocol imap {

}

protocol pop3 {
  pop3_uidl_format = %08Xu%08Xv
}

protocol lda { 
    log_path = /home/vmail/dovecot-deliver.log
    auth_socket_path = /var/run/dovecot/auth-master
    postmaster_address = postmaster@example.com
    mail_plugins = cmusieve
    global_script_path = /home/vmail/globalsieverc
}

auth default { 
  mechanisms = plain login
  passdb sql {
    args = /etc/dovecot/dovecot-sql.conf
  }
  user = nobody 
  userdb static {
    args = uid=5000 gid=5000 home=/home/vmail/%d/%n allow_all_users=yes
  }      
  socket listen {
    master { 
        path = /var/run/dovecot/auth-master
        mode = 0600
        user = vmail
    }

    client { 
        path = /var/spool/postfix/private/auth
        mode = 0660
        user = postfix
        group = postfix
    }
  }
}
dict {
}
plugin {
}
die clamsmtp.conf
Code:
OutAddress: 10026

# The maximum number of connection allowed at once.
# Be sure that clamd can also handle this many connections
#MaxConnections: 64

# Amount of time (in seconds) to wait on network IO
#TimeOut: 180

# Address to listen on (defaults to all local addresses on port 10025)
Listen: 127.0.0.1:10025

# The address clamd is listening on
ClamAddress: /var/run/clamav/clamd.ctl

# A header to add to all scanned email
#ScanHeader: X-AV-Checked: ClamAV using ClamSMTP

# Directory for temporary files
TempDirectory: /var/spool/clamsmtp

# PidFile: location of PID file
PidFile: /var/run/clamsmtp/clamsmtpd.pid

# Whether or not to bounce email (default is to silently drop)
#Bounce: off

# Whether or not to keep virus files 
#Quarantine: off

# Enable transparent proxy support 
#TransparentProxy: off

# User to run as
User: clamsmtp

die logfieles geben nicht wirklich was her ....

ich weis nicht was ich noch machen soll :(

greetz und danke
 
clamav zu benutzen, weil dieser beides enthält also virenscan und spamfilter (soweit ich gelsen habe).
Das hast Du wohl mit AmavisD verwechselt. ClamAV ist wirklich ein AV- (AntiVirus-)Programm.
Mit Amavis hättest Du einen der sowohl Antivirus (diverse, u.a. auch ClamAV) und Spam-Erkennung mit DSpam oder SpamAssassin kann.
Eingebunden wird Amavis auf die selbe Art wie ClamScan.

die logfieles geben nicht wirklich was her ....
Aber zumindest mal, ob clamscan durchlaufen wird oder nicht?
Und mit welchem Delivery-Agent er arbeitet, oder?

Desweiteren kann man Postfix gesprächiger machen:
Code:
smtp            inet  n - n  -  -       smtpd [color=red]-v[/color]
127.0.0.1:10026 inet  n - n  -  16      smtpd [color=red]-v[/color]

huschi.
 

Ähnliche Themen

Dovecot: Geteilte Postfächer (Shared Mailboxes) funktionieren nicht

Zugriff Ubuntu 16.04. auf Freigabe 18.04. LTS nicht möglich

Samba-Server mit Univention Corporate Server

Keine Zugriff von Windows 10 auf Sambafreigaben

postfix/dovecot/cyrus sasl: basic conf

Zurück
Oben