[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
GNU Anubis is able to modify arguments of SMTP commands. To instruct it to do so, define a section named ‘SMTP’. Anubis will call this section each time it receives an SMTP command. This section can contain any statements allowed for ‘RULE’ section, plus the following special flavor of the ‘modify’ statement:
If the current SMTP command matches cmd, rewrite it by using value as its argument.
For example, this is how to force using ‘my.host.org’ as the ‘EHLO’ argument:
BEGIN SMTP modify command [ehlo] "my.host.org" END
Additionally, the ESMTP authentication settings (see section ESMTP Authentication Settings) can be used as actions in this section.
To do so, you must first set esmtp-auth-delayed
to ‘yes’
in the ‘CONTROL’ section (see section esmtp-auth-delayed). Changes in the settings take effect if they
occur either before the ‘MAIL’ SMTP command, or while
handling this command.
Consider, for example, the following configuration:
BEGIN CONTROL mode transparent bind 25 remote-mta mail.example.com esmtp-auth-delayed yes END BEGIN SMTP if command ["mail from:"] "<smith(\+.*)?@example.net>" esmtp-auth-id smith esmtp-password guessme else esmtp-auth no fi END
It delays ESMTP authentication until the receipt of the MAIL
command from the client. Authentication is used only if the mail
is being sent from smith@example.net or any additional mailbox
of that user (e.g. smith+mbox@example.net). Otherwise,
authentication is disabled.
The following points are worth mentioning:
BEGIN SMTP if command ["mail from:"] "<(.*)@(.*)>(.*)" modify command ["mail from:"] "<\1@gnu.org>\2" fi END
BEGIN SMTP
# Wrong!
if command ["mail from:"] "<>(.*)"
modify command [ehlo] "domain.net"
fi
END
It is because by the time ‘MAIL FROM’ is received, the ‘EHLO’ command has already been processed and sent to the server.
The final point to notice is that you may use an alternative name for that section (if you really want to). To do so, define the new name via the ‘smtp-command-rule’ option in the ‘CONTROL’ section (see section smtp-command-rule).
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated on January 6, 2024 using texi2html 5.0.