简体   繁体   中英

Is there any way to filter out bounce notification from other email?

A simple notification is like this, this is one of the mail in my mailbox, it mix with other normal email ,but since it seems it generate by server, so i can not see any standard in it. are there any indication that the mail is bounce(in yahoo, gmail , hotmail) so that i can use php to filter out all of them?

This is an automatically generated Delivery Status Notification

THIS IS A WARNING MESSAGE ONLY.

YOU DO NOT NEED TO RESEND YOUR MESSAGE.

Delivery to the following recipient has been delayed:

    saad@asd.com

Message will be retried for 2 more day(s)

Technical details of temporary failure:
The recipient server did not accept our requests to connect. Learn more at http://support.google.com/mail/bin/answer.py?answer=7720
[asd.com (1): Connection timed out]

----- Original message -----

DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
       d=gmail.com; s=20120113;
       h=message-id:date:subject:from:to:mime-version:content-type;
       bh=xAGZvwfEEefGGRgBmLS9pzSumiQ/oasFH6Lc3Z0fNT8=;
       b=iB4u5m7ShMuwoZjkK17J+ffZJ1j5Fm5UZTIKCDUcCOt/Diy+a303Or+9x4OCBr0HQW
        dlnQ2A462bU1wjN84bIXWU0J+Nz4lNsc1F0DioJBVnlGC2BB0P8eGKXFRyKRU8E+yaAl
        nyjwYG05RqXzwtL0g8l0UPeQT7TvrjSOgX8xFiPYOLuCY0UKEBU9M3OsqcyErtB8Sadt
        yY7gdUhN6m4gkH83UV7Gxdk/ub9UE+v9PxzukwXKhd1V5pHLB8ErI5NC2QygX+X7AE/Q
        VghpEWJwEl6/5HVSJp0pCECbDqkuBSQ+/P2J7Up+9aPAAf1y5PQLWlS6incEJr97MgG6
        DTdw==
Received: by 10.68.238.3 with SMTP id vg3mr53910310pbc.140.1332778023318;
       Mon, 26 Mar 2012 09:07:03 -0700 (PDT)
Return-Path: <foodilnew@gmail.com>
Received: from [::1] (42-2-253-210.static.netvigator.com. [42.2.253.210])
       by mx.google.com with ESMTPS id n7sm8175644pbk.56.2012.03.26.09.07.01
       (version=SSLv3 cipher=OTHER);
       Mon, 26 Mar 2012 09:07:02 -0700 (PDT)
Message-ID: <1332778007.4f709417422d1@localhost>
Date: Mon, 26 Mar 2012 18:06:42 +0200
Subject: asd
From: asdd <foodilnew@gmail.com>
To: saad@asd.com
MIME-Version: 1.0
Content-Type: multipart/alternative;
 boundary="_=_swift_v4_13327780024f70941258e4f_=_"

sadsda

Updated

$message = Swift_Message::newInstance()
  ->setSubject($row['Subject'])
  ->setReturnPath('fypboune@gmail.com')
  ->setFrom(array($row['ReplyTo'] => $row['FromName']))
  ->setBody($html, 'text/html')
  ->addPart($txt, 'text/plain');
  ;

The error delivery mail will go to my sender account no matter i have specific a return path in it, how to fix that? Thanks

what most of do is set a ReturnPath address for the sent mail, any mail that goes to that address is returned by the server not a human, so scan that for error messages added by the server.

$pattern_subject = "#delivery errors|delivery failure|delivery has failed|delivery notification|delivery problem|delivery status notif|failure delivery|failure notice|mail delivery failed|mail delivery system|mail status report|mail system error|mail transaction failed|mailserver notification|mdaemon notification|nondeliverable mail|returned email|returned mail|returned mail|returned to sender|returning message to sender|spam eater|undeliverable|undelivered mail|warning: message#i";

$pattern_body = "#554 delivery error|554 TRANSACTION FAILED|Action: failed|Delivery attempts will continue to be made for|delivery temporarily suspended|Invalid recipient|is not a valid mailbox|Mail rejected by Windows Live Hotmail for policy reasons|mailbox is full|Mailbox quota usage exceeded|mailbox unavailable|my badmailfrom list|no mailbox here by that name|no such address|No such user here|not yet been delivered|Over quota|PERM_FAILURE: DNS Error: Domain name not found|Recipient address rejected|retry timeout exceeded|Status: 4.4.1|The account or domain may not exist, they may be blacklisted, or missing the proper dns entries.|The following address doesn't exist|The message that you sent was undeliverable to the following|The recipient name is not recognized|This Gmail user does not exist|This is a permanent error|Unrouteable address|unrouteable mail domain|User mailbox exceeds allowed size|User unknown in virtual alias table|User unknown#i";

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM