Gerenciamento do exim via comando (terminal)

Gerenciamento Básico de fila do exim;
# a count of all messages in queue
exim -bpc

# a list of message in the queue (time queued, message size, message id, sender, recipient)
exim -bp

# a summary of all messages in queue (count, volume, oldest, newest, destination domain)
exim -bp | exiqsumm

# determine how exim would route a message
exim -bt user@domain.com

# test how exim would deal with a connection from a specific IP address.
# this will display Exim’s filters and ACLs
exim -bh 192.168.1.1

Como pesquisar a fila exim com exiqgrep;

# lists messages from a specified sender
exiqgrep -f [user]@domain

# lists messages to a specified recipient
exiqgrep -r [user]@domain

# lists messages older than a number of seconds
exiqgrep -o [seconds]

# lists messages younger than a number of seconds
exiqgrep -y [seconds]

# lists messages that match the specified size (can be a regex)
exiqgrep -s ‘^2…$’

Exim Queue Management Tutorial

 

You can combine the following switches to further restrict the output of the above

-i to just list the message IDs

-z to just show frozen messages

-x to just show unfrozen messages

Gerenciamento de fila Exim;

# Start a queue run (won't run if over load threshold)
exim -q -v
 
# Force a queue run (will run regardless of load)
exim -qf -v
 
# Start queue run for local deliveries only
exim -ql -v
 
# Remove a message from queue by ID
exim -Mrm <message-id> ...
 
# Freeze a message
exim -Mf <message-id> ...
 
# Thaw a message
exim -Mt <message-d> ...
 
# Force delivery of a message regardless of Frozen status
exim -M <message-id> ...
 
# View a message's logs
exim Mvl
 
# View a message's headers
exim Mvh
 
# View a message's body
exim Mvb

Avançados de gerenciamento de fila exim;

 

# List all queued messages, grouped by sender address
exim -bpr | grep -Eo "<[^ ]*@[^ ]*>" | sort | uniq -c
 
# List all queued messages, grouped by recipient address
exim -bpr | grep -Eo "^\s*[^ ]*@[^ ]*$" | sort | uniq -c
 
# Remove all messages older than 12hrs (43000 seconds)
exiqgrep -o 43000 -i | xargs exim -Mrm
 
# Remove all frozen messages from the queue
exiqgrep -z -i | xargs exim -Mrm
 
# Remove all messages from a particular sender
exiqgrep -i -f [user]@domain.com | xargs exim -Mrm
 
# Remove all messages from a sender that are older than 12hrs
exiqgrep -o 43000 -i -f [user]@domain.com | xargs exim -Mrm


1. To delete mail with certain string in the message.

grep -lr ‘a certain string’ /var/spool/exim/input/ | \sed -e ‘s/^.*\/\([a-zA-Z0-9-]*\)-[DH]$/\1/g’ | xargs exim -Mrm

2. To delete all mails from a specific sender.

exiqgrep -i -f user@domain.com | xargs exim -Mrm

or

# exim -bp|grep “username”| awk {‘print $3′}| xargs exim -Mrm



		
		
			

Deixe um comentário