Remove queued mails for particular Email account – Zimbra/Postfix

Login to the server via SSH and run below command:-

# /opt/zimbra/common/sbin/postqueue -p | tail -n +2 | awk 'BEGIN { RS = "" } /[email protected]\.com/ { print $1 }' | tr -d '*!' | /opt/zimbra/common/sbin/postsuper -d -
  • Replace navdeep.singh and domain name with your choice
  • You can also use above command on a non-zimbra server but make sure it has postfix for the mailing puprose, in this case you can just use postqueue and postsuper instead of using their full path.
  • Your zimbra server may has postqueue and postsuper in a bit different folder so try to find them and best way to do that is this:-
# updatedb         # make sure you has mlocate package OR locate command installed
# locate postqueue
# locate postsuper

 

Change Zimbra Server’s IP via Command Line – CentOS / Ubuntu

su - zimbra

# Below command will show you the Old IP

postconf mynetworks
mynetworks = 127.0.0.0/8 192.168.0.0/24

# Also check via Zimbra LDAP configuration

zmprov getServer zimbra.the-d2.com | grep zimbraMtaMyNetworks

# Change the IP with below command (replace hostname and IP accordingly)

zmprov modifyServer zimbra.the-d2.com zimbraMtaMyNetworks '127.0.0.0/8 192.168.12.44/24'

# Now reload and restart your Zimbra services:-

su - zimbra
postfix reload
zmcontrol stop
zmcontrol start