1

Topic: delete user mail fom forwarding

Hello!
I use SQL from the console
I created alias
INSERT INTO alias (address, name, domain, active) VALUES ('test@mail.ltd', 'mail_alias', 'mail.ltd', 1);
and added user@mail.ltd
INSERT INTO forwardings (address, forwarding, domain, is_list) VALUES ('test@mail.ltd', 'user@mail.ltd', 'mail.ltd', 1);
now I want to delete user@mail.ltd from forwarding and then add another user
DELETE FROM forwardings
  WHERE address = '<test@mail.ltd>'
        AND forwarding = '<user@mail.ltd>'
        AND is_list = 1;
Query OK, 0 rows affected (0.00 sec)
but for some reason this method does not work, tell me how to delete the user

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release):     v0.9.8
- Linux/BSD distribution name and version: centos7
- Store mail accounts in which backend (MySQL):
- Web server (Nginx):Nginx
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: delete user mail fom forwarding

n7754434445 wrote:

but for some reason this method does not work, tell me how to delete the user

What do you mean "does not work"?

3 (edited by n7754434445 2018-07-27 12:17:30)

Re: delete user mail fom forwarding

The fact is that users@mail.ltd have entered the wrong address, now you need to delete it.
"does not work" means that the wrong address is not deleted from the table forwarding
the row in the table is not deleted

4

Re: delete user mail fom forwarding

I coped with the task, the problem was in the signs <> which should not be
DELETE FROM forwardings
  WHERE address = '<test@mail.ltd>'
        AND forwarding = '<user@mail.ltd>'
        AND is_list = 1;
should be so
DELETE FROM forwardings
  WHERE address = 'test@mail.ltd'
        AND forwarding = 'user@mail.ltd'
        AND is_list = 1;