Support » Plugin: Post SMTP Mailer/Email Log » Many entries in wp_postmeta table

Viewing 5 replies - 1 through 5 (of 5 total)
  • Russ

    (@gfxdesigner)

    I was able to clean up the entries by running the following SQL query within phpMyAdmin:

    DELETE FROM wp_postmeta WHERE meta_key = ‘from_header’;
    DELETE FROM wp_postmeta WHERE meta_key = ‘to_header’;
    DELETE FROM wp_postmeta WHERE meta_key = ‘transport_uri’;
    DELETE FROM wp_postmeta WHERE meta_key = ‘original_to’;
    DELETE FROM wp_postmeta WHERE meta_key = ‘original_subject’;
    DELETE FROM wp_postmeta WHERE meta_key = ‘original_message’;
    DELETE FROM wp_postmeta WHERE meta_key = ‘original_headers’;
    DELETE FROM wp_postmeta WHERE meta_key = ‘session_transcript’;
    DELETE FROM wp_postmeta WHERE meta_key = ‘success’;
    DELETE FROM wp_posts WHERE post_type = ‘postman_sent_mail’;

    After running the above and then running an optimize on the database, I went from a 1.78 GB database to only 9.8 MB!

    Perhaps, a future update for Post SMTP Mailer can add the above functions to a clean-up routine.

    Daft question I know, but did you use the “BIN ALL” option on the log page itself?
    That will also delete all of the log entries from the database.

    Also, out of interest, what number did you have set within the “Maximum Log Entries” field?

    I’m pretty sure that if you “Maximum Log Entries” down, on the next clean-up, entries would have been deleted leaving only the new value of entries left. Switching off logging doesn’t delete any existing logs AFAIK.

    Are you sure that your wp-cron tasks are firing off? (i.e. if wp-cron isn’t able to run, then certain WP operations such as clearing out of old comments/data would not be able to run.

    Russ

    (@gfxdesigner)

    I wasn’t able to select “Trash All” on the logs page as I couldn’t even get the log page to load. I am assuming that is because of the sheer amount of submissions that were in the database.

    Maximum log entries were set to 10.

    It looks as though CRON jobs were running.

    Sheesh, 10 Log entries and it was over 1.5GB worth of log data !!!
    Do you think there were more than 10 entries in the tables?
    Or do you think one or more entries was that large, it was taking up that much space?

    Switching logging on and changing the number of log entries to a lower number should normally result in the logs being trimmed.

    However, I’m wondering if someone had previously set the log size to something extraordinarily large at which point, displaying the log would actually fail.
    If the log size was then set to a much lower number, I’m wondering if the ‘delete’ function is failing given that it’s trying to delete over 1.5Gb of entries. (i.e. either the SQL or PHP statement is timing out, depending on the server settings).

    Given the plugin already attempts to clean up the saved mail logs, it wouldn’t be a trivial task to delete that much data in one go.
    You’d have to set up multiple batches, using a recurring WP cron-job to delete them gradually over time, cancelling the cron job on completion.

    I suspect if you had logging enabled, you’d see either PHP timeouts, or SQL Server gone away errors whilst you had that 1.5GB+ of log data. Each time POST SMTP would have tried to clear it out, it should have died.

    You managed to clear it via PhpMyAdmin which has less restrictions.. usually…

    Do you remember if the emails were logged over a long period, or did the site send out a mass of emails in a very short space of time? (i.e. from a hack attempt/spamming attack etc).

    I’m going to try and set up a local server to try and replicate what happened on your site and see what was happening… 1.5+GB of logs !!! That’s huge !!

    Plugin Author yehudah

    (@yehudah)

    @gfxdesigner
    Next release, hope custom db too.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.