Re: [Exim] How to use script to validate address

Pàgina inicial
Delete this message
Reply to this message
Autor: Kirill Miazine
Data:  
A: exim-users
Assumpte: Re: [Exim] How to use script to validate address
* Jan Martinek [2002-09-17 11:38]:
> Hello,
>
> I would like to configure Exim to become an "SMS gateway".
> It should proceed mail addressed to
> xxxxxxxxxx@???
> where xxxxxxxxx is a GSM telephone number. I cannot
> use any list, because there are lots of possible numbers,
> but I can do a script that can check telephone number validity
> and eventually send SMS.
> So Exim should do the following things:
> if the mail address is not local, pipe it to the script.


What do you mean by "not local"?

> The script is able to send the mail as SMS if the number
> is valid.
> If the script returns non zero (invalid number),
> go on proceeding the mail normal way - probably resulting
> in "Unknown recipient" or something.
> Is it possible to do it somehow?


Yes it is. A better approach would IMHO be if the script only was run if
the number is valid. You can use some kind of lookup to do verification
of the local part.

An possible configuration could be somthing like:

<router>

sms_router:
    driver = accept
    domains = your.sms.domain
    condition = <do verification of the number,
                 use ${run} if no lookup can be used>
    transport = sms_transport


</router>


<transport>

sms_transport:
    driver = pipe
    command = /path/to/your/sms-script
    return_path_add
    envelope_to_add
    delivery_date_add
    log_output
    return_fail_output
    message_prefix =
    message_suffix =


</transport>

--
Kirill