summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEduardo Chappa <chappa@washington.edu>2021-12-29 21:57:35 -0700
committerEduardo Chappa <chappa@washington.edu>2021-12-29 21:57:35 -0700
commit2332962c5de1f8f98173fb3cdb2c941e5037ed95 (patch)
tree2f6fd67271958e3c0efa1b4fc773ae3566b3f7a4
parent5d3178a435f355fde3219a6e32be837ba973b796 (diff)
downloadalpine-2332962c5de1f8f98173fb3cdb2c941e5037ed95.tar.xz
* If a user configures the sendmail-path variable, and does not use a
global smtp-server, then Alpine will use the sendmail-path even when the user configured a smtp-server for a role. Reported by Gregory Heytings.
-rw-r--r--doc/tech-notes/background.html2
-rw-r--r--doc/tech-notes/tech-notes.txt15
-rw-r--r--pith/pine.hlp7
-rw-r--r--pith/send.c10
4 files changed, 23 insertions, 11 deletions
diff --git a/doc/tech-notes/background.html b/doc/tech-notes/background.html
index ac4d91af..ad3c9f2f 100644
--- a/doc/tech-notes/background.html
+++ b/doc/tech-notes/background.html
@@ -135,6 +135,8 @@ The first MTA specified in the following list is used:
<LI><EM>sendmail-path</EM> specified on the command line.
+<LI><EM>smtp-server</EM> specified in a role being used.
+
<LI><EM>smtp-server</EM> specified on the command line.
<LI><EM>sendmail-path</EM> in the user's <CODE>.pinerc</CODE> file.
diff --git a/doc/tech-notes/tech-notes.txt b/doc/tech-notes/tech-notes.txt
index 1fa83ad1..8ae016e4 100644
--- a/doc/tech-notes/tech-notes.txt
+++ b/doc/tech-notes/tech-notes.txt
@@ -285,13 +285,14 @@ SMTP and Sendmail
1. _sendmail-path_ in /usr/local/lib/pine.conf.fixed
2. _smtp-server_ in /usr/local/pine.conf.fixed
3. _sendmail-path_ specified on the command line.
- 4. _smtp-server_ specified on the command line.
- 5. _sendmail-path_ in the user's .pinerc file.
- 6. _smtp-server_ in the user's .pinerc file.
- 7. _sendmail-path_ in /usr/local/lib/pine.conf
- 8. _smtp-server_ in /usr/local/pine.conf
- 9. DF_SENDMAIL_PATH defined at compile time.
- 10. SENDMAIL and SENDMAILFLAGS defined at compile time.
+ 4. _smtp-server_ specified in a role being used.
+ 5. _smtp-server_ specified on the command line.
+ 6. _sendmail-path_ in the user's .pinerc file.
+ 7. _smtp-server_ in the user's .pinerc file.
+ 8. _sendmail-path_ in /usr/local/lib/pine.conf
+ 9. _smtp-server_ in /usr/local/pine.conf
+ 10. DF_SENDMAIL_PATH defined at compile time.
+ 11. SENDMAIL and SENDMAILFLAGS defined at compile time.
If the _sendmail-path_ form is used, a child process is forked, and the
specified command is executed with the message passed on standard
diff --git a/pith/pine.hlp b/pith/pine.hlp
index 63c1983a..73196ff7 100644
--- a/pith/pine.hlp
+++ b/pith/pine.hlp
@@ -140,7 +140,7 @@ with help text for the config screen and the composer that didn't have any
reasonable place to be called from.
Dummy change to get revision in pine.hlp
============= h_revision =================
-Alpine Commit 634 2021-12-27 09:44:44
+Alpine Commit 635 2021-12-29 21:56:40
============= h_news =================
<HTML>
<HEAD>
@@ -261,6 +261,11 @@ Bugs addressed include:
is surrounded by quotes, these are not removed by Alpine at the time
to offer to take an address from a message to the addressbook. Reported
by David Prager Branner.
+
+<LI> If a user configures the sendmail-path variable, and does not use a
+ global smtp-server, then Alpine will use the sendmail-path even when
+ the user configured a smtp-server for a role. Reported by Gregory
+ Heytings.
</UL>
<P>Version 2.25 adds new features and addresses bugs found in previous
diff --git a/pith/send.c b/pith/send.c
index 64783374..7f210ee2 100644
--- a/pith/send.c
+++ b/pith/send.c
@@ -112,7 +112,7 @@ int pwbh_finish(int, STORE_S *);
int sent_percent(void);
unsigned short *setup_avoid_table(void);
#ifndef _WINDOWS
-int mta_handoff(METAENV *, BODY *, char *, size_t, void (*)(char *, int),
+int mta_handoff(METAENV *, BODY *, char *, size_t, char **, void (*)(char *, int),
void (*)(PIPE_S *, int, void *));
char *post_handoff(METAENV *, BODY *, char *, size_t, void (*)(char *, int),
void (*)(PIPE_S *, int, void *));
@@ -1737,7 +1737,7 @@ call_mailer(METAENV *header, struct mail_bodystruct *body, char **alt_smtp_serve
#ifndef _WINDOWS
/* try posting via local "<mta> <-t>" if specified */
- if(mta_handoff(header, body, error_buf, sizeof(error_buf), bigresult_f, pipecb_f)){
+ if(mta_handoff(header, body, error_buf, sizeof(error_buf), alt_smtp_servers, bigresult_f, pipecb_f)){
if(error_buf[0])
error_mess = error_buf;
@@ -5503,6 +5503,7 @@ smtp_command(char *errbuf, size_t errbuflen)
int
mta_handoff(METAENV *header, struct mail_bodystruct *body,
char *errbuf, size_t len,
+ char **alt_smtp_servers,
void (*bigresult_f) (char *, int),
void (*pipecb_f)(PIPE_S *, int, void *))
{
@@ -5535,7 +5536,10 @@ mta_handoff(METAENV *header, struct mail_bodystruct *body,
cmd = ps_global->COM_SENDMAIL_PATH;
}
else if(!(ps_global->COM_SMTP_SERVER
- && ps_global->COM_SMTP_SERVER[0])){
+ && ps_global->COM_SMTP_SERVER[0])
+ && !(alt_smtp_servers
+ && alt_smtp_servers[0]
+ && alt_smtp_servers[0][0])){
if((ps_global->vars[V_SENDMAIL_PATH].post_user_val.p
&& ps_global->vars[V_SENDMAIL_PATH].post_user_val.p[0]) ||
(ps_global->vars[V_SENDMAIL_PATH].main_user_val.p