[exim] Re: Exim, virtual users, and usernames

Etusivu
Poista viesti
Vastaa
Lähettäjä: Andrew C Aitchison
Päiväys:  
Vastaanottaja: Cam Ellison
Kopio: exim-users
Aihe: [exim] Re: Exim, virtual users, and usernames
On Wed, 7 Aug 2024, Cam Ellison via Exim-users wrote:

> For my sins, I built and continue to operate a website for a local adult
> football association. Email services are provided via Exim and Dovecot for a
> few positions, but most email is sent by the website itself.
>
> To regularise access to email, I recently decided to move the users to vmail
> and dispense with having home directories, etc. Only one internal
> administrative user remains as a true local user. The necessary information
> for the others resides in a MySQL database which is also used by Dovecot.
>
> In the process of making the transition, I have run afoul of the need to
> sanitise $local_part and $domain. The result is that it is no longer possible
> to send or receive emails involving those accounts. Users can log in and read
> mail.
>
> The exim configuration is monolithic: /etc/exim4/exim4.conf. I've been using
> exim for the best part of 30 years, and cribbed the existing file from one of
> my other sites. It has worked fine until now.
>
> Here are the router, transport, and authenticator settings. Included at the
> top is a set of macros that I found on a website during my frantic Google
> searches. The actual display of $local_part and $domain varies because I have
> been trying everything: this is just the current mess. There are no error
> messages on starting exim.
>
> Macros:
>
>  DETAINTFILE = /etc/exim4/detaint
>  BADCHARS = \N[^A-Za-z0-9_.-]+\N
>  SAFELOCALPART = ${lookup{${sg{$local_part}{BADCHARS}{_}}}
> lsearch*,ret=key{DETAINTFILE}}
>  SAFEDOMAIN = ${lookup{${sg{$domain}{BADCHARS}{_}}}
> lsearch*,ret=key{DETAINTFILE}}


I think looking up local_parts and $local_part_data
in the exim spec.txt will help you.

You may need an appropriate ACL too -
possibly acl_check_rcpt or acl_smtp_rcpt

-- 
Andrew C. Aitchison                      Kendal, UK
                    andrew@???


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