comparison src/fetch.c @ 154:b2a4f839affd noffle

[svn] Use sendmail instead of mail
author enz
date Tue, 05 Dec 2000 19:30:50 +0000
parents 8e350d558c98
children 22b81617d427
comparison
equal deleted inserted replaced
153:945501c95a4e 154:b2a4f839affd
1 /* 1 /*
2 fetch.c 2 fetch.c
3 3
4 $Id: fetch.c 207 2000-09-10 12:29:52Z enz $ 4 $Id: fetch.c 235 2000-12-05 19:30:50Z enz $
5 */ 5 */
6 6
7 #if HAVE_CONFIG_H 7 #if HAVE_CONFIG_H
8 #include <config.h> 8 #include <config.h>
9 #endif 9 #endif
260 Str cmd; 260 Str cmd;
261 FILE *f; 261 FILE *f;
262 sig_t lastHandler; 262 sig_t lastHandler;
263 263
264 Log_err( "Return article to '%s' by mail", sender ); 264 Log_err( "Return article to '%s' by mail", sender );
265 snprintf( cmd, MAXCHAR, "mail -s '[ NOFFLE: Posting failed ]' '%s'", 265 snprintf( cmd, MAXCHAR, "%s -t -oi", SENDMAILPROG);
266 sender );
267 lastHandler = signal( SIGPIPE, SIG_IGN ); 266 lastHandler = signal( SIGPIPE, SIG_IGN );
268 f = popen( cmd, "w" ); 267 f = popen( cmd, "w" );
269 if ( f == NULL ) 268 if ( f == NULL )
270 Log_err( "Invocation of '%s' failed (%s)", cmd, strerror( errno ) ); 269 Log_err( "Invocation of '%s' failed (%s)", cmd, strerror( errno ) );
271 else 270 else
272 { 271 {
273 fprintf( f, 272 fprintf( f,
273 "To: %s\n"
274 "Subject: [ NOFFLE: Posting failed ]\n"
275 "\n"
274 "\t[ NOFFLE: POSTING OF ARTICLE FAILED ]\n" 276 "\t[ NOFFLE: POSTING OF ARTICLE FAILED ]\n"
275 "\n" 277 "\n"
276 "\t[ The posting of your article failed. ]\n" 278 "\t[ The posting of your article failed. ]\n"
277 "\t[ Reason of failure at remote server: ]\n" 279 "\t[ Reason of failure at remote server: ]\n"
278 "\n" 280 "\n"
280 "\n" 282 "\n"
281 "\t[ Full article text has been appended. ]\n" 283 "\t[ Full article text has been appended. ]\n"
282 "\n" 284 "\n"
283 "%s" 285 "%s"
284 ".\n", 286 ".\n",
287 sender,
285 reason, article ); 288 reason, article );
286 ret = pclose( f ); 289 ret = pclose( f );
287 if ( ret != EXIT_SUCCESS ) 290 if ( ret != EXIT_SUCCESS )
288 Log_err( "'%s' exit value %d", cmd, ret ); 291 Log_err( "'%s' exit value %d", cmd, ret );
289 signal( SIGPIPE, lastHandler ); 292 signal( SIGPIPE, lastHandler );