[pfx] Re: Multi-Postfix : Wrong queue

2024-10-20 Thread Joan Moreau via Postfix-users
Also un ls -alR in /var/spool/postfix/0 gives the list of pending 
emails, while ls -alR in /var/spool/postfix/x (x>0) shows an empty queue


I would expect, if I am not worng, that queued messages are getting in 
/var/spool/postfix/x according to the instance handling the emaili, 
isnt' it ?


Maybe a config mistake or something else ?

On 2024-10-21 11:55, Joan Moreau wrote:


Hi

Here the output of the command:

/opt/postfix/postmulti -x -- sh -c '
printf "\n%s:\n" "$MAIL_CONFIG"
/opt/postfix/postconf -f config_directory import_environment 
queue_directory syslog_name

printf -- "--\n"
/opt/postfix/postconf -P "*/*/syslog_name"
'

=

/etc/mail/postfix:
config_directory = /etc/mail/postfix
import_environment = MAIL_CONFIG MAIL_DEBUG MAIL_LOGTAG TZ XAUTHORITY 
DISPLAY

LANG=C POSTLOG_SERVICE POSTLOG_HOSTNAME
queue_directory = /var/spool/postfix/0
syslog_name = ${multi_instance_name?{$multi_instance_name}:{postfix}}
--
relay/unix/syslog_name = postfix/$service_name

/etc/mail/postfix-smtp1:
config_directory = /etc/mail/postfix-smtp1
import_environment = MAIL_CONFIG MAIL_DEBUG MAIL_LOGTAG TZ XAUTHORITY 
DISPLAY

LANG=C POSTLOG_SERVICE POSTLOG_HOSTNAME
queue_directory = /var/spool/postfix/1
syslog_name = ${multi_instance_name?{$multi_instance_name}:{postfix}}
--
relay/unix/syslog_name = postfix/$service_name

/etc/mail/postfix-smtp2:
config_directory = /etc/mail/postfix-smtp2
import_environment = MAIL_CONFIG MAIL_DEBUG MAIL_LOGTAG TZ XAUTHORITY 
DISPLAY

LANG=C POSTLOG_SERVICE POSTLOG_HOSTNAME
queue_directory = /var/spool/postfix/2
syslog_name = ${multi_instance_name?{$multi_instance_name}:{postfix}}
--
relay/unix/syslog_name = postfix/$service_name

/etc/mail/postfix-smtp3:
config_directory = /etc/mail/postfix-smtp3
import_environment = MAIL_CONFIG MAIL_DEBUG MAIL_LOGTAG TZ XAUTHORITY 
DISPLAY

LANG=C POSTLOG_SERVICE POSTLOG_HOSTNAME
queue_directory = /var/spool/postfix/3
syslog_name = ${multi_instance_name?{$multi_instance_name}:{postfix}}
--
relay/unix/syslog_name = postfix/$service_name

/etc/mail/postfix-smtp4:
config_directory = /etc/mail/postfix-smtp4
import_environment = MAIL_CONFIG MAIL_DEBUG MAIL_LOGTAG TZ XAUTHORITY 
DISPLAY

LANG=C POSTLOG_SERVICE POSTLOG_HOSTNAME
queue_directory = /var/spool/postfix/4
syslog_name = ${multi_instance_name?{$multi_instance_name}:{postfix}}
--
relay/unix/syslog_name = postfix/$service_name

/etc/mail/postfix-smtp5:
config_directory = /etc/mail/postfix-smtp5
import_environment = MAIL_CONFIG MAIL_DEBUG MAIL_LOGTAG TZ XAUTHORITY 
DISPLAY

LANG=C POSTLOG_SERVICE POSTLOG_HOSTNAME
queue_directory = /var/spool/postfix/5
syslog_name = ${multi_instance_name?{$multi_instance_name}:{postfix}}
--
relay/unix/syslog_name = postfix/$service_name

/etc/mail/postfix-smtp6:
config_directory = /etc/mail/postfix-smtp6
import_environment = MAIL_CONFIG MAIL_DEBUG MAIL_LOGTAG TZ XAUTHORITY 
DISPLAY

