sendmail issue: multiple mailqueues - load balancer

Posted on 2008-11-05
Last Modified: 2013-12-18
Hi All,

If someone can send me a very informative link that can help me to underdstand the following with examples

1 . sendmail logs (/var/log/maillog)
2 . mailq
3 . how to check the deffered mails?
4 . how to check the rejected emails?
5 . how to resend the deferred and rejected emails?
6 . how can we count how many emails went successful / rejected / deferred in a day?
7 . how can we set and manage the multiple mailqs?
8 . understand /var/mail/mqueue (enteries starting with qf/df/Qf/tf )
9 . understand /var/mail/clientmqueue
10. shared mail server? (load balancer)

I am crazy to learn sendmail fully as in the new office sendmail is being used which i never used :-(
I will really appreciate if someone can help me to sort out these issues.

Many thanks.

Question by:samengr
    1 Comment
    LVL 26

    Accepted Solution

    If you're new to sendmail and really want to learn everything about how it works, I'd suggest you buy a book and read it. However many of your questions are pretty simple to answer:

    1. the logs show all mail traffic (in and out) and most information about the message. You'll see the date, the message id, the process id handling the mail, the To addr, the From addr, the size, the number of recipients, and the relay, which is just the server that submitted the mail if it's an incoming msg or the server that accepted it if it's an outgoing message. Keep in mind there will be multiple log entries for each message, and they can overlap each other, so look at the message id to keep track of which log entries go together or relate to the same mail.

    2. mailq simply shows you what is currently in the queue. If the message has been deferred or tempfailed, it'll list the reason in between the sender and the recipient.

    3. Use mailq to check deferred mail. They'll have "(Deferred:" listed in the reason.

    4. Really the only way to check on rejected msgs is to look in the /var/log/maillog file. Do a search for the term "reject" or search for status codes in the 500s (5.[0-9].[0-9]). 500s are permanent failures, 400s are temporary failures and will be retried.

    5. To force the queue runner, type "sendmail -q", but they'll be resent automatically, but you can force it that way. You can't resent rejected mail, the server discards it. Only the original sender can resend, but chances are, it's going to get rejected again.

    6. Use the mailstats program to keep counts. It tells you the number of messages to, from, rejected, discarded, in the queue and the total bytes in and out. Write a shell script to run from a cron job to parse the output of mailstats to build a db of daily stats.

    7. This should give you an idea about multiple queues:

    8. qf files are the headers, df files are the msg bodies. There should be two files (1 qf and 1 df) for each message in the queue.

    9. First, mail gets dumped into the mqueue folder for processing. If it isn't delivered promptly it gets moved to the clientmqueue folder for later retries afaik.

    10. I'm not quite sure what you're asking on this one, but for load balancing basically you just need multiple sendmail boxes all listed as MX records (with the same priority) or just using roundrobin dns (1 name points to multiple IPs). If you want all the servers to share a common queue or mailbox folder, you'll have to map that location from yet another shared server using NFS or CIFS .

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    MS outlook is a premier email client that enable you to send and receive the e-mails with various file formats of attachments such as document files, media file, and many others formats. There is some scenario occurs when a receiver of an e-mail mes…
    Easy CSR creation in Exchange 2007,2010 and 2013
    In this video we show how to create a Resource Mailbox in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: Navigate to the Recipients >> Resources tab.: "Recipients" is our default selection …
    In this video we show how to create an Accepted Domain in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Mail Flow >> Ac…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now