The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

QMail::QueueHandler - Module to manage QMail message queues

DESCRIPTION

This is all the code behind the qmHandle command line program.

SYNOPSIS

    use QMail::QueueHandler;

    QMail::QueueHandler->new->run;

METHODS

run()

Main driver method.

parse_args()

Parse the command line arguments and set any required attributes.

stop_qmail()

Optionally stop the qmail daemon.

start_qmail()

Restart the qmail daemon if it was previously stopped.

get_subject($msg_id)

Given the id of a message, return the subject of that message.

get_sender($msg_id)

Given the id of a message, return the sender of the message.

send_msgs()

Attempt to send all currently queued messages.

It does this by sending SIGALRM to the qmail daemon.

show_msg_info($msg_id)

Given a message id, display the information about that message.

list_msg($queue)

Display information for all messages in a given queue.

The $queue parameter should be 'L' to display only local messages, 'R' to display only remote messages or anything else to display all messages.

view_msg($msg_id)

View a message in the queue

trash_msgs()

Delete all of the messages whose ids are in the all_to_delete array.

flag_msgs()

Flag all messages whose ids are in the all_to_flag array.

del_msg($msg_id)

Given a message id, add that message to the list of messages to delete.

The actual deletion is carried out by trash_msgs.

del_msg_from_sender($sender)

Given a sender's email address, add all messages from that sender to the list of messages to delete.

The actual deletion is carried out by trash_msgs.

del_msg_from_sender_r($sender)

Given a sender's email address, add all messages from that sender to the list of messages to delete.

This method treats $sender as a regex.

The actual deletion is carried out by trash_msgs.

del_msg_header($header_re, $is_case_sensitive)

Given a regex, add all messages with headers that match the regex to the list of messages to delete.

The actual deletion is carried out by trash_msgs.

del_msg_body_r($body_re, $is_case_sensitive)

Given a regex, add all messages with a body that matches the regex to the list of messages to delete.

The actual deletion is carried out by trash_msgs.

del_msg_subj($subject, $is_case_sensitive)

Given a subject, add all messages with that subject to the list of messages to delete.

The actual deletion is carried out by trash_msgs.

del_all()

Delete all messages in the queue.

The actual deletion is carried out by trash_msgs.

flag_remote($recipient_re)

Flag all remote messages whose recipient matches the given regex.

stats()

Display statistics about the queue.

qmail_pid()

Get the pid of the qmail daemon

usage()

Display usage information.

version()

Display the version.

AUTHOR

Copyright (c) 2016 Dave Cross <dave@perlhacks.com>

Based on original version by Michele Beltrame <mb@italpro.net>

LICENCE

This program is distributed under the GNU GPL. For more information have a look at http://www.gnu.org