/*
Derived from a SMTPclient:
+ ======== Original copyrights ==========
+
SMTPclient -- simple SMTP client
- Copyright (C) 1997 Ralf S. Engelschall, All Rights Reserved.
- rse@engelschall.com
- www.engelschall.com
+ Copyright (c) 1997 Ralf S. Engelschall, All rights reserved.
+
+ This program is free software; it may be redistributed and/or modified
+ only under the terms of either the Artistic License or the GNU General
+ Public License, which may be found in the SMTP source distribution.
+ Look at the file COPYING.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ ======================================================================
+
+ smtpclient_main.c -- program source
+
+ Based on smtp.c as of August 11, 1995 from
+ W.Z. Venema,
+ Eindhoven University of Technology,
+ Department of Mathematics and Computer Science,
+ Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands.
+
+ =========
+
Kern Sibbald, July 2001
+ Note, the original W.Z. Venema smtp.c had no license and no
+ copyright. See:
+ http://archives.neohapsis.com/archives/postfix/2000-05/1520.html
+
+
Version $Id$
*/
{
char *p, *q;
- if ((p = strchr(from_addr, '<')) == NULL) {
+ if ((p = strchr(addr, '<')) == NULL) {
snprintf(buf, buf_len, "<%s>", addr);
} else {
/* Copy <addr> */
"Usage: %s [-f from] [-h mailhost] [-s subject] [-c copy] [recipient ...]\n"
" -8 set charset utf-8\n"
" -c set the Cc: field\n"
-" -dnn set debug level to nn\n"
+" -d <nn> set debug level to <nn>\n"
+" -dt print timestamp in debug output\n"
" -f set the From: field\n"
" -h use mailhost:port as the SMTP server\n"
" -s set the Subject: field\n"
long offset;
_tzset();
offset = _timezone;
- offset += _dstbias;
+ if (tm.tm_isdst) {
+ offset += _dstbias;
+ }
return offset /= 60;
#else
break;
case 'd': /* set debug level */
- debug_level = atoi(optarg);
- if (debug_level <= 0) {
- debug_level = 1;
+ if (*optarg == 't') {
+ dbg_timestamp = true;
+ } else {
+ debug_level = atoi(optarg);
+ if (debug_level <= 0) {
+ debug_level = 1;
+ }
}
Dmsg1(20, "Debug level = %d\n", debug_level);
break;