1.1.3.2. mail
This module provides the contents of the tab used to create and send messages as part of a campaign.
1.1.3.2.1. Functions
1.1.3.2.2. Classes
- class MailSenderConfigurationTab(*args, **kwargs)[source]
Bases:
GladeGObject
This is the tab which allows the user to configure and set parameters for sending messages as part of a campaign.
- config_prefix = 'mailer.'[source]
A prefix to be used for keys when looking up value in the
config
.
- dependencies = <GladeDependencies name='MailSenderConfigurationTab' >[source]
A
GladeDependencies
instance which defines information for loading the widget from the GTK builder data.
- class MailSenderEditTab(*args, **kwargs)[source]
Bases:
GladeGObject
This is the tab which adds basic text edition for changing an email template.
- dependencies = <GladeDependencies name='MailSenderEditTab' >[source]
A
GladeDependencies
instance which defines information for loading the widget from the GTK builder data.
- save_html_file(force_prompt=False)[source]
Save the contents from the editor into an HTML file if one is configured otherwise prompt to user to select a file to save as. The user may abort the operation by declining to select a file to save as if they are prompted to do so.
- Parameters
force_prompt – Force prompting the user to select the file to save as.
- Return type
- Returns
Whether the contents were saved or not.
- class MailSenderPreviewTab(application)[source]
Bases:
object
This tab uses the WebKit engine to render the HTML of an email so it can be previewed before it is sent.
- __init__(application)[source]
- Parameters
application (
KingPhisherClientApplication
) – The application instance.
- load_html_file()[source]
Load the configured HTML file into the WebKit engine so the contents can be previewed.
- webview[source]
The
WebKitHTMLView
object used to render the message HTML.
- class MailSenderSendTab(*args, **kwargs)[source]
Bases:
GladeGObject
This allows the
MailSenderThread
object to be managed by the user through the GUI. These two classes are very interdependent- dependencies = <GladeDependencies name='MailSenderSendTab' >[source]
A
GladeDependencies
instance which defines information for loading the widget from the GTK builder data.
- notify_sent(emails_done, emails_total)[source]
A call back use by
MailSenderThread
to notify when an email has been successfully sent to the SMTP server.
- notify_status(message)[source]
A call back use by
MailSenderThread
to update general status information.- Parameters
message (str) – The status message.
- notify_stopped()[source]
A callback used by
MailSenderThread
to notify when the thread has stopped.
- precheck_routines = ('settings', 'attachment', 'required-files', 'campaign', 'url', 'source', 'spf')[source]
The built-in precheck routines that are executed before sending messages.
- progressbar[source]
The
Gtk.ProgressBar
instance which is used to display progress of sending messages.
- sender_start_failure(message=None, text=None, retry=False)[source]
Handle a failure in starting the message sender thread and perform any necessary clean up.
- Parameters
message (text) – A message to shown in an error popup dialog.
message – A message to be inserted into the text buffer.
retry (bool) – The operation will be attempted again.
- sender_thread[source]
The
MailSenderThread
instance that is being used to send messages.
- text_insert(message)[source]
Insert text into the
textbuffer
.- Parameters
message (str) – The text to insert.
- class MailSenderTab(parent, application)[source]
Bases:
Object
The King Phisher client top-level ‘Send Messages’ tab. This object manages the sub-tabs which display useful information for configuring, previewing and sending messages as part of a campaign.
- GObject Signals
- __init__(parent, application)[source]
- Parameters
parent (
Gtk.Window
) – The parent window for this object.application (
Gtk.Application
) – The main client application instance.
- export_message_data(path=None)[source]
Gather and prepare the components of the mailer tab to be exported into a King Phisher message (KPM) archive file suitable for restoring at a later point in time. If path is not specified, the user will be prompted to select one and failure to do so will prevent the message data from being exported. This function wraps the emission of the
message-data-export
signal.
- import_message_data()[source]
Process a previously exported message archive file and restore the message data, settings, and applicable files from it. This function wraps the emission of the
message-data-import
signal.- Returns
Whether or not the message archive file was loaded from disk.
- Return type