This file is indexed.

/usr/share/jed/lib/sendmail.sl is in jed-common 1:0.99.19-3.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
% sendmail.sl	-*- mode: slang; mode: fold -*-
%
% (Thanks to olesen@weber.me.queensu.ca (mj olesen) for this)
%
% Sendmail interface for Unix.
%
%  Functions: 
%   mail_send             : send message
%   mail                  : initiate mail mode
%   mail_insert_signature : append contents of Mail_Signature_File
%   mail_kill_buffer      : Delete mail buffer
%
%  Variables:
%   Mail_Reply_To         : Set this to appropriate Reply-To value
%   Mail_Signature_File   : Filename of signature (~/.signature is default)
%   SendMail_Cmd          : Name of sendmail program including switches
%   Mail_Extra_Headers	  : Misc headers to insert
%   
% You might want something like the following in mail_hook
%
% define mail_hook ()
% {
%    local_setkey ("mail_send", "^C^C");
%    local_setkey ("mailalias_expand", "^C^E");
%    local_setkey ("mail_kill_buffer", "^Xk");
% }

autoload ("mailalias_expand", "mailalias"); % the mail-alias package

% Create a dummy function if set_line_readonly is not defined.
!if (is_defined ("set_line_readonly")) eval (".(pop) set_line_readonly");

%{{{ Public Variables 

$1 = "~/.signature";
!if (is_defined ("Mail_Signature_File"))
{
   variable Mail_Signature_File = expand_filename ($1);
}

!if (is_defined ("Mail_Header_Separator_String"))
  variable Mail_Header_Separator_String = 
"--- Do not modify this line.  Enter your message below ---";

!if (is_defined ("Mail_Extra_Headers"))
{
   variable Mail_Extra_Headers = NULL;
}


% The sendmail program

$1 = _stkdepth ();
NULL;
"/usr/bin/sendmail";		% places to look
"/usr/lib/sendmail";
"/usr/sbin/sendmail";

!if (is_defined ("SendMail_Cmd"))
{
   variable SendMail_Cmd;

   while (SendMail_Cmd = (), SendMail_Cmd != NULL)
     {
	if (1 == file_status (SendMail_Cmd))
	  {
	     SendMail_Cmd = strcat (SendMail_Cmd, " -t -oem -oi -odb");
	     break;
	  }
     }
   
}

_pop_n (_stkdepth () - $1);

!if (strlen (SendMail_Cmd)) error ("`sendmail' program not found!");

%!% always Reply-To: here instead.
!if (is_defined ("Mail_Reply_To"))
{
   variable Mail_Reply_To = Null_String;
}

%}}}

%{{{ Private Variables

private variable Mail_Previous_Buffer = Null_String;
private variable Mail_Previous_Windows = 1;
private variable Mail_This_Buffer = Null_String;
private variable Mail_Filename = dircat (getenv ("HOME"), ".__jed_mail__");

%}}}

%{{{ Private Functions


define mail_sw2_prev_buf ()
{
   if (bufferp (Mail_Previous_Buffer)) sw2buf (Mail_Previous_Buffer);
   if (1 == Mail_Previous_Windows) onewindow ();
   if (bufferp (Mail_This_Buffer) and strcmp (Mail_This_Buffer, Mail_Previous_Buffer))
     pop2buf (Mail_This_Buffer);
}

%}}}

