Skip to content

How to enforce rule order in postfix::transport #437

@f-deenik

Description

@f-deenik

Affected Puppet, Ruby, OS and module versions/distributions

Puppet: 7.34.0 (puppetserver)
Ruby: 2.7.8
Distribution: Ubuntu 22.04
Module version: 5.1.0

How to reproduce (e.g Puppet code you use)

Setup with the following code

$autoreply_mailboxes = [
  'noreply@example.com'
]
$send_domains = [
  'gmail.com',
  'outlook.com'
]
postfix::transport {
  default:
    ensure => present;
  $autoreply_mailboxes:
    destination => 'autoreply';
  $send_domains:;
  '*':
    destination => 'error',
    nexthop     => 'Delivery not allowed';
}

After the setup add an extra entry in $autoreply_mailboxes and/or $send_domains

$autoreply_mailboxes = [
  'noreply@example.com'
  'more_noreply@example.com'
]

What are you seeing

After the initial setup the /etc/postfix/transport file look this

noreply@example.com autoreply:
gmail.com :
outlook.com :
* error:Delivery not allowed

Which routes and allows specific mail, and blocks everything else.

After adding 'more_noreply@example.com' to the $autoreply_mailboxes the /etc/postfix/transport file look this

noreply@example.com autoreply:
gmail.com :
outlook.com :
* error:Delivery not allowed
more_noreply@example.com autoreply:

This does not enable autoreply for more_noreply@example.com because of the deny rule * error:Delivery not allowed.

What behaviour did you expect instead

I expected the order to be preserved.

Any additional information you'd like to impart

If the order is not preserved, I would like an option to specify the order. As transports is order sensitive.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions