참고: Python 2.7은 2024년 1월 31일 지원 종료됩니다. 기존 Python 2.7 애플리케이션을 계속 실행하고 트래픽을 받을 수 있습니다. 그러나 지원 종료 날짜 이후에는 해당 런타임을 사용하는 애플리케이션의 재배포를 App Engine에서 차단할 수 있습니다.
지원되는 최신 Python 버전으로 마이그레이션하는 것이 좋습니다.
이메일 반송 알림을 수신하려면 앱 구성을 통해 이메일 알림을 사용 설정해야 하며 이러한 알림을 처리할 핸들러를 만들어야 합니다.
앱에서 반송 알림을 수신하도록 구성
이 구성은 두 부분으로 이루어집니다. 먼저 알림을 사용하도록 설정해야 합니다. 두 번째로 /_ah/bounce와 반송 핸들러 간의 매핑을 App Engine이 알림 데이터를 게시할 위치를 인식하도록 설정합니다. 앱에서 반송된 이메일 알림을 수신하도록 구성하려면 다음 안내를 따르세요.
app.yaml 파일에 다음을 추가하여 알림을 사용 설정합니다.
inbound_services:-mail_bounce
또한 app.yaml에서, 다음과 같이 코드 내에 /_ah/bounce와 반송 알림 핸들러 간의 매핑을 설정합니다. 예를 들면 다음과 같습니다.
반송 알림은 메시지 전송에 문제가 있음을 알리는 이메일 시스템의 자동 메시지입니다. 앱에서 반송 핸들러 코드를 만들면 이러한 알림을 수신하고 처리할 수 있습니다.
반송 핸들러를 작성하는 방법 중 하나는 BounceNotificationHandler 편의 클래스를 사용하는 것입니다. 이 방법을 사용하는 경우 BounceNotification 클래스의 인수로 호출되는 receive() 메서드를 재정의해야 합니다. BounceNotificationHandler 편의 클래스 사용 여부에 관계없이 BounceNotification을 사용하여 반송 알림을 파싱해야 합니다.
BounceNotificationHandler와 BounceNotification은 모두 google.appengine.ext.webapp.mail_handlers 패키지에 있습니다.
다음은 BounceNotificationHandler 편의 클래스를 사용하는 반송 핸들러 샘플입니다.
classLogBounceHandler(BounceNotificationHandler):defreceive(self,bounce_message):logging.info('Received bounce post ... [%s]',self.request)logging.info('Bounce original: %s',bounce_message.original)logging.info('Bounce notification: %s',bounce_message.notification)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-03-06(UTC)"],[[["This content describes how to configure an app to receive email bounce notifications using legacy bundled services and APIs in the first-generation App Engine standard environment."],["To receive bounce notifications, you must enable the `mail_bounce` inbound service in your `app.yaml` file."],["You must also define a mapping in your `app.yaml` file between the `/_ah/bounce` URL and your bounce notification handler."],["A bounce handler is needed to process the bounce notifications, which can be done using the `BounceNotificationHandler` or directly with the `BounceNotification` class."],["Both the `BounceNotificationHandler` and `BounceNotification` classes are located within the `google.appengine.ext.webapp.mail_handlers` package."]]],[]]