[exim-dev] (no subject)

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Todd Lyons
Date:  
À: exim-dev
Nouveaux-sujets: Re: [exim-dev] SMTP PRDR, [exim-dev] PRDR (was: (no subject))
Sujet: [exim-dev] (no subject)
Ok, I'm learning about exim's innards. I'm a firm believer that the
best way to learn something is to do a small project (trial by fire),
so I'm attempting to add PRDR (Per Recipient Data Response) capability
to exim. I have not exactly settled on settings in the config file
(hardcoded on for the moment) nor an ACL approach. At this point, I'm
just trying to get exim to recognize the request for PRDR.

The draft (now expired, but like I said, this is mostly for
educational purposes, and it might end up becoming useful if more
implement it) basically says that you add a PRDR capability to the
HELO reponse (done), and activate PRDR when it's requested by the
sending MTA during the mail from:

MAIL FROM:<user@???> PRDR

In the code which parses args to mail and rcpt commands, it requires
key=value pairs (for example, BODY=149833), so this type of option
which is just a singleton (what other word describes it?) is rejected
by the following code:

src/src/smtp_in.c:
    /* Loop, checking for ESMTP additions to the MAIL FROM command. */


    if (esmtp) for(;;)
      {
      uschar *name, *value, *end;
      unsigned long int size;


      if (!extract_option(&name, &value)) break;



which calls:

static BOOL
extract_option(uschar **name, uschar **value)
{
uschar *n;
uschar *v = smtp_cmd_data + Ustrlen(smtp_cmd_data) - 1;
while (isspace(*v)) v--;
v[1] = 0;

while (v > smtp_cmd_data && *v != '=' && !isspace(*v)) v--;
if (*v != '=') return FALSE;

<snip>

So the extract_option requires a key=value pair. At this point, the
has not yet verified that the options are valid/invalid, it's just
splitting them from the email address. With contemporary exim design
standards in mind:

1) would it better to pass a variable to extract_option() to indicate
that "=" is not required?
2) would it be better to make a duplicate function that basically just
does #1 (i.e. not require "=")
3) something else?

I guess the real question is, how many other valid options to mail (or
I guess rcpt) are there that are only a singleton, not key/value
pairs? In my searching, I've not really found any definitive list,
and those that I do find, I've only seen key/value pairs, no
singletons.

I'm hoping for a suggestion of what would be the best way to have this
non key/value option to get accepted.

...Todd
--
Always code as if the guy who ends up maintaining your code will be a
violent psychopath who knows where you live. -- Martin Golding