免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3785 | 回复: 5
打印 上一主题 下一主题

[Mail] 我的邮件服务器在被人攻击,请大家帮忙看看如何解决。 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2003-06-11 12:35 |只看该作者 |倒序浏览
大家好,我的服务器系统为freebsd+postfix+qpopper+openwebmail,支持smtp认证,从昨天开始发现系统不正常:
   1,postmaster账号收到大量的以下信件或类似的Postfix SMTP client:errors from *****的信件。
在不断增加。
Postfix SMTP client: errors from mail1.954access.net[216.235.97.254]  完全邮件头  
   
Unexpected response from mail1.954access.net[216.235.97.254].

Transcript of session follows.

In:  220 Welcome to LogSat's Software ESMTP Server v1.1.2.122 - Unlicensed
    Evaluation Copy
Out: EHLO Hello
In:  250-AUTH LOGIN
In:  250-8BITMIME
In:  250 HELP
Out: MAIL FROM:<Marcinko@yahoo.com>;
In:  250 Marcinko@yahoo.com Address Okay
Out: RCPT TO:<donstop@954access.net>;
In:  521 The IP 61.163.221.110 is Blacklisted by relays.osirusoft.com.0This
    entry was last confirmed open on 10/19/2002
Out: RSET

      2,/var/spool/postfix/  目录下的defer/、deferred/、incoming/目录被大量占用,远远超出邮件服务器的正常使用量。并且在不断增加。


50M    ./defer/E
12M    ./defer/F
44M    ./defer/4
47M    ./defer/6
38M    ./defer/B
45M    ./defer/7
51M    ./defer/C
40M    ./defer/9
54M    ./defer/A
49M    ./defer/3
40M    ./defer/5
43M    ./defer/8
39M    ./defer/1
45M    ./defer/D
49M    ./defer/2
41M    ./defer/0
688M    ./defer
121M    ./deferred/E
29M    ./deferred/F
106M    ./deferred/4
114M    ./deferred/6
93M    ./deferred/B
110M    ./deferred/7
124M    ./deferred/C
97M    ./deferred/9
130M    ./deferred/A
119M    ./deferred/3
100M    ./deferred/5
104M    ./deferred/8
96M    ./deferred/1
108M    ./deferred/D
118M    ./deferred/2
100M    ./deferred/0
1.6G    ./deferred
2.0K    ./flush
2.0K    ./hold
27M    ./incoming/C
16M    ./incoming/A
40M    ./incoming/2
102M    ./incoming/B
97M    ./incoming/1
90M    ./incoming/9
91M    ./incoming/5
82M    ./incoming/0
74M    ./incoming/8
71M    ./incoming/4
64M    ./incoming/D
57M    ./incoming/7
15M    ./incoming/F
51M    ./incoming/6
43M    ./incoming/3
35M    ./incoming/E
955M    ./incoming

3,以下是/etc/postfix/main.cf配置文件的所有内容。


