[SOLVED] sendmail - disable local delivery and queue is growing up?
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
it works but this messages seems to be stuck in sendmail queue:
Code:
sendmail -bp
...
p0IAY17d021939 253 Tue Jan 18 17:34 <root@xx.localdomain>
(Deferred: Connection refused by xx.localdomain.)
<root@xx.localdomain>
Total requests: 2057
and is growing up very fast. Yesterday, it was up to 400000 msg. `sendmail -v -q` seems to not work and I must manually delete it from /var/spool/mqueue.
You specify an alias file: define(`ALIAS_FILE', `/etc/aliases')dnl. Do you have root.xx.localdomain mapped as an alias to a valid (gmail) or other address that can receive mail?
I don't want to map the root to a valid email address. All I want is sending out mail to alert and completely disable the local delivery (don't go to the queue).
I think we might be misunderstanding each other but trying to say the same things. When I mentioned mapping root to a valid email address, I meant to say map the email address 'root@localhost' to the address to the one where would like your alert emails to be sent, not the root user. By default, when applications send out their alerts they are going to send it to 'root@localhost' and unless your mail handler knows where to redirect the message, it will try to deliver it locally, which it can't and you don't want.
I also found this thread. I think the suggestion by Pawel (the second response) received a lot of comments saying it solved the problem for them.
I think we might be misunderstanding each other but trying to say the same things.
No, I don't think so.
Quote:
Originally Posted by Noway2
When I mentioned mapping root to a valid email address, I meant to say map the email address 'root@localhost' to the address to the one where would like your alert emails to be sent, not the root user.
I know, but if I do that, I will get a lot of local messages like this:
Code:
**********************************************
** THIS IS A WARNING MESSAGE ONLY **
** YOU DO NOT NEED TO RESEND YOUR MESSAGE **
**********************************************
The original message was received at Fri, 21 Jan 2011 04:05:01 +0700
from SVR040-763.localdomain [127.0.0.1]
----- Transcript of session follows -----
<root@SVR040-763.localdomain>... Deferred: Connection refused by svr040-763.localdomain.
Warning: message still undelivered after 4 hours
Will keep trying until message is 5 days old
Reporting-MTA: dns; SVR040-763.localdomain
Arrival-Date: Fri, 21 Jan 2011 04:05:01 +0700
Final-Recipient: RFC822; root@SVR040-763.localdomain
Action: delayed
Status: 4.4.1
Remote-MTA: DNS; svr040-763.localdomain
Last-Attempt-Date: Fri, 21 Jan 2011 08:53:31 +0700
Will-Retry-Until: Wed, 26 Jan 2011 04:05:01 +0700
Part 1.2
Subject:
Cron <root@SVR040-763> /usr/bin/unison -batch
From:
root@SVR040-763.localdomain (Cron Daemon)
Date:
Fri, 21 Jan 2011 04:05:01 +0700
To:
root@SVR040-763.localdomain
Usage: unison [options]
or unison root1 root2 [options]
or unison profilename [options]
For a list of options, type "unison -help".
For a tutorial on basic usage, type "unison -doc tutorial".
For other documentation, type "unison -doc topics".
and as you know, that I don't want.
Quote:
Originally Posted by Noway2
I also found this thread. I think the suggestion by Pawel (the second response) received a lot of comments saying it solved the problem for them.
If you take notice of it, you can see that I read from it to disable the local delivery.
I have been giving your posts some thought over the past few days. Specifically, I have been trying to understand and reconcile exactly what your problem is and what to do about it, assuming that anything can be. I was hoping that someone else would have some ideas to help you, but it doesn't appear to be the case. So, I will try to recap:
You are running sendmail as your local MTA
You have configured sendmail to relay to your gmail accounts
You have disabled local delivery to Linux accounts
You are seeing a large number of undelivered messages addressed to 'root@localhost' appearing in your mail queue
You want to receive alerts (emails) from a limited set of applications that you chose, e.g. ossec, Nagios, Redmine.
You do not want to forward ALL root@localdomain email to a gmail account, just the services you select?
The problem that I see is that various processes are configured, by default to send mail to root@localdomain. When the applications do this, your sendmail will pickup the messages and try to handle them. If it thinks that it is supposed to handle mail for localdomain it will try to accept the messages and then try to deliver them. It looks like what is happening is that sendmail is accepting these messages, but doesn't know what to do with them. Hence they get queued up in a deferred status. What it sounds like you need to do is stop sendmail from even accepting mail for this user.
My searching is coming up with little in this regard. However, I see this link. Please check it out. Specifically, look at section 28.3.2 on alias. You will notice that bit.bucket is mapped to /dev/null. Perhaps you could map root to /dev/null? This should cause all root@localdomain mail to go into the void. As long as you have configured the desired applications to send mail where you wish, this may achieve your goal.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.