我有我希望是一个相当正常的家庭后缀设置。 我使用fetchmail获取POP3邮件,通过/ usr / sbin / sendmail传递给postfix。 在postfix的master.cf中,我添加了一个spamassassin服务,并在smtp服务上设置了-o content_filter=spamassassin 。
我希望postfix使用spamassassin过滤收到的邮件,但由于某种原因,它不是这样做。
它正在过滤传出的邮件,虽然:这是一些来自/var/log/mail.log的示例:
接收(不过滤,为什么不?):
Sep 19 01:40:05 fitpc postfix/local[31480]: 062CC2CE070F: to=<[email protected]>, orig_to=<mailandy>, relay=local, delay=0.43, delays=0.24/0.05/0/0.14, dsn=2.0.0, status=sent (delivered to command: procmail -a "$EXTENSION")
发送(过滤,不需要这个):
Sep 19 01:07:16 fitpc postfix/pipe[31190]: 8CB252CE070E: to=<[email protected]>, relay=spamassassin, delay=0.48, delays=0.1/0.05/0/0.33, dsn=2.0.0, status=sent (delivered via spamassassin service)
难道是因为fetchmail使用/ usr / sbin / sendmail而不是通过networking与postfix交谈? 或者sendmail也是通过networking吗?
configuration:
$ postconf -n alias_database = hash:/etc/aliases alias_maps = hash:/etc/aliases append_dot_mydomain = no biff = no config_directory = /etc/postfix inet_interfaces = all mailbox_command = procmail -a "$EXTENSION" mailbox_size_limit = 0 message_size_limit = 0 mydestination = fitpc, localhost.localdomain, localhost, ubuntu-desktop, server-vm, example.com myhostname = fitpc mynetworks = 127.0.0.0/8 10.0.1.0/24 [::ffff:127.0.0.0]/104 [::1]/128 myorigin = example.com notify_classes = resource,software,bounce,2bounce,delay,policy,protocol readme_directory = no recipient_delimiter = + relayhost = relay.plus.net smtp_tls_note_starttls_offer = yes smtp_tls_security_level = may smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu) smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,reject_unauth_destination smtpd_relay_restrictions = permit_sasl_authenticated,defer_unauth_destination smtpd_sasl_auth_enable = yes smtpd_sasl_local_domain = smtpd_sasl_path = private/auth smtpd_sasl_security_options = noanonymous smtpd_sasl_type = dovecot smtpd_tls_auth_only = no smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key smtpd_tls_loglevel = 1 smtpd_tls_received_header = yes smtpd_tls_security_level = may smtpd_tls_session_cache_timeout = 3600s tls_random_source = dev:/dev/urandom $ postconf -M 2025 inet n - - - - smtpd -o content_filter=spamassassin pickup unix n - - 60 1 pickup cleanup unix n - - - 0 cleanup qmgr unix n - n 300 1 qmgr 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 proxywrite unix - - n - 1 proxymap smtp unix - - - - - smtp relay unix - - - - - smtp -o smtp_fallback_relay= showq unix n - - - - showq error unix - - - - - error retry unix - - - - - error discard unix - - - - - discard local unix - nn - - local virtual unix - nn - - virtual lmtp unix - - - - - lmtp anvil unix - - - - 1 anvil scache unix - - - - 1 scache maildrop unix - nn - - pipe flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient} uucp unix - nn - - pipe flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient) ifmail unix - nn - - pipe flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient) bsmtp unix - nn - - pipe flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient scalemail-backend unix - nn - 2 pipe flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension} mailman unix - nn - - pipe flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py ${nexthop} ${user} spamassassin unix - nn - - pipe -v user=debian-spamd argv=/usr/bin/spamc -e /usr/sbin/sendmail -oi -f ${sender} ${recipient}
当然,只要我写了这个,我有一个想法,并得到它的工作。
这个问题不是在后缀或spamassassinconfiguration中,而是在fetchmailconfiguration中。
我有这个在我的.fetchmailrc:
poll example.com with proto POP3 user 'x' there with password 'y' is 'z' here mda "/usr/sbin/sendmail -i -f %F -- %T"
但是因为它使用了/usr/sbin/sendmail ,所以它不会把邮件放到postfix的队列中,而是直接发送(原来),所以它绕过了垃圾邮件filter。 我需要的是:
poll example.com with proto POP3 user 'x' there with password 'y' is 'z' here smtphost localhost/2025
(因为我的后缀在端口2025监听。如果它在端口25上监听,我们根本不需要smpthost行。)