#soft_bounce = no
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
mail_owner = postfix
myhostname = blue.abc.com   
mydomain = abc.com
myorigin = $mydomain
mydestination = $mydomain,localhost.$mydomain,mail.$mydomain
unknown_local_recipient_reject_code = 450
mynetworks_style = subnet
mynetworks = *.*.*.*/28, 127.0.0.0/8
in_flow_delay = 1s
alias_maps = hash:/etc/postfix/aliases
mail_spool_directory = /var/mail   
sendmail_path = /usr/sbin/sendmail
newaliases_path = /usr/bin/newaliases
mailq_path = /usr/bin/mailq
setgid_group = postdrop      
manpage_directory = /usr/local/man
sample_directory = /etc/postfix
readme_directory = /etc/postfix/READMES
smtpd_sasl_auth_enable = yes
#smtpd_sasl_local_domain = $myhostname   
smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,check_relay_domains,reject_unauth_destination
smtpd_client_restrictions = permit_sasl_authenticated
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
2bounce_notice_recipient = postmaster
access_map_reject_code = 554
address_verify_map =
address_verify_negative_cache = yes
address_verify_negative_expire_time = 3d
address_verify_negative_refresh_time = 2h
address_verify_positive_expire_time = 31d
address_verify_positive_refresh_time = 7d
address_verify_sender = postmaster
address_verify_service_name = verify
alias_database = hash:/etc/postfix/aliases
allow_mail_to_commands = alias,forward
allow_mail_to_files = alias,forward
allow_mail_to_files = alias,forward
allow_min_user = no
allow_percent_hack = yes
allow_untrusted_routing = no
alternate_config_directories =
always_bcc =
append_at_myorigin = yes
append_dot_mydomain = yes
authorized_verp_clients = $mynetworks
backwards_bounce_logfile_compatibility = yes
berkeley_db_create_buffer_size = 16777216
berkeley_db_read_buffer_size = 131072
best_mx_transport =
biff = yes
body_checks =
body_checks_size_limit = 51200
bounce_notice_recipient = postmaster
bounce_service_name = bounce
bounce_size_limit = 50000
canonical_maps =
cleanup_service_name = cleanup
command_expansion_filter = 1234567890!@%-_=+:,./abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
command_time_limit = 1000s
config_directory = /etc/postfix
content_filter =
daemon_timeout = 18000s
debug_peer_level = 2
debug_peer_list =
default_database_type = hash
default_delivery_slot_cost = 5
default_delivery_slot_discount = 50
default_delivery_slot_loan = 3
default_destination_concurrency_limit = 60
default_destination_recipient_limit = 100
default_extra_recipient_limit = 1000
default_minimum_delivery_slots = 3
default_privs = nobody
default_process_limit = 100
default_rbl_reply = $rbl_code Service unavailable; $rbl_class [$rbl_what] blocked using $rbl_domain${rbl_reason?; $rbl_reason}
default_recipient_limit = 10000
default_transport = smtp
default_verp_delimiters = +=
defer_code = 450
defer_service_name = defer
defer_transports =
delay_notice_recipient = postmaster
delay_warning_time = 0h
deliver_lock_attempts = 15
deliver_lock_delay = 1s
disable_dns_lookups = no
disable_mime_input_processing = no
disable_mime_output_conversion = no
disable_verp_bounces = no
disable_vrfy_command = no
dont_remove = 0
double_bounce_sender = double-bounce
duplicate_filter_limit = 1000
empty_address_recipient = MAILER-DAEMON
error_notice_recipient = postmaster
error_service_name = error
expand_owner_alias = no
export_environment = TZ MAIL_CONFIG
extract_recipient_limit = 10240
fallback_relay =
fallback_transport =
fast_flush_domains = $relay_domains
fast_flush_purge_time = 7d
fast_flush_refresh_time = 12h
fault_injection_code = 0
flush_service_name = flush
fork_attempts = 20
fork_delay = 2s
forward_expansion_filter = 1234567890!@%-_=+:,./abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
forward_path = $home/.forward${recipient_delimiter}${extension},$home/.forward
hash_queue_depth = 1
hash_queue_names = incoming,active,deferred,bounce,defer,flush,hold,trace
header_address_token_limit = 10240
header_size_limit = 102400
helpful_warnings = yes
home_mailbox =
hopcount_limit = 100
ignore_mx_lookup_error = no
import_environment = MAIL_CONFIG MAIL_DEBUG MAIL_LOGTAG TZ XAUTHORITY DISPLAY
in_flow_delay = 1s
inet_interfaces = all
initial_destination_concurrency = 10
invalid_hostname_reject_code = 501
ipc_idle = 100s
ipc_timeout = 3600s
ipc_ttl = 1000s
line_length_limit = 2048
lmtp_cache_connection = yes
lmtp_connect_timeout = 0s
lmtp_data_done_timeout = 600s
lmtp_data_init_timeout = 120s
lmtp_data_xfer_timeout = 180s
lmtp_lhlo_timeout = 300s
lmtp_mail_timeout = 300s
lmtp_quit_timeout = 300s
lmtp_rcpt_timeout = 300s
lmtp_rset_timeout = 120s
lmtp_sasl_auth_enable = no
lmtp_sasl_password_maps =
lmtp_sasl_security_options = noplaintext, noanonymous
lmtp_skip_quit_response = no
lmtp_tcp_port = 24
local_command_shell =
local_destination_concurrency_limit = 5
local_destination_recipient_limit = 1
local_recipient_maps = proxy:unix:passwd.byname $alias_maps
local_transport = localmyhostname
luser_relay =
mail_name = Postfix
#mail_owner = postfix
mail_release_date = 20030126
mail_version = 2.0.3-20030126
mailbox_command =
mailbox_command_maps =
mailbox_delivery_lock = flock
mailbox_size_limit = 320000000
mailbox_transport =
maps_rbl_domains =
maps_rbl_reject_code = 554
masquerade_classes = envelope_sender, header_sender, header_recipient
masquerade_domains =
masquerade_exceptions =
max_idle = 100s
max_use = 100
maximal_backoff_time = 4000s
maximal_queue_lifetime = 5d
message_size_limit = 60240000
mime_boundary_length_limit = 2048
mime_header_checks = $header_checks
mime_nesting_limit = 100
minimal_backoff_time = 1000s
multi_recipient_bounce_reject_code = 550
mynetworks_style = subnet
nested_header_checks = $header_checks
non_fqdn_reject_code = 504
notify_classes = resource,software,protocol
owner_request_special = yes
parent_domain_matches_subdomains = debug_peer_list,fast_flush_domains,mynetworks,permit_mx_backup_networks,qmqpd_authorized_clients,relay_doma
ins,smtpd_access_maps
permit_mx_backup_networks =
pickup_service_name = pickup
prepend_delivered_header = command, file, forward
process_id_directory = pid
program_directory = /usr/libexec/postfix
propagate_unmatched_extensions = canonical, virtual
proxy_interfaces =
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domai
ns $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps
qmgr_clog_warn_time = 300s
qmgr_fudge_factor = 100
qmgr_message_active_limit = 2000
qmgr_message_recipient_limit = 2000
qmgr_message_recipient_minimum = 10
qmqpd_authorized_clients =
qmqpd_error_delay = 1s
qmqpd_timeout = 300s
#queue_directory = /var/spool/postfix
queue_file_attribute_count_limit = 100
queue_minfree = 0
queue_run_delay = 1000s
queue_service_name = qmgr
rbl_reply_maps =
recipient_canonical_maps =
recipient_delimiter =
reject_code = 554
relay_domains_reject_code = 554
relay_recipient_maps =
relay_transport = relay
relayhost =
relocated_maps =
require_home_directory = no
resolve_dequoted_address = yes
rewrite_service_name = rewrite
sender_based_routing = no
sender_canonical_maps =
service_throttle_time = 60s
show_user_unknown_table_name = yes
showq_service_name = showq
smtp_always_send_ehlo = yes
smtp_bind_address =
smtp_connect_timeout = 30s
smtp_data_done_timeout = 600s
smtp_data_init_timeout = 120s
smtp_data_xfer_timeout = 180s
smtp_destination_concurrency_limit = $default_destination_concurrency_limit
smtp_destination_recipient_limit = $default_destination_recipient_limit
smtp_helo_name = Hello
smtp_helo_timeout = 300s
smtp_line_length_limit = 990
smtp_mail_timeout = 300s
smtp_never_send_ehlo = no
smtp_pix_workaround_delay_time = 10s
smtp_pix_workaround_threshold_time = 500s
smtp_quit_timeout = 300s
smtp_randomize_addresses = yes
smtp_rcpt_timeout = 300s
smtp_rset_timeout = 120s
smtp_sasl_auth_enable = no
smtp_skip_4xx_greeting = yes
smtp_skip_5xx_greeting = yes
smtp_skip_quit_response = yes
smtpd_banner = mail.zzvcom.com ESMTP
smtpd_data_restrictions =
smtpd_delay_reject = yes
smtpd_error_sleep_time = 4s
smtpd_etrn_restrictions =
smtpd_expansion_filter = \t\40!"#$%&'()*+,-./0123456789:;<=>;?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~
smtpd_hard_error_limit = 40
smtpd_helo_required = no
smtpd_helo_restrictions =
smtpd_history_flush_threshold = 100
smtpd_junk_command_limit = 100
smtpd_noop_commands =
smtpd_null_access_lookup_key = <>;
smtpd_recipient_limit = 1000
smtpd_restriction_classes =
smtpd_sender_login_maps =
smtpd_sender_restrictions =
smtpd_soft_error_limit = 10
smtpd_timeout = 300s
soft_bounce = no
stale_lock_time = 500s
strict_7bit_headers = no
strict_8bitmime = no
strict_8bitmime_body = no
strict_mime_encoding_domain = no
strict_rfc821_envelopes = no
sun_mailtool_compatibility = no
swap_bangpath = yes
syslog_facility = mail
syslog_name = postfix
trace_service_name = trace
transport_maps =
transport_retry_time = 60s
trigger_timeout = 10s
undisclosed_recipients_header = To: undisclosed-recipients:;
unknown_address_reject_code = 450
unknown_client_reject_code = 450
unknown_hostname_reject_code = 450
unknown_local_recipient_reject_code = 550
unknown_relay_recipient_reject_code = 550
unknown_virtual_alias_reject_code = 550
unknown_virtual_mailbox_reject_code = 550
unverified_recipient_reject_code = 450
unverified_sender_reject_code = 450
verp_delimiter_filter = -=+
virtual_alias_domains = $virtual_alias_maps
virtual_alias_maps = $virtual_maps
virtual_gid_maps =
virtual_mailbox_base =
virtual_mailbox_domains = $virtual_mailbox_maps
virtual_mailbox_limit = 51200000
virtual_mailbox_lock = fcntl
virtual_mailbox_maps =
virtual_minimum_uid = 100
virtual_transport = virtual
virtual_uid_maps =

