From: <ke...@us...> - 2008-07-23 09:15:11
|
Revision: 7421 http://bacula.svn.sourceforge.net/bacula/?rev=7421&view=rev Author: kerns Date: 2008-07-23 09:15:20 +0000 (Wed, 23 Jul 2008) Log Message: ----------- Make some tweaks to bsmtp based on patch submitted in bug #1124. Modified Paths: -------------- trunk/bacula/src/tools/bsmtp.c trunk/bacula/technotes-2.5 Modified: trunk/bacula/src/tools/bsmtp.c =================================================================== --- trunk/bacula/src/tools/bsmtp.c 2008-07-23 08:25:20 UTC (rev 7420) +++ trunk/bacula/src/tools/bsmtp.c 2008-07-23 09:15:20 UTC (rev 7421) @@ -1,7 +1,7 @@ /* Bacula® - The Network Backup Solution - Copyright (C) 2001-2007 Free Software Foundation Europe e.V. + Copyright (C) 2001-2008 Free Software Foundation Europe e.V. The main author of Bacula is Kern Sibbald, with contributions from many others, a complete list can be found in the file AUTHORS. @@ -480,19 +480,19 @@ * we do. */ get_response(); /* banner */ - chat("helo %s\r\n", my_hostname); - chat("mail from:%s\r\n", cleanup_addr(from_addr, buf, sizeof(buf))); + chat("HELO %s\r\n", my_hostname); + 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]); - chat("rcpt to:%s\r\n", cleanup_addr(argv[i], buf, sizeof(buf))); + chat("RCPT TO:%s\r\n", cleanup_addr(argv[i], buf, sizeof(buf))); } if (cc_addr) { - chat("rcpt to:%s\r\n", cleanup_addr(cc_addr, buf, sizeof(buf))); + chat("RCPT TO:%s\r\n", cleanup_addr(cc_addr, buf, sizeof(buf))); } Dmsg0(20, "Data\n"); - chat("data\r\n"); + chat("DATA\r\n"); /* * Send message header @@ -565,28 +565,30 @@ while (fgets(buf, sizeof(buf), stdin)) { if (maxlines > 0 && ++lines > maxlines) { Dmsg1(20, "skip line because of maxlines limit: %lu\n", maxlines); + while (fgets(buf, sizeof(buf), stdin)) { + ++lines; + } break; } buf[sizeof(buf)-1] = '\0'; buf[strlen(buf)-1] = '\0'; - if (buf[0] == '.' && buf[1] == '\0') { /* quote lone dots */ - fputs("..\r\n", sfp); - } else { /* pass body through unchanged */ - fputs(buf, sfp); - fputs("\r\n", sfp); + if (buf[0] == '.') { /* add extra . see RFC 2821 4.5.2 */ + fputs(".", sfp); } + fputs(buf, sfp); + fputs("\r\n", sfp); } if (lines > maxlines) { Dmsg1(10, "hit maxlines limit: %lu\n", maxlines); - fprintf(sfp, "\r\n[maximum of %lu lines exceeded, skipped %lu lines of output]\r\n", maxlines, lines-maxlines); + fprintf(sfp, "\r\n\r\n[maximum of %lu lines exceeded, skipped %lu lines of output]\r\n", maxlines, lines-maxlines); } /* * Send SMTP quit command */ chat(".\r\n"); - chat("quit\r\n"); + chat("QUIT\r\n"); /* * Go away gracefully ... Modified: trunk/bacula/technotes-2.5 =================================================================== --- trunk/bacula/technotes-2.5 2008-07-23 08:25:20 UTC (rev 7420) +++ trunk/bacula/technotes-2.5 2008-07-23 09:15:20 UTC (rev 7421) @@ -33,6 +33,8 @@ General: 23Jul08 +kes Make some tweaks to bsmtp based on patch submitted in bug #1124. + This fixes bug #1124. kes Make the default bat restore Pool be Any. This fixes bug #1118. 22Jul08 kes Remove debug statement that crashes the SD at the end of This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |