Постфиксное отклонение неизвестный локальный получатель

У меня есть проблема с обратным рассеянием. Спаммеры посылают электронные письма не существующее имя пользователя существующий домен, размещенный на моем сервере. Я пытаюсь прервать сессию вместо того, чтобы передать возвращенные сообщения обратно подделанным адресам отправителя. Я пытался добавить reject_unverified_recipient, но это, кажется, не работает.

То, когда я проверяю mailq, я вижу, что многие засунули "пользователя, не существует" электронные письма возврата от MAILER_DAEMON до не существующие получатели.

Вот мой postconf-n

append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
config_directory = /etc/postfix
dovecot_destination_recipient_limit = 1
inet_interfaces = all
inet_protocols = ipv4
mailbox_size_limit = 0
message_size_limit = 102400000
milter_default_action = accept
milter_protocol = 2
mydestination = localhost
myhostname = domain.com
mynetworks = 127.0.0.0/8
non_smtpd_milters = inet:localhost:8891
readme_directory = no
recipient_delimiter = +
relay_domains =
relayhost =
resolve_numeric_domain = yes
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_milters = inet:localhost:8891
smtpd_relay_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, reject_unknown_recipient_domain, reject_unverified_recipient, permit_auth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_tls_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_tls_CAfile = /etc/ssl/certs/domain.com.chain.crt
smtpd_tls_cert_file = /etc/ssl/certs/domain.com.crt
smtpd_tls_key_file = /etc/ssl/private/domain.com.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
virtual_alias_domains = mysql:/etc/postfix/sqlconf/virtual_alias_domains.cf
virtual_alias_maps = mysql:/etc/postfix/sqlconf/virtual_mailbox_maps.cf
virtual_mailbox_domains = mysql:/etc/postfix/sqlconf/mydestination.cf
virtual_transport = dovecot

Это - master.cf файл

smtp      inet  n       -       -       -       -       smtpd
  -o content_filter=spamassassin
  -o receive_override_options=no_header_body_checks,no_unknown_recipient_checks,no_milters
smtps     inet  n       -       -       -       -       smtpd
  -o content_filter=checkhook
  -o smtpd_tls_wrappermode=yes
  -o smtpd_sasl_auth_enable=yes
dovecot   unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${recipient}
pickup    unix  n       -       -       60      1       pickup
cleanup   unix  n       -       -       -       0       cleanup
qmgr      unix  n       -       n       300     1       qmgr
#qmgr     unix  n       -       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
proxywrite unix -       -       n       -       1       proxymap
smtp      unix  -       -       -       -       -       smtp
relay     unix  -       -       -       -       -       smtp
showq     unix  n       -       -       -       -       showq
error     unix  -       -       -       -       -       error
retry     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}
spamassassin unix -     n       n       -       -       pipe
  user=spamfilter argv=/usr/bin/spamc -f -e /usr/sbin/sendmail -oi -f ${sender} ${recipient}
checkhook unix  -       n       n       -       -       pipe
  user=www-data argv=/etc/postfix/scripts/send ${sender} ${recipient}

Вот некоторые журналы, которые были сделаны, когда я пытался отправить недопустимому локальному получателю.

Jan 22 19:09:34 ip-12345 postfix/qmgr[19938]: CF96B20013B: from=<invalid@sender.ocm>, size=249, nrcpt=1 (queue active)
Jan 22 19:09:35 ip-12345 postfix/pickup[19939]: 982D320013D: uid=5007 from=<invalid@sender.ocm>
Jan 22 19:09:35 ip-12345 postfix/pipe[21485]: CF96B20013B: to=<nonexistentx@localdomain.com>, relay=spamassassin, delay=18, delays=16/0/0/1.2, dsn=2.0.0, status=sent (delivered via spamassassin service)                           
Jan 22 19:09:35 ip-12345 postfix/qmgr[19938]: CF96B20013B: removed
Jan 22 19:09:35 ip-12345 postfix/cleanup[21477]: 982D320013D: message-id=<20170122190935.982D320013D@maindomain.com>
Jan 22 19:09:35 ip-12345 postfix/qmgr[19938]: 982D320013D: from=<invalid@sender.ocm>, size=1333, nrcpt=1 (queue active)
Jan 22 19:09:35 ip-12345 dovecot: auth: Debug: master in: USER#0111#011nonexistentx@localdomain.com#011service=lda
Jan 22 19:09:35 ip-12345 dovecot: auth-worker(14636): Debug: sql(nonexistentx@localdomain.com): SELECT '/var/vmail/nonexistentx@localdomain.com' as home, 'vmail' as uid, 'vmail' as gid, concat('*:storage=', quota_kb) AS quota_rule, concat('*:messages=', quota_msg) AS quota_rule2 FROM users WHERE username = 'nonexistentx' AND domain = 'localdomain.com' and active=1                          
Jan 22 19:09:35 ip-12345 dovecot: auth-worker(14636): sql(nonexistentx@localdomain.com): unknown user                                                  
Jan 22 19:09:35 ip-12345 dovecot: auth: Debug: userdb out: NOTFOUND#0111       
Jan 22 19:09:35 ip-12345 postfix/pipe[21400]: 982D320013D: to=<nonexistentx@localdomain.com>, relay=dovecot, delay=0.07, delays=0.05/0/0/0.02, dsn=5.1.1, status=bounced (user unknown)                                              
Jan 22 19:09:35 ip-12345 postfix/cleanup[21396]: A8B0720013C: message-id=<20170122190935.A8B0720013C@maindomain.com>
Jan 22 19:09:35 ip-12345 postfix/bounce[21474]: 982D320013D: sender non-delivery notification: A8B0720013C                                                   
Jan 22 19:09:35 ip-12345 postfix/qmgr[19938]: A8B0720013C: from=<>, size=3394, nrcpt=1 (queue active)                                                  
Jan 22 19:09:35 ip-12345 postfix/qmgr[19938]: 982D320013D: removed      
Jan 22 19:09:35 ip-12345 postfix/smtp[21496]: A8B0720013C: to=<invalid@sender.ocm>, relay=none, delay=0.03, delays=0/0.01/0.02/0, dsn=5.4.4, status=bounced (Host or domain name not found. Name service error for name=sender.ocm type=A: Host not found)                                                              
Jan 22 19:09:35 ip-12345 postfix/qmgr[19938]: A8B0720013C: removed
0
задан 22 January 2017 в 12:53

