munged file via email (long)

munged file via email (long)

Post by jim barch » Sat, 03 Apr 1999 04:00:00



Hello All!

I picked this group to post to because it's possible the problem is
caused by any number (or combination) of reasons. Could be shell, zip,
sendmail, cat, dunno.

I distribute the FidoNet FidoNews email via Majordomo-driven lists.
The distribution is kicked off by this procmail recipe:

:0: bc
*^Subject:.*PASSWORD
| /home/fidonews/bin/newsnooze

That appears to work fine.

Newsnooze is 'probably' not a pretty and elegant script, it was one of
the first 'not trivial' scripts I wrote. I don't even care if it's
ugly, just that it works, so please don't comment on aesthetics unless
it really has to do with functionality. :)

================

#!/bin/sh

# create a new subdir and go there

cd ~/snoozework
mkdir $$
cd $$

# write what procmailrc passed to us

cat > anysnooze

# determine encoding of incoming file and decode it

grep -i "^Content-Transfer-Encoding: base64" anysnooze && munpack
anysnooze
grep -i "^begin.*660.*fnews....zip" anysnooze &&  uudecode anysnooze

# unzip incoming file, make sure everything is lower case

perl /pl/upper2lower.pl
unzip *.zip
perl /pl/upper2lower.pl

# extract filenames

ls | grep "fnews....zip$" > ZFNAME
ls | grep "fido.....nws$" > TFNAME

# create distributable files

uuencode    `cat ZFNAME` `cat ZFNAME` > tmptmpuue
uuencode -m `cat ZFNAME` `cat ZFNAME` > tmptmp64

# post files to mailing lists (whoops, sorry for the wrapping)


-s`cat TFNAME`


-s`cat ZFNAME`

cat ../../bin/pword tmptmp64            | mail

# copy to ftp area

cp *.nws /home/ftp/pub/fnews-nws/1999/.
chown root.ftp /home/ftp/pub/fnews-nws/1999/*
chmod 644 /home/ftp/pub/fnews-nws/1999/*

================

The problem I'm having is very slight and very unpredictable file
munging. When I first built this script it worked fine, in fact
perfect. I gave someone else password access to post, and the -text-
version of the distribution became munged, here's an example:

========
     Any programme receiving a packet with a password
differing from the
ssword set up between the system having created the packet and
the
========

(Again, sorry for the wrapping.) The above should look like:

========
     Any programme receiving a packet with a password
differing from the
     password set up between the system having created the
packet and the
========

It's hard to see with this wrapping but that line is losing 5 ascii
space and the 'pa'. The amount of text -varies-, sometimes half the
line is gone.

The munging repeats through the file at roughly 100 line intervals
(about every 8k if that's a clue.)

............

OK, so that problem went on for a while. I tinkered with the script
but had no real results. On -rare- occasion the file would go through
-perfectly- clean.

But lately there's a -new- problem. The base64 encoded file is
suffering some trimmed lines, here's an example.

This is the encoded file as it resides in $$:

========
nyy5JtefhA1pM3aY6IBSL7jZgCPPqIVv8s9ngTJ3tvyqv7SaVbjM4fh8uyUB
Scrb4H08GDocdteVCgnAX1IGC1QAC6pDUeoUpqBJGhCUV5guSYOxHEyjAZmu
0aESIbUiakH9iLSuWuQCmc9XfcGKAIHY0WRhK4Dmkoa8EUGYilJe9RUGkKuy
========

And here's what received email looks like:

========
nyy5JtefhA1pM3aY6IBSL7jZgCPPqIVv8s9ngTJ3tvyqv7SaVbjM4fh8uyUB
YOxHEyjAZmu
0aESIbUiakH9iLSuWuQCmc9XfcGKAIHY0WRhK4Dmkoa8EUGYilJe9RUGkKuy
========

That one lost most of the leading part of the line; it will obviously
fail decoding.

The munging occurs anywhere from every 50 to 150 lines, much less
'regular' than the text munging.

.....................

Other possibly helpful clues:

The original *.nws, tmptmp64, and tmptmpuue files as they reside in $$
are -perfect-, there is -never- the slightest problem with them.

The uuencoded version has -never- suffered from this glitch.

When I send to the script from Pegasus/Win16 is 'very often' does not
glitch. (But not often enough to be reliable.

The 'copy to ftp area' lines also appear to not work; files never show
up there. (This is less of a concern for me unless it is a symptom of
other problems.)

.................

So, the questions are:

Are there any obvious errors in the above recipe or script?

What other debugging code could I add to script or recipe to help look
at the problem more closely?

................

Thanks for listening. Have a :) day!

jb

--
jim barchuk


 
 
 

1. KNode: reply by email with munged identity?

My ISP will not relay email if the From: address is not resolvable (sensible
anti-spam measure). If I reply-by-email using KNode, then the From address

even if I set an unmunged global identity different to the one for the news
server.

Is there a way to be able to select the From email address with KNode (like
there is with KMail) so that I can successfully reply by email?

--
Cheers,
-nick

2. pcmcia and latest kernel?

3. cancels in 'big8 ' for 'munged' email addresses?

4. Interesting Installation Problem

5. extract email from text file and send an email to the email address

6. Remote Login Problem.

7. Sending a file via email from unix to Microsoft Outlook 2000

8. D-Link dwl 713p and Linux?

9. Linux help files via e-mail no-more!

10. Hown can I send a file via e-mail from the commnad prompt?

11. Sending a file via email to Microsoft Outlook 2000

12. Sending binary file via email from shell

13. Automatically save file via e-mail!!