FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » How To » Mailing list receiving its own messages back
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Mailing list receiving its own messages back [message #160220 is a reply to message #160219] Wed, 05 August 2009 08:27 Go to previous message
billnot is currently offline  billnot   Spain
Messages: 28
Registered: August 2006
Location: Spain
Karma:
Junior Member
I have found a way round this problem.

I have got the mailing list to add a small footer to every message. I have added a routine to mlist_post.inc to check for this footer in the last 160 characters of an outgoing message. If it finds it, it sends the message to a trash account I've set up (once I'm certain it works perfectly it will simply not send anywhere). If it doesn't find the footer, it processes the mail as before.

I'm not a programmer, and I'm sure that my coding is bad, but for what it's worth, here it is:

mlist_post.inc (as amended)

function mail_list_post($list_email, $from, $subject, $body, $msg_id, $reply_to=null, $attch=null, $attach_mime=null, $additional_headers=null)

/** Original code **/
$multi_part = 0;
$final_body = '';
/** my extra code **/
/** Set your mailing list variables here **/
$divert_email = 'trashcan@mydomain'; // The e-mail address you want duplicate messages diverted to
$teststring = 'Footer'; // The string your mailing list adds to every message body
$testst=substr($body,-160); //check only last 160 characters of message body
if (strpos($testst,$teststring)) {
$to_email = $divert_email;
} // string found; divert
else {
$to_email = $list_email;
} // string not found; send to list
/** end of my code
many lines unaltered
and the last line **/

/** original code send_email($from, $list_email, $subject, $final_body, $header); **/
send_email($from, $to_email, $subject, $final_body, $header);


--
Bill Hayles
El Inglés Loco
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Topics only visible to some users
Next Topic: How do I include video link in subscribed E-mail's
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Sep 27 15:26:21 GMT 2024

Total time taken to generate the page: 0.04997 seconds