Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: exim: users

Executing $run command ???

 

 

exim users RSS feed   Index | Next | Previous | View Threaded


exim at u61

May 12, 2012, 2:18 PM

Post #1 of 3 (608 views)
Permalink
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 [at] domain
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.



--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/


jgh at wizmail

May 12, 2012, 2:26 PM

Post #2 of 3 (598 views)
Permalink
Re: Executing $run command ??? [In reply to]

On 2012-05-12 22:18, Always Learning wrote:
> I wanted to send an email from within Exim's ACLs.

logwrite = mail warning to CONTACT_NAME
continue = ${run \
{/usr/sbin/sendmail -n -s high_rbounce_rate_userid_$acl_m_rcpt_uid CONTACT_NAME -- -f <>} \
{}{}}


--
Jeremy

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/


Lena at lena

May 13, 2012, 7:25 AM

Post #3 of 3 (596 views)
Permalink
Re: Executing $run command ??? [In reply to]

> all my attempts to feed the Exim Binary with an email message
> failed:-
>
> EXBINARY = /usr/sbin/exim
> MAILME = user [at] domain
> SHELL = /bin/bash
>
> ${run{SHELL -c "\N{\N echo Subject: Test Msg; echo; echo Un Deux \
> Drie Vier; \N}\N | EXBINARY MAILME"}}

root [at] len:/root# exim -be
> ${run{/bin/sh -c "\N{\N echo Subject: Test Msg; echo; echo hello world; \N}\N | /usr/local/sbin/exim -f root Lena [at] lena"}}

> ^C

> Received: from root by lena.kiev.ua with local (Exim 4.77 (FreeBSD))
> (envelope-from <root()lena.kiev.ua>)
> id 1STZYZ-000Miq-0b
> for Lena [at] lena; Sun, 13 May 2012 17:13:55 +0300
> Subject: Test Msg
> Message-Id: <E1STZYZ-000Miq-0b [at] lena>
> From: root()lena.kiev.ua
> Date: Sun, 13 May 2012 17:13:55 +0300
>
> hello world

I do get a message when a SMTP auth brute force attack detected
and IP-address automatically blocked - see my Exim config excerpts:
http://lena.kiev.ua/Lena-eximconf-run.txt

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/

exim users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.