288 |
|
|
289 |
if ((rc = mu_debug_create (&mudebug, NULL))) |
if ((rc = mu_debug_create (&mudebug, NULL))) |
290 |
{ |
{ |
291 |
mu_error (_("mu_debug_create failed: %s\n"), mu_errstring (rc)); |
mu_error (_("mu_debug_create failed: %s\n"), mu_strerror (rc)); |
292 |
exit (EX_TEMPFAIL); |
exit (EX_TEMPFAIL); |
293 |
} |
} |
294 |
if ((rc = mu_debug_set_level (mudebug, debug_flags))) |
if ((rc = mu_debug_set_level (mudebug, debug_flags))) |
295 |
{ |
{ |
296 |
mu_error (_("mu_debug_set_level failed: %s\n"), |
mu_error (_("mu_debug_set_level failed: %s\n"), |
297 |
mu_errstring (rc)); |
mu_strerror (rc)); |
298 |
exit (EX_TEMPFAIL); |
exit (EX_TEMPFAIL); |
299 |
} |
} |
300 |
if ((rc = mu_debug_set_print (mudebug, _mu_debug_printer, NULL))) |
if ((rc = mu_debug_set_print (mudebug, _mu_debug_printer, NULL))) |
301 |
{ |
{ |
302 |
mu_error (_("mu_debug_set_print failed: %s\n"), |
mu_error (_("mu_debug_set_print failed: %s\n"), |
303 |
mu_errstring (rc)); |
mu_strerror (rc)); |
304 |
exit (EX_TEMPFAIL); |
exit (EX_TEMPFAIL); |
305 |
} |
} |
306 |
} |
} |
373 |
if (rc) |
if (rc) |
374 |
{ |
{ |
375 |
mu_error (_("can't initialize sieve machine: %s"), |
mu_error (_("can't initialize sieve machine: %s"), |
376 |
mu_errstring (rc)); |
mu_strerror (rc)); |
377 |
} |
} |
378 |
else |
else |
379 |
{ |
{ |
493 |
tempfile = mu_tempname (NULL); |
tempfile = mu_tempname (NULL); |
494 |
if ((status = file_stream_create (&stream, tempfile, MU_STREAM_RDWR))) |
if ((status = file_stream_create (&stream, tempfile, MU_STREAM_RDWR))) |
495 |
{ |
{ |
496 |
mailer_err (_("unable to open temporary file: %s"), mu_errstring (status)); |
mailer_err (_("unable to open temporary file: %s"), mu_strerror (status)); |
497 |
exit (exit_code); |
exit (exit_code); |
498 |
} |
} |
499 |
|
|
500 |
if ((status = stream_open (stream))) |
if ((status = stream_open (stream))) |
501 |
{ |
{ |
502 |
mailer_err (_("unable to open temporary file: %s"), mu_errstring (status)); |
mailer_err (_("unable to open temporary file: %s"), mu_strerror (status)); |
503 |
exit (exit_code); |
exit (exit_code); |
504 |
} |
} |
505 |
|
|
548 |
|
|
549 |
if (status) |
if (status) |
550 |
{ |
{ |
551 |
mailer_err (_("temporary file write error: %s"), mu_errstring (status)); |
mailer_err (_("temporary file write error: %s"), mu_strerror (status)); |
552 |
stream_destroy (&stream, stream_get_owner (stream)); |
stream_destroy (&stream, stream_get_owner (stream)); |
553 |
return status; |
return status; |
554 |
} |
} |
565 |
if (status) |
if (status) |
566 |
{ |
{ |
567 |
errno = status; |
errno = status; |
568 |
mailer_err (_("temporary file write error: %s"), mu_errstring (status)); |
mailer_err (_("temporary file write error: %s"), mu_strerror (status)); |
569 |
stream_destroy (&stream, stream_get_owner (stream)); |
stream_destroy (&stream, stream_get_owner (stream)); |
570 |
return status; |
return status; |
571 |
} |
} |
575 |
|| (status = mailbox_open (*mbox, MU_STREAM_READ)) |
|| (status = mailbox_open (*mbox, MU_STREAM_READ)) |
576 |
|| (status = mailbox_set_stream (*mbox, stream))) |
|| (status = mailbox_set_stream (*mbox, stream))) |
577 |
{ |
{ |
578 |
mailer_err (_("temporary file open error: %s"), mu_errstring (status)); |
mailer_err (_("temporary file open error: %s"), mu_strerror (status)); |
579 |
stream_destroy (&stream, stream_get_owner (stream)); |
stream_destroy (&stream, stream_get_owner (stream)); |
580 |
return status; |
return status; |
581 |
} |
} |
585 |
{ |
{ |
586 |
errno = status; |
errno = status; |
587 |
mailer_err (_("temporary message creation error: %s"), |
mailer_err (_("temporary message creation error: %s"), |
588 |
mu_errstring (status)); |
mu_strerror (status)); |
589 |
stream_destroy (&stream, stream_get_owner (stream)); |
stream_destroy (&stream, stream_get_owner (stream)); |
590 |
return status; |
return status; |
591 |
} |
} |
623 |
|
|
624 |
if ((status = mailbox_get_stream (imbx, &istream)) != 0) |
if ((status = mailbox_get_stream (imbx, &istream)) != 0) |
625 |
{ |
{ |
626 |
mailer_err (_("can't get input message stream: %s"), mu_errstring (status)); |
mailer_err (_("can't get input message stream: %s"), mu_strerror (status)); |
627 |
mu_auth_data_free (auth); |
mu_auth_data_free (auth); |
628 |
return; |
return; |
629 |
} |
} |
631 |
if ((status = mailbox_create (&mbox, auth->mailbox)) != 0) |
if ((status = mailbox_create (&mbox, auth->mailbox)) != 0) |
632 |
{ |
{ |
633 |
mailer_err (_("can't open mailbox %s: %s"), |
mailer_err (_("can't open mailbox %s: %s"), |
634 |
auth->mailbox, mu_errstring (status)); |
auth->mailbox, mu_strerror (status)); |
635 |
mu_auth_data_free (auth); |
mu_auth_data_free (auth); |
636 |
return; |
return; |
637 |
} |
} |
649 |
return; |
return; |
650 |
if (status != 0) |
if (status != 0) |
651 |
{ |
{ |
652 |
mailer_err (_("can't open mailbox %s: %s"), path, mu_errstring (status)); |
mailer_err (_("can't open mailbox %s: %s"), path, mu_strerror (status)); |
653 |
mailbox_destroy (&mbox); |
mailbox_destroy (&mbox); |
654 |
return; |
return; |
655 |
} |
} |
662 |
|
|
663 |
if (status) |
if (status) |
664 |
{ |
{ |
665 |
mailer_err (_("cannot lock mailbox '%s': %s"), path, mu_errstring (status)); |
mailer_err (_("cannot lock mailbox '%s': %s"), path, mu_strerror (status)); |
666 |
mailbox_destroy (&mbox); |
mailbox_destroy (&mbox); |
667 |
exit_code = EX_TEMPFAIL; |
exit_code = EX_TEMPFAIL; |
668 |
return; |
return; |
671 |
if ((status = mailbox_get_stream (mbox, &ostream))) |
if ((status = mailbox_get_stream (mbox, &ostream))) |
672 |
{ |
{ |
673 |
mailer_err (_("can't get stream for mailbox %s: %s"), |
mailer_err (_("can't get stream for mailbox %s: %s"), |
674 |
path, mu_errstring (status)); |
path, mu_strerror (status)); |
675 |
mailbox_destroy (&mbox); |
mailbox_destroy (&mbox); |
676 |
return; |
return; |
677 |
} |
} |
679 |
if ((status = stream_size (ostream, (off_t *) &size))) |
if ((status = stream_size (ostream, (off_t *) &size))) |
680 |
{ |
{ |
681 |
mailer_err (_("can't get stream size (mailbox %s): %s"), |
mailer_err (_("can't get stream size (mailbox %s): %s"), |
682 |
path, mu_errstring (status)); |
path, mu_strerror (status)); |
683 |
mailbox_destroy (&mbox); |
mailbox_destroy (&mbox); |
684 |
return; |
return; |
685 |
} |
} |
703 |
if ((status = stream_size (istream, (off_t *) &isize))) |
if ((status = stream_size (istream, (off_t *) &isize))) |
704 |
{ |
{ |
705 |
mailer_err (_("can't get stream size (input message): %s"), |
mailer_err (_("can't get stream size (input message): %s"), |
706 |
path, mu_errstring (status)); |
path, mu_strerror (status)); |
707 |
exit_code = EX_UNAVAILABLE; |
exit_code = EX_UNAVAILABLE; |
708 |
failed++; |
failed++; |
709 |
} |
} |
759 |
if (status) |
if (status) |
760 |
{ |
{ |
761 |
mailer_err (_("error writing to mailbox: %s"), |
mailer_err (_("error writing to mailbox: %s"), |
762 |
mu_errstring (status)); |
mu_strerror (status)); |
763 |
} |
} |
764 |
} |
} |
765 |
|
|