If qconfirm-check already knows this envelope sender, or was told to accept mails from this sender, it immediately exits with 0, and so allows the mail to be processed further in the .qmail file. If not, qconfirm-check injects a confirmation request message to the envelope sender asking for a reply, and exits 111 to defer the message temporarily. The message will stay in the qmail queue and will be tried to be delivered in a little while.
qconfirm-check then defers this message
on future delivery attempts and all other messages from the same envelope
sender temporarily without injecting another confirmation request message
until a reply to the confirmation request message is received (Exception:
see the -t option).
If queuelifetime has expired for a message before a reply to the
confirmation request was received, the message is bounced and never
delivered to the recipient.
Envelope sender address id
To check if the envelope sender is allowed,
qconfirm-check creates an
id based on the envelope sender mail address as follows:
The sender mail address is split into two parts, the local part
and the host part. For example if the sender mail address is
floyd@smarden.org, the local part is floyd, the
host part is smarden.org.
These two parts are concatenated in reverse order with a "=-"
in between, any uppercase letter is converted to lowercase, and finally
each dot, slash, and apostrophe is replaced by a colon. So the id for
floyd@smarden.org is smarden:org=-floyd.
Matching envelope sender address id
qconfirm-check matches the id
created from the envelope sender address against a file in the directory
~/.qconfirm/ok/ the same way qmail matches .qmail files
for extension addresses. For example, the address
floyd-extension@smarden.org
with the id smarden:org=-floyd-extension is matched by the
following files in the ~/.qconfirm/ok/ directory:
smarden:org=-floyd-extension smarden:org=-floyd-default smarden:org=-default defaultIf at least one of these files exists in the ~/.qconfirm/ok/ directory, the message is allowed to be processed further in the .qmail file. If qconfirm-check runs with the -b option, the same matching takes place for the .qconfirm/bad/ directory.
list:smarden:org :smarden:org :orgExtended domain matching is applied after matching the envelope sender address id.
qconfirm-check creates a special Message-ID for the confirmation request message it sends so that delivery confirmation request message can be processed automatically. The Message-ID is constructed using the Message-ID of the mail message the delivery confirmation is requested for, by prepending the string ``confirm-'', and appending the host part of the mail address qconfirm is configured for. E.g.: qconfirm runs for <floyd@smarden.org> and sends a delivery confirmation request message for a message with the Message-ID <abcde@sender.mid>. The Message-ID of the confirmation request message is <confirm-abcde@sender.mid@smarden.org>.
The next time qmail tries to deliver a temporarily deferred or a new message from this envelope sender, qconfirm-check matches the sender to be allowed and allows the message to be processed further in the .qmail file. If the file in the ~/.qconfirm/ok/ directory that matched the envelope sender is not empty, qconfirm-check optionally injects a confirmation acknowledgement message to the envelope sender, including the contents of the file at the bottom of the message, and then truncates this file to the size 0.
The qconfirm-notice program can validate delivery notifications, is capable of detecting delivery confirmation request messages, and automatically confirming delivery on such requests.
A dot-qmail file with a program delivery to qconfirm-notice has been set up to handle delivery notification messages to such addresses.
Whenever qconfirm-notice processes a delivery notification message, it check if the dot-qmail file it was invoked from is in use for long enough. If so, qconfirm-notice creates a new seven characters long random string, creates a new dot-qmail file with this random string, and tells qconfirm-inject to use the new random string from now on. Obsolete dot-qmail files for delivery notifications are removed automatically.
The configuration file conf/QCONFIRM_MID has been set up in the qconfirm directory, containing the seven characters long random string to detect follow-ups. A 14 characters long random string to identify confirmation request messages is created for each outgoing message.
qconfirm-inject keeps track of the Message-IDs of mail messages it has sent in the .qconfirm/notice/ directory for some time. qconfirm-notice checks the Message-IDs of potential configuration request messages against files on this directory before sending a delivery confirmation message.