Welcome to WebProNews Breaking eBusiness and Search News
Advertise | Newsletter | Sitemap | News Feeds News Feed 
 WebProNews Search Part of the iEntry network iEntry inc. 

Triple Threat

A.P. Lawrence
Expert Author
Published: 2003-06-02

WebProNews RSS Feed


Good things come in small packages, but large things aren't always bad either. That must have been the thought someone had in designing an email newsletter for their customers. Apparently they had quite a bit of news; this particular piece of email was 34 megabytes when it arrived at the Mitel SME (E-Smith) server of one of my customers.

Although unreasonably large, that in itself wasn't a problem. While the original designers of qmail probably never expected anyone to send such a silly thing, the server accepted the mail. Unfortunately, for reasons unknown, the sending side of the transaction didn't seem to understand that it had been accepted. So every twenty minutes or so, it send the mail again.

Well, that wasn't a terrible burden either. The server had plenty of disk space, and reasonable network bandwidth, so no harm yet. Not to the server anyway. The Windows machine of the actual recipient did start to have problems pretty quickly though: Microsoft Outlook Express soon literally started to choke as it clogged up with multiple 34 megabyte messages.

Forwarding rejected
There was another little glitch here that aggravated both the SME server and the poor Windows machine. The user also had her email forwarded by the SME to her home account. That was the intent, anyway. Unfortunately, her home isp wasn't about to accept a 34 megabyte mail message, so it rejected it back to the main account. That's how forwarding works: if your account on SME is fred@xyz.com and you forward to freddy@abc.com, if abc.com rejects the message, it goes back to fred@xyz.com. That caused yet another copy of this monster newsletter to come to her . Qmail would try to forward that again, but eventually would notice too many of its own headers amd quit. Of course, the reject messages did make their way to Outlook.

Slowing Down
The toll eventually started to affect the SME server. The bandwidth was getting sucked away by the regular arrivals of 34 megabyte messages, which then were attempted to be forwarded to another server, which rejected them back, and more forwards were attempted, so more and more copies tried to go to Outlook, which was in no mood to swallow any more. It was a death spiral.

At this point, I called in for support from Mitel, and within a very few minutes had one of their engineers logged into the server.

The first necessity was to block the email. Fortunately, that's fairly easy to do. The SME server doesn't actually use qmail to recieve mail, but the smtpfront-qmail does recognize qmail control files. The Mitel engineer created /var/qmail/control/badmailfrom and added the sender's address to it:

newsletter@sillyplace.com

Be sure it's all lower case even if the sending mail says "Newsletter@SillyPlace.com".

Of course, smtpfront has to be stopped to put this in place. There are two ways to do that on SME:

svc -d /service/smtpfront-qmail

or

/etc/rc.d/init.d/smtpfront-qmail stop

If you examine the init.d script, you'll see that it actually does svc -d and svc -u.

The "svc" facility is used for both qmail and smtpfront-qmail on the 5.6 version of SME server. It's part of daemontools, a replacement for inittab (SME server still uses inittab; this is used in addition). To stop a daemontool service, use "svc -d"; to start it, use "svc -u".

This now blocked this person from sending mail, so the twenty minute cycles of new 34 megabyte newsletters was stopped.

What we now had was almost a dozen messages in the queue still trying to forward to the user's home ISP. To deal with those, we had to stop qmail (svc -d /service/qmail) and clean them out of the queue. That's not as straightforward with qmail as it might be, because qmail has a complicated queue structure.

Cleaning the queue
The actual program that uses the queue is "qmail-send". In the SME implementation, the svc -d /service/qmail kills that off. We are now free to mess with the queue.

The actual messages will be found under /var/qmail/queue/mess in subdirectories. Each message will be stored with a name equal to its Queue ID. For example, you might have /var/qmail/queue/mess/21/1713843. If you examined it, you might see:

Received: (qmail 9013 invoked by uid 0); 17 May 2003 11:22:38 -0000
Date: 17 May 2003 11:22:38 -0000
Message-ID: <20030517112238.9012.qmail@aplawrence.org>
From: root@aplawrence.org
To: tony@aplawrence.org
Subject: ggg

hhh

Other parts of the queue will have this same id:

# cd /var/qmail/queue
# find . -name 1713843
./queue/intd/1713843
./queue/mess/21/1713843
./queue/todo/1713843

So, to get rid of these newsletters, we simply need to find the queue id's and then remove them:

cd /var/qmail/queue/mess
find . -exec grep -l "Newsletter" {} /dev/null ; > /tmp/these
cd /var/qmail/queue
for i in `cat /tmp/these`
do
find . -name `basename $i` -exec rm {} ;
done

Restart qmail (svc -u /service/qmail) and smtpfront ( svc -u /service/smtpfront-qmail) it's done.

No more newsletter

Checking /var/log/smtpfront-qmail/current the next day showed that the constant attempts to send the newsletter stopped right after it was first rejected. To see dates in qmail log files, use "tai64nlocal":

tail /var/log/smtpfromt-qmail/current | tai64nlocal

It was then safe to remove the "badmailfrom" file and restart smtpfront-qmail a final time.

Originally appeared at APLawrence.com

Please read this disclaimer
Copyright and Reprint Info

Receive Our Daily Email of Breaking eBusiness News


About the Author:
A.P. Lawrence provides SCO Unix and Linux consulting services http://www.pcunix.com

WebProNews RSS Feed

More Articles

Contact WebProNews
Advertisement





TOP NEWS

Targeted Information for Business
WebProNews is part of the iEntry network

Internet Business: Marketing: Small Business:
WebProNews MarketingNewz SmallBusinessNewz
WebProWorld AdvertisingDay PromoteNews
EcommNewz SalesNewz EntrepreneurNewz

Software: Search Engines: Web Design:
WebMasterFree Jayde B2B DesignNewz
NetworkingFiles SearchZA FlashNewz
SecurityConfig SearchNewz WebSiteNotes

Developer: IT Management: Security:
DevWebPro ITManagement SecurityProNews
DevNewz SysAdminNews SecurityConfig
TheDevWeb NetworkingFiles NetworkNewz

The iEntry Network consists of over 100 web publications reaching millions of Internet Professionals. Contact us to advertise.
eBUSINESS RESOURCES






 Advertise | Contact Us | Corporate | Newsletter | Sitemap | Submit an Article | News Feeds
 WebProNews is an iEntry, Inc. ® publication - $line) { echo $line ; } ?> All Rights Reserved
About WebProNews
WebProNews is the number one source for eBusiness News. Over 5 million eBusiness professionals read WebProNews and other iEntry business and tech publications.

WebProNews provides real-time coverage of internet business.

Free Email Newsletters:
WebProNews SearchNewz
WebProWorld DevWebPro
Marketing SecurityNews
Plus over 100 other newsletters!

Send me relevant info on products and services.


WebProWorld
Ten most recent posts.

NetworkingFiles
Featured Software

WebProNews in the News
View all recent mentions of WebProNews from around the world!

Recent Articles On ...
Google eBusiness
Yahoo Ask Jeeves
MSN Blogs
Search Engines Blogging
Affiliate Programs Marketing
eCommerce Advertising
eBay Sun Microsystems
AOL Adsense
Microsoft Adwords
Oracle IBM
Amazon Apple
SEM Mac
SEO iPod
Adsense XBox
PR Adobe



iEntry.com WebProWorld RSS Feed WebProWorld Contact WebProNews Print Version Email a friend Bookmark us