From: Kern Sibbald Date: Sat, 19 May 2007 08:28:14 +0000 (+0000) Subject: kes Cleanup incorrect email addresses in bsmtp. X-Git-Tag: Release-7.0.0~6311 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7f6a8863e8163f55330a0075d709fb06ac692f8d;p=bacula%2Fbacula kes Cleanup incorrect email addresses in bsmtp. kes Make bat display initial messages rather than discard them. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4831 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/kernstodo b/bacula/kernstodo index 1423e0c4bc..a4d1f74bd9 100644 --- a/bacula/kernstodo +++ b/bacula/kernstodo @@ -49,8 +49,10 @@ Professional Needs: - Synthetic Full, Diff, Inc (Virtual, Reconstructed) - SD to SD - Modules for Databases, Exchange, ... +- Novell NSS backup http://www.novell.com/coolsolutions/tools/18952.html Priority: +- Unicode input http://en.wikipedia.org/wiki/Byte_Order_Mark - How does restore JobId=nnn work? (Dirk) - What does: restore select fileset="TestSet" client="workplay-fd" pool="Default" > storage="File2" before="2007-02-05 23:05:04" do? (Dirk) diff --git a/bacula/src/qt-console/console/console.cpp b/bacula/src/qt-console/console/console.cpp index 04f50c8331..d7ebbef4ec 100644 --- a/bacula/src/qt-console/console/console.cpp +++ b/bacula/src/qt-console/console/console.cpp @@ -158,7 +158,7 @@ void Console::connect() QObject::connect(m_notifier, SIGNAL(activated(int)), this, SLOT(read_dir(int))); write(".api 1"); - discardToPrompt(); + displayToPrompt(); beginNewCommand(); dir_cmd(".jobs", job_list); diff --git a/bacula/src/qt-console/mainwin.cpp b/bacula/src/qt-console/mainwin.cpp index ec64b6042b..561bd75f19 100644 --- a/bacula/src/qt-console/mainwin.cpp +++ b/bacula/src/qt-console/mainwin.cpp @@ -67,7 +67,7 @@ MainWin::MainWin(QWidget *parent) : QMainWindow(parent) readSettings(); - foreach(Console *console, m_consoleHash){ + foreach(Console *console, m_consoleHash) { console->connect(); } m_currentConsole = (Console*)getFromHash(m_firstItem); diff --git a/bacula/src/tools/bsmtp.c b/bacula/src/tools/bsmtp.c index 1397ff4d7f..d0b6066e68 100644 --- a/bacula/src/tools/bsmtp.c +++ b/bacula/src/tools/bsmtp.c @@ -70,13 +70,37 @@ static int mailport = 25; static char my_hostname[MAXSTRING]; static bool content_utf8 = false; +/* + * Take input that may have names and other stuff and strip + * it down to the mail box address ... i.e. what is enclosed + * in < >. Otherwise add < >. + */ +static char *cleanup_addr(char *addr, char *buf, int buf_len) +{ + char *p, *q; + + if ((p = strchr(from_addr, '<')) == NULL) { + snprintf(buf, buf_len, "<%s>", addr); + } else { + /* Copy */ + for (q=buf; *p && *p!='>'; ) { + *q++ = *p++; + } + if (*p) { + *q++ = *p; + } + *q = 0; + } + Dmsg2(100, "cleanup in=%s out=%s\n", addr, buf); + return buf; +} /* * examine message from server */ static void get_response(void) { - char buf[MAXSTRING]; + char buf[1000]; Dmsg0(50, "Calling fgets on read socket rfp.\n"); buf[3] = 0; @@ -184,7 +208,7 @@ __MINGW_IMPORT long _dstbias; */ int main (int argc, char *argv[]) { - char buf[MAXSTRING]; + char buf[1000]; struct sockaddr_in sin; struct hostent *hp; int i, ch; @@ -405,27 +429,15 @@ hp: */ get_response(); /* banner */ chat("helo %s\r\n", my_hostname); - if (strchr(from_addr, '<') == NULL) { - chat("mail from:<%s>\r\n", from_addr); - } else { - chat("mail from:%s\r\n", from_addr); - } - + chat("mail from:%s\r\n", cleanup_addr(from_addr, buf, sizeof(buf))); + for (i = 0; i < argc; i++) { Dmsg1(20, "rcpt to: %s\n", argv[i]); - if (strchr(argv[i], '<') == NULL) { - chat("rcpt to:<%s>\r\n", argv[i]); - } else { - chat("rcpt to:%s\r\n", argv[i]); - } + chat("rcpt to:%s\r\n", cleanup_addr(argv[i], buf, sizeof(buf))); } if (cc_addr) { - if (strchr(cc_addr, '<') == NULL) { - chat("rcpt to:<%s>\r\n", cc_addr); - } else { - chat("rcpt to:%s\r\n", cc_addr); - } + chat("rcpt to:%s\r\n", cleanup_addr(cc_addr, buf, sizeof(buf))); } Dmsg0(20, "Data\n"); chat("data\r\n"); diff --git a/bacula/src/version.h b/bacula/src/version.h index 7189096cd9..7dc9356f23 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -3,9 +3,9 @@ */ #undef VERSION -#define VERSION "2.1.8" -#define BDATE "16 May 2007" -#define LSMDATE "16May07" +#define VERSION "2.1.10" +#define BDATE "18 May 2007" +#define LSMDATE "18May07" #define PROG_COPYRIGHT "Copyright (C) %d-2007 Free Software Foundation Europe e.V.\n" #define BYEAR "2007" /* year for copyright messages in progs */ diff --git a/bacula/technotes-2.1 b/bacula/technotes-2.1 index 6c921cf06b..53dd863cbb 100644 --- a/bacula/technotes-2.1 +++ b/bacula/technotes-2.1 @@ -1,6 +1,9 @@ Technical notes on version 2.1 General: +18May07 +kes Cleanup incorrect email addresses in bsmtp. +kes Make bat display initial messages rather than discard them. 16May07 kes First cut of adding .mod to the run command. kes Implement auto display of messages in bat.