LANG=C POSTLOG_SERVICE POSTLOG_HOSTNAME
queue_directory = /var/spool/postfix/6
syslog_name = ${multi_instance_name?{$multi_instance_name}:{postfix}}
--
relay/unix/syslog_name = postfix/$service_name

=

For the evidence, I am routing the emails by the source sender via exim 
to specific relays (running on postfix on the same machine, each 
binding on one IP)


Email sent to one postfix on one IP (correctly) but get in the queue of 
the default postfix when sending out if not sent immediatly (bounced or 
greylisted by the receiver or else)


On 2024-10-21 11:34, Viktor Dukhovni via Postfix-users wrote:
On Mon, Oct 21, 2024 at 09:31:53AM +0800, Joan Moreau via Postfix-users 
wrote:


I am using the " multi" postifx
: https://www.postfix.org/MULTI_INSTANCE_README.html

When an email is ending in the queue for relaunch, it goes to the
principal process, not the one where it has firstly managed by

(says if I have 2 instance p1 and p2, I send the mail with p2, I
restart postfix, the email is now sent by p1 inproperly)

Is this a bug or a misconfiguration ?
It is not even clear what problem you're describing.

- Perhaps the message does not even touch multiple queues, and all
you have is misconfigured logging?

1.  Nothing built-in to the Postfix queue manager or delivery agents
moves messages from one instance queue to another.  So what you're
describing "can't happen".  Many services can even run in a chroot
jail, with the OS constraining their view of the filesystem to just
the queue directory.

2.  Of course if you somehow manage to give multiple instances the same
queue directory, that would a serious misconfiguration.  Post the
output of:

$ postmulti -x -- sh -c '
printf "\n%s:\n" "$MAIL_CONFIG"
postconf -f config_directory import_environment queue_directory 
syslog_name

printf -- "--\n"
postconf -P "*/*/syslog_name"
'

On my single-instance system the output is:

/opt/postfix/etc:
config_directory = /opt/postfix/etc
import_environment = MAIL_CONFIG MAIL_DEBUG MAIL_LOGTAG TZ XAUTHORITY 
DISPLAY

LANG=C POSTLOG_SERVICE POSTLOG_HOSTNAME
queue_directory = /var/spool/post

[pfx] Re: Multi-Postfix : Wrong queue

2024-10-20 Thread Joan Moreau via Postfix-users

Hi

Here the output of the command:

/opt/postfix/postmulti -x -- sh -c '
printf "\n%s:\n" "$MAIL_CONFIG"
/opt/postfix/postconf -f config_directory import_environment 
queue_directory syslog_name

printf -- "--\n"
/opt/postfix/postconf -P "*/*/syslog_name"
'

=

/etc/mail/postfix:
config_directory = /etc/mail/postfix
import_environment = MAIL_CONFIG MAIL_DEBUG MAIL_LOGTAG TZ XAUTHORITY 
DISPLAY

LANG=C POSTLOG_SERVICE POSTLOG_HOSTNAME
queue_directory = /var/spool/postfix/0
syslog_name = ${multi_instance_name?{$multi_instance_name}:{postfix}}
--
relay/unix/syslog_name = postfix/$service_name

/etc/mail/postfix-smtp1:
config_directory = /etc/mail/postfix-smtp1
import_environment = MAIL_CONFIG MAIL_DEBUG MAIL_LOGTAG TZ XAUTHORITY 
DISPLAY

LANG=C POSTLOG_SERVICE POSTLOG_HOSTNAME
queue_directory = /var/spool/postfix/1
syslog_name = ${multi_instance_name?{$multi_instance_name}:{postfix}}
--
relay/unix/syslog_name = postfix/$service_name

/etc/mail/postfix-smtp2:
config_directory = /etc/mail/postfix-smtp2
import_environment = MAIL_CONFIG MAIL_DEBUG MAIL_LOGTAG TZ XAUTHORITY 
DISPLAY

LANG=C POSTLOG_SERVICE POSTLOG_HOSTNAME
queue_directory = /var/spool/postfix/2
syslog_name = ${multi_instance_name?{$multi_instance_name}:{postfix}}
--
relay/unix/syslog_name = postfix/$service_name

