Topic: user specified as a definer does not exist amavis
==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.4.2 OPENLDAP
- Deployed with iRedMail Easy or the downloadable installer?: Downloadable installer
- Linux/BSD distribution name and version: Ubuntu 21.04 x64
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): LDAP External AD Server
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro?: No
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
A couple of prefaces:
1. I installed iRedMail with a remote MySQL server using the instructions here: https://docs.iredmail.org/install.iredm … erver.html the command I used was
sudo USE_EXISTING_MYSQL='YES' MYSQL_SERVER_ADDRESS='10.0.0.229' MYSQL_SERVER_PORT='3306' MYSQL_ROOT_USER='admin_iredmail' MYSQL_ROOT_PASSWD='somepassword' MYSQL_GRANT_HOST='10.0.0.226' bash iRedMail.sh
My SMTP server is on 10.0.0.226, MySQL lives on 10.0.0.229.
2. Post install I followed the instructions here to link mail accounts with AD accounts: https://docs.iredmail.org/active.directory.html
3. As per the Remote MySQL instructions I deleted the "admin_iredmail" user from my SQL server for security, as the tutorial stated it was no longer required.
Whenever my server receives email the mail is not delivered to the user. Instead this shows up in the logs:
/var/log/mail.log:Nov 13 00:05:48 vsmtp1 amavis: (16961-08) (!!)TROUBLE in check_mail: gen_mail_id FAILED: find_or_save_addr: failed to insert addr firstname.lastname@example.org: sql exec: err=1449, HY000, DBD::mysql::st execute failed: The user specified as a definer ('admin_iredmail'@'10.0.0.226') does not exist at (eval 108) line 173. at (eval 110) line 116.
/var/log/mail.log:Nov 13 00:05:48 vsmtp1 postfix/amavis/smtp: 4Hr3GJ5PpDz40VZ: to=<email@example.com>, relay=127.0.0.1[127.0.0.1]:10024, delay=75972, delays=75972/0.02/0.01/0.08, dsn=4.5.0, status=deferred (host 127.0.0.1[127.0.0.1] said: 451 4.5.0 Error in processing, id=16961-08, gen_mail_id FAILED: find_or_save_addr: failed to insert addr firstname.lastname@example.org: sql exec: err=1449, HY000, DBD::mysql::st execute failed: The user specified as a definer ('admin_iredmail'@'10.0.0.226') does not exist at (eval 108) line 173. at (eval 110) line 116. (in reply to end of DATA command))
A previous post stated to check /etc/amavis/conf.d/50-user for the incorrect mysql login information, but it's not in there. It's set to use the amavis user to login to MySQL.
Actually I did a find / -xdev -type f -print0 | xargs -0 grep -H "admin_iredmail" across the entire server and that username is not found in any configuration files. Just my bash history, syslog and mail.log, and /root/.my.cnf
I used a rather insecure password for the setup of the remote mysql privileged user and I'd rather not re-create that user to get this to work. And of course I'd also rather not reinstall iRedMail either. Any ideas on how I can find out where to get this changed so that I can use iRedMail successfully. Thanks.