Mail::Qmail::Queue::Error - Error handling for programs which emulate or use qmail-queue.
use Mail::Qmail::Queue::Error qw(:errcodes :fail); print "blah\n" or tempfail QQ_EXIT_WRITEERR,"Write error: $!\n"; if (has_virus($body)) { permfail QQ_EXIT_REFUSED,"Message refused: it has a virus!!\n"; } qfail $exit_status,"qmail-queue exited $exit_status\n";
Mail::Qmail::Queue::Error is designed to simplify error handling for a program which emulates or uses a program implementing the qmail-queue(8) interface. It declares constants for a variety of permanent and temporary error codes, and provides shorthand methods similar to die that return an appropriate error code. It also provides some methods to look at an error code returned by qmail-queue and determine whether it is temporary or permanent.
Mail::Qmail::Queue::Error
die
qmail-queue
These constants are defined in qmail-queue(8). They are mostly self-explanatory.
Exit with a temporary failure code, or die if in an eval. If the first argument is numeric, or if the message starts with a number, that will be used as the exit code. Otherwise, the temporary failure code QQ_EXIT_BUG will be used.
eval
QQ_EXIT_BUG
Note that no checking of the failure code is done; if you pass a code that does not indicate temporary failure, it will be used as is.
Exit with a permanent failure code, or die if in an eval. If the first argument is numeric, that will be used as the exit code. Otherwise, the permanent failure code QQ_EXIT_REFUSED will be used.
QQ_EXIT_REFUSED
Note that no checking of the failure code is done; if you pass a code that does not indicate permanent failure, it will be used as is.
Exit with a failure code, or die if in an eval. If the first argument is numeric, that will be used as the exit code. Otherwise, the temporary failure code QQ_EXIT_BUG will be used.
Test if the provided value is a temporary exit status.
Test if the provided value is a permanent exit status.
qmail-queue(8), Mail::Qmail::Queue::Message, Mail::Qmail::Queue::Receive::Body, Mail::Qmail::Queue::Receive::Envelope, Mail::Qmail::Queue::Send.
Copyright 2006 Scott Gifford.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Mail::Qmail::Queue::Send, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mail::Qmail::Queue::Send
CPAN shell
perl -MCPAN -e shell install Mail::Qmail::Queue::Send
For more information on module installation, please visit the detailed CPAN module installation guide.