Re: [exim] ${lookup{value}lsearch{file}{yes}{no}} tricks help request

2018-11-13 Thread Lena--- via Exim-users
> From: supportsob...@mail.ru

> Could someone help with syntax of?${lookup{value}lsearch{file}{yes}{no}}
> 
> I'm trying to write a condition that will return "FALSE" if either of hosts
> from "Received:" headers (yes, any on the way from sender's server to me)
> is listed in?/etc/whitelist_networks, otherwise "TRUE".

deny !condition = ${if forany{<\n $h_Received:}\
 {match{$item}\
   {\N\B(\d+\.\d+\.\d+\.\d+)\B\N}\
   {$lookup{$1}iplsearch{/path/file}{1}{0}}\
   {0}\
 }\
   }

-- 
Lena

-- 
## 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/


Re: [exim] ${lookup{value}lsearch{file}{yes}{no}} tricks help request

2018-11-13 Thread Jeremy Harris via Exim-users
On 10/11/2018 23:52, supportsobaka--- via Exim-users wrote:
> I'm trying to write a condition that will return "FALSE" if either of hosts 
> from "Received:" headers (yes, any on the way from sender's server to me) 

Where there are multiple headers of name requested using $h_foo:
you get a newline-separated list.  You could walk that list in
an expansion condition "forany", calling your lookup for each one.

http://exim.org/exim-html-current/doc/html/spec_html/ch-string_expansions.html#SECTexpcond

-- 
Cheers,
  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/


Re: [exim] multiple routes to the same smarthost, discrimating based on size?

2018-11-13 Thread Jeremy Harris via Exim-users
On 09/11/2018 18:33, Adam Stenseth via Exim-users wrote:
> I’m trying to set up exim to send messages for a particular subdomain (a 
> specific mailacross two different links (one default route, one a static 
> route on the system).One of these links is very low-bandwidth, so I need 
> to discrimate based on message size. Anybody if exim has a facility to do 
> this?

Your routing for the smrthost is probably done using a manualroute
router.  The routing data for these is expanded, so has access to
all the Exim expansion variables.

See
http://exim.org/exim-html-current/doc/html/spec_html/ch-the_manualroute_router.html
and
http://exim.org/exim-html-current/doc/html/spec_html/ch-string_expansions.html

You probably need to involve $message_size.
-- 
Cheers,
  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/


Re: [exim] LMTP connection - how to debug?

2018-11-13 Thread Jeremy Harris via Exim-users
On 07/11/2018 23:21, Naoyuki Tai via Exim-users wrote:
>  netstat -an | grep LISTEN | grep 2003
> prints out a line, and when I do
> 
> telnet localhost 2003
> Trying ::1...
> Trying 127.0.0.1...
> Connected to localhost.
> Escape character is '^]'.
> 220 mailserver Cyrus LMTP 2.5.10-Debian-2.5.10-3ubuntu1 server ready
> 
> So, it looks like lmtpd TCP socket seems working all right.

I assume that is cyrus on the port it's expecting the lmtp feed on.

> Nov  7 15:21:23 mailserver exim[28104]: 2018-11-07 15:21:23 Start queue
> run: pid=28104
> Nov  7 15:21:23 mailserver exim[28107]: 2018-11-07 15:21:23
> 1gKIxS-0006X5-KE H=localhost [::1] Connection refused
> Nov  7 15:21:23 mailserver exim[28107]: 2018-11-07 15:21:23
> 1gKIxS-0006X5-KE H=localhost [127.0.0.1] Connection refused
> Nov  7 15:21:23 mailserver exim[28106]: 2018-11-07 15:21:23
> 1gKIxS-0006X5-KE == r...@nile.cleanwinner.com R=local_user T=cyrus_ltcp
> defer (111): Connection refused
> Nov  7 15:21:23 mailserver exim[28104]: 2018-11-07 15:21:23 End queue
> run: pid=28104

Presumably your cyrus_ltcp transport has a port option. Check it
is set to the expected one.

If you want the port logged, add outgoing_port to your log_selector.
-- 
Cheers,
  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/


[exim] multiple routes to the same smarthost, discrimating based on size?

2018-11-13 Thread Adam Stenseth via Exim-users
Hi,

I’m trying to set up exim to send messages for a particular subdomain (a 
specific mailacross two different links (one default route, one a static route 
on the system).One of these links is very low-bandwidth, so I need to 
discrimate based on message size. Anybody if exim has a facility to do this?

thanks, 

-adam
-- 
## 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] LMTP connection - how to debug?

2018-11-13 Thread Naoyuki Tai via Exim-users
Hello,

I am having a bit of problem with exim4 talking to Cyrus
lmtpd.

I have been using Cyrus and Exim for last 10+ years or so,
and I just set up a new host. New hardware with fresh
Ubuntu server 18.04 LTS installed.

Cyrus IMAP as imap server is working. I can connect to the
IMAP from client. netstat -an | grep LISTEN | grep 2003
prints out a line, and when I do

telnet localhost 2003
Trying ::1...
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 mailserver Cyrus LMTP 2.5.10-Debian-2.5.10-3ubuntu1 server ready

So, it looks like lmtpd TCP socket seems working all right.

I get mails using fetchmail, it is sent to exim, and exim
sends it to Cyrus.

>From /var/log/mail.log

Nov  7 15:21:23 mailserver exim[28104]: 2018-11-07 15:21:23 Start queue
run: pid=28104
Nov  7 15:21:23 mailserver exim[28107]: 2018-11-07 15:21:23
1gKIxS-0006X5-KE H=localhost [::1] Connection refused
Nov  7 15:21:23 mailserver exim[28107]: 2018-11-07 15:21:23
1gKIxS-0006X5-KE H=localhost [127.0.0.1] Connection refused
Nov  7 15:21:23 mailserver exim[28106]: 2018-11-07 15:21:23
1gKIxS-0006X5-KE == r...@nile.cleanwinner.com R=local_user T=cyrus_ltcp
defer (111): Connection refused
Nov  7 15:21:23 mailserver exim[28104]: 2018-11-07 15:21:23 End queue
run: pid=28104

EXIM says "connection refused". I know, if you do plain TCP connection
(like telnet), it does connect.

How can I debug this?
I want to know why Exim says "connection refused".

As I said, although this is a new box, I've done this (with virtually
identical set up) many times over years. This is the first time
exim is giving me a hard time.

For info - cyrus lmptd is running using "lmtpd -a" which I learned
from https://github.com/Exim/exim/wiki/CyrusImap
so, the authentication of lmtp connection shouldn't be the problem.

Thanks.

-- Tai

-- 
## 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] ${lookup{value}lsearch{file}{yes}{no}} tricks help request

2018-11-13 Thread supportsobaka--- via Exim-users
Could someone help with syntax of ${lookup{value}lsearch{file}{yes}{no}}

I'm trying to write a condition that will return "FALSE" if either of hosts 
from "Received:" headers (yes, any on the way from sender's server to me) is 
listed in /etc/whitelist_networks, otherwise "TRUE".

This will work:

deny
 condition = ${if !match{$h_Received:}{1.1.1.1}}
But I want to have a whitelist file, so I'm trying this:

deny 
 condition = \
 ${lookup{$h_Received:}\
 lsearch*{/etc/whitelist_networks}\
 {no}{yes}} This obviously will not work.

Is there an opposite to above way to say exim: "search a partial match of the 
line  from  /etc/whitelist_networks  in  $h_Received?"

Thanks
-- 
## 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/