soonick / poMMo

poMMo
115 stars 51 forks source link

Bounce Backs #15

Open adrianloaded opened 14 years ago

adrianloaded commented 14 years ago

I dont think this feature was ever implemented...... will it be as i have over 75k emails and they need tidying.

soonick commented 14 years ago

Hello adrianloaded,

I think there was someone who implemented that feature, but I have not been able to test it. I will keep your request here until someone confirms it is working or until I can test it.

Thank you.

maxnegro commented 14 years ago

In the current tree there's no code for handling bounces. Argyrism said he did add the feature (see issue "my new pommo") but I haven't been able to see his changes yet.

soonick commented 14 years ago

You are right, I just review the commits and there is nothing about bounces. Lets keep this in here so we can attack it when there is time.

MiYaGin commented 13 years ago

I know this is not the best solution... it doesnt work fine jet: I have created a gmail account to bounced mail, and a php to open imap unread emails, search for the attached file with error, read the "To: " part and save it to "pommo_mail_error" table, i have somo todo and errors:

Todo: Use congif.php to save gmail user and pass and sender from mail server error. Read only the sender emails. Check the subscriber table and marked the error emails subscriber (adding a field to the table).

Error: I dont know why it just read one by one mail...

P.d i´m not a php programer, just a pommo lover.

Code:

<?php

require ('../../bootstrap.php');

$pommo->init(); $logger = & $pommo->_logger; $dbo = & $pommo->_dbo;

$gmail_username = 'user.tracking@gmail.com'; $gmail_password = 'password';

$imap = imap_open ("{imap.gmail.com:993/imap/ssl}INBOX", $gmail_username, $gmail_password) or die("can't connect: " . imap_last_error());

$date = date("Y-m-d H:i:s");

$new_msg = imap_search($imap,'UNSEEN');

