summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosé Fonseca <jrfonseca@users.sourceforge.net>2002-11-05 12:30:13 +0000
committerJosé Fonseca <jrfonseca@users.sourceforge.net>2002-11-05 12:30:13 +0000
commit037b74a4e5c146ca1950f7337c7b27ef9b87551b (patch)
treeae869348d433da26295e3a48ae02c7cf50dc4535
parent267b916ea89e25e424dedd89649ba61f850fe6c8 (diff)
Version bump. Minor code reordering.
-rw-r--r--configure.ac2
-rw-r--r--main.c23
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)