View the postfix version :
# postconf mail_version
mail_version = 2.3.3
# postconf mail_version
mail_version = 2.3.3
Check the postfix installation :
# postfix check
# postfix check
Show default postfix values :
# postconf -d
# postconf -d
To show non default postfix values :
# postconf -n
# postconf -n
To restart postfix mail server :
# postfix reload
Flush the mail queue :
# postfix flush
Or you can use:
# postfix -f
# postfix flush
Or you can use:
# postfix -f
To see mail queue :
# mailq
( in send mail sendmail -bp )
# mailq | wc -l
(will give the total no of mails in queue )
# mailq
( in send mail sendmail -bp )
# mailq | wc -l
(will give the total no of mails in queue )
To remove all mail from the queue :
# postsuper -d ALL
# postsuper -d ALL
To remove all mails in the deferred queue :
# postsuper -d ALL deferred
# postsuper -d ALL deferred
To see the mails in a tree structure :
# qshape
# qshape
View the mail content :
# postcat -q AFD4A228 37C
# postcat -q AFD4A228 37C
You will get the above id from mailq . Or you can view the mails from postfix mail spool. Usually postfix will store the mails in /var/spool/postfix/active/ from this location also you can view the mails . We can change the queue directory from the postfix conf.
Sort by from address :
# mailq | awk ‘/^[0-9,A-F]/ {print $7}’ | sort | uniq -c | sort -n
To remove all mails sent by user@adminlogs.info from the queue :
# mailq| grep ‘^[A-Z0-9]‘|grep user@adminlogs.info|cut -f1 -d’ ‘ |tr -d \*|postsuper -d -
To remove all mails being sent using the From address “user@adminlogs.info” :
# mailq | awk ‘/^[0-9,A-F].*user@adminlogs. info / {print $1}’ | cut -d ‘!’ -f 1 | postsuper -d -
To remove all mails sent by the domain adminlogs.info from the queue :
# mailq| grep ‘^[A-Z0-9]‘|grep @adminlogs.info|cut -f1 -d’ ‘ |tr -d \*|postsuper -d -
No comments:
Post a Comment