현상유지 現狀維持

Qmail 대량의 bouncing 메일 큐 문제 덤으로 메일 지연 발생 본문

Linux

Qmail 대량의 bouncing 메일 큐 문제 덤으로 메일 지연 발생

정상유지 2017. 6. 16. 10:31

리눅스 환경에서 qmail메이 서버 운영시 특정서버 또는 유저로부터

대량의 메일발송 + bouncing메일  결과 대량의 큐 발생 메일 발송지연 문제



1.  먼저 현재 큐상황 확인

 [root@MEZASU bin]# /var/qmail/bin/qmail-qstat

messages in queue: 84728 →  역시 대량의 큐 스팩에 따라 한계는 다르지만 메일 송신 지연이 발생
messages in queue but not yet preprocessed: 0


2. 큐에 쌓여 있는 메일 을 일단확인(bouncing이 대량으로 리스트됨)

 [root@MEZASU bin]# /var/qmail/bin/qmail-qread

6 Jun 2017 09:00:01 GMT #17546505 5310 <XXXXXX@mezasu.com> bouncing 
remote XXXXXX@mezasu.com
done remote XXXXXX@mezasu.com


3. 문제의 대량의 bouncing메일 내용확인 (일단은 내용을 확인해봅시다)

 [root@MEZASU bin]# find /var/qmail/queue/ -name 17546505 | xargs cat | less

<kazkoyam@mezasu.com>:
xx.xxx.xxx.xxx does not like recipient.
Remote host said: 550 5.4.1 [xxxx@mezasu.com]: Recipient address rejected: Access denied [TY1JPN01FT006.eop-JPN01.prod.protection.outlook.com]
Giving up on xx.xxx.xxx.xxx.

Received: (qmail 31358 invoked from network); 6 Jun 2017 09:00:01 +0900
Received: from unknown (HELO testserver) (xx.xxx.xxx.xxx)
by MEZASU.xxxx.local with SMTP; 6 Jun 2017 09:00:01 +0900
Message-ID: <23255990.1496707201743.JavaMail.hojintask@testserver>
Date: Tue, 6 Jun 2017 09:00:01 +0900 (JST)
From: =?ISO-2022-JP?Q?SBB=1B=24BK!=3FM1D6H=257=259=25F=25=60=1B=28B?= <dddddd>
To: <XXX@XXXXXX.ne.jp>
Subject: =?iso-2022-jp?Q?=1B$B8GDj=1B(BIP=1B$B%5!<%S%9$N$*CN$i$;=1B(B?=
Mime-Version: 1.0
Content-Type: multipart/mixed;
boundary=”—-=_Part_0_19106770.1496707201680″


4. 대응방법을 논의 함

a.지금의 큐을 처리하더라도 대량의 메일이  지속적으로 유입될 경우
대응의 의미가 없으니 우선 유입을 차단
(정말차단해도 문제안되는 유저인지 걱정)

b.유입이 차단되었으면 현재 쌓여있는 큐는 어떡하지 (그냥둔다 or 삭제한다)

-그냥두는경우는 [queuelifetime ]설정으로 시간이해결
하지만 장시간 메일 송신지연발생

-삭제하는경우 무작정 전부삭제는  유저 크레임가능성 농후
[bouncing]만 삭제로 합의

5.유입차단

a.클라이언트가 서버인경우 and (POP Before SMTP)이용의경우는
[/var/qmail/relay-ctrl/tcp.smtp]을 편집해서 서버을 차단

b.유저을 차단하는경우는 [/var/qmail/control/badmailfrom]을이용

# vi /var/qmail/control/badmailfrom
spamer@example.jp ←메일주소로차단
@example.jp ←도메인으로차단

6.큐 삭제 처리 [bouncing]만 삭제 (쉘작성해서 대응 )

qmHandle 또는 queue-fast.pl 로도 처리가능함
어느방법이든 큐의 양에 따라서는 시간걸림



Comments