Friday, September 2, 2011

Qmail Tips & Tricks.

qmail is a mail transfer agent that runs on Unix. It was written, starting December 1995, by Daniel J. Bernstein as a more secure replacement for the popular Sendmail program. qmail's source code is released to the public domain, making qmail free software. Most Popular email services like Yahoo,Gmail are using qmail for their mail traffic. Here I am pasting some qmail tips,which helped me to override when I was blackout with my Qmail Box.

qmailctl - This command will show you a lot of information about your qmail server.

[] qmailctl stat 
/service/qmail-send: up (pid 3030) 30 seconds
/service/qmail-send/log: up (pid 3025) 30 seconds
/service/qmail-smtpd: up (pid 3028) 30 seconds
/service/qmail-smtpd/log: up (pid 3029) 30 seconds
/service/qmail-pop3d: up (pid 3026) 30 seconds
/service/qmail-pop3d/log: up (pid 3027) 30 seconds
messages in queue: 0
messages in queue but not yet preprocessed: 0

The above output means your Qmail server is Ready to deliver / receive messages. The seconds figure should be same,for a clean server.

[]qmailctl queue
messages in queue: 0
messages in queue but not yet preprocessed: 0

This will shows the list of mails which were not delivered in the server.

[]qmailctl queue | wc -l
Which will give the number of mails in the queue.

[]qmailctl start
Starts mail service (smtp connection accepted, mail can go out)

[]qmailctl stop
Stops mail service (smtp connections refused, nothing goes out).

[]qmailctl pause
Temporarily stops mail service (connections accepted, nothing leaves).

To block a sender or entire domain to your Qmail Box. Because some times you need to block a user or entire domain from outside world to reach to your qmail

[] vi /var/qmail/control/badmailfrom

Inside the " badmailfrom " file, the syntax might look something like this:

What do the above lines do?

The entry for "" would block all mail coming from "".

The entry for "" would block any and all mail coming from the domain "".

To be Continued.... 
Because Qmail Administration is an Ocean,I am just seeing it from the Shore. ..