The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Double Blind Email System

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #31222

    Hi All,
    Im looking for an idea on a double-blind email system.

    Basically the client wants a system where a signed in user will submit an email on a web form, that email will be sent out to all users subscribed to that user but the senders address will appear as [email protected].

    The receiver will be able to reply to that email address. Now the receiver is also a sender and gets their email encoded as well so the original sender will not see the receivers email address in the reply.

    All senders and receivers will have to be registered with the website before they can send and receive emails to their email address. So I was thinking that I could assign a unique ID to each registered user, then use that unique id in the email from and to. So it would be Unique ID= 12345 email = [email protected] and set up a catchall on the domain.

    So say Fred signs up with [email protected], I would assign a unique ID to them as 12345. Now whenever Fred sends an email from the web form, it will send as [email protected] and all replies to [email protected] will be forwarded over to [email protected]. So Suzie gets the email from [email protected] and replies. Her unique id happens to be 54321. So Fred gets an email reply back (forwarded to [email protected]) from [email protected]. So it’s masking both emails.

    The best example I could give with this is craigslist. The problem with their system is they are only single-blind. As soon as the receiver replies to the email, you have their real address. I need to keep it masked the whole time.


    One solution might be to to only allow users to reply back to emails via the website, instead of just clicking the reply button in their email client. So in the email they recieve it has the content etc, plus a link that says, “to reply click here” which takes them to a reply email on your website.


    That is an idea that i was toying with, but the client wants it all through email. Right now they have a messaging system in place that doesn’t really work very well on the site, so they want to move it all off-site so they don’t have to deal with it.

    I think I’ve come up with a rough idea for code if you guys wanna look through it.

    Code below, but also here for easier viewing.

    // open IMAP connection for gmail

    $mail = imap_open('{}', '[email protected]', 'password');

    // grab a list of all the mail headers
    $headers = imap_headers($mail);

    // make the variable for iterating through the emails
    $i = 1;

    // this username will be pulled from a database
    $username = '[email protected]';

    //loop through the email headers
    foreach($headers as $header){

    // grab the header from the email with the assigned number (numbers are auto assigned by gmail, not sure about other clients)
    $header = imap_header($mail, $i);

    // grab the body of the email
    $body = imap_body($mail, $i);

    // grab the subject of the email
    $subject = $header->subject;

    // grab the from (which comes in as an Array (see below))
    $from = $header->from;

    // set the date (mainly for checking (see below))
    $date = date('H:i', $header->udate);

    // grab the from (mailbox is before the @ and host is after the @ so [email protected])
    $email = $from[0]->mailbox."@".$from[0]->host;

    // subtract one minute from the received date (again, for checking (see below))
    $minute = date('i', $date) - 1;

    // just for testing to make sure i got the info
    echo $email . ' - ' . $subject . ' ' . $minute . '
    ' ;

    // add one to the $i variable to grab the next email

    // figure out what the time was one minute ago
    $oneminuteago = date('H:i', strtotime('-1 minutes'));

    // if the email date is less than or equal to one minute ago, proceed to the next check
    if ($date <= $oneminuteago){

    // if the username and email match, forward the email (this is for testing, I will grab the username from the database and compare it to the email address in the email)
    if ($username == $email){

    // real address to forward the email to
    $to = '[email protected]';

    // set the From: as a unique id ( right now i have a catch-all set up so anything emailed to my name will be received
    $headers_mail = 'From: You have a new message from <' . uniqid('user-') . '>' . "rn";

    // forward the email
    mail($to, $subject, $body, $headers_mail);

    // close the connection

    What do you think? I know it’s rough and sloppy, but so far it works.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘Back End’ is closed to new topics and replies.