Re: [exim] Subject rewriting

2021-08-31 Thread nb via Exim-users
Le 2021-09-01 04:42, Sebastian via Exim-users a écrit :
> I would personally use the "Keywords:" header instead:
> 
>   warn
> condition = ${if
> forany{${listnamed_d:trusted_domains}}{match{$sender_address_domain}{\\.$item\$}}{yes}{${if
> forany{${listnamed_d:trusted_domains}}{eq{$sender_address_domain}{$item}}{yes}{no
> set acl_m3 = =E2=9C=94=EF=B8=8F Betrodd dom=C3=A4n
> set acl_m4 = dnswl_whitelisted
> set acl_m5 = pass
> set acl_m6 = 1
>   warn
> condition = ${if
> forany{${listnamed_d:trusted_domains}}{match{$sender_address_domain}{\\.$item\$}}{no}{${if
> forany{${listnamed_d:trusted_domains}}{eq{$sender_address_domain}{$item}}{no}{yes
> set acl_m3 = =E2=9E=96 Ok=C3=A4nd dom=C3=A4n
> set acl_m5 = fail
>   warn
> condition = ${if
> forany{${listnamed_d:suspicious_domains}}{match{$sender_address_domain}{\\.$item\$}}{yes}{${if
> forany{${listnamed_d:suspicious_domains}}{eq{$sender_address_domain}{$item}}{yes}{no
> condition = ${if eq{$acl_m5}{fail}{yes}{no}}
> set acl_m3 = =E2=9D=8C Misst=C3=A4nkt skadlig dom=C3=A4n
> set acl_m5 = suspicious
> 
>   deny
> message = 5.7.23 SPF fail (phishing) -
> (${sg{${sg{$spf_smtp_comment}{http\:\/\/www\.open-spf\.org\/Why}{https:\/\/www.sebbe.eu\/spf.cgi}}}
> {=sebbe\.eu}{}})
> log_message = SPF check failed: ($spf_header_comment)
> spf = fail : softfail
>   warn
> set acl_m1 = 4
>   warn
> spf = pass
> add_header = X-SPF-Signature: $spf_result ($spf_header_comment)
> set acl_m1 = 3
> set acl_m2 = =E2=9C=94=EF=B8=8F SPF-signaturen =C3=A4r giltig
>   warn
> spf = none : neutral
> add_header = X-SPF-Signature: $spf_result ($spf_header_comment)
> set acl_m1 = 2
> set acl_m2 = =E2=9E=96 SPF-signatur saknas
>   warn
> spf = permerror : temperror
> log_message = SPF failure: $spf_header_comment
> add_header = X-SPF-Signature: $spf_result ($spf_header_comment)
> set acl_m1 = 1
> set acl_m2 = =E2=9A=A0=EF=B8=8F Trasig SPF-signatur
>warn
> condition =  ${if eq{$acl_m1}{4}{yes}{no}}
> add_header = X-SPF-Signature: permerror (No SPF lookup was made due to 
> technical error)
> set acl_m1 = 1
> set acl_m2 = =E2=9A=A0=EF=B8=8F Trasig SPF-signatur
>   accept
> 
> 
> acl_check_dkim:
>   accept
>dkim_status = fail
>add_header = X-DKIM-Signature: fail (address=$sender_address 
> domain=$dkim_cur_signer -
> signature is bad)
>add_header = Keywords: =?UTF-8?Q?$acl_m2,=E2=9D=8C F=C3=B6rfalskad
> DKIM-signatur,$acl_m3?=
>add_header = X-Priority: ${if eq {$acl_m1}{3}{3}{1}}
>add_header = X-Status: ${if eq {$acl_m6}{1}{${if eq 
> {$acl_m1}{3}{F}{}}}{}}
>   accept
>dkim_status = invalid
>add_header = X-DKIM-Signature: invalid ($dkim_verify_status - 
> $dkim_verify_reason)
>add_header = Keywords: =?UTF-8?Q?$acl_m2,=E2=9A=A0=EF=B8=8F Trasig
> DKIM-signatur,$acl_m3?=
>add_header = X-Priority: ${if eq {$acl_m1}{3}{3}{5}}
>add_header = X-Status: ${if eq {$acl_m6}{1}{${if eq 
> {$acl_m1}{3}{F}{}}}{}}
>   accept
>dkim_status = pass
>add_header = X-DKIM-Signature: pass (address=$sender_address 
> domain=$dkim_cur_signer -
> signature is good)
>add_header = Keywords: =?UTF-8?Q?$acl_m2,=E2=9C=94=EF=B8=8F 
> DKIM-signaturen =C3=A4r
> giltig,$acl_m3?=
>add_header = X-Priority: 3
>add_header = X-Status: ${if eq {$acl_m6}{1}{F}{}}
>   accept
>dkim_status = none
>add_header = X-DKIM-Signature: none (address=$sender_address 
> domain=$dkim_cur_signer -
> no signature found)
>add_header = Keywords: =?UTF-8?Q?$acl_m2,=E2=9E=96 DKIM-signatur 
> saknas,$acl_m3?=
>add_header = X-Priority: ${if eq {$acl_m1}{3}{3}{${if eq 
> {$acl_m1}{2}{1}{5
>add_header = X-Status: ${if eq {$acl_m6}{1}{${if eq 
> {$acl_m1}{3}{F}{}}}{}}
> 
> Gives a nice status indicator in Microsoft Outlook (you have to assign the 
> colors manually, tough),
> while the X-Priority header will add a (!) for fraudulent email, and a 
> (DOWNARROW) for when there
> is some technical problem, for email clients not supporting the Keywords: 
> header.
> 
> And also automatically star's the email with a star when all validations 
> succeed, for the same
> reason - email clients with no support for Keywords: header.
> 
> -Ursprungligt meddelande-
> Från: Jasen Betts via Exim-users  
> Skickat: den 1 september 2021 04:09
> Till: exim-users@exim.org
> Ämne: Re: [exim] Subject rewriting
> 
> On 2021-08-26, nb via Exim-users  wrote:
> > Hi,
> >
> > I need to change the subject when the message is considered as spam,
> > *and* when there is an SPF problem.
> >
> > I use the following method:
> >
> > 1 - for SPF:
> >  # remove old subject
> >  remove_header=Subject
> >  # create a new subject
> >  add_header = Subject: *** SPF Error 

Re: [exim] Subject rewriting

2021-08-31 Thread nb via Exim-users
Le 2021-09-01 01:54, Jasen Betts via Exim-users a écrit :
> On 2021-08-26, nb via Exim-users  wrote:
> > Hi,
> >
> > I need to change the subject when the message is considered as spam,
> > *and* when there is an SPF problem.
> >
> > I use the following method:
> >
> > 1 - for SPF:
> >  # remove old subject
> >  remove_header=Subject
> >  # create a new subject
> >  add_header = Subject: *** SPF Error *** $rh_Subject:
> >
> > 2 - for SPAM:
> >  # remove old subject
> >  remove_header=Subject
> >  # create a new subject
> >  add_header = Subject: ***SPAM (score: $spam_score)*** $rh_Subject:
> >
> > It works fine when either of these two cases occur.
> > But when both occur at the same time, I don't get the expected result.
> > In this case, I get two "Subject" headers.
> 
> One way would be to build up the prefix in an ACL variable.
> 
> # 1 - for SPF:
>   # add this to subject
>   set acl_m_subj_prefix = $acl_m_subj_prefix *** SPF Error *** 
> 
> # 2 - for SPAM:
>   # add this to subject
>   set acl_m_subj_prefix = $acl_m_subj_prefix ***SPAM (score: 
> $spam_score)*** 
> 
> 
>   warn
> condition = ${if!eq{}{$acl_m_subj_prefix}}
> logwrite = subject rewritten
> # remove old subject
> remove_header=Subject
> # create a new subject
> add_header = Subject: $acl_m_subj_prefix $h_Subject:
>   # discard the variable
>   set acl_m_subj_prefix =
> 
> > Furthermore, would it be better to use $h_header?
> 
> If your exim configuration supports UTF-8, then yes.
> (headers_charset setting in main configurarion)
> 
> -- 
>   Jasen.

Thanks Jasen.
Nice solution.
I had found one using a local variable, but this one is cleaner and
better. I'll use it.

Noury

-- 
## 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] One Smart Host for certain domain

2021-08-31 Thread Effendy Abdullah via Exim-users
On 2021-09-01 01:33, Jasen Betts wrote:
> On 2021-08-31, Effendy Abdullah via Exim-users  wrote:
> > On 2021-08-31 19:52, Cyborg wrote:
> >> Am 27.08.21 um 15:35 schrieb Effendy Abdullah via Exim-users:
> >> > Hi,
> >> >
> >> > How do I route to one Smart Host for certain domain and all other domain 
> >> > route to another Smart Host. Using WHM/cPanel with Exim.
> >
> > I think I didn't make myself clear. 
> > I'm using MailGun as a smartest with one "default" credentials, with about 
> > 80 domains. Some of the domain will be using their own login credentials 
> > for MailGun.
> >
> > So my current Exim config in WHM is as follows:
> >
> > #Section: AUTH
> > mailgun_login:
> > driver = plaintext
> > public_name = LOGIN
> > hide client_send = : 
> > ${extract{user}{${lookup{$sender_address_domain}lsearch{/etc/exim_smarthosts:
> >  
> > ${extract{pass}{${lookup{$sender_address_domain}lsearch{/etc/exim_smarthosts
> 
>   A:
>change lsearch to nwildlsearch
>add a * entry at the end of the /etc/exim_smarthosts file. that entry has 
> the default credentials
> 
>  or
>  
> 
> 
> 
> 
> 
> 
> 
> -- 
>   Jasen.
> 
> 

Wow thank you so much! Everyone here is awesome...
-- 
## 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] Subject rewriting

2021-08-31 Thread Sebastian via Exim-users
I would personally use the "Keywords:" header instead:

  warn
condition = ${if
forany{${listnamed_d:trusted_domains}}{match{$sender_address_domain}{\\.$item\$}}{yes}{${if
forany{${listnamed_d:trusted_domains}}{eq{$sender_address_domain}{$item}}{yes}{no
set acl_m3 = =E2=9C=94=EF=B8=8F Betrodd dom=C3=A4n
set acl_m4 = dnswl_whitelisted
set acl_m5 = pass
set acl_m6 = 1
  warn
condition = ${if
forany{${listnamed_d:trusted_domains}}{match{$sender_address_domain}{\\.$item\$}}{no}{${if
forany{${listnamed_d:trusted_domains}}{eq{$sender_address_domain}{$item}}{no}{yes
set acl_m3 = =E2=9E=96 Ok=C3=A4nd dom=C3=A4n
set acl_m5 = fail
  warn
condition = ${if
forany{${listnamed_d:suspicious_domains}}{match{$sender_address_domain}{\\.$item\$}}{yes}{${if
forany{${listnamed_d:suspicious_domains}}{eq{$sender_address_domain}{$item}}{yes}{no
condition = ${if eq{$acl_m5}{fail}{yes}{no}}
set acl_m3 = =E2=9D=8C Misst=C3=A4nkt skadlig dom=C3=A4n
set acl_m5 = suspicious

  deny
message = 5.7.23 SPF fail (phishing) -
(${sg{${sg{$spf_smtp_comment}{http\:\/\/www\.open-spf\.org\/Why}{https:\/\/www.sebbe.eu\/spf.cgi}}}
{=sebbe\.eu}{}})
log_message = SPF check failed: ($spf_header_comment)
spf = fail : softfail
  warn
set acl_m1 = 4
  warn
spf = pass
add_header = X-SPF-Signature: $spf_result ($spf_header_comment)
set acl_m1 = 3
set acl_m2 = =E2=9C=94=EF=B8=8F SPF-signaturen =C3=A4r giltig
  warn
spf = none : neutral
add_header = X-SPF-Signature: $spf_result ($spf_header_comment)
set acl_m1 = 2
set acl_m2 = =E2=9E=96 SPF-signatur saknas
  warn
spf = permerror : temperror
log_message = SPF failure: $spf_header_comment
add_header = X-SPF-Signature: $spf_result ($spf_header_comment)
set acl_m1 = 1
set acl_m2 = =E2=9A=A0=EF=B8=8F Trasig SPF-signatur
   warn
condition =  ${if eq{$acl_m1}{4}{yes}{no}}
add_header = X-SPF-Signature: permerror (No SPF lookup was made due to 
technical error)
set acl_m1 = 1
set acl_m2 = =E2=9A=A0=EF=B8=8F Trasig SPF-signatur
  accept


acl_check_dkim:
  accept
   dkim_status = fail
   add_header = X-DKIM-Signature: fail (address=$sender_address 
domain=$dkim_cur_signer -
signature is bad)
   add_header = Keywords: =?UTF-8?Q?$acl_m2,=E2=9D=8C F=C3=B6rfalskad
DKIM-signatur,$acl_m3?=
   add_header = X-Priority: ${if eq {$acl_m1}{3}{3}{1}}
   add_header = X-Status: ${if eq {$acl_m6}{1}{${if eq 
{$acl_m1}{3}{F}{}}}{}}
  accept
   dkim_status = invalid
   add_header = X-DKIM-Signature: invalid ($dkim_verify_status - 
$dkim_verify_reason)
   add_header = Keywords: =?UTF-8?Q?$acl_m2,=E2=9A=A0=EF=B8=8F Trasig
DKIM-signatur,$acl_m3?=
   add_header = X-Priority: ${if eq {$acl_m1}{3}{3}{5}}
   add_header = X-Status: ${if eq {$acl_m6}{1}{${if eq 
{$acl_m1}{3}{F}{}}}{}}
  accept
   dkim_status = pass
   add_header = X-DKIM-Signature: pass (address=$sender_address 
domain=$dkim_cur_signer -
signature is good)
   add_header = Keywords: =?UTF-8?Q?$acl_m2,=E2=9C=94=EF=B8=8F 
DKIM-signaturen =C3=A4r
giltig,$acl_m3?=
   add_header = X-Priority: 3
   add_header = X-Status: ${if eq {$acl_m6}{1}{F}{}}
  accept
   dkim_status = none
   add_header = X-DKIM-Signature: none (address=$sender_address 
domain=$dkim_cur_signer -
no signature found)
   add_header = Keywords: =?UTF-8?Q?$acl_m2,=E2=9E=96 DKIM-signatur 
saknas,$acl_m3?=
   add_header = X-Priority: ${if eq {$acl_m1}{3}{3}{${if eq 
{$acl_m1}{2}{1}{5
   add_header = X-Status: ${if eq {$acl_m6}{1}{${if eq 
{$acl_m1}{3}{F}{}}}{}}

Gives a nice status indicator in Microsoft Outlook (you have to assign the 
colors manually, tough),
while the X-Priority header will add a (!) for fraudulent email, and a 
(DOWNARROW) for when there
is some technical problem, for email clients not supporting the Keywords: 
header.

And also automatically star's the email with a star when all validations 
succeed, for the same
reason - email clients with no support for Keywords: header.

-Ursprungligt meddelande-
Från: Jasen Betts via Exim-users  
Skickat: den 1 september 2021 04:09
Till: exim-users@exim.org
Ämne: Re: [exim] Subject rewriting

On 2021-08-26, nb via Exim-users  wrote:
> Hi,
>
> I need to change the subject when the message is considered as spam,
> *and* when there is an SPF problem.
>
> I use the following method:
>
> 1 - for SPF:
>  # remove old subject
>  remove_header=Subject
>  # create a new subject
>  add_header = Subject: *** SPF Error *** $rh_Subject:
>
> 2 - for SPAM:
>  # remove old subject
>  remove_header=Subject
>  # create a new subject
>  add_header = Subject: ***SPAM (score: $spam_score)*** $rh_Subject:
>
> It works fine when either of these two cases occur.
> But when both occur at the same time, I don't get the expected 

Re: [exim] Subject rewriting

2021-08-31 Thread Jasen Betts via Exim-users
On 2021-08-26, nb via Exim-users  wrote:
> Hi,
>
> I need to change the subject when the message is considered as spam,
> *and* when there is an SPF problem.
>
> I use the following method:
>
> 1 - for SPF:
>  # remove old subject
>  remove_header=Subject
>  # create a new subject
>  add_header = Subject: *** SPF Error *** $rh_Subject:
>
> 2 - for SPAM:
>  # remove old subject
>  remove_header=Subject
>  # create a new subject
>  add_header = Subject: ***SPAM (score: $spam_score)*** $rh_Subject:
>
> It works fine when either of these two cases occur.
> But when both occur at the same time, I don't get the expected result.
> In this case, I get two "Subject" headers.

One way would be to build up the prefix in an ACL variable.

# 1 - for SPF:
  # add this to subject
  set acl_m_subj_prefix = $acl_m_subj_prefix *** SPF Error *** 

# 2 - for SPAM:
  # add this to subject
  set acl_m_subj_prefix = $acl_m_subj_prefix ***SPAM (score: 
$spam_score)*** 


  warn
condition = ${if!eq{}{$acl_m_subj_prefix}}
logwrite = subject rewritten
# remove old subject
remove_header=Subject
# create a new subject
add_header = Subject: $acl_m_subj_prefix $h_Subject:
# discard the variable
set acl_m_subj_prefix =

> Furthermore, would it be better to use $h_header?

If your exim configuration supports UTF-8, then yes.
(headers_charset setting in main configurarion)

-- 
  Jasen.

-- 
## 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] One Smart Host for certain domain

2021-08-31 Thread Jasen Betts via Exim-users
On 2021-08-31, Effendy Abdullah via Exim-users  wrote:
> On 2021-08-31 19:52, Cyborg wrote:
>> Am 27.08.21 um 15:35 schrieb Effendy Abdullah via Exim-users:
>> > Hi,
>> >
>> > How do I route to one Smart Host for certain domain and all other domain 
>> > route to another Smart Host. Using WHM/cPanel with Exim.
>
> I think I didn't make myself clear. 
> I'm using MailGun as a smartest with one "default" credentials, with about 80 
> domains. Some of the domain will be using their own login credentials for 
> MailGun.
>
> So my current Exim config in WHM is as follows:
>
> #Section: AUTH
> mailgun_login:
> driver = plaintext
> public_name = LOGIN
> hide client_send = : 
> ${extract{user}{${lookup{$sender_address_domain}lsearch{/etc/exim_smarthosts:
>  
> ${extract{pass}{${lookup{$sender_address_domain}lsearch{/etc/exim_smarthosts

  A:
   change lsearch to nwildlsearch
   add a * entry at the end of the /etc/exim_smarthosts file. that entry has 
the default credentials

 or
 
  B: 
use the not-found branch of "lsearch" or "extract" to get the default
credentials.

which means code like:

 hide client_send = : \
  
${extract{user}{${lookup{$sender_address_domain}lsearch{/etc/exim_smarthosts}{$value}{DEFAULTUSER:\
  
${extract{pass}{${lookup{$sender_address_domain}lsearch{/etc/exim_smarthosts}{$value}{DEFAULRPASS

or

 hide client_send = : \
  
${extract{user}{${lookup{$sender_address_domain}lsearch{/etc/exim_smarthosts}}}{$value}{DEFAULTUSER}}:\
  
${extract{pass}{${lookup{$sender_address_domain}lsearch{/etc/exim_smarthosts}}}{$value}{DEFAULRPASS}}



-- 
  Jasen.

-- 
## 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] Exim on server hardware

2021-08-31 Thread Jasen Betts via Exim-users
On 2021-08-26, M.R.P. zensky via Exim-users  wrote:
> Can Exim be installed on a desktop pc or is it better to have a dedicated 
> server.

Yes. If your PC is fast enough for your traffic needs it will run ok.

If it's a single user, small office or family setup then a PC will be
fine. Probably a raspberry pi with an external disk would even be 
sufficient for a single user.

If you're going to do bulk sending you'll discover all the people who
don't like bulk sending. more powerful hardware won't help there.



-- 
  Jasen.

-- 
## 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] One Smart Host for certain domain

2021-08-31 Thread Effendy Abdullah via Exim-users
On 2021-08-31 19:52, Cyborg wrote:
> Am 27.08.21 um 15:35 schrieb Effendy Abdullah via Exim-users:
> > Hi,
> >
> > How do I route to one Smart Host for certain domain and all other domain 
> > route to another Smart Host. Using WHM/cPanel with Exim.
> The answere you seek is in the default config:
> 
> # Alternatively, comment out the above router and uncomment this one to
> # route all mail to a smarthost instead of sending it directly to the
> # intended recipients. If your smarthost requires authentication, change
> # 'remote_smtp' to 'remote_msa' and set up the 'client_auth' authenticator
> # later in this file. You might need to change the port number in the
> # remote_msa transport.
> #
> 
> begin routers
> 
> smarthost:
>driver = manualroute
>domains = ! +local_domains
>condition = ${if eq{"domainname.target"}{${domain}}}
>transport = remote_smtp
>route_data = smarthost.myisp.net
>no_more
> 
> ...{repeat as often as needed}...
> 
> dnslookup:
>driver = dnslookup
>domains = ! +local_domains
> ...
> 
> 

I think I didn't make myself clear. 
I'm using MailGun as a smartest with one "default" credentials, with about 80 
domains. Some of the domain will be using their own login credentials for 
MailGun.

So my current Exim config in WHM is as follows:

#Section: AUTH
mailgun_login:
driver = plaintext
public_name = LOGIN
hide client_send = : 
${extract{user}{${lookup{$sender_address_domain}lsearch{/etc/exim_smarthosts:
 
${extract{pass}{${lookup{$sender_address_domain}lsearch{/etc/exim_smarthosts

#Section: ROUTERSTART
mailgun:
driver = manualroute
domains = ! +local_domains
transport = mailgun_transport
route_list = "* smtp.mailgun.org::587 byname"
host_find_failed = defer
no_more

#Section: TRANSPORTSTART
mailgun_transport:
driver = smtp
hosts = smtp.mailgun.org
hosts_require_auth = smtp.mailgun.org
hosts_require_tls = smtp.mailgun.org

#My /etc/exim_smarhost
domain1.com: domain=domain1.com user=MAILGUN_smtp_user1 
pass=MAILGUN_api_password1
domain2.com: domain=domain2.com user=MAILGUN_smtp_user2 
pass=MAILGUN_api_password2


I just need the AUTH section to get users on the list  /etc/exim_smarhost while 
those not on the list will have a default password. I'm trying not to list all 
80+ domains on the list. 

I've tried:
#Section: AUTH
mailgun_login:
 driver = plaintext
 public_name = LOGIN
 hide client_send = : ${if 
eq{${lookup{$sender_address_domain}partial-lsearch{/etc/exim_smarthosts}{$value}}}{}{DEFAULT_MAILGUN_SMTP_LOGIN
 : 
DEFAULT_MAILGUN_SMTP_PASS}{${extract{user}{${lookup{$sender_address_domain}lsearch{/etc/exim_smarthosts}{$value}fail}}}
 : 
${extract{pass}{${lookup{$sender_address_domain}lsearch{/etc/exim_smarthosts}{$value}fail}

In Exim command line it works, but when I try sending an email I get an error. 
Most likely some syntax issues with regards to the colon ' : ', still can't 
figure it out. The ' : ' is recognized as the start of a new string so it 
expects a ' } '  to close the string. Adding double colon ' :: '  will result 
in Auth failure.






-- 
## 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] One Smart Host for certain domain

2021-08-31 Thread Cyborg via Exim-users

Am 27.08.21 um 15:35 schrieb Effendy Abdullah via Exim-users:

Hi,

How do I route to one Smart Host for certain domain and all other domain route 
to another Smart Host. Using WHM/cPanel with Exim.

The answere you seek is in the default config:

# Alternatively, comment out the above router and uncomment this one to
# route all mail to a smarthost instead of sending it directly to the
# intended recipients. If your smarthost requires authentication, change
# 'remote_smtp' to 'remote_msa' and set up the 'client_auth' authenticator
# later in this file. You might need to change the port number in the
# remote_msa transport.
#

begin routers

smarthost:
  driver = manualroute
  domains = ! +local_domains
  condition = ${if eq{"domainname.target"}{${domain}}}
  transport = remote_smtp
  route_data = smarthost.myisp.net
  no_more

...{repeat as often as needed}...

dnslookup:
  driver = dnslookup
  domains = ! +local_domains
...

--
## 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] Exim on server hardware

2021-08-31 Thread Odhiambo Washington via Exim-users
On Tue, Aug 31, 2021 at 8:36 PM M.R.P. zensky via Exim-users <
exim-users@exim.org> wrote:

> Can Exim be installed on a desktop pc or is it better to have a dedicated
> server.
>
>
Exim can be installed on any supported OS, running on any hardware as long
as the hardware meets the requirements for installing "server applications".

-- 
Best regards,
Odhiambo WASHINGTON,
Nairobi,KE
+254 7 3200 0004/+254 7 2274 3223
"Oh, the cruft.", egrep -v '^$|^.*#' :-)
-- 
## 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] Exim on server hardware

2021-08-31 Thread Cyborg via Exim-users

Am 26.08.21 um 19:34 schrieb M.R.P. zensky via Exim-users:

Can Exim be installed on a desktop pc or is it better to have a dedicated 
server.
it can, but that pc should be reachable via the internet, or you don't 
get mails in .


Exim itself does not use much cpu power, if that was your concern.


Best regards,
Marius

--
## 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] Problem with exim 4.94 and transport using $local_part_suffix

2021-08-31 Thread Jeremy Harris via Exim-users

On 27/08/2021 19:10, Chad Leigh Shire.Net LLC via Exim-users wrote:

With the need for $local_part to be done with $local_part_data, I am not sure 
how to pick up whatever local part suffix was picked up by the router


Does $local_part_suffix_v do what you need?

--
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] Exim on server hardware

2021-08-31 Thread Jeremy Harris via Exim-users

On 26/08/2021 18:34, M.R.P. zensky via Exim-users wrote:

Can Exim be installed on a desktop pc or is it better to have a dedicated 
server.


That depends on how much mail you need to handle.
--
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] Subject rewriting

2021-08-31 Thread Jeremy Harris via Exim-users

On 26/08/2021 20:46, nb via Exim-users wrote:

It works fine when either of these two cases occur.
But when both occur at the same time, I don't get the expected result.
In this case, I get two "Subject" headers.


That follows logically from the documented behaviour of
those ACL modifiers.

Use a temporary variable.
--
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] One Smart Host for certain domain

2021-08-31 Thread Jeremy Harris via Exim-users

On 27/08/2021 14:35, Effendy Abdullah via Exim-users wrote:

How do I route to one Smart Host for certain domain and all other domain route 
to another Smart Host. Using WHM/cPanel with Exim.



That depends on the facilities that cPanel offers, since you're not
using Exim directly.
--
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] dbm aliases file problem

2021-08-31 Thread Jeremy Harris via Exim-users

On 30/08/2021 19:40, Chad Leigh Shire.Net LLC via Exim-users wrote:

rda_interpret (string): 
'${lookup{$local_part_data}dbm{/var/spool/exim/${domain_data}/aliases}}'
  search_open: dbm "/var/spool/exim/YYY.TLD/aliases"
  EXIM_DBOPEN: file  dir 
 flags=O_RDONLY
  returned from EXIM_DBOPEN: 685010
  search_find: file="/var/spool/exim/YYY.TLD/aliases"
key="" partial=-1 affix=NULL starflags=0 opts=NULL
  LRU list:
0/var/spool/exim/YYY.TLD/aliases
End
  internal_search_find: file="/var/spool/exim/YYY.TLD/aliases"
type=dbm key="" opts=NULL


key="".

The key for the dbm lookup.

Where are you arranging for $local_part_data to have a useful value?
--
Cheers,
  Jeremy

PS: Directors do not exist, following Exim 4.00 (released in 2002).
You seem to be talking about a router.

--
## 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] Problem with exim 4.94 and transport using $local_part_suffix

2021-08-31 Thread Chad Leigh Shire.Net LLC via Exim-users


> On Aug 27, 2021, at 12:10 PM, Chad Leigh Shire.Net LLC via Exim-users 
>  wrote:
> 
> I recently upgraded my exim from an earlier version to 4.94, and had to 
> upgrade the $local_part to $local_part_data in my transports for certain 
> deliveries to work (like alias file lookup based on domain name).
> 
> My problem is that I have a transport that copies an email into a maildir 
> subfolder for the user when the local part contains a suffix.  I was using:
> 
> driver
> 
> ldaplocal_suffix:
>  driver = accept
>  condition = ${if eq {}{${lookup ldap {user=\”—— user info -\" 
> pass=XXX 
> ldap://my.ldap.host:389/accountName=$local_part,domain=$domain,dc=,dc=YYY}}}{no}{yes}}
>  local_part_suffix = +*
>  retry_use_local_part
>  transport = ldap_virtual_appendfile_suffix
> 
> 
> 
> transport:
> 
> ldap_virtual_appendfile_suffix:
>  driver = appendfile
>  directory = ${lookup ldap {user="—— user info -" pass=XXX 
> ldap://my.ldap.host:389/accountName=${local_part},domain=${domain},dc=,dc=YYY?mailboxLoc?base?}{$value}fail}/.${substr_1_1000:${local_part_suffix}}
>  group = mailgroup
>  maildir_format
>  user = mailuser
> 
> 
> 
> The version of this above that does not look for local parts suffixes and 
> just delivers to the local part (without the 
> “/.${substr_1_1000:${local_part_suffix}}” at the end works fine.  


I was able to find a post in the list archives that set me on the right road to 
get a solution.Thanks!!!

ldap_virtual_appendfile_suffix:
  driver = appendfile
  directory = ${lookup ldap {user="—— user info -" pass=XXX  
ldap://my.ldap.host:389/accountName=${local_part},domain=${domain},dc=?mailboxLoc?base?}{$value}fail}/.${substr_1_1000:${lookup
 {/${local_part_suffix_v}} nwildlsearch,ret=key 
{/opt/local/etc/exim/local_part_suffix.pcre} {$value} {}}}
  group = mailgroup
  maildir_format
  user = mailuser


-- 
## 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] Problem with exim 4.94 and transport using $local_part_suffix

2021-08-31 Thread Chad Leigh Shire.Net LLC via Exim-users

(Sorry for having to resubscribe — my normal subscription has a suffix in my 
email address local part and I am currently broken and cannot get the email 
from the exim users list to my normal recipient email due to the problem I need 
advice and help with)

I recently upgraded my exim from an earlier version to 4.94, and had to upgrade 
the $local_part to $local_part_data in my transports for certain deliveries to 
work (like alias file lookup based on domain name).

My problem is that I have a transport that copies an email into a maildir 
subfolder for the user when the local part contains a suffix.  I was using:

driver

ldaplocal_suffix:
  driver = accept
  condition = ${if eq {}{${lookup ldap {user=\”—— user info -\" 
pass=XXX 
ldap://my.ldap.host:389/accountName=$local_part,domain=$domain,dc=,dc=YYY}}}{no}{yes}}
  local_part_suffix = +*
  retry_use_local_part
  transport = ldap_virtual_appendfile_suffix



transport:

ldap_virtual_appendfile_suffix:
  driver = appendfile
  directory = ${lookup ldap {user="—— user info -" pass=XXX 
ldap://my.ldap.host:389/accountName=${local_part},domain=${domain},dc=,dc=YYY?mailboxLoc?base?}{$value}fail}/.${substr_1_1000:${local_part_suffix}}
  group = mailgroup
  maildir_format
  user = mailuser



The version of this above that does not look for local parts suffixes and just 
delivers to the local part (without the 
“/.${substr_1_1000:${local_part_suffix}}” at the end works fine.  


With the need for $local_part to be done with $local_part_data, I am not sure 
how to pick up whatever local part suffix was picked up by the router…  I’ve 
been reading through the exim documentation but don’t see how to do this.
-- 
## 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] Subject rewriting

2021-08-31 Thread nb via Exim-users
Hi,

I need to change the subject when the message is considered as spam,
*and* when there is an SPF problem.

I use the following method:

1 - for SPF:
 # remove old subject
 remove_header=Subject
 # create a new subject
 add_header = Subject: *** SPF Error *** $rh_Subject:

2 - for SPAM:
 # remove old subject
 remove_header=Subject
 # create a new subject
 add_header = Subject: ***SPAM (score: $spam_score)*** $rh_Subject:

It works fine when either of these two cases occur.
But when both occur at the same time, I don't get the expected result.
In this case, I get two "Subject" headers.

Is there a way to have a subject like:
Subject: ***SPAM (score: $spam_score)*** *** SPF Error *** xx
xxx being the original subject

Furthermore, would it be better to use $h_header?

Thanks in advance for any idea.

-- 
## 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] One Smart Host for certain domain

2021-08-31 Thread Effendy Abdullah via Exim-users
Hi,

How do I route to one Smart Host for certain domain and all other domain route 
to another Smart Host. Using WHM/cPanel with Exim.
-- 
## 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] Exim on server hardware

2021-08-31 Thread M.R.P. zensky via Exim-users
Can Exim be installed on a desktop pc or is it better to have a dedicated 
server.
-- 
## 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] dbm aliases file problem

2021-08-31 Thread Chad Leigh Shire.Net LLC via Exim-users

As I recently posted in another thread, I upgraded to exim 4.94.2 last week 
under duress.  The upgrade was planned but I had some other pseudo-system 
software that had to be upgraded and that changed some libraries on the system 
which broke my running exim 4.89.  I am having problems on one domain that has 
its own director that uses a dbm file based aliases file so that the owner can  
maintain his own local aliases.

I have a director as follows (which has its original root in exim3, but which 
was running ok with 4.89 without the _data changes for local_part and domain):

permaddressforwarder:
  driver = redirect
  allow_defer
  allow_fail
  data = ${lookup{$local_part_data}dbm{/var/spool/exim/${domain_data}/aliases}}
  domains = YYY.TLD
  file_transport = address_file
  forbid_pipe
  pipe_transport = address_pipe
  retry_use_local_part
# >> Option added by convert4r3


This stopped working after the update to 4.94.2  If I do an "exim -bt -d” I see 
the following, which should have picked up the alias:

> permaddressforwarder router <
local_part=chad domain=YYY.TLD
checking domains
YYY.TLD in “YYY.TLD"? yes (matched “YYY.TLD")
calling permaddressforwarder router
rda_interpret (string): 
'${lookup{$local_part_data}dbm{/var/spool/exim/${domain_data}/aliases}}'
 search_open: dbm "/var/spool/exim/YYY.TLD/aliases"
 EXIM_DBOPEN: file  dir 
 flags=O_RDONLY
 returned from EXIM_DBOPEN: 685010
 search_find: file="/var/spool/exim/YYY.TLD/aliases"
   key="" partial=-1 affix=NULL starflags=0 opts=NULL
 LRU list:
   0/var/spool/exim/YYY.TLD/aliases
   End
 internal_search_find: file="/var/spool/exim/YYY.TLD/aliases"
   type=dbm key="" opts=NULL
expanded: ''
file is not a filter file
parse_forward_list: 
permaddressforwarder router declined for c...@yyy.tld


I am not sure how to interpret this.  Is this successully opening the DBM db 
but finding something other than it was looking for?  Is that the “file is not 
a filter file”?

It is built using “exim_dbmbuild” which was updated last week in building the 
new exim version.

I did not specify a specific USE* in the local Makefile.  The base system is 
SmartOS (Solaris)

The directory with the aliases file has  (iisle is the shell user that “owns” 
the base aliases text file and generates this — mail is the “mailgroup” exim 
runs under

# ls -al /var/spool/exim/YYY.TLD/
total 22
drwxrwx--x  2 iisle mail4 Aug 30 17:54 .
drwxr-x--x 10 mail  mail   11 Aug 30 17:59 ..
-rw-r--r--  1 iisle mail 4096 Aug 30 17:54 aliases.dir
-rw-r--r--  1 iisle mail 7168 Aug 30 17:54 aliases.pag
#

Which makes it look like Berkeley was used??

Thanks for any insight.  I am not sure where to start poking.

-- 
## 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] build problems

2021-08-31 Thread Chad Leigh Shire.Net LLC via Exim-users

> On Aug 27, 2021, at 2:51 AM, Heiko Schlittermann via Exim-users 
>  wrote:
> 
> Chad Leigh via Exim-users mailto:exim-users@exim.org>> 
> (Mi 25 Aug 2021 23:30:49 CEST):
>> 
>> Hi
>> 
>> (I normally am c...@shire.net but my smtp server is down at the moment and 
>> is the reason for this post)
>> 
>> I screwed something on on my SmartOS (Solaris) based system that was running 
>> exim4.  I updated some system librarues and my existing build was not 
>> finding the stuff it was looking for.  I wanted to update to the latest 
>> anyway and I use my own build due to some site specific stuff I build in.  I 
>> got the latest 4.94.2 and am trying to do a “make” on it.
>> 
>> I am getting a bunch of basic errors that look like language errors…I 
>> have tried with gcc49, gcc6, and gcc9
>> 
>> This is what I am seeing (and a lot more) and I am not sure what to do next. 
>>  I would expect that the default codebase should build with gcc.
>> 
>> 
>> # make
>> /bin/sh scripts/source_checks
>> `Makefile' is up to date.
>> 
>> make[1]: Entering directory '/opt/build/exim-4.94.2/build-SunOS5-5.11-i386'
>> gcc -DMACRO_PREDEF macro_predef.c
>> In file included from exim.h:526:0,
>> from macro_predef.c:12:
>> dbstuff.h:693:3: error: unknown type name 'BOOL'
>>   BOOL   expired; /* Retry time has expired */
> 
> After having a short glance, it seems the file src/mytypes.h having the
> typedef for BOOL.
> 


I got it running (and did not see the post from my other address, due to my 
main mail address being down, until Friday)…

The problem was I had made a mistake in copying my local_scan files from the 
old build directory to the new version build directory and so had accidentally 
excluded the system local_scan.h, which is where the problem arose.  Once I 
figured out the problem, it built.  I had annother issue wth “string_sprintf” 
as an unresolved symbol, which I will post about separately.  I worked around 
it and got up running but it seems the problem shouldn’t have happened.   I 
will post a different thread when I have time.

But this problem was a faulty move of the local_scan stuff causing local_scan.h 
to notg be used properly.



-- 
## 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] sieve filter output on pipe transport

2021-08-31 Thread giovanni--- via Exim-users

Hello Everyone,

Exim 4.94.2.

At the transport (pipe transport) I am not able to get the sieve filter 
output.
Is it possible to retrieve the output of the sieve filter performed on 
"file = /filters/thisisasievefilter.sievesource" ?


# ROUTER
sieve_filter_virtual_user:
   allow_filter
   driver = redirect
   file = /filters/thisisasievefilter.sievesource
   file_transport = sieve_filter_lda

...
...
...

#TRANSPORT
sieve_filter_lda:
   drive = pipe
   command = /usr/local/libexec/dovecot/dovecot-lda -c 
/etc/dovecot/dovecot.conf -e -k \
   -f "$sender_address" -a "$original_local_part@$original_domain" -d 
"$local_part@$domain"

  ...
  ...


Thank You For Your Consideration

G







--
## 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] Exim clock offset and CLOCK_MONOTONIC timer

2021-08-31 Thread Jeremy Harris via Exim-users

On 26/08/2021 14:08, Martin Preen via Exim-users wrote:

I think there is a problem with the Solaris version of Exim.

The symptoms I've seen are negative RT log entries and negative $message_age 
values.
But there maybe more. With a SIGHUP the negative values disappear (temporarily).

I've read the sources and manual pages and maybe this is the reason:

Exim calculates an offset of the CLOCK_MONOTONIC timer once at the start of the 
program
and this offset is used to calculate the real receive time of an incoming 
message.


... if _POSIX_MONOTONIC_CLOCK exists.  I assume it does on your platform.


This is fine if CLOCK_REALTIME and CLOCK_MONOTONIC timers are both updated by 
adjtime
or other calls (e.g. via ntpd/ntpdate). This is the case with Linux and AFAIK 
this also
applies to CLOCK_BOOTTIME. On Solaris CLOCK_MONOTONIC isn't updated by clock 
drifts.


But if your clock really is monotonic and not adjusted by adjtime (or similar),
it should never go backwards and you shouldn't get the symptoms you are seeing.

I'm worried that somewhere a different time syscall is being used.

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