if(@$new_msg) { echo "Errors:
";

foreach ($new_msg as $result)
{
    $structure = imap_fetchstructure($imap,$result); print_r($structure);
    $parts = $structure->parts;

    foreach ($parts as $part)
    {
        if (@$part->parameters[0]->attribute)
        {
            if ($part->parameters[0]->attribute == "NAME")
            {
            $texto = imap_base64(imap_fetchbody($imap,$result,2));
            $pos = strpos($texto,'To: ')+3;
            $cadena = substr($texto, $pos ,100);
            $posb = strpos($cadena,'From:');
            $cadenab = substr($cadena, 0 ,$posb);

            $query = "INSERT IGNORE INTO ".$dbo->table['mail_error']." (`email` ,`date`)
                      VALUES ('".$cadenab."', '".$date ."')";
            $dbo->query($query);

echo $cadenab."
";

            imap_fetchbody($imap,$result,2);

            }
             else
            {
              $texto = imap_fetchbody($imap,$result,2);
              $pos = strpos($texto,'To: ')+3;
              $cadena = substr($texto, $pos ,100);
              $posb = strpos($cadena,'From:');
              $cadenab = substr($cadena, 0 ,$posb);

              $query = "INSERT IGNORE INTO ".$dbo->table['mail_error']." (`email` ,`date`)
                                      VALUES ('".$cadenab."', '".$date ."')";
              $dbo->query($query);

echo $cadenab."
";

              imap_fetchbody($imap,$result,2);

            }
        }

    }

}

} else { echo "No new mail
"; }

imap_close($imap);

?>

soonick commented 13 years ago

Hello MiYaGin,

Thank you for your code snippet. It will still take us some time to review and implement it. If you want to accelerate the process you could fork current master branch and make a commit with your solution. That way I can take a look at how it works and we could polish it together.

Thanks, Adrian

thealexbaron commented 12 years ago

I am currently working out a solution to this issue. I will keep you updated with my progress and any questions I might have.

thealexbaron commented 12 years ago

I have taken a simpler approach than MiYaGin scratch proposal. I am simply adding a column to the subscribers table.

Do we want a separate column to the subscribers table to flag rows as bounced or should we add another special number for "bounced"? I assume the latter would require some changes to other files since "bounced" also means inactive.

My reasoning: At first I thought we could just flag the row as inactive, but there is value in knowing which rows are bounced as well as inactive and which are just inactive.

I have also added a column to the subscribers table called bounce_count. Once this number has reached whatever the user has specified in the config, the row will be marked as bounced.

Please let me know if this all makes sense.

soonick commented 12 years ago

Hello thealexbaron,

Are you still working on this issue?

thealexbaron commented 12 years ago

Can I get some feedback on my proposal?

soonick commented 12 years ago

Hello Alex,

I took a look at your proposal. One question, that I am not sure what the answer is. Do you know if there is a way to distinguish a hard bounce (email address doesn't exist) vs a soft bounce (domain is down, mailbox is full)?

I think we could just have the bounce_count table and if it has a positive number we know it is a bounced address. If we could distinguish the type of bounce I would make the email inactive after one hard bounce and have the user configure how many soft bounces they would accept before deactivating the email address.

Let me know if there is anything else you would like me to comment on.

Thanks a lot for your help.

soonick commented 12 years ago

Hello thealexbaron,

Are you still working on this?

moiseevigor commented 12 years ago

Hey guys, I know it is not a place to make this offer, but taking a glace at GPL2 OSS phpList, we see

https://github.com/gionn/phplist/blob/master/README.bounces

Then the table generating script with regular expressions https://github.com/gionn/phplist/blob/master/public_html/lists/admin/generatebouncerules.php

And a lot of staff of bounce managing in the https://github.com/gionn/phplist/tree/master/public_html/lists/admin

How about to get an insight?

soonick commented 12 years ago

Hello Moiseevigor,

I am not sure if I understand your message. Are you suggesting we base our bounce manager on phplists' bounce manager? If so, It may be a good idea and we appreciate the links. We will look at them when we start developing our manager.

Thanks, Adrian

thealexbaron commented 12 years ago

This reminds me. I developed a bounce parser called BounceHandler using Perl's Catalyst framework. I'm going to put it on GitHub soon - you could probably use a lot of the logic from my project.

The bounce parser on phpList is cumbersome, and does not scale well at all.

One thing that differentiates poMMo from phpList is that the interface is surprisingly well built, and there are very few config file changes that need to be made. The bounce parser should definitely follow suit!

Keep up the great work, Adrian!

Thanks,

Alexander Scott Baron

On Mon, Sep 24, 2012 at 7:18 PM, Adrian Ancona Novelo < notifications@github.com> wrote:

Hello Moiseevigor,

I am not sure if I understand your message. Are you suggesting we base our bounce manager on phplists' bounce manager? If so, It may be a good idea and we appreciate the links. We will look at them when we start developing our manager.

Thanks, Adrian

— Reply to this email directly or view it on GitHubhttps://github.com/soonick/poMMo/issues/15#issuecomment-8840636.

soonick commented 12 years ago

Hello Alexander,

Please post the link when you find it. It will be very helpful for implementing this feature.

Regards, Adrian

moiseevigor commented 12 years ago

@soonick

Are you suggesting we base our bounce manager on phplists' bounce manager?

yes that was a proposal.

@thealexbaron

The bounce parser on phpList is cumbersome, and does not scale well at all.

the proposal was to get an "insight" that includes regular expressions, bounce email parsing and some logic like pop/imap account for bounces etc, and not to copy the phplist code. If you have a code and/or logical scheme to treat various automatic email responses that would be great!

jpugliese commented 11 years ago

Hello All.

This is my first time here and I have no experience with git. I've been using POMMO for a long time and I've successfully ported the PHPList bounce management to POMMO. Please help me to share the code with all.

I'm interested too in colaborate to bring some features to POMMO that could make it more beauty, like open/click/bounce statistics and delivery schedule.

Thanks.

Jefferson

soonick commented 11 years ago

Hello jpugliese,

That sounds awesome, I would love to see your port of PHPLists bounce manager.

To share your code you would need to: 1.- Fork my repository 2.- Download your forked repository to your local development environment 3.- Make the change in your local environment and commit it 4.- Push your commit to your repository 5.- Create a pull request with your commit

Let me know if you need help in any specific step.

Regards, Adrian

maximka1812 commented 11 years ago

Want to bump it up, as it is very time consuming to handle bounces by hand, make text files from emails and remove them from the list.

maximka1812 commented 11 years ago

This really need to be implemented.

thealexbaron commented 11 years ago

I'll link you to the app tomorrow. On May 11, 2013 3:10 PM, "tester13" notifications@github.com wrote:

This really need to be implemented.

— Reply to this email directly or view it on GitHubhttps://github.com/soonick/poMMo/issues/15#issuecomment-17767545 .

maximka1812 commented 11 years ago

I'll link you to the app tomorrow.

Any news?

jpugliese commented 11 years ago

Hello, currently I'm working in other project and I haven't so much time to apply my fork to POMMO project. With luck, I will do this soon. Sorry to make you wait so.

Atenciosamente.

Jefferson Pugliese Analista de Ti

Use energia solar. A natureza agradece

On Tue, May 14, 2013 at 2:49 AM, tester13 notifications@github.com wrote:

I'll link you to the app tomorrow.

Any news?

— Reply to this email directly or view it on GitHubhttps://github.com/soonick/poMMo/issues/15#issuecomment-17857956 .

maximka1812 commented 11 years ago

May be you could just reference me to the code or share it? So it'll be possible to merge.

thealexbaron commented 11 years ago

Sure, it's a Perl Catalyst project, but it should give you a really good idea of what needs to happen to manage bounces. Would you be interested in that?

Thanks,

Alexander Scott Baron

On Tue, May 14, 2013 at 5:40 AM, tester13 notifications@github.com wrote:

May be you could just reference me to the code or share it? So it'll be possible to merge.

— Reply to this email directly or view it on GitHubhttps://github.com/soonick/poMMo/issues/15#issuecomment-17870698 .

maximka1812 commented 11 years ago

Some useful code I found

http://cheesefather.com/2011/12/process-email-bounces-with-php/

http://anti-spam-man.com/php_bouncehandler/v7.0/

valerian commented 11 years ago

I am currently installing PoMMO and i am paid by my client to develop or install some bouncing handler for it, and also a click tracking feature. I will keep you updated on my progress.

soonick commented 11 years ago

Hello @valerian,

Thanks for offering to help. I saw all the other tickets you opened and they look like good things to have. For this ticket in particular please try to keep me updated constantly because it is a big effort and it would be easier for me to approve if we keep the code reviews short.

Thanks, Adrian

valerian commented 11 years ago

I will work on it today : i think i will probably use http://anti-spam-man.com/php_bouncehandler/v7.0/ , and implement bounce handling in pommo on a separated php file, with as few as possible edits in the other pommo files. For the first versions of the script, it will only set a bounce status on a subscriber field, so it can be freely used when creating group filters.

soonick commented 11 years ago

Sounds good. Please try to create incremental commits and don't include anything we don't need. I look forward to seeing it.

soonick commented 10 years ago

I'm going to try to dedicate some time to work on this.

The first thing I need to do is probably add a Return-Path header with an e-mail address where all bounces will be sent and then have a way to periodically check it and update the database accordingly.

TrapezeArtist commented 10 years ago

Is there any movement on the issue of bounces? I've just transferred from phplist to Pommo: great in every respect except bounce-handling. My present mailing list has generated about 1400 bounces and I would really love to get rid of them before sending out my next newsletter. However that would take at least 700 tedious minutes as things currently stand.

maximka1812 commented 10 years ago

@TrapezeArtist

Check http://www.maxprog.com/site/software/internet-marketing/email-bounce-handler_sheet_us.php

I use this with Pommo.

soonick commented 10 years ago

Hello @TrapezeArtist,

I am working on a solution but I am far from done. The solution @tester13 recommended should work in the meantime.

Regards, Adrian

gerhard141 commented 10 years ago

has anyone been able to implement this?