postal icon indicating copy to clipboard operation
postal copied to clipboard

Remove users from suspension list

Open rbashish opened this issue 6 years ago • 8 comments

Hi,

How to remove users email from suspensions list immediately. Right now it says it will get removed after 30 days. Please help ASAP...

rbashish avatar Aug 06 '20 09:08 rbashish

You can remove someone from the suspension list by manually releasing an email to them as the suppression list means emails to that person will be held automatically.

If you need to remove lots of people, it may be easier to clear from the database directly.

willpower232 avatar Aug 06 '20 12:08 willpower232

How can I access the database and what command do I need to run to remove the users from it.

rbashish avatar Aug 06 '20 17:08 rbashish

You will have entered all the details into the postal.yml file so if you don't have the technical knowledge to access the database, its probably safer that you don't.

If you get into the databases, you should see that each server you have set up in the Postal UI has its own database and each of those databases has a table called suppressions. You should be able to remove the rows from that table with whatever software you're using to connect to the database.

willpower232 avatar Aug 11 '20 15:08 willpower232

I got the table name and it is "suppressions". Thanks!

rbashish avatar Aug 12 '20 11:08 rbashish

great, feel free to close if you don't have any more questions

willpower232 avatar Aug 13 '20 18:08 willpower232

If you use a unique Postal database server and need to clear the suppression list on all mail servers, here's my bash-one-line tip:

export DB_PASS=mypassword; \
for j in `echo 'show databases like "postal-server-%" ' |mysql -u root -p$DB_PASS \
|grep 'postal-server-' |awk '(NR>1)'`; \
do mysql -u root -p$DB_PASS $j -e "truncate suppressions"; done

cinco avatar Dec 08 '21 05:12 cinco

I'd definitely argue against having your root password in your terminal history, you could use something similar with the Postal database user details from the config file which would be slightly less risky.

willpower232 avatar Dec 08 '21 09:12 willpower232

If you use a unique Postal database server and need to clear the suppression list on all mail servers, here's my bash-one-line tip:

export DB_PASS=mypassword; \
for j in `echo 'show databases like "postal-server-%" ' |mysql -u root -p$DB_PASS \
|grep 'postal-server-' |awk '(NR>1)'`; \
do mysql -u root -p$DB_PASS $j -e "truncate suppressions"; done

I made a python script to clean all held messages, on a specific mail server:

https://gist.github.com/cinco/1e2efe4d67dc69b2a26704378ef358ae

Attention to the necessary environment variables:

POSTAL_LOGIN=your-email
POSTAL_PASSWORD=your-pass
POSTAL_URL=http://your-postal-domain
POSTAL_ORGANIZATION=slug-of-your-organization
POSTAL_MAIL_SERVER=slug-of-mail-server

cinco avatar Feb 21 '22 20:02 cinco