Article View: pl.comp.mail
Article #352Patch do listproca
From: Piotr Kucharski
Date: Fri, 27 Jun 1997 22:10
Date: Fri, 27 Jun 1997 22:10
74 lines
3270 bytes
3270 bytes
Hej
Zauważyłem ostatnio dość przykrą przypadłość ListProca 6.0c. Mianowicie
przy wysyłaniu na listę wiadomości MIME z takiego nagłówka:
Content-Type: multipart/report; report-type=delivery-status;
boundary="TAB26997.867087254/hermes.sgh.waw.pl"
wycinał linijkę z "boundary". Wstawienie boundary w różnych wariantach
(<TAB>boundary, boundary, \tboundary i inne) do config w opcji 'header'
nic nie pomagało. Dodatkowo okazało się, po szybkim hacku, że nawet jak
zostawi linijkę z "boundary", to odwraca kolejność nagłówków, tak że
boundary pojawia się przed Content-type.
No dobrze, koniec tego wodolejstwa :-) Oto patch:
----- cut -----
diff -r -u src.org/list.c src/list.c
--- src.org/list.c Fri Jun 27 22:32:39 1997
+++ src/list.c Fri Jun 27 22:11:00 1997
@@ -1171,6 +1171,7 @@
long int lines_to_skip = 0; /* skip lines of incoming message */
long int sig_mask;
MATCHED_PREC_HEADER *out_header = matched_prec_header;
+ MATCHED_PREC_HEADER *last_header = NULL;
PRECIOUS_HEADER *pheader;
int request_found, i;
@@ -1274,7 +1275,7 @@
else { /* Check if precious header line */
pheader = sys.lists[listid].header;
while (pheader) {
- if (!strncmp (line, pheader->line, strlen (pheader->line))) {
+ if (!strncasecmp (line, pheader->line, strlen (pheader->line))) {
if (! (out_header =
(MATCHED_PREC_HEADER *) malloc (sizeof (MATCHED_PREC_HEADER))))
report_progress (report, "\nprocess_message(): malloc() failed",
@@ -1286,8 +1287,12 @@
TRUE),
gexit (11);
strcpy (out_header->line, line);
- out_header->next = matched_prec_header;
- matched_prec_header = out_header;
+ out_header->next = NULL;
+ if (!last_header)
+ matched_prec_header = out_header;
+ else
+ last_header->next = out_header;
+ last_header = out_header;
}
pheader = pheader->next;
}
diff -r -u src.org/misc.c src/misc.c
--- src.org/misc.c Fri Jun 27 22:32:41 1997
+++ src/misc.c Fri Jun 27 22:05:00 1997
@@ -586,7 +586,8 @@
sys->lists[id].header = NULL;
while (!feof (config) && strcmp (sys->arg, "}")) {
RESET (sys->arg);
- fscanf (config, "%s\n", sys->arg);
+ fgets (sys->arg, MAX_LINE, config);
+ sys->arg[strlen(sys->arg)-1]='\0';
if (sys->arg[0] == '#') {
fgets (sys->arg, MAX_LINE - 2, config);
continue;
----- cut -----
Dodatkowo strncasecmp załatwił sprawę podwójnego wpisywania headerów
w różnych wariantach (MIME-Version, Mime-Version).
Żeby patch zadziałał [:-)] to trzeba do headers dodać "<TAB>boundary".
pozdrawiam
-- P.
ps. podziękowania dla Marcina Cieślaka za pomoc :-)
Technical Details
Message-ID:
<5p1do7$1j4$1@dukat.sgh.waw.pl>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!pingwin.icm.edu.pl!news.icm.edu.pl!sgh.waw.pl!not-for-mailShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!pingwin.icm.edu.pl!news.icm.edu.pl!sgh.waw.pl!not-for-mail From: Piotr Kucharski <chopin@sgh.waw.pl> Newsgroups: pl.comp.mail Subject: Patch do listproca Date: 27 Jun 1997 22:10:15 GMT Organization: Szkola Glowna Handlowa w Warszawie Lines: 74 Message-ID: <5p1do7$1j4$1@dukat.sgh.waw.pl> NNTP-Posting-Host: jantar.sgh.waw.pl Mime-Version: 1.0 Keywords: listproc, patch, boundary X-Newsreader: TIN [UNIX 1.3 unoff BETA 970327; sun4m SunOS 5.5] Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit