diff options
-rw-r--r-- | CHANGES | 8 | ||||
-rw-r--r-- | makelynx.bat | 3 | ||||
-rw-r--r-- | src/LYMail.c | 75 | ||||
-rw-r--r-- | src/LYMail.h | 6 | ||||
-rw-r--r-- | src/LYMain.c | 6 |
5 files changed, 63 insertions, 35 deletions
diff --git a/CHANGES b/CHANGES index c94833e6..4de592e6 100644 --- a/CHANGES +++ b/CHANGES @@ -1,9 +1,13 @@ --- $LynxId: CHANGES,v 1.546 2011/05/28 13:13:56 tom Exp $ +-- $LynxId: CHANGES,v 1.547 2011/06/04 12:39:52 tom Exp $ =============================================================================== Changes since Lynx 2.8 release =============================================================================== -2011-05-28 (2.8.8dev.9) +2011-06-04 (2.8.8dev.9) +* update command-line syntax for the blat mailer, to work with blat 2.6.2 -TD +* change default in makelynx.bat to assume blat rather than blatj, because + the latter does not provide a way to authenticate user/password on a mail + server -TD * change #define's for addrlist-page and alt-bindings to reflect their non-experimental status -TD * change default for --enable-addrlist-page configure option to enabled -TD diff --git a/makelynx.bat b/makelynx.bat index b71a05a3..9c1d0ee7 100644 --- a/makelynx.bat +++ b/makelynx.bat @@ -1,5 +1,5 @@ @echo off -@rem $LynxId: makelynx.bat,v 1.15 2011/05/28 13:07:55 tom Exp $ +@rem $LynxId: makelynx.bat,v 1.16 2011/06/04 00:59:22 tom Exp $ @echo Windows/Dos batch makefile for MingW32 and lynx.exe @echo Remember to precede this by "command /E:8192" for Windows prior to @echo W2000 and "cmd.exe /E:8192" for subsequent Window versions and to @@ -61,7 +61,6 @@ echo #define HAVE_STRERROR 1 >> lynx_cfg.h echo #define LYNX_CFG_FILE "./lynx.cfg" >> lynx_cfg.h echo #define LY_MAXPATH 1024 >> lynx_cfg.h echo #define USE_BLAT_MAILER 1 >> lynx_cfg.h -echo #define USE_ALT_BLAT_MAILER 1 >> lynx_cfg.h echo #define VC 2.14FM >> lynx_cfg.h echo #define _WIN_CC 1 >> lynx_cfg.h rem echo #define USE_SCROLLBAR 1 >> lynx_cfg.h diff --git a/src/LYMail.c b/src/LYMail.c index 42666cef..dc0d5584 100644 --- a/src/LYMail.c +++ b/src/LYMail.c @@ -1,5 +1,5 @@ /* - * $LynxId: LYMail.c,v 1.87 2011/05/27 23:14:46 tom Exp $ + * $LynxId: LYMail.c,v 1.88 2011/06/04 13:32:51 tom Exp $ */ #include <HTUtils.h> #include <HTParse.h> @@ -303,20 +303,51 @@ static void show_addresses(char *addresses) #if USE_BLAT_MAILER /* -syntax: + * blat's options-file parser (see makeargv.cpp) treats backslash and double + * quote characters specially. lynx doesn't. Do a conversion as we write the + * option. + */ +static void blat_option(FILE *fp, const char *option, const char *value) +{ + if (non_empty(value)) { + const char *special = "\\\""; + size_t length = strlen(value); + size_t reject = strcspn(value, special); + + fputs(option, fp); + fputc(' ', fp); + if (length == reject) { + fputs(value, fp); + } else { + fputc('"', fp); + while (*value != '\0') { + if (strchr(special, *value)) { + fputc('\\', fp); + } + fputc(UCH(*value), fp); + ++value; + } + fputc('"', fp); + } + fputc('\n', fp); + } +} + +/* +syntax for blat 2.6.2: Blat <filename> -t <recipient> [optional switches (see below)] -<filename> : file with the message body --t <recipient>: recipient list (comma separated) --s <subj> : subject line --f <sender> : overrides the default sender address (must be known to server) --i <addr> : a 'From:' address, not necessarily known to the SMTP server. --c <recipient>: carbon copy recipient list (comma separated) --b <recipient>: blind carbon copy recipient list (comma separated) --h : displays this help. --mime : MIME Quoted-Printable Content-Transfer-Encoding. --q : supresses *all* output. --server <addr>: overrides the default SMTP server to be used. +-bodyF <filename> : file with the message body +-t <recipient> : recipient list (comma separated) +-s <subj> : subject line +-f <sender> : overrides the default sender address (must be known to server) +-i <addr> : a 'From:' address, not necessarily known to the SMTP server. +-c <recipient> : carbon copy recipient list (comma separated) +-b <recipient> : blind carbon copy recipient list (comma separated) +-help : displays the help message. +-mime : MIME Quoted-Printable Content-Transfer-Encoding. +-q : supresses *all* output. +-server <addr> : overrides the default SMTP server to be used. */ @@ -344,7 +375,7 @@ static char *blat_cmd(char *filename, } else { - const char *format = "%s @%s"; + const char *format = "%s -of %s"; char bl_cmd_file[LY_MAXPATH]; FILE *fp; @@ -364,17 +395,11 @@ static char *blat_cmd(char *filename, HTAddParam(&b_cmd, format, 1, BLAT_MAIL); ConvertToWin32Path(filename, dosname); - fprintf(fp, "%s\n", dosname); - - fprintf(fp, "-t\n%s\n", address); - if (subject) - fprintf(fp, "-s\n%s\n", subject); - if (non_empty(mail_addr)) { - fprintf(fp, "-f\n%s\n", mail_addr); - } - if (non_empty(ccaddr)) { - fprintf(fp, "-c\n%s\n", ccaddr); - } + blat_option(fp, "-bodyF", dosname); + blat_option(fp, "-t", address); + blat_option(fp, "-s", subject); + blat_option(fp, "-f", mail_addr); + blat_option(fp, "-c", ccaddr); LYCloseOutput(fp); ConvertToWin32Path(bl_cmd_file, dosname); diff --git a/src/LYMail.h b/src/LYMail.h index fb1df6a1..f75f686b 100644 --- a/src/LYMail.h +++ b/src/LYMail.h @@ -1,5 +1,5 @@ /* - * $LynxId: LYMail.h,v 1.16 2011/05/27 23:18:26 tom Exp $ + * $LynxId: LYMail.h,v 1.17 2011/06/02 10:37:23 tom Exp $ */ #ifndef LYMAIL_H #define LYMAIL_H @@ -17,8 +17,8 @@ extern "C" { #define USE_BLAT_MAILER 1 #endif -#ifndef USE_ALTBLAT_MAILER -#define USE_ALTBLAT_MAILER 0 +#ifndef USE_ALT_BLAT_MAILER +#define USE_ALT_BLAT_MAILER 0 #endif #ifndef USE_BLAT_MAILER diff --git a/src/LYMain.c b/src/LYMain.c index 19c93109..8f869295 100644 --- a/src/LYMain.c +++ b/src/LYMain.c @@ -1,5 +1,5 @@ /* - * $LynxId: LYMain.c,v 1.229 2011/05/27 22:55:56 tom Exp $ + * $LynxId: LYMain.c,v 1.230 2011/06/02 10:37:33 tom Exp $ */ #include <HTUtils.h> #include <HTTP.h> @@ -351,9 +351,9 @@ BOOLEAN no_table_center = FALSE; /* 1998/10/09 (Fri) 15:12:49 */ #if USE_BLAT_MAILER BOOLEAN mail_is_blat = TRUE; -BOOLEAN mail_is_altblat = USE_ALTBLAT_MAILER; +BOOLEAN mail_is_altblat = USE_ALT_BLAT_MAILER; -#if USE_ALTBLAT_MAILER +#if USE_ALT_BLAT_MAILER #define THIS_BLAT_MAIL ALTBLAT_MAIL #define THAT_BLAT_MAIL BLAT_MAIL #else |