1 ответ

Смотря на Вашу общую конфигурацию, это похоже на Ваш milter (spamassassin?) принимает по умолчанию. Ваш постфикс лучше отклонил бы еще некоторый спам в парадной двери.

Вот часть постфиксной конфигурации, которую я использую на одном сервере, нацеленном на не допускание спама в парадной двери, а также попытки предотвратить лавинные рассылки спама. Не просто скопируйте его. Читайте немного больше о постфиксной конфигурации, практических руководствах, wikis и т.д. (Точно так же, как я имею в прошлом). Можно вслепую скопировать его, хотя, но затем сначала удаляют строки с helo_access и упомянутым файлом доступа. Если те файлы не будут существовать, то постфикс выступит и не запустится.

Также примечание, что порядок очень важен в "paragraphes" с, например, smtpd_helo_restrictions, smtpd_recipient_restrictions и т.д., Например, smtpd_recipient_restrictions блок, должно иметь серверы РУБЛЯ как последние, для уменьшения сетевых запросов, позволяя постфиксу сделать начальные проверки сначала. Затем после того, как постфикс сделал задание там в той части, РУБЛИ могут посмотреть на то, что все еще оставляют проверить на спаммеров.

smtpd_client_connection_count_limit = 10
smtpd_client_connection_rate_limit = 60
smtpd_error_sleep_time = 1s
smtpd_hard_error_limit = 20
smtpd_helo_required = yes
smtpd_helo_restrictions = 
 permit_mynetworks, 
 permit_sasl_authenticated,
 check_helo_access hash:/etc/postfix/helo_access,
 reject_non_fqdn_hostname, 
 reject_invalid_hostname, 
 reject_unauth_pipelining, 
 permit
smtpd_recipient_restrictions = 
 permit_mynetworks, 
 permit_sasl_authenticated, 
 reject_unauth_destination, 
 reject_unauth_pipelining, 
 reject_non_fqdn_sender, 
 reject_non_fqdn_recipient, 
 reject_invalid_hostname, 
 reject_unknown_sender_domain, 
 reject_unknown_recipient_domain, 
 reject_unlisted_recipient, 
 reject_rbl_client psbl.surriel.com, 
 reject_rbl_client ix.dnsbl.manitu.net, 
 reject_rbl_client zen.spamhaus.org, 
 reject_rbl_client bl.spamcop.net, 
 permit
smtpd_sender_restrictions = 
 check_sender_access hash:/etc/postfix/access, 
 permit_mynetworks, 
 permit_sasl_authenticated, 
 reject_non_fqdn_sender, 
 reject_unknown_sender_domain
smtpd_soft_error_limit = 10

И подсказка, установите pfqueue:

sudo apt-get install pfqueue

, С которым можно быстро пройти электронные письма в очереди и удалить то, что Вы хотите удалить. Можно также удалить все электронные письма в постфиксной очереди, ЕСЛИ Вы уверены, что все это - несоответствующие, неважные электронные письма:

sudo postsuper -d ALL

Снова, быть осторожным с той последней командой. См. также:

man postsuper
0
ответ дан 7 November 2019 в 03:08

Другие вопросы по тегам:

Похожие вопросы: