summaryrefslogtreecommitdiff
path: root/pith/send.c
diff options
context:
space:
mode:
authorEduardo Chappa <chappa@washington.edu>2013-05-31 17:16:44 -0600
committerEduardo Chappa <chappa@washington.edu>2013-05-31 17:16:44 -0600
commita46157ba61f2c65f88b42abb31db60c4a714f87b (patch)
treee37bc41ad2f57b3fd2bad310576cc155a58ca6b7 /pith/send.c
parent81e994d7907f850506ddc248f84761a54995e58c (diff)
downloadalpine-a46157ba61f2c65f88b42abb31db60c4a714f87b.tar.xz
* somehow all.patch got here. Reversing.
Diffstat (limited to 'pith/send.c')
-rw-r--r--pith/send.c71
1 files changed, 16 insertions, 55 deletions
diff --git a/pith/send.c b/pith/send.c
index 3cca3365..a0c60439 100644
--- a/pith/send.c
+++ b/pith/send.c
@@ -44,7 +44,6 @@ static char rcsid[] = "$Id: send.c 1204 2009-02-02 19:54:23Z hubert@u.washington
#include "../pith/ablookup.h"
#include "../pith/sort.h"
#include "../pith/smime.h"
-#include "../pith/rules.h"
#include "../c-client/smtp.h"
#include "../c-client/nntp.h"
@@ -54,7 +53,7 @@ static char rcsid[] = "$Id: send.c 1204 2009-02-02 19:54:23Z hubert@u.washington
/* name::type::canedit::writehdr::localcopy::rcptto */
PINEFIELD pf_template[] = {
{"X-Auth-Received", FreeText, 0, 1, 1, 0}, /* N_AUTHRCVD */
- {"From", Address, 1, 1, 1, 0},
+ {"From", Address, 0, 1, 1, 0},
{"Reply-To", Address, 0, 1, 1, 0},
{TONAME, Address, 1, 1, 1, 1},
{CCNAME, Address, 1, 1, 1, 1},
@@ -258,13 +257,6 @@ postponed_stream(MAILSTREAM **streamp, char *mbox, char *type, int checknmsgs)
if(exists & FEX_ISFILE){
context_apply(tmp, p_cntxt, mbox, sizeof(tmp));
-#ifndef _WINDOWS
- if (!struncmp(tmp, "#md/",4) || !struncmp(tmp, "#mc/", 4)){
- char tmp2[MAILTMPLEN];
- maildir_file_path(tmp, tmp2, sizeof(tmp2));
- strcpy(tmp, tmp2);
- }
-#endif
if(!(IS_REMOTE(tmp) || is_absolute_path(tmp))){
/*
* The mbox is relative to the home directory.
@@ -1237,7 +1229,7 @@ pine_new_env(ENVELOPE *outgoing, char **fccp, char ***tobufpp, PINEFIELD *custom
*p = *(p+4);
pf->type = pf_template[i].type;
- pf->canedit = (i == N_FROM) ? CAN_EDIT(ps_global) : pf_template[i].canedit;
+ pf->canedit = pf_template[i].canedit;
pf->rcptto = pf_template[i].rcptto;
pf->writehdr = pf_template[i].writehdr;
pf->localcopy = pf_template[i].localcopy;
@@ -1746,9 +1738,9 @@ call_mailer(METAENV *header, struct mail_bodystruct *body, char **alt_smtp_serve
char error_buf[200], *error_mess = NULL, *postcmd;
ADDRESS *a;
ENVELOPE *fake_env = NULL;
- int addr_error_count, we_cancel = 0, choice, num_rules = 0, added_rules = -1;
+ int addr_error_count, we_cancel = 0;
long smtp_opts = 0L;
- char *verbose_file = NULL, **smtp_list;
+ char *verbose_file = NULL;
BODY *bp = NULL;
PINEFIELD *pf;
BODY *origBody = body;
@@ -1901,49 +1893,20 @@ call_mailer(METAENV *header, struct mail_bodystruct *body, char **alt_smtp_serve
* OK, who posts what? We tried an mta_handoff above, but there
* was either none specified or we decided not to use it. So,
* if there's an smtp-server defined anywhere,
- * First we check for rules and make a list using the rules.
*/
- if(ps_global->VAR_SMTP_RULES && ps_global->VAR_SMTP_RULES[0]
- && ps_global->VAR_SMTP_RULES[0][0])
- while (ps_global->VAR_SMTP_RULES[num_rules]) num_rules++;
-
- if(num_rules){
- int i, j;
-
- added_rules = 0;
- smtp_list = (char **) fs_get ((num_rules + 1)*sizeof(char*));
- for (i = 0, j = 0; i < num_rules; i++){
- RULELIST *rule = get_rulelist_from_code(V_SMTP_RULES,
- ps_global->rule_list);
- RULE_S *prule = get_rule(rule, i);
- if(prule){
- char *rule_result = process_rule(prule, FOR_COMPOSE, header->env);
- if(rule_result && *rule_result){
- smtp_list[j++] = cpystr(rule_result);
- added_rules++;
- }
- }
- }
- }
-
- if (added_rules < 0){
- smtp_list = (char **) fs_get (sizeof(char*));
- added_rules = 0;
+ if(alt_smtp_servers && alt_smtp_servers[0] && alt_smtp_servers[0][0]){
+ /*---------- SMTP ----------*/
+ dprint((4, "call_mailer: via TCP (%s)\n",
+ alt_smtp_servers[0]));
+ TIME_STAMP("smtp-open start (tcp)", 1);
+ sending_stream = smtp_open(alt_smtp_servers, smtp_opts);
}
- smtp_list[added_rules] = NULL;
-
- choice = smtp_list && smtp_list[0] && smtp_list[0][0] ? 3 :
- (alt_smtp_servers && alt_smtp_servers[0] && alt_smtp_servers[0][0] ? 2 :
- (ps_global->VAR_SMTP_SERVER && ps_global->VAR_SMTP_SERVER[0]
- && ps_global->VAR_SMTP_SERVER[0][0] ? 1 : -1));
-
- if(choice > 0){
- /*---------- SMTP ----------*/
- dprint((4, "call_mailer: via TCP (%s)\n",smtp_list[0]));
- TIME_STAMP("smtp-open start (tcp)", 1);
- sending_stream = smtp_open(choice == 3 ? smtp_list
- : (choice == 2 ? alt_smtp_servers
- : ps_global->VAR_SMTP_SERVER), smtp_opts);
+ else if(ps_global->VAR_SMTP_SERVER && ps_global->VAR_SMTP_SERVER[0]
+ && ps_global->VAR_SMTP_SERVER[0][0]){
+ /*---------- SMTP ----------*/
+ dprint((4, "call_mailer: via TCP\n"));
+ TIME_STAMP("smtp-open start (tcp)", 1);
+ sending_stream = smtp_open(ps_global->VAR_SMTP_SERVER, smtp_opts);
}
else if((postcmd = smtp_command(ps_global->c_client_error, sizeof(ps_global->c_client_error))) != NULL){
char *cmdlist[2];
@@ -2179,8 +2142,6 @@ call_mailer(METAENV *header, struct mail_bodystruct *body, char **alt_smtp_serve
if(error_mess){
q_status_message(SM_ORDER | SM_DING, 4, 7, error_mess);
dprint((1, "call_mailer ERROR: %s\n", error_mess));
- if (ps_global->send_immediately)
- printf("%s\n",error_mess);
}
return(-1);