Skip to content

Added LMTP transport to Dovecot and Exim configs#307

Open
MrSleeps wants to merge 1 commit into
vexim:masterfrom
MrSleeps:dovecot_lmtp
Open

Added LMTP transport to Dovecot and Exim configs#307
MrSleeps wants to merge 1 commit into
vexim:masterfrom
MrSleeps:dovecot_lmtp

Conversation

@MrSleeps

Copy link
Copy Markdown

LMTP is a more modern way of delivering mail, these are the configs I use on my system to make that magic work.

@runout-at

runout-at commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

There is already a PR for this feature: #247 (running on my live system since 2017)

This PR #247 splits out the 'pipe' router. If we want to do it in this or another way is currently in discussion in PR #300

@runout-at

Copy link
Copy Markdown
Contributor

I had a short check if you do something different.

  • Renaming of the main vexim router is not a very good idea. 250_vexim_virtual_domains -> 250_vexim_virtual_domains_lmtp
  • My version uses some macros. This way settings can be adapted without changing the router and transport. (.../main/00_vexim_listmacrosdefs)
  • You do provide some dovecot config in whole files which would substitute the packaged config. It would be better not to touch the original config if possible. This causes headaches during configuration on merging with other specific changes and later problems on upgrades which wants to overwrite your changes. I do this by throwing this config changes in files like: 11-master-override.conf, 21-lmtp-override.conf, ...

But I like the idea to add suggestions for configuring dovecot. Possibly this could go to the wiki page too: https://github.com/vexim/vexim2/wiki/Server-configuration:-Dovecot-v2.x

@runout-at

Copy link
Copy Markdown
Contributor

your router is not backwards compatible.

I provide it this way:

  .ifdef LMTP_COMMAND LMTP_SOCKET
    file_transport = virtual_delivery_lmtp
  .else
    file_transport = virtual_delivery
  .endif

@runout-at

Copy link
Copy Markdown
Contributor

Another question because I'm not sure we need the 'piped' user in the dovecot sql query. It's on my server too. But do we need it?

A 'pipe' account would give the mail to a command and not to a mailbox. So dovecot won't find the file structure.

Should 'piped' be removed?

user_query =
...
    AND type IN ('local', 'piped')
...

@MrSleeps

Copy link
Copy Markdown
Author

I had a short check if you do something different.

  • Renaming of the main vexim router is not a very good idea. 250_vexim_virtual_domains -> 250_vexim_virtual_domains_lmtp
  • My version uses some macros. This way settings can be adapted without changing the router and transport. (.../main/00_vexim_listmacrosdefs)
  • You do provide some dovecot config in whole files which would substitute the packaged config. It would be better not to touch the original config if possible. This causes headaches during configuration on merging with other specific changes and later problems on upgrades which wants to overwrite your changes. I do this by throwing this config changes in files like: 11-master-override.conf, 21-lmtp-override.conf, ...

But I like the idea to add suggestions for configuring dovecot. Possibly this could go to the wiki page too: https://github.com/vexim/vexim2/wiki/Server-configuration:-Dovecot-v2.x

Makes sense (to me) to have 2 different example files so that way the user can choose which way they want to install it.

Dovecot, was just an example. Been running 2.4 since it came out and there's been a fair few upgrades that have never overwritten it.. It also gives a example of what it will look like from a fresh install. Feel free to mod it.

@MrSleeps

Copy link
Copy Markdown
Author

Should 'piped' be removed?

In my opinion, yes. I disabled it about 10 years ago, allowing users to run unchecked scripts that are triggered via an email is, imo, a gaping hole in a systems security.

@runout-at

Copy link
Copy Markdown
Contributor

FROM users \
WHERE username = '%{original_user}' \
AND enabled = 1 \
AND type IN ('local', 'piped')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You still accept the 'piped' user here and in the 2 sql statements below.

@MrSleeps

Copy link
Copy Markdown
Author

VExim2 supports pipe.. We have 0 ways of having an email delivered to a pipe command in our systems but it's supported by VExim. Our views on pipe don't match all other sys-admins views.

If Vexim is moving away from supporting pipe then it needs to go but as it stands pipes are supported.

But that was taken from our internal mail server, so that is pure laziness in updating the config ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants