Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section Mail Server
  • Search

AntiSpam block all incoming emails ?

Questions regarding the Mail Server
Dovecot, Exim, RoundCube
Post Reply
  • Print view
Advanced search
7 posts • Page 1 of 1
hafeezksa
Posts: 81
Joined: Mon Apr 27, 2015 5:45 pm
Contact:
Contact hafeezksa
Website

AntiSpam block all incoming emails ?
  • Quote

Post by hafeezksa » Wed May 20, 2015 7:26 am

1- AntiSpam Support
2- AntiVirus Support
3- DKIM Support in my email server.
Above three services enabled on my mail server. Email sending ok but when I enable AntiSpam Support I can not receive any email from others. From where I can check AntiSpam log in order to check why it is blocking all emails?
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: AntiSpam block all incoming emails ?
  • Quote

Post by skurudo » Sun May 24, 2015 10:14 pm

Try to look in log:
/var/log/dovecot.log

What's error you get from your server?
Top

rgawron
Posts: 12
Joined: Wed Feb 18, 2015 10:15 am

Re: AntiSpam block all incoming emails ?
  • Quote

Post by rgawron » Mon May 25, 2015 3:02 pm

You installed clamav and spamassassin manually ?
Please paste /etc/exim/exim.conf.
Top

hafeezksa
Posts: 81
Joined: Mon Apr 27, 2015 5:45 pm
Contact:
Contact hafeezksa
Website

Re: AntiSpam block all incoming emails ?
  • Quote

Post by hafeezksa » Mon May 25, 2015 8:20 pm

rgawron wrote:You installed clamav and spamassassin manually ?
Please paste /etc/exim/exim.conf.
Yes, I installed clamav and spamassassin manually.

# cat /etc/exim/exim.conf
######################################################################
# #
# Exim configuration file for Vesta Control Panel #
# #
######################################################################

SPAMASSASSIN = yes
#SPAM_SCORE = 50
CLAMD = yes

domainlist local_domains = dsearch;/etc/exim/domains/
domainlist relay_to_domains = dsearch;/etc/exim/domains/
hostlist relay_from_hosts = 127.0.0.1
hostlist whitelist = net-iplsearch;/etc/exim/white-blocks.conf
hostlist spammers = net-iplsearch;/etc/exim/spam-blocks.conf
no_local_from_check
untrusted_set_sender = *
acl_smtp_connect = acl_check_spammers
acl_smtp_mail = acl_check_mail
acl_smtp_rcpt = acl_check_rcpt
acl_smtp_data = acl_check_data
acl_smtp_mime = acl_check_mime

.ifdef SPAMASSASSIN
spamd_address = 127.0.0.1 783
.endif

.ifdef CLAMD
av_scanner = clamd: /var/run/clamav/clamd.sock
.endif

tls_advertise_hosts = *
tls_certificate = /usr/local/vesta/ssl/certificate.crt
tls_privatekey = /usr/local/vesta/ssl/certificate.key

daemon_smtp_ports = 25 : 465 : 587 : 2525
tls_on_connect_ports = 465
never_users = root
host_lookup = *
rfc1413_hosts = *
rfc1413_query_timeout = 5s
ignore_bounce_errors_after = 2d
timeout_frozen_after = 7d

DKIM_DOMAIN = ${lc:${domain:$h_from:}}
DKIM_FILE = /etc/exim/domains/${lc:${domain:$h_from:}}/dkim.pem
DKIM_PRIVATE_KEY = ${if exists{DKIM_FILE}{DKIM_FILE}{0}}



######################################################################
# ACL CONFIGURATION #
# Specifies access control lists for incoming SMTP mail #
######################################################################
begin acl

acl_check_spammers:
accept hosts = +whitelist

drop message = Your host in blacklist on this server.
log_message = Host in blacklist
hosts = +spammers

accept


acl_check_mail:
deny condition = ${if eq{$sender_helo_name}{}}
message = HELO required before MAIL

drop message = Helo name contains a ip address (HELO was $sender_helo _name) and not is valid
condition = ${if match{$sender_helo_name}{\N((\d{1,3}[.-]\d{1,3}[. -]\d{1,3}[.-]\d{1,3})|([0-9a-f]{8})|([0-9A-F]{8}))\N}{yes}{no}}
condition = ${if match {${lookup dnsdb{>: defer_never,ptr=$sender_ host_address}}\}{$sender_helo_name}{no}{yes}}
delay = 45s

drop condition = ${if isip{$sender_helo_name}}
message = Access denied - Invalid HELO name (See RFC2821 4.1.3)

drop condition = ${if eq{[$interface_address]}{$sender_helo_name}}
message = $interface_address is _my_ address

accept


acl_check_rcpt:
accept hosts = :

deny message = Restricted characters in address
domains = +local_domains
local_parts = ^[.] : ^.*[@%!/|]

deny message = Restricted characters in address
domains = !+local_domains
local_parts = ^[./|] : ^.*[@%!] : ^.*/\\.\\./

require verify = sender

accept hosts = +relay_from_hosts
control = submission

accept authenticated = *
control = submission/domain=

deny message = Rejected because $sender_host_address is in a black li st at $dnslist_domain\n$dnslist_text
hosts = !+whitelist
dnslists = ${readfile {/etc/exim/dnsbl.conf}{:}}

require message = relay not permitted
domains = +local_domains : +relay_to_domains

deny message = smtp auth requried
sender_domains = +local_domains
!authenticated = *

require verify = recipient

.ifdef CLAMD
warn set acl_m0 = no

warn condition = ${if exists {/etc/exim/domains/$domain/antivirus}{yes} {no}}
set acl_m0 = yes
.endif

.ifdef SPAMASSASSIN
warn set acl_m1 = no

warn condition = ${if exists {/etc/exim/domains/$domain/antispam}{yes}{ no}}
set acl_m1 = yes
.endif

accept


acl_check_data:
.ifdef CLAMD
deny message = Message contains a virus ($malware_name) and has been rejected
malware = *
condition = ${if eq{$acl_m0}{yes}{yes}{no}}
.endif

.ifdef SPAMASSASSIN
warn !authenticated = *
hosts = !+relay_from_hosts
condition = ${if < {$message_size}{100K}}
condition = ${if eq{$acl_m1}{yes}{yes}{no}}
spam = nobody:true/defer_ok
add_header = X-Spam-Score: $spam_score_int
add_header = X-Spam-Bar: $spam_bar
add_header = X-Spam-Report: $spam_report
set acl_m2 = $spam_score_int

warn condition = ${if !eq{$acl_m2}{} {yes}{no}}
condition = ${if >{$acl_m2}{SPAM_SCORE} {yes}{no}}
add_header = X-Spam-Status: Yes
message = SpamAssassin detected spam (from $sender_address to $r ecipients).
.endif

accept


acl_check_mime:
deny message = Blacklisted file extension detected
condition = ${if match {${lc:$mime_filename}}{\N(\.ade|\.adp|\.bat |\.chm|\.cmd|\.com|\.cpl|\.exe|\.hta|\.ins|\.isp|\.jse|\.lib|\.lnk|\.mde|\.msc|\ .msp|\.mst|\.pif|\.scr|\.sct|\.shb|\.sys|\.vb|\.vbe|\.vbs|\.vxd|\.wsc|\.wsf|\.ws h)$\N}{1}{0}}

accept



######################################################################
# AUTHENTICATION CONFIGURATION #
######################################################################
begin authenticators

dovecot_plain:
driver = dovecot
public_name = PLAIN
server_socket = /var/run/dovecot/auth-client
server_set_id = $auth1

dovecot_login:
driver = dovecot
public_name = LOGIN
server_socket = /var/run/dovecot/auth-client
server_set_id = $auth1



######################################################################
# ROUTERS CONFIGURATION #
# Specifies how addresses are handled #
######################################################################
begin routers

#smarthost:
# driver = manualroute
# domains = ! +local_domains
# transport = remote_smtp
# route_list = * smartrelay.vestacp.com
# no_more
# no_verify

dnslookup:
driver = dnslookup
domains = !+local_domains
transport = remote_smtp
no_more

userforward:
driver = redirect
check_local_user
file = $home/.forward
allow_filter
no_verify
no_expn
check_ancestor
file_transport = address_file
pipe_transport = address_pipe
reply_transport = address_reply

procmail:
driver = accept
check_local_user
require_files = ${local_part}:+${home}/.procmailrc:/usr/bin/procmail
transport = procmail
no_verify

autoreplay:
driver = accept
require_files = /etc/exim/domains/$domain/autoreply.${local_part}.msg
condition = ${if exists{/etc/exim/domains/$domain/autoreply.${local_part}.msg} }{yes}{no}}
retry_use_local_part
transport = userautoreply
unseen

aliases:
driver = redirect
headers_add = X-redirected: yes
data = ${extract{1}{:}{${lookup{$local_part@$domain}lsearch{/etc/exim/domains/ $domain/aliases}}}}
require_files = /etc/exim/domains/$domain/aliases
redirect_router = dnslookup
pipe_transport = address_pipe
unseen

localuser_fwd_only:
driver = accept
transport = devnull
condition = ${if exists{/etc/exim/domains/$domain/fwd_only}{${lookup{$local_pa rt}lsearch{/etc/exim/domains/$domain/fwd_only}{true}{false}}}}

localuser_spam:
driver = accept
transport = local_spam_delivery
condition = ${if eq {${if match{$h_X-Spam-Status:}{\N^Yes\N}{yes}{no}}} {${loo kup{$local_part}lsearch{/etc/exim/domains/$domain/passwd}{yes}{no_such_user}}}}

localuser:
driver = accept
transport = local_delivery
condition = ${lookup{$local_part}lsearch{/etc/exim/domains/$domain/passwd}{tru e}{false}}

catchall:
driver = redirect
headers_add = X-redirected: yes
require_files = /etc/exim/domains/$domain/aliases
data = ${extract{1}{:}{${lookup{*@$domain}lsearch{/etc/exim/domains/$domain/al iases}}}}
file_transport = local_delivery
redirect_router = dnslookup

terminate_alias:
driver = accept
transport = devnull
condition = ${lookup{$local_part@$domain}lsearch{/etc/exim/domains/$domain/ali ases}{true}{false}}



######################################################################
# TRANSPORTS CONFIGURATION #
######################################################################
begin transports

remote_smtp:
driver = smtp
#helo_data = $sender_address_domain
dkim_domain = DKIM_DOMAIN
dkim_selector = mail
dkim_private_key = DKIM_PRIVATE_KEY
dkim_canon = relaxed
dkim_strict = 0

procmail:
driver = pipe
command = "/usr/bin/procmail -d $local_part"
return_path_add
delivery_date_add
envelope_to_add
user = $local_part
initgroups
return_output

local_delivery:
driver = appendfile
maildir_format
maildir_use_size_file
user = ${extract{2}{:}{${lookup{$local_part}lsearch{/etc/exim/domains/$domain/ passwd}}}}
group = mail
create_directory
directory_mode = 770
mode = 660
use_lockfile = no
delivery_date_add
envelope_to_add
return_path_add
directory = "${extract{5}{:}{${lookup{$local_part}lsearch{/etc/exim/domains/$d omain/passwd}}}}/mail/$domain/$local_part"
quota = ${extract{6}{:}{${lookup{$local_part}lsearch{/etc/exim/domains/$domain /passwd}}}}M
quota_warn_threshold = 75%

local_spam_delivery:
driver = appendfile
maildir_format
maildir_use_size_file
user = ${extract{2}{:}{${lookup{$local_part}lsearch{/etc/exim/domains/$domain/ passwd}}}}
group = mail
create_directory
directory_mode = 770
mode = 660
use_lockfile = no
delivery_date_add
envelope_to_add
return_path_add
directory = "${extract{5}{:}{${lookup{$local_part}lsearch{/etc/exim/domains/$d omain/passwd}}}}/mail/$domain/$local_part/.Spam"
quota = ${extract{6}{:}{${lookup{$local_part}lsearch{/etc/exim/domains/$domain /passwd}}}}M
quota_directory = "${extract{5}{:}{${lookup{$local_part}lsearch{/etc/exim/doma ins/$domain/passwd}}}}/mail/$domain/$local_part"
quota_warn_threshold = 75%

address_pipe:
driver = pipe
return_output

address_file:
driver = appendfile
delivery_date_add
envelope_to_add
return_path_add

address_reply:
driver = autoreply

userautoreply:
driver = autoreply
file = /etc/exim/domains/$domain/autoreply.${local_part}.msg
from = "${local_part}@${domain}"
subject = "${if def:h_Subject: {Autoreply: ${quote:${escape:$h_Subject:}}} {Au toreply Message}}"
to = "${sender_address}"

devnull:
driver = appendfile
file = /dev/null


######################################################################
# RETRY CONFIGURATION #
######################################################################
begin retry

# Address or Domain Error Retries
# ----------------- ----- -------
* * F,2h,15m; G,16h,1h,1.5; F,4d,6h



######################################################################
# REWRITE CONFIGURATION #
######################################################################
begin rewrite
Top

rgawron
Posts: 12
Joined: Wed Feb 18, 2015 10:15 am

Re: AntiSpam block all incoming emails ?
  • Quote

Post by rgawron » Tue May 26, 2015 8:15 am

I have the same problem :)

#SPAM_SCORE = 50
Uncomment this variable on top config file. Value you can change if you want.
Without this variable everything goes to spam.

I report this information to VestaCP staff, they can add this line to FAQ
sed -i "s/^#SPAM_SCORE/SPAM_SCORE/g" /etc/exim/exim.conf
Top

hafeezksa
Posts: 81
Joined: Mon Apr 27, 2015 5:45 pm
Contact:
Contact hafeezksa
Website

Re: AntiSpam block all incoming emails ?
  • Quote

Post by hafeezksa » Wed Sep 16, 2015 7:52 pm

rgawron wrote:I have the same problem :)

#SPAM_SCORE = 50
Uncomment this variable on top config file. Value you can change if you want.
Without this variable everything goes to spam.

I report this information to VestaCP staff, they can add this line to FAQ
sed -i "s/^#SPAM_SCORE/SPAM_SCORE/g" /etc/exim/exim.conf
Thanks: rgawron

but vesta still did not fix it.
Top

Perp
Posts: 19
Joined: Wed Sep 09, 2015 4:48 pm

Re: AntiSpam block all incoming emails ?
  • Quote

Post by Perp » Sun Oct 04, 2015 8:22 am

rgawron wrote:I have the same problem :)

#SPAM_SCORE = 50
Uncomment this variable on top config file. Value you can change if you want.
Without this variable everything goes to spam.

I report this information to VestaCP staff, they can add this line to FAQ
sed -i "s/^#SPAM_SCORE/SPAM_SCORE/g" /etc/exim/exim.conf
Haven't worked for me. Mails are still being filtered, even though I uncommented. In reject log it says mail is NOT spam, but it never reaches destination.

In main log:

2015-10-04 10:16:15 1ZieSt-0004fX-2K H=mail-wi0-f182.google.com [209.85.212.182] F=<[email protected]> temporarily rejected after DATA: failed to expand ACL string "${if >{$acl_m2}{SPAM_SCORE} {yes}{no}}": integer expected but "SPAM_SCORE" found

Any other ideas ? What value should spam score be and what does it represent ?
Top


Post Reply
  • Print view

7 posts • Page 1 of 1

Return to “Mail Server”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password