From 9f1bf39868c71a87bb7d7649698ccebac7a40cdd Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Mon, 27 Nov 2000 03:11:52 +0000 Subject: [PATCH] 5-6-0bis fix for smtpname. svn path=/trunk/; revision=2989 --- NEWS | 3 ++- conf.c | 1 + fetchmail.c | 4 ++++ fetchmailconf | 7 +++++-- rcfile_l.l | 1 + rcfile_y.y | 3 ++- 6 files changed, 15 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index c7258fc7..d6162557 100644 --- a/NEWS +++ b/NEWS @@ -3,11 +3,12 @@ (The `lines' figures total .c, .h, .l, and .y files under version control.) ------------------------------------------------------------------------------ -fetchmail-5.6.0 (Sun Nov 26 13:20:45 EST 2000), 19625 lines: +fetchmail-5.6.0 (Sun Nov 26 22:11:09 EST 2000), 19625 lines: * Updated FAQ on IPv6 operation. * Enabled showdots to work from the command line. * Fixed a bug in fetchmailconf's handling of the `principal' option. +* smtpname processing fixed. There are 288 people on fetchmail-friends and 575 on fetchmail-announce. diff --git a/conf.c b/conf.c index 9b7571c7..6c17b253 100644 --- a/conf.c +++ b/conf.c @@ -360,6 +360,7 @@ void dump_config(struct runctl *runp, struct query *querylist) stringdump("properties", ctl->properties); listdump("smtphunt", ctl->smtphunt); stringdump("smtpaddress", ctl->smtpaddress); + stringdump("smtpname", ctl->smtpname); indent('\0'); fprintf(stdout, "'antispam':'"); diff --git a/fetchmail.c b/fetchmail.c index 33bed685..8f270c0c 100644 --- a/fetchmail.c +++ b/fetchmail.c @@ -907,6 +907,7 @@ static int load_params(int argc, char **argv, int optind) memset(&def_opts, '\0', sizeof(struct query)); def_opts.smtp_socket = -1; def_opts.smtpaddress = (char *)0; + def_opts.smtpname = (char *)0; #define ANTISPAM(n) save_str(&def_opts.antispam, STRING_DUMMY, 0)->val.status.num = (n) ANTISPAM(571); /* sendmail */ ANTISPAM(550); /* old exim */ @@ -1687,6 +1688,9 @@ static void dump_params (struct runctl *runp, if (ctl->smtpaddress) printf(_(" Host part of MAIL FROM line will be %s\n"), ctl->smtpaddress); + if (ctl->smtpname) + printf(_(" Address to be put in RCPT TO lines shipped to SMTP will be %s\n"), + ctl->smtpname); } if (ctl->server.protocol != P_ETRN) { diff --git a/fetchmailconf b/fetchmailconf index 43dbb164..75a00fca 100755 --- a/fetchmailconf +++ b/fetchmailconf @@ -4,7 +4,7 @@ # by Eric S. Raymond, . # Requires Python with Tkinter, and the following OS-dependent services: # posix, posixpath, socket -version = "1.31" +version = "1.32" from Tkinter import * from Dialog import * @@ -235,6 +235,7 @@ class User: ('password', 'String'), # Leave out smtphunt ('smtpaddress', 'String'), + ('smtpname', 'String'), ('preconnect', 'String'), ('postconnect', 'String'), ('mda', 'String'), @@ -340,7 +341,7 @@ class User: for x in self.mailboxes: res = res + " " + x res = res + "\n" - for fld in ('smtpaddress', 'preconnect', 'postconnect', 'mda', 'bsmtp', 'properties'): + for fld in ('smtpaddress', 'smtpname', 'preconnect', 'postconnect', 'mda', 'bsmtp', 'properties'): if getattr(self, fld): res = res + " %s %s\n" % (fld, `getattr(self, fld)`) if self.lmtp != UserDefaults.lmtp: @@ -1498,6 +1499,8 @@ class UserEdit(Frame, MyWidget): self.user.smtphunt, None, None, targwin, None) LabeledEntry(targwin, 'Append to MAIL FROM line:', self.smtpaddress, '26').pack(side=TOP, fill=X) + LabeledEntry(targwin, 'Set RCPT To address:', + self.smtpname, '26').pack(side=TOP, fill=X) LabeledEntry(targwin, 'Connection setup command:', self.preconnect, '26').pack(side=TOP, fill=X) LabeledEntry(targwin, 'Connection wrapup command:', diff --git a/rcfile_l.l b/rcfile_l.l index d729e3ed..e35ecd92 100644 --- a/rcfile_l.l +++ b/rcfile_l.l @@ -97,6 +97,7 @@ pass(word)? {SETSTATE(NAME); return PASSWORD; } folder(s)? { return FOLDER; } smtp(host)? { return SMTPHOST; } smtpaddress { return SMTPADDRESS; } +smtpname { return SMTPNAME; } antispam { return SPAMRESPONSE; } mda { return MDA; } bsmtp { return BSMTP; } diff --git a/rcfile_y.y b/rcfile_y.y index 7308e3ff..c912d4f5 100644 --- a/rcfile_y.y +++ b/rcfile_y.y @@ -61,7 +61,7 @@ extern char * yytext; %token DEFAULTS POLL SKIP VIA AKA LOCALDOMAINS PROTOCOL %token PREAUTHENTICATE TIMEOUT KPOP SDPS KERBEROS4 KERBEROS5 KERBEROS SSH %token ENVELOPE QVIRTUAL USERNAME PASSWORD FOLDER SMTPHOST MDA BSMTP LMTP -%token SMTPADDRESS SPAMRESPONSE PRECONNECT POSTCONNECT LIMIT WARNINGS +%token SMTPADDRESS SMTPNAME SPAMRESPONSE PRECONNECT POSTCONNECT LIMIT WARNINGS %token NETSEC INTERFACE MONITOR PLUGIN PLUGOUT %token IS HERE THERE TO MAP WILDCARD %token BATCHLIMIT FETCHLIMIT EXPUNGE PROPERTIES @@ -312,6 +312,7 @@ user_option : TO localnames HERE | FOLDER folder_list | SMTPHOST smtp_list | SMTPADDRESS STRING {current.smtpaddress = xstrdup($2);} + | SMTPNAME STRING {current.smtpname = xstrdup($2);} | SPAMRESPONSE num_list | MDA STRING {current.mda = xstrdup($2);} | BSMTP STRING {current.bsmtp = xstrdup($2);} -- 2.43.2