Hiển thị các bài đăng có nhãn Exim. Hiển thị tất cả bài đăng
Hiển thị các bài đăng có nhãn Exim. Hiển thị tất cả bài đăng

Thứ Hai, 19 tháng 5, 2014

Exim Commands

Exim Commands

Debug a mail delivery:
 /usr/sbin/exim -bt -d email@address.com
Retry message delivery:
 /usr/sbin/exim -M messageID
Force delivery of all message:
 /usr/sbin/exim -qf
Force delivery of all message and delete of frozen ones:
 /usr/sbin/exim -qff
Shows log delivery for a message:
 /usr/sbin/exim -Mvl messageID
Display message body:
 /usr/sbin/exim -Mvb messageID
Display message header:
 /usr/sbin/exim -Mvh messageID
Delete a message without warning:
 /usr/sbin/exim -Mrm messageID
Count messages in queue:
 /usr/sbin/exim -bpr | grep "<" | wc -l or /usr/sbin/exim -bpc
Display all messages from queue:
 /usr/sbin/exim -bp
Count frozen messages:
 /usr/sbin/exim -bpr | grep frozen | wc -l
Delete frozen messages:
 /usr/sbin/exim -bpr | grep frozen | awk '{print $3}' | xargs /usr/sbin/exim -Mrm

Read More

Thứ Sáu, 16 tháng 5, 2014

Disable exim email on single cPanel Account

Disable exim email on single cPanel Account 

A week ago one of our clients account been compromised and the attacker used the server to blast emails.
as a system administrator my task was to prevent any outgoing email from the account before I start to investigate the attack and remove any kind of scripts from the hosting account.

Studying cPanel files made me to come around following solution.
To disable email for one account we can change the permission of /etc directory for that particular user, using our root power simply use following commands:
chmod 0 /home/username/etc
chattr +ia /home/username/etc
You need to replace username with your user username. Once this is done the user will not be able to send anymore emails from local server. To undo this you should run the chattr once more:
chattr -ia /home/username/etc
chmod 750 /home/username/etc
Read More

Thứ Hai, 15 tháng 4, 2013

Exim Remove All messages From the Mail Queue

Question:

 I'm using Exim mail server under CentOS Linux. How do I remove all messages from the Exim mail queue using a shell prompt?

Answer:
Exim is a mail transfer agent (MTA) used on Unix-like operating systems. It aims to be a general and flexible mailer with extensive facilities for checking incoming e-mail.

To print a list of the messages in the queue, enter:

# exim -bp

To remove a message from the queue, enter:

# exim -Mrm {message-id}

To remove all messages from the queue, enter:

# exim -bp | awk '/^ *[0-9]+[mhd]/{print "exim -Mrm " $3}' | bash
Dallas Marlow, suggested following clean command:
# exim -bp | exiqgrep -i | xargs exim -Mrm
DELETE FROZEN MAILS
/usr/sbin/exim -bp | awk '$6~"frozen" { print $3 }' | xargs /usr/sbin/exim -Mrm
REMOVE MAILS FROM SENDER
/usr/sbin/exiqgrep -i -f (MAIL ADDRESS HERE) | xargs /usr/sbin/exim -Mrm 
OR 
/usr/sbin/exim -bp | awk '$4~"info@domain.com" { print $3 }' | xargs /usr/sbin/exim -Mrm


Read More

How to block emails from a specific address using Exim

Issue :
How to block emails from a specific address on a cPanel/WHM server using Exim ?
Solution :
This is fairly easy to achieve with Exim.
First you’ll need to find the system filter file for Exim. This can be found out through WHM >> Main >> Service Configuration >> Exim Configuration Editor.
Towards the middle of the page, under the section ‘Filters’ , you ‘ll find the path to the file.
Open that file via SSH using your favorite editor and add the following to it :
if first_delivery
and ( (“$h_from:” contains “emailtoblock@domainname.com”)
)
then fail
endif
Read More