/etc/mail/postfix-smtp3:
config_directory = /etc/mail/postfix-smtp3
import_environment = MAIL_CONFIG MAIL_DEBUG MAIL_LOGTAG TZ XAUTHORITY 
DISPLAY

LANG=C POSTLOG_SERVICE POSTLOG_HOSTNAME
queue_directory = /var/spool/postfix/3
syslog_name = ${multi_instance_name?{$multi_instance_name}:{postfix}}
--
relay/unix/syslog_name = postfix/$service_name

/etc/mail/postfix-smtp4:
config_directory = /etc/mail/postfix-smtp4
import_environment = MAIL_CONFIG MAIL_DEBUG MAIL_LOGTAG TZ XAUTHORITY 
DISPLAY

LANG=C POSTLOG_SERVICE POSTLOG_HOSTNAME
queue_directory = /var/spool/postfix/4
syslog_name = ${multi_instance_name?{$multi_instance_name}:{postfix}}
--
relay/unix/syslog_name = postfix/$service_name

/etc/mail/postfix-smtp5:
config_directory = /etc/mail/postfix-smtp5
import_environment = MAIL_CONFIG MAIL_DEBUG MAIL_LOGTAG TZ XAUTHORITY 
DISPLAY

LANG=C POSTLOG_SERVICE POSTLOG_HOSTNAME
queue_directory = /var/spool/postfix/5
syslog_name = ${multi_instance_name?{$multi_instance_name}:{postfix}}
--
relay/unix/syslog_name = postfix/$service_name

/etc/mail/postfix-smtp6:
config_directory = /etc/mail/postfix-smtp6
import_environment = MAIL_CONFIG MAIL_DEBUG MAIL_LOGTAG TZ XAUTHORITY 
DISPLAY

LANG=C POSTLOG_SERVICE POSTLOG_HOSTNAME
queue_directory = /var/spool/postfix/6
syslog_name = ${multi_instance_name?{$multi_instance_name}:{postfix}}
--
relay/unix/syslog_name = postfix/$service_name

=

For the evidence, I am routing the emails by the source sender via exim 
to specific relays (running on postfix on the same machine, each binding 
on one IP)


Email sent to one postfix on one IP (correctly) but get in the queue of 
the default postfix when sending out if not sent immediatly (bounced or 
greylisted by the receiver or else)


On 2024-10-21 11:34, Viktor Dukhovni via Postfix-users wrote:

On Mon, Oct 21, 2024 at 09:31:53AM +0800, Joan Moreau via Postfix-users 
wrote:



I am using the " multi" postifx
: https://www.postfix.org/MULTI_INSTANCE_README.html

When an email is ending in the queue for relaunch, it goes to the
principal process, not the one where it has firstly managed by

(says if I have 2 instance p1 and p2, I send the mail with p2, I
restart postfix, the email is now sent by p1 inproperly)

Is this a bug or a misconfiguration ?


It is not even clear what problem you're describing.

- Perhaps the message does not even touch multiple queues, and all
you have is misconfigured logging?

1.  Nothing built-in to the Postfix queue manager or delivery agents
moves messages from one instance queue to another.  So what you're
describing "can't happen".  Many services can even run in a chroot
jail, with the OS constraining their view of the filesystem to just
the queue directory.

2.  Of course if you somehow manage to give multiple instances the same
queue directory, that would a serious misconfiguration.  Post the
output of:

$ postmulti -x -- sh -c '
printf "\n%s:\n" "$MAIL_CONFIG"
postconf -f config_directory import_environment queue_directory 
syslog_name

printf -- "--\n"
postconf -P "*/*/syslog_name"
'

On my single-instance system the output is:

/opt/postfix/etc:
config_directory = /opt/postfix/etc
import_environment = MAIL_CONFIG MAIL_DEBUG MAIL_LOGTAG TZ XAUTHORITY 
DISPLAY

LANG=C POSTLOG_SERVICE POSTLOG_HOSTNAME
queue_directory = /var/spool/postfix
syslog_name = ${multi_instance_name?{$multi_instance_name}:{postfix}}
--
465/inet/syslog_name = postfix/smtps
submission/inet/syslog_name = postfix/submission

3.  As mentioned by Wietse, post logs that evidence the reported issue.___
Postfix-users mailing list -- postfix-users@postfix.org
To unsubsc

[pfx] Re: Multi-Postfix : Wrong queue

2024-10-20 Thread Viktor Dukhovni via Postfix-users
On Mon, Oct 21, 2024 at 11:55:27AM +0800, Joan Moreau via Postfix-users wrote:

> Here the output of the command:
> 
>   /opt/postfix/postmulti -x -- sh -c '
>   printf "\n%s:\n" "$MAIL_CONFIG"
>   /opt/postfix/postconf -f config_directory import_environment 
> queue_directory
>   syslog_name
>   printf -- "--\n"
>   /opt/postfix/postconf -P "*/*/syslog_name"
>   '
> 
> =
> 
> /etc/mail/postfix:
> config_directory = /etc/mail/postfix
> queue_directory = /var/spool/postfix/0
> syslog_name = ${multi_instance_name?{$multi_instance_name}:{postfix}}
> --
> relay/unix/syslog_name = postfix/$service_name

This should be either the instance independent:

relay/unix/syslog_name = 
${multi_instance_name?{$multi_instance_name}:{postfix}}/$service_name

or else set explicitly in each instance:

> 
> /etc/mail/postfix-smtp1:
> config_directory = /etc/mail/postfix-smtp1
> queue_directory = /var/spool/postfix/1
> syslog_name = ${multi_instance_name?{$multi_instance_name}:{postfix}}
> --
> relay/unix/syslog_name = postfix/$service_name

With this, the "relay" transport logging will fail to distinguish
between "postfix" and "postfix-smtp1", and ditto for all the other
instances.  I should have also asked for "multi_instance_name", but I
assume that's set correctly in each instance (check!).

> For the evidence, I am routing the emails by the source sender via exim to
> specific relays (running on postfix on the same machine, each binding on one
> IP)

That's not "evidence".  Where's the logging showing messages ending up
in a different instance than the one that received them?

> Email sent to one postfix on one IP (correctly) but get in the queue of the
> default postfix when sending out if not sent immediatly (bounced or
> greylisted by the receiver or else)

You're claiming that deferred messages end up in a different queue than
the instance they came into, show evidence (LOGGING).

At this time you should also post the output of:

$ postmulti -x -- sh -c '
printf "\n%s:\n" "$MAIL_CONFIG"
postconf -f config_directory inet_interfaces multi_instance_name 
smtpd_proxy_filter queue_directory
printf -- "--\n"
postconf -Mf "*/inet" "*/pass"
printf -- "--\n"
postconf -P "*/*/syslog_name"
'


On Mon, Oct 21, 2024 at 11:58:47AM +0800, Joan Moreau via Postfix-users wrote:

> Also un ls -alR in /var/spool/postfix/0 gives the list of pending emails,
> while ls -alR in /var/spool/postfix/x (x>0) shows an empty queue

That does not mean anything other than that the default instance has
undelivered mail, and others don't.  And the way to list queues is not
"ls -alR", but "postqueue -p" (a.k.a. "mailq"):

$ postmulti -i - postqueue -p
$ postmulti -i postfix-smtp1 postqueue -p
$ postmulti -i postfix-smtp2 postqueue -p

Without reporting logging you'll get nowhere.

> I would expect, if I am not worng, that queued messages are getting in
> /var/spool/postfix/x according to the instance handling the emaili,
> isn't it?

Queued messages are in the queue of the (last) Postfix instance that has
received and has not yet delivered the message.

-- 
Viktor.
___
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org


[pfx] Re: Multi-Postfix : Wrong queue

2024-10-20 Thread Wietse Venema via Postfix-users
Joan Moreau via Postfix-users:
> Hi,
> 
> I am using the " multi" postifx
> https://www.postfix.org/MULTI_INSTANCE_README.html
> 
> When an email is ending in the queue for relaunch, it goes to the
> principal process, not hte one where it has firstly managed by

What command did you use to relaunch Postfix?

> (says if I have 2 instance p1 and p2, I send the mail with p2, I
> restart postfix, the email is now sent by p1 inproperly)

What command did you use to restart Postfix?

What is the evidence (logging) a message  was in the p2 queue?

What is the evidence (logging) that that message goes from the p2
queue into the p1 queue?

Wietse
___
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org


[pfx] Multi-Postfix : Wrong queue

2024-10-20 Thread Joan Moreau via Postfix-users
Hi,

I am using the " multi" postifx
: https://www.postfix.org/MULTI_INSTANCE_README.html

When an email is ending in the queue for relaunch, it goes to the
principal process, not hte one where it has firstly managed by

(says if I have 2 instance p1 and p2, I send the mail with p2, I
restart postfix, the email is now sent by p1 inproperly)

Is this a bug or a misconfiguration ?

Thank you

___
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org


[pfx] Re: Multi-Postfix : Wrong queue

2024-10-20 Thread Joan Moreau via Postfix-users
To clarify, I have the following parameters in main.cf of the default
instance

multi_instance_wrapper = ${command_directory}/postmulti -p --
multi_instance_enable = yes
multi_instance_directories = /etc/mail/postfix-smtp1 /etc/mail/postfix-smtp2 
/etc/mail/postfix-smtp3 /etc/mail/postfix-smt


On Mon, 2024-10-21 at 09:31 +0800, Joan Moreau wrote:
> Hi,
> 
> I am using the " multi" postifx
> : https://www.postfix.org/MULTI_INSTANCE_README.html
> 
> When an email is ending in the queue for relaunch, it goes to the
> principal process, not hte one where it has firstly managed by
> 
> (says if I have 2 instance p1 and p2, I send the mail with p2, I
> restart postfix, the email is now sent by p1 inproperly)
> 
> Is this a bug or a misconfiguration ?
> 
> Thank you
> 

___
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org


[pfx] Re: Multi-Postfix : Wrong queue

2024-10-20 Thread Viktor Dukhovni via Postfix-users
On Mon, Oct 21, 2024 at 09:31:53AM +0800, Joan Moreau via Postfix-users wrote:

> I am using the " multi" postifx
> : https://www.postfix.org/MULTI_INSTANCE_README.html
> 
> When an email is ending in the queue for relaunch, it goes to the
> principal process, not the one where it has firstly managed by
> 
> (says if I have 2 instance p1 and p2, I send the mail with p2, I
> restart postfix, the email is now sent by p1 inproperly)
> 
> Is this a bug or a misconfiguration ?

It is not even clear what problem you're describing.

- Perhaps the message does not even touch multiple queues, and all
  you have is misconfigured logging?

1.  Nothing built-in to the Postfix queue manager or delivery agents
moves messages from one instance queue to another.  So what you're
describing "can't happen".  Many services can even run in a chroot
jail, with the OS constraining their view of the filesystem to just
the queue directory.

2.  Of course if you somehow manage to give multiple instances the same
queue directory, that would a serious misconfiguration.  Post the
output of:

$ postmulti -x -- sh -c '
printf "\n%s:\n" "$MAIL_CONFIG"
postconf -f config_directory import_environment queue_directory 
syslog_name
printf -- "--\n"
postconf -P "*/*/syslog_name"
'

On my single-instance system the output is:

/opt/postfix/etc:
config_directory = /opt/postfix/etc
import_environment = MAIL_CONFIG MAIL_DEBUG MAIL_LOGTAG TZ XAUTHORITY 
DISPLAY
LANG=C POSTLOG_SERVICE POSTLOG_HOSTNAME
queue_directory = /var/spool/postfix
syslog_name = ${multi_instance_name?{$multi_instance_name}:{postfix}}
--
465/inet/syslog_name = postfix/smtps
submission/inet/syslog_name = postfix/submission

3.  As mentioned by Wietse, post logs that evidence the reported issue.

-- 
Viktor.
___
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org