From 037b74a4e5c146ca1950f7337c7b27ef9b87551b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Fonseca?= Date: Tue, 5 Nov 2002 12:30:13 +0000 Subject: Version bump. Minor code reordering. --- configure.ac | 2 +- main.c | 23 +++++++++++++---------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/configure.ac b/configure.ac index ffa5eaf..513ae57 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.53) -AC_INIT(esmtp, 0.2) +AC_INIT(esmtp, 0.3) AC_CONFIG_SRCDIR(Makefile.am) AM_INIT_AUTOMAKE(1.6 dist-bzip2) AM_MAINTAINER_MODE diff --git a/main.c b/main.c index d9019d9..f6f58e1 100644 --- a/main.c +++ b/main.c @@ -192,10 +192,9 @@ main (int argc, char **argv) parse_rcfile(); /* This program sends only one message at a time. Create an SMTP - session and add a message to it. */ + session. */ auth_client_init (); session = smtp_create_session (); - message = smtp_add_message (session); while ((c = getopt (argc, argv, "A:B:b:C:cd:e:F:f:Gh:IiL:M:mN:nO:o:p:q:R:r:sTtV:vX:")) != EOF) @@ -433,14 +432,14 @@ main (int argc, char **argv) sa.sa_flags = 0; sigaction (SIGPIPE, &sa, NULL); - /* Set the SMTP Starttls extension. */ - smtp_starttls_enable (session, starttls); - /* Set the host running the SMTP server. LibESMTP has a default port number of 587, however this is not widely deployed so the port is specified as 25 along with the default MTA host. */ smtp_set_server (session, host ? host : "localhost:25"); + /* Set the SMTP Starttls extension. */ + smtp_starttls_enable (session, starttls); + /* Do what's needed at application level to use authentication. */ authctx = auth_create_context (); @@ -455,6 +454,15 @@ main (int argc, char **argv) */ smtp_auth_set_context (session, authctx); + /* At present it can't handle one recipient only out of many + failing. Make libESMTP require all specified recipients to + succeed before transferring a message. */ + smtp_option_require_all_recipients (session, 1); + + /* Add a message to the SMTP session. + */ + message = smtp_add_message (session); + /* Set the reverse path for the mail envelope. (NULL is ok) */ smtp_set_reverse_path (message, from); @@ -467,11 +475,6 @@ main (int argc, char **argv) smtp_set_messagecb (message, readlinefp_cb, stdin); #endif - /* At present it can't handle one recipient only out of many - failing. Make libESMTP require all specified recipients to - succeed before transferring a message. */ - smtp_option_require_all_recipients (session, 1); - /* Add remaining program arguments as message recipients. */ while (optind < argc) -- cgit v1.2.3