define mail_send () %{{{
{
   variable dir, file, sent, buf = "*mail*";
   variable sep_mark, fcc_mark, fcc_file;

   if (buf != whatbuf ())
     error ("not *mail* buffer");

   flush ("Sending...");

   push_spot ();

   bob ();
   !if (bol_fsearch (Mail_Header_Separator_String))
     {
	!if (bol_fsearch ("\n"))
	  {
	     pop_spot ();
	     verror ("Cannot find %s\n", Mail_Header_Separator_String);
	  }
     }

   set_line_readonly (0);
   del_eol ();
   sep_mark = create_user_mark ();

   bob ();
   fcc_mark = NULL;
   if (bol_fsearch ("Fcc: "))
     {
	push_mark_eol ();
	go_right_1 ();
	fcc_file = strtrim (substr (bufsubstr_delete (), 6, -1));
	fcc_mark = create_user_mark ();
     }
  
  
   mark_buffer ();
   sent = not (pipe_region (SendMail_Cmd));
   
   if (fcc_mark != NULL)
     {
	if (sent and strlen (fcc_file))
	  {
	     variable user = getenv ("USER");
	     if (user == NULL)
	       {
		  user = getenv ("LOGNAME");
		  if (user == NULL)
		    user = "user";
	       }
	     () = append_string_to_file (sprintf ("From %s %s\n", user, time ()), fcc_file);

	     % Make sure the buffer ends with two newline characters
	     eob ();
	     push_mark ();
	     bskip_chars (" \t\n");
	     del_region ();
	     newline (); newline ();
	     
	     mark_buffer ();
	     () = append_region_to_file (fcc_file);
	  }
	goto_user_mark (fcc_mark);
	vinsert ("Fcc: %s\n", fcc_file);

	% If the marks are on top of one another, make sure sep_mark gets
	% updated.  I added the binary operations on User Marks just for
	% this purpose.
	if (fcc_mark == sep_mark)
	  move_user_mark (sep_mark);
     }

   goto_user_mark (sep_mark);
   insert (Mail_Header_Separator_String);

   pop_spot ();

   if (sent)
     {
	set_buffer_modified_flag (0);
	flush ("Sending...done");
	(file, dir,,) = getbuf_info ();
	() = delete_file (make_autosave_filename (dir, file));
	file = dircat (dir, file);
	!if (strcmp (Mail_Filename, file))
	  () = delete_file (Mail_Filename);
	mail_sw2_prev_buf ();
	bury_buffer (buf);
	return;
     }

   flush ("Error sending message");
   beep ();
}
add_completion ("mail_send");

%}}}

define mail_format_buffer () %{{{
{
   variable erase, opt_headers=NULL;
   if (_NARGS == 2)
     opt_headers = ();
   erase = ();

   variable km = "mail_map";

   text_mode ();

   setbuf_info (getbuf_info () & ~(0x40)); %  turn off buried buffer flag
   
   !if (keymap_p(km)) make_keymap(km);
   use_keymap(km);

   if (erase == -1)
     {
	if (buffer_modified ())
	  {
	     !if (get_yes_no("Mail already being composed.  Erase it"))
	       erase = 0;
	  }
     }

   if (erase)
     {
	erase_buffer ();

	insert ("To: \nCc: \nBcc: \nSubject: \n");
	if (strlen (Mail_Reply_To))
	  vinsert ("Reply-To: %s\n", Mail_Reply_To);

	if (opt_headers != NULL)
	  {
	     insert (opt_headers);
	  }

	if (Mail_Extra_Headers != NULL)
	  {
	     insert (Mail_Extra_Headers);
	     newline ();
	  }
	insert (Mail_Header_Separator_String);
	newline ();

	go_up_1 ();
	set_line_readonly (1);

	bob (); eol ();
	set_buffer_modified_flag(0);
   
     }

   push_spot ();
   run_mode_hooks("mail_hook");
   pop_spot ();

   set_buffer_undo(1);
}

%}}}

define mail_kill_buffer () %{{{
{
   call ("kill_buffer");
   mail_sw2_prev_buf ();
}

%}}}

define mail () %{{{
{
   variable status, dir, file, buf = "*mail*";
   variable do_format = -1;
   
   status = bufferp (buf);
   Mail_Previous_Windows = nwindows ();
   Mail_This_Buffer = whatbuf ();
   
   if (BATCH)
     {
	% Mail_Previous_Buffer = whatbuf ();
	sw2buf (buf);
     }
   else
     {
	Mail_Previous_Buffer = pop2buf_whatbuf (buf);
     }

   % if buffer is not old, turn autosave on
   if (status)
     {
	(,,,status) = getbuf_info ();
	if (buffer_modified ())
	  return;
     }
   else
     {
	(dir, file) = parse_filename (Mail_Filename);
	setbuf_info (file, dir, buf, 2);	% autosave
	
	file = make_autosave_filename(dir, file);
	if (1 == file_status (file))
	  {
	     if (get_yes_no ("An autosave file exists.  Use it"))
	       {
		  erase_buffer ();
		  () = insert_file (file);
		  do_format = 0;
	       }
	  }
     }

   () = set_buffer_umask (0077);
   mail_format_buffer (do_format);
}

%}}}

define mail_insert_signature () %{{{
{
   !if (strlen (Mail_Signature_File))
     return;
   
   push_spot ();
   eob ();
   insert ("\n-- \n");
   () = insert_file (Mail_Signature_File);
   pop_spot ();
}

%}}}