postfix flush, postqueue -f, postsuper -h ALL

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

postfix flush, postqueue -f, postsuper -h ALL

das mouse
Hi

I run Postfix 3.1 on a Ubuntu 16lts box. Postfix' config on this machine is very very simple, not more than a local relay.

As weird as it sounds none of the queue managing commands seem to do anything: postfix flush, postqueue -f, postsuper -h ALL, postsuper -H ALL. Increasing verbosity levels (-v) does not really help.

Back in the days of Postfix 2.2 I remember I could use postsuper -h ALL to put the Postfix queue on hold. Arriving emails would be held back. With postsuper -H ALL I would release everything. Same with postfix flush. If I read them correctly this is also what the current man pages tell.

On this machine, however, I must put emails on hold using configuration in main.cf:

smtpd_recipient_restrictions =
   check_recipient_access hash:/etc/postfix/hold

with /etc/postfix/hold:

and release the held back emails with postsuper -r [queueid].
The cli queue commands neither hold emails nor do they flush the queues.

If somebody could point me in the right direction? Am I missing something? 

Thank you
philipp

Reply | Threaded
Open this post in threaded view
|

Re: postfix flush, postqueue -f, postsuper -h ALL

Noel Jones-2
On 10/18/2018 6:26 AM, das mouse wrote:

> Hi
>
> I run Postfix 3.1 on a Ubuntu 16lts box. Postfix' config on this
> machine is very very simple, not more than a local relay.
>
> As weird as it sounds none of the queue managing commands seem to do
> anything: postfix flush, postqueue -f, postsuper -h ALL, postsuper
> -H ALL. Increasing verbosity levels (-v) does not really help.
>
> Back in the days of Postfix 2.2 I remember I could use postsuper -h
> ALL to put the Postfix queue on hold. Arriving emails would be held
> back. With postsuper -H ALL I would release everything. Same with
> postfix flush. If I read them correctly this is also what the
> current man pages tell.
>
> On this machine, however, I must put emails on hold using
> configuration in main.cf <http://main.cf>:
>
> smtpd_recipient_restrictions =
>    check_recipient_access hash:/etc/postfix/hold
>
> with /etc/postfix/hold:
> mydomain.com <http://mydomain.com> HOLD
>
> and release the held back emails with postsuper -r [queueid].
> The cli queue commands neither hold emails nor do they flush the queues.
>
> If somebody could point me in the right direction? Am I missing
> something? 
>
> Thank you
> philipp
>


This is a very odd problem.  I'm guessing either a corrupted
filesystem or some security software interfering with file access.

I think it's unlikely this is a problem with postfix itself.



  -- Noel Jones
Reply | Threaded
Open this post in threaded view
|

Re: postfix flush, postqueue -f, postsuper -h ALL

Viktor Dukhovni
In reply to this post by das mouse


> On Oct 18, 2018, at 7:26 AM, das mouse <[hidden email]> wrote:
>
> I run Postfix 3.1 on a Ubuntu 16lts box. Postfix' config on this machine is very very simple, not more than a local relay.
>
> As weird as it sounds none of the queue managing commands seem to do anything: postfix flush, postqueue -f, postsuper -h ALL, postsuper -H ALL. Increasing verbosity levels (-v) does not really help.

Are you running these as "root" or as some other user?  And if as "root", are
you sure that "postsuper -h" and "postsuper -H" don't work even when the source
queue is not empty of complete messages?

The "postqueue" command is setgid, e.g. on my system:

  $ ls -ld /usr/local/sbin/postqueue
  -rwxr-sr-x  1 root  maildrop  20512 Jun 14 00:10 /usr/local/sbin/postqueue

so one might imagine some system configurations in which such programs silently
don't execute (and containers of various sorts can also simply suppress execution
of specific binaries and make them silent NOOPs).

> On this machine, however, I must put emails on hold using configuration in main.cf:
>
> smtpd_recipient_restrictions =
>    check_recipient_access hash:/etc/postfix/hold
>
> with /etc/postfix/hold:
> mydomain.com HOLD
>
> and release the held back emails with postsuper -r [queueid].
> The cli queue commands neither hold emails nor do they flush the queues.

