aboutsummaryrefslogtreecommitdiffstats
path: root/dist-tools/html2txt
blob: d2ae59a1d99134aa975a336e59542b2dc208bea1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#! /bin/sh

# html2txt.sh - A program to convert fetchmail's HTML documentation to text
# Copyright (C) 2004  Matthias Andree

# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

# --------------------------------------------------------------------------

# Usage: html2txt.sh INPUT.html

# --------------------------------------------------------------------------

# Abort on error
set -e

# Parse arguments
if [ $# -ne 1 ] ; then
    echo >&2 "Usage: `basename $0 || echo $0` input.html"
    exit 1
fi

# Pull in variables
inp="$1"
tmp="html2txt.$$.html"

# now preprocess
trap "rm -f \"$tmp\"" 0 1 2 3 15
${AWK:=awk} '/<table .*summary="Canned/ { i=1; }
     /<\/table>/ { i=0; }
     { if (i == 0) print $0; }' "$inp" >"$tmp"

# and go!
echo "  (This file was generated from $inp)"
lynx -dump -nolist "$tmp"
rm -f "$tmp"
trap "" 0 1 2 3 15
/span>table border=1 width=80% align=center summary="Server list"> <tr> <td><strong>Protocol &amp; Version:</strong></td> <td><strong>Special Options:</strong></td> </tr> <tr><td>IMAP: CommuniGate IMAP server</td><td>IMAPrev1 STARTTLS AUTH=CRAM-MD5 AUTH=DIGEST-MD5</td> <tr><td>POP3: CommuniGate POP3 server</td><td>CAPA LAST APOP CRAM-MD5</td> <tr><td>POP3: IntraStore POP3 mail server</td><td>!CAPA LAST</td> <tr><td>APOP: IntraStore POP3 mail server</td><td>!CAPA LAST APOP</td> <tr><td>IMAP: IntraStore IMAP mail server</td><td>IMAPrev1 IDLE AUTH=CRAM-MD5 AUTH=SKEY AUTH=ANONYMOUS</td> <tr><td>POP3: Eudora EIMS</td><td>CAPA LAST APOP SASL CRAM-MD5 NTLM</td> <tr><td>POP3: gmx.de pop server</td><td>!CAPA UIDL</td> <tr><td>IMAP: IMail IMAP server</td><td>IMAP4rev1 AUTH=CRAM-MD5</td> <tr><td>IMAP: Microsoft Exchange</td><td>IDLE AUTH=NTLM</td> <tr><td>POP3: qpopper 3.1.2 (Eudora) patched with mysql</td><td>CAPA UIDL</td> <tr><td>IMAP: Courier IMAP</td><td>IMAP4rev1</td> <tr><td>POP3: Courier POP3</td><td>CAPA UIDL</td> <tr><td>APOP: Qpopper using APOP</td><td>!CAPA</td> <tr><td>IMAP: UW IMAP</td><td>IMAPrev1</td> <tr><td>IMAP: Courier IMAP</td><td>IMAP4rev1</td> <tr><td>POP3: Qpopper 4.0.5</td><td>CAPA UIDL</td> </tr></table> <p>If you control a post-office server that is not one of the types listed here, please consider lending me a test account. Note that I do <em>not</em> need shell access, just the permissions to send mail to a mailbox the server looks at and to fetch mail off of it.</p> <p>I'd like to have weird things like a POP2 server on here. Also more closed-source servers because they tend to be broken in odd ways. These are the real robustness tests.</p> <hr /> <table width="100%" cellpadding=0 summary="Canned page header"><tr> <td width="30%">Back to <a href="/~esr">Eric's Home Page</a> <td width="30%" align=center>Up to <a href="/~esr/sitemap.html">Site Map</a> <td width="30%" align=right>Mon Jan 12 15:52:14 EST 2004 </tr></table> <br clear="left" /> <ADDRESS>Eric S. Raymond <A HREF="mailto:esr@thyrsus.com">&lt;esr@thyrsus.com&gt;</A></ADDRESS> </BODY> </HTML>