[exim] Executing $run command ???

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Always Learning
Dátum:  
Címzett: Exim
Tárgy: [exim] Executing $run command ???

I use Exim 4.63 with Centos 5.8

I wanted to send an email from within Exim's ACLs.

Googling I found the recent posting from Lena
http://www.exim.org/lurker/message/20100323.122536.8fe8af1a.en.html

> accept authenticated = *
>    !verify = recipient/defer_ok/callout=10s,defer_ok,use_sender
>    ratelimit = LIM / PERIOD / per_rcpt / user-$acl_m_user
>    continue = ${run{SHELL -c "echo $acl_m_user >>DIR/blocked_users; \
>      \N{\N echo Subject: user $acl_m_user blocked; echo; echo because \
>      has sent mail to more than LIM invalid recipients during PERIOD.; \
>      \N}\N | EXIMBINARY WARNTO"}}
>    control = freeze/no_tell
>    add_header = X-Authenticated-As: $acl_m_user


and found I could get Exim to run a shell. For example this works:-

warn message = ${run{/bin/bash -c "echo $sender_helo_name
>> /eximtest;"}}


However all my attempts to feed the Exim Binary with an email message
failed:-

EXBINARY       = /usr/sbin/exim
MAILME         = user@???
SHELL          = /bin/bash


${run{SHELL -c "\N{\N echo Subject: Test Msg; echo; echo Un Deux \
      Drie Vier; \N}\N | EXBINARY MAILME"}}


I found success with PHP:-

warn message = ${run{SHELL -c "/usr/bin/php /dx/php/exim01 'SSSSS' 'test
msg AZC'"}}

<?php
$subj = $argv[1];
$mess = $argv[2];
$headers = 'From: Exim Server <.....@......com>'."\n".
           'Content-Type: text/plain; charset=ISO-8859-1'."\n";
$to      = 'Exim Warning <.....@......com>';
mail($to,$subj,$mess,$headers,'-f .....@......com');
?>


and a nice email was produced and successfully processed by Exim.

HOWEVER, I would like to be able to use the Exim Binary as Lena did. All
ideas gratefully welcome.


--
Paul.
England,
EU.