Commit f21fd984 f21fd984dd809048d8d8d512276dea46c04b03a6 by Sergey Poznyakoff

check for "dot" variable. Implemented "~.","appenddeadletter"

1 parent c1cf18d4
...@@ -126,11 +126,11 @@ mail_send0 (struct send_environ *env, int save_to) ...@@ -126,11 +126,11 @@ mail_send0 (struct send_environ *env, int save_to)
126 } 126 }
127 else 127 else
128 { 128 {
129 if (buf)
130 free (buf);
129 if (++int_cnt == 2) 131 if (++int_cnt == 2)
130 break; 132 break;
131 util_error("(Interrupt -- one more to kill letter)"); 133 util_error("(Interrupt -- one more to kill letter)");
132 if (buf)
133 free (buf);
134 } 134 }
135 continue; 135 continue;
136 } 136 }
...@@ -139,7 +139,9 @@ mail_send0 (struct send_environ *env, int save_to) ...@@ -139,7 +139,9 @@ mail_send0 (struct send_environ *env, int save_to)
139 { 139 {
140 if (util_find_env ("ignoreeof")->set) 140 if (util_find_env ("ignoreeof")->set)
141 { 141 {
142 util_error ("Use \".\" to terminate letter."); 142 util_error (util_find_env ("dot")->set ?
143 "Use \".\" to terminate letter." :
144 "Use \"~.\" to terminate letter.");
143 continue; 145 continue;
144 } 146 }
145 else 147 else
...@@ -147,11 +149,15 @@ mail_send0 (struct send_environ *env, int save_to) ...@@ -147,11 +149,15 @@ mail_send0 (struct send_environ *env, int save_to)
147 } 149 }
148 150
149 int_cnt = 0; 151 int_cnt = 0;
150 152
151 if (buf[0] == (util_find_env("escape"))->value[0]) 153 if (buf[0] == '.' && util_find_env("dot")->set)
154 done = 1;
155 else if (buf[0] == (util_find_env("escape"))->value[0])
152 { 156 {
153 if (buf[1] == buf[0]) 157 if (buf[1] == buf[0])
154 fprintf (env->file, "%s\n", buf+1); 158 fprintf (env->file, "%s\n", buf+1);
159 else if (buf[1] == '.')
160 done = 1;
155 else 161 else
156 { 162 {
157 int argc; 163 int argc;
...@@ -189,7 +195,9 @@ mail_send0 (struct send_environ *env, int save_to) ...@@ -189,7 +195,9 @@ mail_send0 (struct send_environ *env, int save_to)
189 { 195 {
190 if (util_find_env ("save")->set) 196 if (util_find_env ("save")->set)
191 { 197 {
192 FILE *fp = fopen (getenv("DEAD"), "a"); 198 FILE *fp = fopen (getenv("DEAD"),
199 util_find_env ("appenddeadletter")->set ?
200 "a" : "w");
193 201
194 if (!fp) 202 if (!fp)
195 { 203 {
......