110Maintenance - amagerard/Mail GitHub Wiki

HOME

RedHat10/Mail

1- Network 2- Postfix 3- Dovecot 4- Postfixadmin 5- PostfixMariaDB 6- DovecotMariaDB
7- RelaySmtp 8- Troubleshoot 9- Selinux 10- GnomeShell 11- Maintenance

11. Maintenance.

11.1 Database.

Save the postfixadmin database.
mariadb-dump -u root -p postfixadmin > backup_postfixadmin.sql

Save only data.
mariadb-dump -u root -p --no-create-db --no-create-info postfixadmin > backup_postfixadmin_data.sql

Restore the postfixadmin database.
mariadb -u root -p postfixadmin < backup_postfixadmin.sql

Restore only date.
mariadb -u root -ppostfixadmin < backup_postfixadmin_data.sql

Change password.
mariadb -u root -p mysql
MariaDB [mysql]> select user,host,password from mysql.user;
alter user 'username'@'localhost' identified by 'NewPassword';

11.2 Virtual accounts folder.

cd /var/vmail/<domain>.

11.3 Automatic restart.

If for some reason the dovecot or postfix services would be stopped.

11.3.1 dovecot.

mkdir -p /etc/systemd/system/dovecot.service.d
vi /etc/systemd/system/dovecot.service.d/custom.conf

#linuxbabe  Xiao Guoan  
[Service]  
Restart=always  
RestartSec=5s  

systemctl daemon-reload
test: pkill dovecot
wait 5 s.
systemctl status dovecot

11.3.2 Postfix.

mkdir -p /etc/systemd/system/postfix.service.d
vi /etc/systemd/system/postfix.service.d/custom.conf

#linuxbabe  Xiao Guoan  
[Service]  
Restart=on-failure  
RestartSec=5s  

systemctl daemon-reload
test: pkill master
wait 5 s.
systemctl status postfix

11.4 Command list.

  • Purge all queues.
    postsuper -d ALL
  • Queues list.
    postqueue -p
  • Mail Server : Mail Log Report : pflogsumm.
    dnf -y install postfix-perl-scripts
    Generate mail log summary for yesterday.
    perl /usr/sbin/pflogsumm -d yesterday /var/log/maillog
⚠️ **GitHub.com Fallback** ⚠️