Cómo recibir notificaciones de rebote
Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Si deseas recibir notificaciones de rebote de correo electrónico, debes configurar tu app para habilitar las notificaciones de rebote y administrar las notificaciones entrantes en la app.
Configura tu aplicación para las notificaciones de rebote de correo electrónico
Según la configuración predeterminada, las aplicaciones no reciben notificaciones de rebote de correos electrónicos que no pudieron entregarse. Para habilitar el servicio de notificación de rebote entrante, debes modificar los archivos de configuración appengine-web.xml
y web.xml
de la aplicación.
Para modificar appengine-web.xml
, agrega la sección inbound-services
a fin de habilitar el servicio de rebote entrante:
Para modificar web.xml
, mapea la URL de rebote /_ah/bounce
al servlet de control de rebote de la siguiente manera:
Maneja las notificaciones de rebote
La API de JavaMail incluye la clase BounceNotificationParser, que usas para analizar notificaciones de rebote entrantes, como se muestra aquí:
Salvo que se indique lo contrario, el contenido de esta página está sujeto a la licencia Atribución 4.0 de Creative Commons, y los ejemplos de código están sujetos a la licencia Apache 2.0. Para obtener más información, consulta las políticas del sitio de Google Developers. Java es una marca registrada de Oracle o sus afiliados.
Última actualización: 2025-08-19 (UTC)
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Información o código de muestra incorrectos","incorrectInformationOrSampleCode","thumb-down"],["Faltan la información o los ejemplos que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-08-19 (UTC)"],[[["\u003cp\u003eTo enable email bounce notifications, you must configure your application to receive them and handle them within your app.\u003c/p\u003e\n"],["\u003cp\u003eEnable the incoming bounce notification service by adding the \u003ccode\u003email_bounce\u003c/code\u003e service within the \u003ccode\u003einbound-services\u003c/code\u003e section of your \u003ccode\u003eappengine-web.xml\u003c/code\u003e file.\u003c/p\u003e\n"],["\u003cp\u003eMap the bounce URL \u003ccode\u003e/_ah/bounce\u003c/code\u003e to your bounce handling servlet within your \u003ccode\u003eweb.xml\u003c/code\u003e file to direct bounce notifications appropriately.\u003c/p\u003e\n"],["\u003cp\u003eUse the \u003ccode\u003eBounceNotificationParser\u003c/code\u003e class from the JavaMail API to parse incoming bounce notifications in your application.\u003c/p\u003e\n"]]],[],null,["# Receiving Bounce Notification\n\nTo receive email bounce notifications, you need to configure your app to\nenable bounce notification and you need to handle the incoming notification in\nyour app.\n\n\n| This API is supported for first-generation runtimes and can be used when [upgrading to corresponding second-generation runtimes](/appengine/docs/standard/\n| java-gen2\n|\n| /services/access). If you are updating to the App Engine Java 11/17 runtime, refer to the [migration guide](/appengine/migration-center/standard/migrate-to-second-gen/java-differences) to learn about your migration options for legacy bundled services.\n\n\u003cbr /\u003e\n\nConfiguring your application for email bounce notification\n----------------------------------------------------------\n\nBy default, applications do not receive bounce notifications for email that\ncould not be delivered. To enable the incoming bounce notification service, you\nmust modify your application `appengine-web.xml` and `web.xml` configuration\nfiles.\n\nModify `appengine-web.xml`by adding an `inbound-services` section to enable the\nincoming bounce service: \n\n \u003cinbound-services\u003e\n \u003c!-- Used to handle incoming mail. --\u003e\n \u003cservice\u003email\u003c/service\u003e\n \u003c!-- Used to handle bounced mail notifications. --\u003e\n \u003cservice\u003email_bounce\u003c/service\u003e\n \u003c/inbound-services\u003e\n\nModify `web.xml` by mapping the bounce URL `/_ah/bounce` to your bounce\nhandling servlet, as follows: \n\n \u003cservlet\u003e\n \u003cservlet-name\u003ebouncehandler\u003c/servlet-name\u003e\n \u003cservlet-class\u003ecom.example.appengine.mail.BounceHandlerServlet\u003c/servlet-class\u003e\n \u003c/servlet\u003e\n \u003cservlet-mapping\u003e\n \u003cservlet-name\u003ebouncehandler\u003c/servlet-name\u003e\n \u003curl-pattern\u003e/_ah/bounce\u003c/url-pattern\u003e\n \u003c/servlet-mapping\u003e\n \u003csecurity-constraint\u003e\n \u003cweb-resource-collection\u003e\n \u003cweb-resource-name\u003ebounce\u003c/web-resource-name\u003e\n \u003curl-pattern\u003e/_ah/bounce\u003c/url-pattern\u003e\n \u003c/web-resource-collection\u003e\n \u003cauth-constraint\u003e\n \u003crole-name\u003eadmin\u003c/role-name\u003e\n \u003c/auth-constraint\u003e\n \u003c/security-constraint\u003e\n\nHandling Bounce Notifications\n-----------------------------\n\nThe JavaMail API includes the\n[BounceNotificationParser class](/appengine/docs/legacy/standard/java/javadoc/com/google/appengine/api/mail/BounceNotificationParser),\nwhich you use to parse incoming bounce notifications, as shown here: \n\n import com.google.appengine.api.mail.https://cloud.google.com/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.mail.BounceNotification.html;\n import com.google.appengine.api.mail.https://cloud.google.com/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.mail.ee10.BounceNotificationParser.html;\n\n import java.io.IOException;\n import java.util.logging.Logger;\n import javax.mail.MessagingException;\n import javax.servlet.http.HttpServlet;\n import javax.servlet.http.HttpServletRequest;\n import javax.servlet.http.HttpServletResponse;\n\n public class BounceHandlerServlet extends HttpServlet {\n\n private static final Logger log = Logger.getLogger(BounceHandlerServlet.class.getName());\n\n @Override\n public void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException {\n try {\n https://cloud.google.com/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.mail.BounceNotification.html bounce = https://cloud.google.com/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.mail.ee10.BounceNotificationParser.html.parse(req);\n log.warning(\"Bounced email notification.\");\n // The following data is available in a BounceNotification object\n // bounce.getOriginal().getFrom() \n // bounce.getOriginal().getTo() \n // bounce.getOriginal().getSubject() \n // bounce.getOriginal().getText() \n // bounce.getNotification().getFrom() \n // bounce.getNotification().getTo() \n // bounce.getNotification().getSubject() \n // bounce.getNotification().getText() \n // ...\n } catch (MessagingException e) {\n // ...\n }\n }\n }"]]