Bounce Address는 무엇입니까?
반환 경로 또는 봉투 발송인이라고도 불리는 반송 주소는 이메일이 전달될 수 없을 때 비 배달 보고서 (NDR)를 수신하는 이메일 주소입니다. 이 주소는 수신자에게 표시된 "From" 주소와 분리되어 자동화된 배송 알림을 위해서만 사용됩니다.
Bounce Addresses는 어떻게 일합니다
이메일 전송은 주소의 2 세트를 사용합니다:
Header From (수신자 가능):From: John Doe <john@example.com>
(SMTP 레벨, 반송에 사용) :
MAIL FROM: <bounces@example.com>
배송이 실패하면 수신 서버는 주소에서 헤더가 아닌 봉투 발송자에게 반송을 보냅니다.
SMTP 대화 예
Client: MAIL FROM: <bounces@example.com>
Server: 250 OK
Client: RCPT TO: <invalid@recipient.com>
Server: 550 No such user here
Client: QUIT
# Later, server sends bounce to bounces@example.com
이메일 Bounces의 유형
단단한 도약
영원한 납품 실패:
- 사용자는 존재하지 않습니다 : 550 그러한 사용자 없음
- Domain은 존재하지 않습니다. 550 도메인 찾을 수 없음
- 정책에 의해 거부 : 550 스팸 차단
소프트 바운스
임시 실패:
-
Mailbox 전체: 452 충분한 체계 저장블록 반송
공급 능력:
Bounce 주소 구성
이메일 헤더의 반환 경로 설정
PHP (이메일 기능) :$to = "recipient@example.com";
$subject = "Test Email";
$message = "Email body";
$headers = "From: sender@example.com\r\n";
$headers .= "Return-Path: bounces@example.com\r\n";
mail($to, $subject, $message, $headers, "-f bounces@example.com");
PHPMailer :
$mail = new PHPMailer();
$mail->From = "sender@example.com";
$mail->Sender = "bounces@example.com"; // Return path
$mail->addAddress("recipient@example.com");
$mail->Subject = "Test Email";
$mail->send();
우편 번호 (SMTP) :
# /etc/postfix/main.cf
sender_canonical_maps = hash:/etc/postfix/sender_canonical
# /etc/postfix/sender_canonical
@example.com bounces@example.com
# Apply changes
postmap /etc/postfix/sender_canonical
systemctl reload postfix
Dedicated Bounce 취급 서비스
대부분의 이메일 서비스 공급자 제안 도약 관리:
Amazon SES:{
"Message": {
"Subject": "Test",
"From": "sender@example.com",
"ReturnPath": "bounces@example.com"
}
}
SendGrid **:
const msg = {
to: 'recipient@example.com',
from: 'sender@example.com',
replyTo: 'reply@example.com',
return_path: 'bounces@example.com',
subject: 'Test Email',
text: 'Email body'
};
이메일: info@naminggroup.com
Subdomain 접근
bounces@example.com # General bounces
no-reply@example.com # No-reply emails
returns@example.com # Returns/receipts
캠페인 스펙
캠페인 당 반송 :
bounces-newsletter@example.com
bounces-campaign-123@example.com
bounces-transaction@example.com
변수 봉투 반환 경로 (VERP)
비밀번호:
Sending to: user@recipient.com
Return path: bounces+user=recipient.com@example.com
When bounce arrives at bounces+*, parse to identify failed recipient
회사 소개
자동화된 Bounce Parsing
Python 예제 :import email
from email import policy
def parse_bounce(raw_email):
msg = email.message_from_string(raw_email, policy=policy.default)
# Extract bounce type
if "550" in msg.get_payload():
return "hard_bounce"
elif "452" in msg.get_payload():
return "soft_bounce"
# Extract failed recipient
for part in msg.walk():
if part.get_content_type() == "message/delivery-status":
# Parse delivery status
pass
return bounce_info
# Integrate with mailing list to remove hard bounces
Webhook 기반 Bounce 처리
현대 ESP는 webhooks를 제공합니다:
SendGrid Webhook :POST /bounce-webhook
{
"email": "recipient@example.com",
"event": "bounce",
"reason": "550 5.1.1 User unknown",
"type": "blocked",
"status": "5.0.0"
}
Action: 메일을 반송하여 데이터베이스를 업데이트하십시오.
SPF 및 반송 주소
SPF는 헤더에서 envelope sender (부스 주소)를 확인합니다.
Message:
From: newsletter@example.com (header)
Return-Path: bounces@mail-server.com (envelope)
SPF Check:
Queries: mail-server.com TXT record (not example.com)
Must include sending IP in mail-server.com's SPF
Bounce 도메인 SPF 구성
bounces.example.com. IN TXT "v=spf1 include:_spf.sendgrid.net ~all"
귀하의 반송 하위 도메인은 전송 인프라에 적합한 SPF 레코드를 제공합니다.
Bounce Address 모범 사례
Dedicated Bounce 주소 사용
도약을 위한 당신의 주된 이메일을 결코 사용하지 마십시오:
# Bad
Return-Path: info@example.com
# Good
Return-Path: bounces@example.com
감시자 Bounce 비율
| 공급 업체 | 연구분야 | - 연혁 |
|---|---|---|
| < 2=""> | 제품 정보 | 계속 감시 |
| 25%년 | 관련 기사 | 감사 이메일 목록 품질 |
| 5~10일 | 사이트맵 | Immediate 목록 청소 필요 |
| > 10% 할인 | 한국어 | 위험에 대한 책임 |
# # # # Bounce 처리 구현
단단한 도약의 Automate 제거:
-- Mark emails with hard bounces
UPDATE mailing_list
SET status = 'bounced', bounce_count = bounce_count + 1
WHERE email IN (SELECT email FROM recent_hard_bounces);
-- Remove after 3 hard bounces
DELETE FROM mailing_list
WHERE bounce_count >= 3;
별도의 거래 및 마케팅 반송
transactional-bounces@example.com # Order confirmations, receipts
marketing-bounces@example.com # Newsletters, campaigns
다른 반송 비율은 각 유형을 위해 예상됩니다.
Bounce Processing 자동화 설정
Cron 작업 예:#!/bin/bash
# Process bounces every hour
# Fetch bounces from IMAP
fetchmail -c /etc/fetchmailrc
# Parse and update database
/usr/local/bin/process-bounces.py
# Clean up processed bounces older than 30 days
find /var/mail/bounces -mtime +30 -delete
Backscatter와 Bounce 안전
# Backscatter 문제
서버가 스팸을 받아 들일 때, 위조된 주소로 전송됩니다.
1. Spammer sends email with forged From
2. Your server accepts it
3. Your server realizes it's spam/invalid
4. Your server bounces to forged From address
5. Innocent party receives bounce (backscatter)
Solution : SMTP 시간에 거절하십시오, 그 후에 도약을 받아들이지 마십시오:
# Postfix: Reject unknown users at SMTP time
smtpd_recipient_restrictions = reject_unauth_destination
local_recipient_maps = hash:/etc/postfix/local_recipients
# # # # 바운드 Forgery
Attackers는 대등한 메시지를 할 수 있습니다:
- Harvest 유효한 주소
- 스팸을 반송으로 전달
- 가짜 배달 보고서를 통해 의사 결정
- MX 서버에서 시작된 반송 체크
- Verify Bounc는 실제로 보내지는 이메일입니다
- 파스 배달 통계 헤더 주의
일반적인 반송 시나리오
Scenario 1: 모든 이메일 반송
원인 : SPF 실패, IP 블랙리스트, 또는 서버 명성 체크 : SPF 레코드, 보낸 사람 IP 명성, DMARC 보고서# Scenario 2 : 수신되지 않는 반송
원인: Bounce 주소 misconfigured 또는 존재하지 않습니다 Check: 반송 도메인에 대한 MX 레코드, mailbox 존재Scenario 3: 높은 연약한 되튐 비율
원인 : 서버가 과부하, 제한 속도, 큰 메시지 체크 : 전송률, 메시지 크기, 수신 서버 오류# Scenario 4 : 반송 루프
원인: Bounce 주소 방아쇠는, 다른 도약을 방아쇠 체크 : 반송 주소에 자동 응답기 사용시험 Bounce 취급
잘못된 수신자가있는 테스트 이메일 :# Test bounce to invalid address
swaks --to invalid-user@test-domain.com \
--from bounces@example.com \
--server mx.test-domain.com
# Check if bounce arrives at bounces@example.com
반송 도메인의 SPF를 확인 :
dig bounces.example.com TXT
# Should show SPF record with authorized senders
Proper Bounc 주소 관리는 sender 명성, 명부 위생 및 deliverability를 유지하기를 위해 중요합니다.