deleting from the corrupt queue

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

deleting from the corrupt queue

Dan Langille
How does one delete from the corrupt queue? 

FreeBSD 10.3 and Postfix 3.2.3

I have inspected the message, know the cause of the corruption, and wish to delete it.

Upon restart, I see this output from Postfix:

postfix/postfix-script: warning: damaged message: corrupt/B251C2BDE

The filesystem contains:

$ sudo find /var/spool/postfix/ -name B251C2BDE
/var/spool/postfix/defer/B/B251C2BDE
/var/spool/postfix/corrupt/B251C2BDE

Let's try deleting:

$ sudo postsuper -d corrupt/B251C2BDE
postsuper: warning: invalid mail queue id: corrupt/B251C2BDE

$ sudo postsuper -d B251C2BDE
$ sudo postsuper -d B251C2BDE corrupt
postsuper: fatal: invalid directory name: corrupt
$ sudo postsuper -d B251C2BDE defer  
$ sudo find /var/spool/postfix/ -name B251C2BDE
/var/spool/postfix/defer/B/B251C2BDE
/var/spool/postfix/corrupt/B251C2BDE

It's still there.

Am I doing this right?

Thank you.

-- 
Dan Langille - BSDCan / PGCon
[hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: deleting from the corrupt queue

Dan Langille

> On Sep 28, 2017, at 10:48 AM, Dan Langille <[hidden email]> wrote:
>
> How does one delete from the corrupt queue?
>
> FreeBSD 10.3 and Postfix 3.2.3
>
> I have inspected the message, know the cause of the corruption, and wish to delete it.
>
> Upon restart, I see this output from Postfix:
>
> postfix/postfix-script: warning: damaged message: corrupt/B251C2BDE
>
> The filesystem contains:
>
> $ sudo find /var/spool/postfix/ -name B251C2BDE
> /var/spool/postfix/defer/B/B251C2BDE
> /var/spool/postfix/corrupt/B251C2BDE
>
> Let's try deleting:
>
> $ sudo postsuper -d corrupt/B251C2BDE
> postsuper: warning: invalid mail queue id: corrupt/B251C2BDE
>
> $ sudo postsuper -d B251C2BDE
> $ sudo postsuper -d B251C2BDE corrupt
> postsuper: fatal: invalid directory name: corrupt
> $ sudo postsuper -d B251C2BDE defer  
> $ sudo find /var/spool/postfix/ -name B251C2BDE
> /var/spool/postfix/defer/B/B251C2BDE
> /var/spool/postfix/corrupt/B251C2BDE
> $
>
> It's still there.
>
> Am I doing this right?
>
> Thank you.
>

For those interested:

[dan@zuul:~] $ postconf -n
alias_maps = hash:/etc/mail/aliases
command_directory = /usr/local/sbin
daemon_directory = /usr/local/libexec/postfix
data_directory = /var/db/postfix
debug_peer_level = 2
debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5
html_directory = no
inet_interfaces = $myhostname, localhost
inet_protocols = ipv4
mail_owner = postfix
mailbox_size_limit = 102400000
mailq_path = /usr/local/bin/mailq
manpage_directory = /usr/local/man
message_size_limit = 102400000
mynetworks = xxx.xxx.116.64/26, 127.0.0.1, 10.0.0.0/24
newaliases_path = /usr/local/bin/newaliases
queue_directory = /var/spool/postfix
readme_directory = no
recipient_delimiter = +
relay_clientcerts = hash:/usr/local/etc/postfix-config/relay_clientcerts
sample_directory = /usr/local/etc/postfix
sendmail_path = /usr/local/sbin/sendmail
setgid_group = maildrop
smtp_tls_CAfile = /usr/local/etc/ssl/cert.pem
smtp_tls_cert_file = /usr/local/etc/ssl/zuul.example.org.fullchain.cer
smtp_tls_fingerprint_digest = sha1
smtp_tls_key_file = /usr/local/etc/ssl/zuul.example.org.key
smtp_tls_policy_maps = hash:/usr/local/etc/postfix-config/tls_policy
smtp_tls_security_level = may
smtp_tls_session_cache_database = btree:/var/db/postfix/smtp_scache
smtpd_tls_CAfile = /usr/local/etc/ssl/cert.pem
smtpd_tls_cert_file = /usr/local/etc/ssl/zuul.example.org.fullchain.cer
smtpd_tls_fingerprint_digest = sha1
smtpd_tls_key_file = /usr/local/etc/ssl/zuul.example.org.key
smtpd_tls_security_level = may
smtpd_tls_session_cache_database = btree:/var/db/postfix/smtpd_scache
soft_bounce = yes
transport_maps = hash:/usr/local/etc/postfix-config/transport
unknown_local_recipient_reject_code = 550

--
Dan Langille - BSDCan / PGCon
[hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: deleting from the corrupt queue

Viktor Dukhovni
In reply to this post by Dan Langille

> On Sep 28, 2017, at 10:48 AM, Dan Langille <[hidden email]> wrote:
>
> How does one delete from the corrupt queue?

With /bin/rm, after you're satisfied that the files are no longer
useful.

Corrupt queue files may indicate some sort of filesystem issue, since
Postfix only sets the executable bit on a queue file when the content
is complete... But you can get "corrupt" queue files if the host crashes
between the "chmod 700" and the following fsync(), if the metadata write
happens, but the data write does not.

--
--
        Viktor.

Reply | Threaded
Open this post in threaded view
|

Re: deleting from the corrupt queue

Wietse Venema
Viktor Dukhovni:

>
> > On Sep 28, 2017, at 10:48 AM, Dan Langille <[hidden email]> wrote:
> >
> > How does one delete from the corrupt queue?
>
> With /bin/rm, after you're satisfied that the files are no longer
> useful.
>
> Corrupt queue files may indicate some sort of filesystem issue, since
> Postfix only sets the executable bit on a queue file when the content
> is complete... But you can get "corrupt" queue files if the host crashes
> between the "chmod 700" and the following fsync(), if the metadata write
> happens, but the data write does not.

Note that Postfix does not claim that a message is received until
fsync() reports success, so if this was a message in transit, it
would still be in the remote sender's queue (or in the maildrop
directory in the case of local submission).

        Wietse