From owner-freebsd-questions Wed Nov 17 17:27:55 1999 Delivered-To: freebsd-questions@freebsd.org Received: from athserv.otenet.gr (athserv.otenet.gr [195.170.0.1]) by hub.freebsd.org (Postfix) with ESMTP id 7F06114D02 for ; Wed, 17 Nov 1999 17:27:49 -0800 (PST) (envelope-from keramida@diogenis.ceid.upatras.gr) Received: from hades.hell.gr (patr530-a044.otenet.gr [195.167.115.44]) by athserv.otenet.gr (8.9.3/8.9.3) with SMTP id DAA05912 for ; Thu, 18 Nov 1999 03:27:45 +0200 (EET) Received: (qmail 393 invoked by uid 1001); 17 Nov 1999 15:22:45 -0000 To: james.wilde@telia.com Cc: freebsd-questions@freebsd.org Subject: Re: Corruption of file attachments passing late BSD relayers References: <015a01bf30e8$1c8298d0$8c0aa8c0@hk.tbv.se> From: Giorgos Keramidas Date: 17 Nov 1999 17:22:45 +0200 In-Reply-To: "James A Wilde"'s message of "Wed, 17 Nov 1999 11:40:03 +0100" Message-ID: <86r9hpw3ay.fsf@localhost.hell.gr> Lines: 129 X-Mailer: Gnus v5.6.45/XEmacs 21.1 - "20 Minutes to Nikko" Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hello James, At first, I would like to apologize for my lengthy posting. Now let us see what we can do for your problems :) > Problem description: > > My employer company's new mail system comprises a Microsoft Exchange server > version 5.5 SP2 protected by a FreeBSD UNIX version 2.2.5 firewall.. Your FreeBSD system is kind of old. Since on the www.freebsd.org pages I seem to have noticed that 2.2.8 was the first version of the base-system to qualify as Y2K safe, you might consider upgrading to a newer version. At least before Jan 1 2000 comes knocking on your door. > The internal clients use > the FreeBSD machine as their smtp server. > The system has run very > satisfactorily for about a year and a half. You are using FreeBSD as the server's OS. But what are you using as your smtp server or imap4 server software? > About three weeks ago a new smtp server was installed outside the firewall. > This runs FreeBSD UNIX version 3.1. What smtp server software are you using? Which version? > Almost immediately reports began to come in of corrupted file > attachments. Hitherto only Microsoft Word and Excel documents have > been examined since these were readily available. On a Windows platform there are lots of other binary formats you can use for testing how your attachments work. The executables .exe and .dll might be of some use, archives like .zip and/or .rar files was what I would use next, etc. etc. endless binary formats. > The new smtp server was at first assumed to be the cause and was taken > out of the system, whereupon the level of reports reduced drastically > but did not disappear altogether. Which means that the new server was not the real cause of the problem, but somehow helped in making things even worse. > Further investigation confirmed that the problem had not disappeared > with the removal of the smtp server. Mail passing in one direction > from an account with one local Internet service provider to our > company Exchange server could be relied upon to corrupt file > attachments provided the client program was configured for html > format. > Mail passing out from our Exchange server to the same account > was apparently not affected. When mail is sent from Exchange to the ISP server, the protocols involved are (correct me if I'm wrong): smtp smtp Exchange ------> FreeBSD ------> ISP's smtp server This means that the following programs work correctly (at least as they're expected to work): * Your Exchange smtp forwarder. * The smtp listener of your FreeBSD, and it's smtp forwarder (these are usually part of the same package). * The ISP's smtp listener. > Mail to and from accounts with two other major Internet service > providers passed without corruption of the file attachments. Assuming that you're using the same FreeBSD machine as above, the plan now would be something like: smtp FreeBSD <------ ISP's smtp server : : later on imap4 : Outlook <------- FreeBSD > File attachments to mail from our Exchange server back to our Exchange > server routed via the new smtp server were also corrupted in a > reproducible manner. The fact that your attachments are corrupted means that one of the programs involved in this type of connection does not work as expected. Let's see what programs are involved: * The ISP's smtp forwarder. * The FreeBSD's smtp listener. * The imap4 server on FreeBSD. You can check if mail reaches the FreeBSD machine without being corrupted by your ISP's smtp forwarder or the FreeBSD listener, by the following simple process. Install some mail user agent on the FreeBSD machine; well known such programs include Pine, Mutt, elm, etc. Then (after making sure that imap4 server is not running) copy a mailbox that contains some attachments to /tmp and restart imap4 server, so as not to hinder the users trying to access their mail through imap4. Then open the mailbox with a mail user agent in FreeBSD, and see if you can extract the attached documents. Check with a non-corrupted copy of the documents to see if you managed to extract them correctly. This can be as simple as FTP'ing a copy of the documents, and using cmp(1) as in: % cmp good.doc attached.doc ; echo $? if that prints zero (0), then the attached document is fine. If this works and you find out that the attachment has reached the BSD machine through your ISP's smtp forwarder without corruption, then the breaking of the data happens on the next stage, quite possibly the imap4 server process. If you find that this is true, then check with your imap4 server's vendor for newer versions or bugs with the version that you have installed on your BSD machine. On the other hand, if you discover that on the BSD machine the attachments arrive broken, you might find useful a mail transfer agent that is 8-bit clean (like Sendmail's latest versions, or qmail, or postfix, etc). Hoping that all this will prove helpful somehow... Regards. -- Giorgos Keramidas, "What we have to learn to do, we learn by doing." [Aristotle] To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message