But you report that "postsuper -r" works, suggests "postsuper" actually runs,
and moves queue files around, so "postsuper -h" would not be expected to fail.

--
        Viktor.

Reply | Threaded
Open this post in threaded view
|

Re: postfix flush, postqueue -f, postsuper -h ALL

Peter Ajamian
In reply to this post by das mouse
On 19/10/18 00:26, das mouse wrote:
> As weird as it sounds none of the queue managing commands seem to do
> anything: postfix flush, postqueue -f, postsuper -h ALL, postsuper -H
> ALL. Increasing verbosity levels (-v) does not really help.

None of these will do anything on an empty queue.

> Back in the days of Postfix 2.2 I remember I could use postsuper -h ALL
> to put the Postfix queue on hold. Arriving emails would be held back.

Not entirely correct.  Existing messages already in the queue will be
moved to the hold queue with this command.

> On this machine, however, I must put emails on hold using configuration
> in main.cf <http://main.cf>:
>
> smtpd_recipient_restrictions =
>    check_recipient_access hash:/etc/postfix/hold
>
> with /etc/postfix/hold:
> mydomain.com <http://mydomain.com> HOLD

This will put all messages with a recipient of mydomain.com on hold as
soon as postfix accepts them.  BTW, it can be shortened to:

smtpd_recipient_restrictions = check_recipient_access
inline:{example.com=HOLD}

...or if you really want to put ALL inbound mail on hold:

smtpd_recipient_restrictions = check_recipient_access static:HOLD


Peter
Reply | Threaded
Open this post in threaded view
|

Re: postfix flush, postqueue -f, postsuper -h ALL

Viktor Dukhovni


> On Oct 18, 2018, at 2:33 PM, Peter <[hidden email]> wrote:
>
>> As weird as it sounds none of the queue managing commands seem to do
>> anything: postfix flush, postqueue -f, postsuper -h ALL, postsuper -H
>> ALL. Increasing verbosity levels (-v) does not really help.
>
> None of these will do anything on an empty queue.
>
>> Back in the days of Postfix 2.2 I remember I could use postsuper -h ALL
>> to put the Postfix queue on hold. Arriving emails would be held back.
>
> Not entirely correct.  Existing messages already in the queue will be
> moved to the hold queue with this command.

Indeed if the OP expected "postsuper -h ALL" to cause *future* messages
to be put on HOLD, then the OP is much mistaken.  That *never* worked.

The CLI commands only apply to messages *currently* in the queue,
*future* messages handling is specified in main.cf and master.cf.

--
        Viktor.

Reply | Threaded
Open this post in threaded view
|

Re: postfix flush, postqueue -f, postsuper -h ALL

das mouse
Yes indeed, I had expected postsuper -h ALL would put the system on hold for all messages, especially future messages.
Thank you for the clarification of the postsuper man page. Much appreciated. 

Am Do., 18. Okt. 2018 um 20:44 Uhr schrieb Viktor Dukhovni <[hidden email]>:


> On Oct 18, 2018, at 2:33 PM, Peter <[hidden email]> wrote:
>
>> As weird as it sounds none of the queue managing commands seem to do
>> anything: postfix flush, postqueue -f, postsuper -h ALL, postsuper -H
>> ALL. Increasing verbosity levels (-v) does not really help.
>
> None of these will do anything on an empty queue.
>
>> Back in the days of Postfix 2.2 I remember I could use postsuper -h ALL
>> to put the Postfix queue on hold. Arriving emails would be held back.
>
> Not entirely correct.  Existing messages already in the queue will be
> moved to the hold queue with this command.

Indeed if the OP expected "postsuper -h ALL" to cause *future* messages
to be put on HOLD, then the OP is much mistaken.  That *never* worked.

The CLI commands only apply to messages *currently* in the queue,
*future* messages handling is specified in main.cf and master.cf.

--
        Viktor.