nadeemshafi9 Posted February 13, 2009 Share Posted February 13, 2009 Hi guys I am reading mailbox to try and capture bounce backs exactly after the mails have been sent using an ajaxian set timeout, now the synchronization is bad as it takes long for the mail to be retrieved, is there a faster way of doing it. My current method is as follows and it takes up to 5 or 10 seconds which isn't good enough to look real time: <?php $mbox = imap_open("{mail.x.com:995/pop3/ssl/novalidate-cert}INBOX", "nadeem.shafi@x.com", "x"); echo "<h1>Mailboxes</h1>\n"; $folders = imap_listmailbox($mbox, "{imap.mail.x.com:143}", "*"); if ($folders == false) { echo "Call failed<br />\n"; } else { foreach ($folders as $val) { echo $val . "<br />\n"; } } echo "<h1>Headers in INBOX</h1>\n"; $headers = imap_headers($mbox); if ($headers == false) { echo "Call failed<br />\n"; } else { foreach ($headers as $val) { echo $val . "<br />\n"; } } ?> And is there a way to get only mails based on a custom header straight off the server instead of getting them all and then filtering. Thanks Quote Link to comment Share on other sites More sharing options...
nadeemshafi9 Posted February 13, 2009 Author Share Posted February 13, 2009 Sorry this is silly bouncbacks can takes weeks, but i still need the code read custom headers any help im looking into it Quote Link to comment Share on other sites More sharing options...
printf Posted February 13, 2009 Share Posted February 13, 2009 Tell me what you are looking for in the message header, body or both, (IE: FROM: ?, RETURN PATH, FILETYPE=*.pdf)? Tell me the MTA type (IE: Dovecot, or other) so I know what it supports, or if it's an onle service tell me that services name! After I will give you example that does this server side, instead of reading every message header! Quote Link to comment Share on other sites More sharing options...
nadeemshafi9 Posted February 13, 2009 Author Share Posted February 13, 2009 Tell me what you are looking for in the message header, body or both, (IE: FROM: ?, RETURN PATH, FILETYPE=*.pdf)? Tell me the MTA type (IE: Dovecot, or other) so I know what it supports, or if it's an onle service tell me that services name! After I will give you example that does this server side, instead of reading every message header! i just put a custom header in the email header it is user-id Content-Type: multipart/mixed; boundary="=_13e847ba35983fbc93e81edc364f6412" MIME-Version: 1.0 User-Id: 1 Message-Id: <20090213114137.7473C34C55F@sternhammer.local> Date: Fri, 13 Feb 2009 11:41:36 +0000 (GMT) i just need to get these emails that contains the users id so i can show him his bounces Quote Link to comment Share on other sites More sharing options...
nadeemshafi9 Posted February 13, 2009 Author Share Posted February 13, 2009 dont test it, just post it i will test it, as i have teh system set up here Quote Link to comment Share on other sites More sharing options...
printf Posted February 13, 2009 Share Posted February 13, 2009 Okay got it, I have an IT meeting now, but when I get back in about an hour and a half I will give you an example that will speed up the process... Quote Link to comment Share on other sites More sharing options...
nadeemshafi9 Posted February 13, 2009 Author Share Posted February 13, 2009 Okay got it, I have an IT meeting now, but when I get back in about an hour and a half I will give you an example that will speed up the process... thanks alot m8 i hope to repay it at some point lol if that's even possible you never know lol i may have some expertise in other fields Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.