Howto purge the E-mail queue

Howto purge the E-mail queue

Hi All,

On my outsystems 5 installation I've been testing the E-mail possiblities which seem very nice.
My E-mail server has authentication disabled and makes a decision to relay E-mail based on the Client IP address.

Now there are some previously sent test E-mails that I would like to purge from a queue in the Platform server because they had a default 'authentication' set and because some of them didn't have a recipient, which is unaccepted by my mailserver.

Not purging them gives me below admin E-mails: ------------------------------------------------------------------------------------
Transcript of session follows.

Out: 220 NO UCE/UBE ESMTP Postfix (Debian/GNU) :
Authorized Use Only! Violators will be prosecuted
In: EHLO outsystems
Out: 250-SIZE 50000000
Out: 250-ETRN
Out: 250-8BITMIME
Out: 250 DSN
Out: 250 2.1.0 Ok
In: RCPT TO: <>
Out: 501 5.1.3 Bad recipient address syntax

Session aborted, reason: lost connection

Does anybody have an idea how to fix this?
Hi Eric

Unfortunately, purging the email queue was something that wasn't included in the features of the Agile Platform. So there's no easy 1-Click email purge button.

However, this can be accomplished by updating the meta-information directly on the database, for the emails in question.

Using a database client tool (Microsoft SQL Server Management Studio for SQL Server RDBMS, or SQL Plus or SQL Developer for Oracle RDBMS), you can perform one of two actions:
  • Delete the emails you which to purge from the database, by deleting the corresponding rows of the ossys_email table that should exist on the OutSystems SQL Server catalog, or HubAdmin Oracle schema. You can identify the corresponding rows by searching that table for the email subjects and recipients. For instance, suppose you want to delete the emails sent to, with the subject "Daily Activity Update". Just run the query:
                select * from ossys_email where to='' and subject like '%Daily Activity Update%';

              These are the rows that correspond to the emails you want to delete. In order to delete all rows according to these conditions, just change the query to:

                delete from ossys_email where to='' and subject like '%Daily Activity Update%';
  • You can also set the emails status so that they will remain in the system, as if they were already sent. This will not delete the emails from the system, but instead it will fool the system saying that the emails were already sent. You can do this by updating the ossys_email_status table, using a join condition to identify the emails to update. Say you want to update the status of all emails sent to, with the subject "Daily Activity Update". Just run the query:
               update ossys_email_status set NEXT_RUN=NULL, IS_RUNNING_SINCE=NULL, SENT='2010-02-02 00:00:00'
               where ID IN (select ID from ossys_email where to='' and subject like '%Daily Activity Update%');

             This will update the status table with a non-null date, and the emails shouldn't be sent again.

Please note that performing changes manually directly on the Agile Platform's system metadata, can lead to inconsistency and data corruption problems, so be extra carefull manipulation these queries, and always perform a database backup prior to any change.

Hope this information is helpful.

Best regards

Miguel João

Hi Miguel,

Sorry I didn't reply to this; I think I didn't set the notify checkbox.