[exim] Re: Routing based on *recipient* IP address

2023-10-27 Thread Gandalf Corvotempesta via Exim-users
Il giorno gio 26 ott 2023 alle ore 18:43 Jeremy Harris via Exim-users
 ha scritto:
> Run it seperately using "-be" expansion-test mode

As you can see here, with some hosts the MXs are returned properly
(even with IPv6, i've cheded),
but with some others, don't. (it also fails on some of my domains). Any clue ?

It's the "a+" lookup that fails, the mxh is working properly.

# exim -be '${lookup dnsdb{>; a+=${lookup dnsdb{>; mxh=gmail.com'

# exim -be '${lookup dnsdb{>; a+=${lookup dnsdb{>; mxh=ansa.it'

# exim -be '${lookup dnsdb{>; a+=${lookup dnsdb{>; mxh=microsoft.com'
104.47.53.36;104.47.54.36
# exim -be '${lookup dnsdb{>; a+=${lookup dnsdb{>; mxh=tex.cu'
190.92.116.36

-- 
## subscription configuration (requires account):
##   https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
##   exim-users-unsubscr...@lists.exim.org
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/


[exim] Re: Routing based on *recipient* IP address

2023-10-27 Thread Kirill Miazine via Exim-users

• Gandalf Corvotempesta via Exim-users [2023-10-27 08:40]:

Il gio 26 ott 2023, 21:22 Kirill Miazine via Exim-users <
exim-users@lists.exim.org> ha scritto:


Maybe you could solve the task at a lower level, e.g. use operating
system's networking facilities e.g. to redirect connections to port 25
on those specific IP addresses to the smarthost, or better have some VPN
between GCP and AWS and route packets via the AWS instance (which would
have to make sure to use NAT on packets coming from GCP).

Could that work?



i can , and would be much easier, but this would "break" logging and
debugging i think
exim will log an email sent to IP 1.2.3.4 (the real one) but thank to
iptables, the email is sent to a different host.

It works, but in 2 days we'll forget this thing and we'll start to
troubleshoot why an email sent to and accepted by 1.2.3.4 is not delivered,
forgetting that the email could be stuck in our external "proxy"

even an exim -bt f...@.in will not produce a useful output

Better to handle the routing inside exim, but in going crazy with the
conditions

i've already set a condition with ${if forany.} to trigger if any of
the the ip in the list are inside a file, but with ipv6 it doesn't work at
all, the list seems to be always empty


Have you considered using the dnslists ACL condition and set an 
appropriate ACL message variable to check in a router? There's an 
example at the end of section 30 for how to query dnslists for multiple 
explicit keys at the same time:


https://www.exim.org/exim-html-current/doc/html/spec_html/ch-access_control_lists.html#SECTmulkeyfor

The countries.nerd.dk zone contains two-letter ISO 3166 country-code 
subdomains you can use to determine whether an IP is from that 
particular country.


--
## subscription configuration (requires account):
##   https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
##   exim-users-unsubscr...@lists.exim.org
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/


[exim] Re: Routing based on *recipient* IP address

2023-10-27 Thread Kirill Miazine via Exim-users

• Kirill Miazine via Exim-users [2023-10-27 09:26]:
The countries.nerd.dk zone contains two-letter ISO 3166 country-code 
subdomains you can use to determine whether an IP is from that 
particular country.


ah, the list doesn't seem to be active anymore... :(

--
## subscription configuration (requires account):
##   https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
##   exim-users-unsubscr...@lists.exim.org
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/


[exim] Re: Routing based on *recipient* IP address

2023-10-27 Thread Gandalf Corvotempesta via Exim-users
Il giorno ven 27 ott 2023 alle ore 09:30 Kirill Miazine via Exim-users
 ha scritto:
> Have you considered using the dnslists ACL condition and set an
> appropriate ACL message variable to check in a router? There's an
> example at the end of section 30 for how to query dnslists for multiple
> explicit keys at the same time:
>
> https://www.exim.org/exim-html-current/doc/html/spec_html/ch-access_control_lists.html#SECTmulkeyfor

I can't use dnslist ACL because I don't have the *remote* ip address
to use as key to search for
I have to use a dnsdb lookup first and, as i have to call the lookup
anyway, i think it's easier to call
it directly inside the router with a condition, just to keep
everything in a single place, or not ?
Also, to use a custom dnslist i have to start a rbldnsd (or similar) server

> The countries.nerd.dk zone contains two-letter ISO 3166 country-code
> subdomains you can use to determine whether an IP is from that
> particular country.

It doens't work. NXDOMAIN

-- 
## subscription configuration (requires account):
##   https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
##   exim-users-unsubscr...@lists.exim.org
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/


[exim] Re: Looking for generic tutorial for implementing SMTP AUTH against LDAP

2023-10-27 Thread Alan Hicks via Exim-users

On 27/10/2023 05:24, Mihamina RKTMB via Exim-users wrote:

Hi all,

I want to setup an Exim SMTP AUTH server, where my users are in a 
POSIX compliant LDAP.


I am running ArchLinux, so a generic tutorial would be fine (Debian 
specific ones need some transformations to remove the Debians 
packagers macros)


Would you know any existing tutorial for that, please?

Regards.


Not a tutorial, but maybe the following configuration file might help, 
it's generic with ldap commented out. I'm using it in production and it 
works well with openldap 2.6:

https://github.com/dbmail/dbmail/blob/main/contrib/exim-dbmail-configure

--
## subscription configuration (requires account):
##   https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
##   exim-users-unsubscr...@lists.exim.org
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/


[exim] Re: Routing based on *recipient* IP address

2023-10-27 Thread Gandalf Corvotempesta via Exim-users
Il giorno ven 27 ott 2023 alle ore 09:17 Gandalf Corvotempesta
 ha scritto:
> As you can see here, with some hosts the MXs are returned properly
> (even with IPv6, i've cheded),
> but with some others, don't. (it also fails on some of my domains). Any clue ?
>
> It's the "a+" lookup that fails, the mxh is working properly.
>
> # exim -be '${lookup dnsdb{>; a+=${lookup dnsdb{>; mxh=gmail.com'
>
> # exim -be '${lookup dnsdb{>; a+=${lookup dnsdb{>; mxh=ansa.it'
>
> # exim -be '${lookup dnsdb{>; a+=${lookup dnsdb{>; mxh=microsoft.com'
> 104.47.53.36;104.47.54.36
> # exim -be '${lookup dnsdb{>; a+=${lookup dnsdb{>; mxh=tex.cu'
> 190.92.116.36

Found the issue: when the remote domain as multiple MXs, the dnsdb
lookup for "A/" records fails.
I need to use a forany on the mx list, but if I understood correctly,
the forany can be used only inside an IF

-- 
## subscription configuration (requires account):
##   https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
##   exim-users-unsubscr...@lists.exim.org
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/


[exim] Re: Routing based on *recipient* IP address

2023-10-27 Thread Lena--- via Exim-users
> From: Gandalf Corvotempesta

> # exim -be '${lookup dnsdb{>; a+=${lookup dnsdb{>; mxh=gmail.com'

Must be : instead or ; before mxh.

-- 
## subscription configuration (requires account):
##   https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
##   exim-users-unsubscr...@lists.exim.org
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/


[exim] Re: Routing based on *recipient* IP address

2023-10-27 Thread Kirill Miazine via Exim-users

• Gandalf Corvotempesta [2023-10-27 09:44]:

Il giorno ven 27 ott 2023 alle ore 09:30 Kirill Miazine via Exim-users
 ha scritto:

Have you considered using the dnslists ACL condition and set an
appropriate ACL message variable to check in a router? There's an
example at the end of section 30 for how to query dnslists for multiple
explicit keys at the same time:

https://www.exim.org/exim-html-current/doc/html/spec_html/ch-access_control_lists.html#SECTmulkeyfor


I can't use dnslist ACL because I don't have the *remote* ip address
to use as key to search for
I have to use a dnsdb lookup first and, as i have to call the lookup
anyway, i think it's easier to call
it directly inside the router with a condition, just to keep
everything in a single place, or not ?


You'd have to do MX lookup, yes (as the example in the docs show), but 
then dnslists would do the matching for you. I'd say it's easier to use 
an existing matching facility, rather than re-implementing it (and risk 
some edge cases). OTOH, the ACL would set the variable on a per-message 
basis, and routing condition will be on a per-recipient basis, so router 
with condition is likely best if you want to do this in Exim.



Also, to use a custom dnslist i have to start a rbldnsd (or similar) server


countries.nerd.dk used to be such a list... The benefit of such dns 
lists is that they could be used from multiple hosts, without a need to 
have a local copy of files around.



The countries.nerd.dk zone contains two-letter ISO 3166 country-code
subdomains you can use to determine whether an IP is from that
particular country.


It doens't work. NXDOMAIN


Yeah, it seems to be gone.

--
## subscription configuration (requires account):
##   https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
##   exim-users-unsubscr...@lists.exim.org
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/


[exim] Re: Routing based on *recipient* IP address

2023-10-27 Thread Jasen Betts via Exim-users
On 2023-10-26, Gandalf Corvotempesta via Exim-users  
wrote:
> Hi guys
>
> TL;DR: how can i route, to a specific smarthost, all email based on
> the *recipient* mx IP address ?

Yes, in your config use the dnslookup router for that smarthost use 
ignore_target_hosts with an
inverted host list  ( that is put a ! in front of it )

 hostlist iran_ips = .
  
 iram_mx:
   driver=dnslookup
   ignore_target_hosts = ! +iran_ips
   route_data=address_of_your_smarthost
   transport = iran_smarthost
   
 
> I can check for the remote MX in the transport, but:
> 1. i'm getting a list of multiple hosts
> 2. i need to convert one (or more) of them to IP addresses
> 3. i need to check if at least one of these IP is inside a file
> (automatically updated from ipdeny.com)

looking in a file is also possible

hostlist iran_ips = /path/to/file

-- 
 Jasen.
 🇺🇦 Слава Україні

-- 
## subscription configuration (requires account):
##   https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
##   exim-users-unsubscr...@lists.exim.org
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/


[exim] Re: Destination address in a transport

2023-10-27 Thread Jasen Betts via Exim-users
On 2023-10-26, Thomas Andrews via Exim-users  wrote:
> On 10/26/23 11:51, Jeremy Harris via Exim-users wrote:
>> On 26/10/2023 10:11, Thomas Andrews via Exim-users wrote:
>>> The external program is delivering the email to another server for 
>>> further processing.
>>
>> If that's all it is doing, and the delivery is done using SMTP, Exim
>> can do that itself.  What are you not telling us?
>
> Sorry for the vagueness - I just didn't want to clutter with too much 
> info. The emails are not getting delivered to the next machine via SMTP 
> - that option is not available/possible/suitable in this case. So, it's 
> a bespoke program that is used to do the transfer. (And that facilitates 
> additional processing, but that's not relevant.)
>

Can you modfy the program so that it takes the destination address
from a header instead of from the command line?


-- 
 Jasen.
 🇺🇦 Слава Україні

-- 
## subscription configuration (requires account):
##   https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
##   exim-users-unsubscr...@lists.exim.org
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/


[exim] Re: SEGV_MAPERR

2023-10-27 Thread Julian Waters via Exim-users
Thanks for the replies. I don’t fully understand everything you asked but as 
much as i’ve been able to figure out is pasted below. Also the config incase 
there’s an obvious issue there. 
I haven’t raised a debian bug, I’m assuming it’s just my incompetence. 

Any assistance deeply appreciated. 


Version:
Exim version 4.96 #2 built 29-Sep-2023 20:38:02

Permissions:
-rwsr-xr-x 1 root root1575384 Sep 30 09:38 exim4


Configuration file:
#

primary_hostname = controlroom.co

# ports
daemon_smtp_ports = 25 : 465 : 587
tls_on_connect_ports = 465

#MySQL
VIRTUAL_DOMAINS = SELECT DISTINCT domain FROM domains WHERE type = 'local' AND 
enabled = '1' AND domain = '${quote_mysql:$domain}'
RELAY_DOMAINS = SELECT DISTINCT domain FROM domains WHERE type = 'relay'  AND 
domain = '${quote_mysql:$domain}'
ALIAS_DOMAINS = SELECT DISTINCT alias FROM domainalias WHERE alias = 
'${quote_mysql:$domain}'

MAIN_LOCAL_DOMAINS = @ : controlroom.co : ${lookup mysql{VIRTUAL_DOMAINS}} : 
${lookup mysql{ALIAS_DOMAINS}}
MAIN_RELAY_TO_DOMAINS = ${lookup mysql{RELAY_DOMAINS}}
MAIN_RELAY_NETS = localhost : @ : 192.168.0.0/24
MAIN_TRUSTED_USERS = www-data : vexim : root

VEXIM_LOCALPART_SUFFIX = +*

VEXIM_SPAM_REPORT_HEADER_NAME = X-Spam-Status

hide mysql_servers = 
localhost::(/var/run/mysqld/mysqld.sock)/vexim/vexim/###

# users
exim_user = Debian-exim
exim_group = Debian-exim
never_users = root

# TLS
MAIN_TLS_ENABLE = 1
REMOTE_SMTP_SMARTHOST_HOSTS_REQUIRE_TLS = *
REQUIRE_PROTOCOL = smtps
MAIN_TLS_CERTIFICATE = /etc/letsencrypt/live/controlroom.co/fullchain.pem
MAIN_TLS_PRIVATEKEY = /etc/letsencrypt/live/controlroom.co/privkey.pem
auth_advertise_hosts = ${if eq {$tls_cipher}{}{}{*}}

tls_dhparam = none

#



$ openssl s_client -connect localhost:587 -servername controlroom.co -starttls 
smtp
CONNECTED(0003)
809BCD053E7F:error:0A000126:SSL routines:ssl3_read_n:unexpected eof while 
reading:../ssl/record/rec_layer_s3.c:303:
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 230 bytes and written 353 bytes
Verification: OK
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
Early data was not sent
Verify return code: 0 (ok)
---




$ swaks -a -tls -p 587 -q AUTH -s controlroom.co -au jul...@communico.nz
Password: #
=== Trying controlroom.co:587...
=== Connected to controlroom.co.
<-  220 controlroom.co ESMTP Exim 4.96 Fri, 27 Oct 2023 11:00:24 +1300
 -> EHLO ip-172-31-27-131.ap-southeast-2.compute.internal
<-  250-controlroom.co Hello controlroom.co [52.65.43.74]
<-  250-SIZE 52428800
<-  250-8BITMIME
<-  250-PIPELINING
<-  250-PIPECONNECT
<-  250-CHUNKING
<-  250-STARTTLS
<-  250-PRDR
<-  250 HELP
 -> STARTTLS
*** Remote host closed connection unexpectedly.



$ sudo tail -f /var/log/mail.log

2023-10-27T12:59:18.381777+13:00 ip-172-31-27-131 imapd-ssl: Connection, 
ip=[:::121.99.134.237], port=[53803]
2023-10-27T12:59:18.438273+13:00 ip-172-31-27-131 imapd-ssl: LOGIN, 
user=jul...@communico.nz, ip=[:::121.99.134.237], port=[53803], 
protocol=IMAP
2023-10-27T12:59:18.495509+13:00 ip-172-31-27-131 imapd-ssl: LOGOUT, 
user=jul...@communico.nz, ip=[:::121.99.134.237], port=[53803], headers=0, 
body=0, rcvd=36, sent=277, time=0, starttls=1




$ sudo tail -f /var/log/exim4/mainlog

2023-10-27 12:55:32 SIGSEGV (fault address: 0x4)
2023-10-27 12:55:32 SEGV_MAPERR
2023-10-27 12:55:32 SIGSEGV (null pointer indirection)
2023-10-27 12:55:32 SIGSEGV (1400295 handling incoming connection from 
(smtpclient.apple) [121.99.134.237]
)
2023-10-27 12:55:32 SMTP syntax error in 
"\026\003\001?\251\001??\245\003\003e:\374t+\035\007" H=[121.99.134.237] NUL 
character(s) present (shown as '?')
2023-10-27 12:55:32 SMTP syntax error in 
"\223l\334D\227\275\2412\315\303\251*?h\257\257\327c\346>w\247e\264??,?\377\300,\300+\300$\300#\300"
 H=[121.99.134.237] NUL character(s) present (shown as '?')
2023-10-27 12:55:32 SMTP syntax error in "\300  
\300\b\3000\300/\300(\300'\300\024\300\023\300\022?\235?\234?=? On 19/10/2023, at 9:41 PM, Jeremy Harris via Exim-users 
>  wrote:
> 
> On 19/10/2023 07:53, Julian Waters via Exim-users wrote:
>> Since upgrading to Debian Bookworm
> 
> That doesn't actually tell us what version of Exim.  "exim -bV" will.
> Have you raised a Debian bug?
> 
>> After reconfiguring from scratch a few times narrowed it down to this error 
>> in the exim4 mainlog:
> 
>> 2023-10-19 19:45:43 SIGSEGV (fault address: 0x4)
>> 2023-10-19 19:45:43 SEGV_MAPERR
>> 2023-10-19 19:45:43 SIGSEGV (null pointer indirection)
>> 2023-10-19 19:45:43 SIGSEGV (1302999 handling incoming connection from 
>> [xx.xx.xx.xx]
> 
> Not much to go on there apart from "it crashed".  What was it doing
> at the time?  Anything logged immediately before?  If not, if you place
> a custom log line in the connect ACL, does it shoe up consistently
> bef

[exim] Re: Routing based on *recipient* IP address

2023-10-27 Thread Gandalf Corvotempesta via Exim-users
Il giorno ven 27 ott 2023 alle ore 10:07 Kirill Miazine via Exim-users
 ha scritto:
> You'd have to do MX lookup, yes (as the example in the docs show), but
> then dnslists would do the matching for you. I'd say it's easier to use
> an existing matching facility, rather than re-implementing it (and risk
> some edge cases). OTOH, the ACL would set the variable on a per-message
> basis, and routing condition will be on a per-recipient basis, so router
> with condition is likely best if you want to do this in Exim.

Can you post an example, because Exim configuration and I, aren't good
friends :-)

-- 
## subscription configuration (requires account):
##   https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
##   exim-users-unsubscr...@lists.exim.org
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/


[exim] Re: Routing based on *recipient* IP address

2023-10-27 Thread Gandalf Corvotempesta via Exim-users
Il giorno ven 27 ott 2023 alle ore 10:10 Jasen Betts via Exim-users
 ha scritto:
> Yes, in your config use the dnslookup router for that smarthost use 
> ignore_target_hosts with an
> inverted host list  ( that is put a ! in front of it )
>
>  hostlist iran_ips = .
>
>  iram_mx:
>driver=dnslookup
>ignore_target_hosts = ! +iran_ips
>route_data=address_of_your_smarthost
>transport = iran_smarthost

This is very interesting and much simpler than mine, but route_data
can't be used in a dnslookup router, only in manualrouter
And the manualrouter doesn't do a dnslookup

-- 
## subscription configuration (requires account):
##   https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
##   exim-users-unsubscr...@lists.exim.org
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/


[exim] Re: Routing based on *recipient* IP address

2023-10-27 Thread Gandalf Corvotempesta via Exim-users
Il giorno ven 27 ott 2023 alle ore 10:10 Jasen Betts via Exim-users
 ha scritto:
> Yes, in your config use the dnslookup router for that smarthost use 
> ignore_target_hosts with an
> inverted host list  ( that is put a ! in front of it )
>
>  hostlist iran_ips = .
>
>  iram_mx:
>driver=dnslookup
>ignore_target_hosts = ! +iran_ips
>route_data=address_of_your_smarthost
>transport = iran_smarthost

SOLVED!
this is the solution (seems to work):

Google MX : routed normally

# exim -bt t...@gmail.com
R: relay_to_aws for t...@gmail.com
R: dnslookup for t...@gmail.com
t...@gmail.com
  router = dnslookup, transport = remote_smtp
  host gmail-smtp-in.l.google.com  [2a00:1450:400c:c0c::1a] MX=5
  host gmail-smtp-in.l.google.com  [108.177.15.27]  MX=5
  host alt1.gmail-smtp-in.l.google.com [2a00:1450:4013:c16::1b] MX=10
  host alt1.gmail-smtp-in.l.google.com [142.250.153.27] MX=10
  host alt2.gmail-smtp-in.l.google.com [2a00:1450:4025:c03::1a] MX=20
  host alt2.gmail-smtp-in.l.google.com [142.251.9.27]   MX=20
  host alt3.gmail-smtp-in.l.google.com [2a00:1450:4010:c1c::1b] MX=30
  host alt3.gmail-smtp-in.l.google.com [142.250.150.27] MX=30
  host alt4.gmail-smtp-in.l.google.com [2404:6800:4003:c00::1b] MX=40
  host alt4.gmail-smtp-in.l.google.com [74.125.200.26]  MX=40

Cuban MX: routed via AWS:

# exim -bt t...@tex.cu
R: relay_to_aws2 for t...@tex.cu
t...@tex.cu
  router = relay_to_aws, transport = remote_smtp_aws


relay_to_aws:
  debug_print = "R: relay_to_aws for $local_part@$domain"
  driver = dnslookup
  ignore_target_hosts = ! +gce_blocked_ips
  domains = ! +local_domains
  transport = remote_smtp_aws


remote_smtp_aws:
  debug_print = "T: remote_smtp_aws for $local_part@$domain"
  driver = smtp

  connect_timeout = 5s
  hosts = XXX.XXX.XXX.XXX
  hosts_override

-- 
## subscription configuration (requires account):
##   https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
##   exim-users-unsubscr...@lists.exim.org
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/


[exim] Re: Destination address in a transport

2023-10-27 Thread Thomas Andrews via Exim-users

On 10/27/23 06:09, Jasen Betts via Exim-users wrote:

On 2023-10-26, Thomas Andrews via Exim-users  wrote:

On 10/26/23 11:51, Jeremy Harris via Exim-users wrote:

On 26/10/2023 10:11, Thomas Andrews via Exim-users wrote:

The external program is delivering the email to another server for
further processing.

If that's all it is doing, and the delivery is done using SMTP, Exim
can do that itself.  What are you not telling us?

Sorry for the vagueness - I just didn't want to clutter with too much
info. The emails are not getting delivered to the next machine via SMTP
- that option is not available/possible/suitable in this case. So, it's
a bespoke program that is used to do the transfer. (And that facilitates
additional processing, but that's not relevant.)


Can you modfy the program so that it takes the destination address
from a header instead of from the command line?
Thanks Jasen, but I have elected to use the "dirty hack" solution 
suggested by Markus Reschke.


--
Regards,
Thomas


--
## subscription configuration (requires account):
##   https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
##   exim-users-unsubscr...@lists.exim.org
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/


[exim] Re: SEGV_MAPERR

2023-10-27 Thread Jeremy Harris via Exim-users

On 27/10/2023 04:12, Julian Waters via Exim-users wrote:

I haven’t raised a debian bug, I’m assuming it’s just my incompetence.


That a segv can happen at all constitutes a bug,
however it was triggered.


Can you run with debug?


This would have helped, but

Can you get a coredump (note: Exim is usually run suid)? 


This turns out to be essential, as the segv is hitting in
a library:

(libgnutls.so.30 + 0x15e06e)#012#2  0x7f451526b354 
gnutls_certificate_set_dh_params
 (libgnutls.so.30 + 0x6b354)#012#3  0x56095cf86da5 n/a
 (exim4 + 0xbfda5)#012#4  0x56095cf871c6 n/a
 (exim4 + 0xc01c6)#012#5  0x56095cf88280 n/a
 (exim4 + 0xc1280)#012#6  0x56095cf74622 n/a
 (exim4 + 0xad622)#012#7  0x56095cf06eef n/a
 (exim4 + 0x3feef)#012#8  0x56095cef89d8 n/a
 (exim4 + 0x319d8)#012#9  0x7f45154461ca __libc_start_call_main
 (libc.so.6 + 0x271ca)#012#10 0x7f4515446285 __libc_start_main_impl

What we can glean so far is:
- the crash is in the GnuTLS library
- (inference) possibly exim handed it some parameter it can't handle

and, you might actually have a core dump:

systemd-coredump[1400341]: Process 1400339 (exim4) of user 113 dumped 
core.#012#012S


However, this will probably have been a fully optimised binary for exim, and 
might
not include debug information.  It it doesn't, there might be an adjunct 
"debuginfo"
package you can install - or it may be that it requires special compilation.
You need to discuss this with Debian-knowledgeable people.

Once debug info is present, the next step is to investigate a coredump using 
gdb,
and get a stackdump (use the "bt" command) complete with function call 
arguments.

I still think you should open a Debian bug for this.
--
Cheers,
  Jeremy


--
## subscription configuration (requires account):
##   https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
##   exim-users-unsubscr...@lists.exim.org
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/