Jump to content

Ajaxian Settimout Impap Bouncback Capturing


nadeemshafi9

Recommended Posts

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

Link to comment
Share on other sites

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!

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.