1832566 Members
5770 Online
110043 Solutions
New Discussion

Sendmail bounced email

 
SOLVED
Go to solution
Sean_21
Advisor

Sendmail bounced email

Hi,

Can anyone tell me a way to delete email messages that get bounced back to my server admin account after a mass mailing. The var partition fills up and brings my system to it's knees.

Sendmail version 8.9.3

Thanks in advance
7 REPLIES 7
Kevin Wright
Honored Contributor

Re: Sendmail bounced email

Incorporate into your mass mailing script a little if then part that removes messages if they are sent back to you.
Jeff Schussele
Honored Contributor

Re: Sendmail bounced email

Hi Sean,

If you don't care about legit replies to these mailings you can setup a .forward file for the mailing user that contains just /dev/null. Then it's hasta-la-vista to any mail for that user - returns included. You just have to remember that this user will essentially have NO mail while that file exists.

HTH,
Jeff

PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Jeff Schussele
Honored Contributor

Re: Sendmail bounced email

Sean,

The .forward files needs to reside in the user's home dir.

To delete (all) the mail for USERNAME do:

#> /var/mail/USERNAME
OR
#cat /dev/null > /var/mail/USERNAME

IF the /var/spool/mqueue is what's filling up then thats a diff problem - that is mail stuck in the queue & requires diff actions - let me know.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Sean_21
Advisor

Re: Sendmail bounced email

Yes it's a mail que problem. Isn't there a filter to stop bounce emails returning to the original user and from spooling in the que?
Sean_21
Advisor

Re: Sendmail bounced email

Let me flush this out bit more.

What's happening is when I send out a mass mailing, bounce emails and outgoing email slow the system down to a halt. This takes up a lot of system resources. Not sure if it's the que thats causing the problem or the system trying to manage mass mailings.
Mark Fenton
Esteemed Contributor

Re: Sendmail bounced email

Sean,

Something to look into: if your email server is behind a firewall, you may be able to limit the number of connections per minute on port 25 (or on whatever port you receive email) to some more manageable number, giving your mqueue more time to handle its load.

Different firewalls have different capabilities in that regard, so this might not be of any practical use to you.

Jeff Schussele
Honored Contributor
Solution

Re: Sendmail bounced email

Sean,

Understood.
If you do a
#sendmail -bp | more
this will give you queue status. Anything with old dates is undeliverable due to bad domain addressing, servers not accepting, etc. These will sit for 5 days by default & then be returned to sender unless manually deleted. You can delete by determining the queue # - indicated by the 3 letter/5 number designation in this output. You can delete by:
#rm *queuenumber - you need the wildcard as there or always 2-3 files involved in every msg. This, of course, can be scripted.

As to performance you'll need to "tune" the sendmail.cf file. Look at these values in sendmail.cf:

# maximum number of children we allow at one time
O MaxDaemonChildren=12

# maximum number of new connections per second
#O ConnectionRateThrottle=3
O ConnectionRateThrottle=5

The first is the max # of concurrent session - the second is the max connections/second values. Make sure these are uncommented. By default they're unlimited & that'll kill a server in mass mailings.

Also check the RefuseLA & QueueLA values. These will refuse connections or only queue msgs, respectively, depending on server loads. If they're commented they're not in effect. The defaults are OK - just uncomment & bounce sendmail for these changes to take effect. If you
#ps -ef | grep send | wc
This gives you a good idea on connections in use.

There is also a vaule in sendmail.cf to adjust the 5-day period for non-deliverable, but I can't remember & can't get to my server now to check.
Maybe someone else can chime in - or I can find it for you tomorrow.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!