论坛徽章:
0
2 [报告]
发表于 2003-06-11 12:39 |只看该作者

我的邮件服务器在被人攻击,请大家帮忙看看如何解决。

谢谢了!

论坛徽章:
0
3 [报告]
发表于 2003-06-11 15:28 |只看该作者

我的邮件服务器在被人攻击,请大家帮忙看看如何解决。

原帖由 "bluebird2003" 发表:
cdefghijklmnopqrstuvwxyz{|}~
smtpd_hard_error_limit = 40
smtpd_helo_required = no
smtpd_helo_restrictions =
smtpd_history_flush_threshold = 100
smtpd_junk_command_limit = 100
smtpd_noop_commands..........
   

老大。建议你别一下配置那么多参数。否则问题很难检查。
首先,请backup你的main.cf,然后
这样:
postconf -n >; /etc/postfix/main.cf
去掉那些注释先 (但你得先backup好这个文件)

然后再贴main.cf出来。

此外,不要弄那么多额外的设置,例如对address的设置,对队列的一些设置等等。太多了看得头晕。。在你不是太熟悉他们干什么之前不要乱用。:(

论坛徽章:
0
4 [报告]
发表于 2003-06-11 15:38 |只看该作者

我的邮件服务器在被人攻击,请大家帮忙看看如何解决。

先谢谢了。

论坛徽章:
0
5 [报告]
发表于 2003-06-12 18:31 |只看该作者

我的邮件服务器在被人攻击,请大家帮忙看看如何解决。


服务器开始变得正常了,至少目前看来是这样了。
1,对于大量的deferred/和defer/目录下的文件可以毫不留情的在相应目录下执行清除命令:rm-rf *
2,对于incoming目录下的文件,为了让服务器恢复正常所以也在思考得失后rm -rf *了解了过去。
3,修改配置文件。最主要的是:
第一,把mynetworks去掉,把mynetworks_style = subnet 该成了mynetworks_style = host,这样就只为服务器自己和通过认证的用户relay mail。
第二,去掉了大部分的配置,实际上是使用他们的默认值运行。


####file path settings
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
alias_maps = hash:/etc/postfix/aliases
mail_spool_directory = /var/mail
sendmail_path = /usr/sbin/sendmail
newaliases_path = /usr/bin/newaliases
mailq_path = /usr/bin/mailq
setgid_group = postdrop
manpage_directory = /usr/local/man
sample_directory = /etc/postfix
config_directory = /etc/postfix
readme_directory = /etc/postfix/READMES
mail_owner = postfix
####my hostname,domain name
myhostname = xxx.xxx.com
mydomain = xxx.com
####mail from
myorigin = $mydomain
####receive mail for
mydestination = $mydomain,localhost.$mydomain,mail.$mydomain
####default relay mail for localhost only
mynetworks_style = host
####my own network address
inet_interfaces = all
#mynetworks = 61.163.221.110, 127.0.0.1
####smtp auth
smtpd_sasl_auth_enable = yes
#smtpd_sasl_local_domain = $myhostname
smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,reject_unauth_destination
smtpd_client_restrictions = permit_mynetworks,permit_sasl_authenticated
unknown_local_recipient_reject_code = 450
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
notify_classes = resource,software,protocol
####hello restrictions
#smtpd_helo_restrictions = permit_mynetworks,reject_invalid_hostname,reject_unknown_hostname
#### concurrency settings
initial_destination_concurrency = 4
default_destination_concurrency_limit = 20
default_destination_recipient_limit = 100
smtpd_recipient_limit = 1000
#### queue settings
maximal_queue_lifetime = 2d
#minimal_backoff_time = 3600s
#maximal_backoff_time = 7200s
#smtpd_error_sleep_time = 2s
####process limits
default_process_limit = 200
####mail size limit 100M
message_size_limit = 100100100
mailbox_size_limit = 500100100
queue_minfree = 800100100
####report to
bounce_notice_recipient = postmaster
delay_notice_recipient = postmaster
delay_warning_time = 0h
error_notice_recipient = postmaster
address_verify_sender = postmaster
2bounce_notice_recipient = postmaster
####default database type
default_database_type = hash
####for rbl,uncomplete
#default_rbl_reply = $rbl_code Service unavailable; $rbl_class [$rbl_what] blocked using $rbl_domain${rbl_reason?; $rbl_reason}
####hello banner
smtpd_banner = $myhostname ESMTP

论坛徽章:
0
6 [报告]
发表于 2003-06-12 18:41 |只看该作者

我的邮件服务器在被人攻击,请大家帮忙看看如何解决。

原帖由 "bluebird2003"]t 发表:
blocked using $rbl_domain${rbl_reason?; $rbl_reason}
####hello banner
smtpd_banner = $myhostname ESMTP
   

直接删除啊?也行的。不过可以这样:

cd /var/spool/postfix
for i in `find a* i* d* -type f`;do postsuper -d $i;done

或者直接postsuper -d ALL
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP