ALT Linux sysadmins discussion
 help / color / mirror / Atom feed
From: Sergey <a_s_y@sama.ru>
To: "ALT Linux sysadmins' discussion" <sysadmins@lists.altlinux.org>
Subject: Re: [Sysadmins] очередь сендмыла
Date: Fri, 31 May 2013 10:33:27 +0400
Message-ID: <201305311033.27076.a_s_y@sama.ru> (raw)
In-Reply-To: <51A76BFE.6030703@iop.kiev.ua>

On Thursday 30 May 2013, Andrii Dobrovol`s`kii wrote:

> Возможно ли рулить очередью сендмыла на уровне отдельных писем?
> Например удалить из очереди все письма конкретного отправителя?
> Или это из области фантастики?
 
Никакой фантастики. Я даже с mailq не заморачиваюсь.

#!/bin/bash

ALIEN='какой-то признак поуникальнее'

for QN in `seq -f %03g 20`; do
    echo queue$QN
    find /var/spool/mqueue/queue$QN/ -type f -print0 | 2>/dev/null xargs -0 egrep -l "$ALIEN" | \
    cut -d '/' -f6|cut -b 3- | \
    while read f; do \
       rm -f /var/spool/mqueue/queue$QN/*$f; \
       done
done

Можно в find добавить -regex ".*\/qf.*", если достаточно по данным
заголовка ориентироваться.

-- 
С уважением, Сергей
a_s_y@sama.ru


  reply	other threads:[~2013-05-31  6:33 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-30 15:10 Andrii Dobrovol`s`kii
2013-05-31  6:33 ` Sergey [this message]
2013-05-31 10:04   ` Andrii Dobrovol`s`kii
2013-06-02 22:06     ` Sergey
2013-06-03 11:59       ` Andrii Dobrovol`s`kii
2013-06-03 14:46         ` Sergey
2013-06-03 15:35           ` Andrii Dobrovol`s`kii
2013-06-03 16:11             ` Sergey
2013-06-18 17:26             ` Sergey
2013-06-19 10:05               ` Andrii Dobrovol`s`kii
2013-06-19 15:10                 ` Anton Gorlov
2013-06-19 15:23                   ` Andrii Dobrovol`s`kii
2013-06-21 11:58                   ` Sergey
2013-06-22  8:24                       ` Sergey
2013-06-21 11:55                 ` Sergey
2013-06-25 11:16                   ` Andrii Dobrovol`s`kii
2013-05-31 10:02   ` Andrii Dobrovol`s`kii
2013-05-31 13:05     ` Andrii Dobrovol`s`kii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201305311033.27076.a_s_y@sama.ru \
    --to=a_s_y@sama.ru \
    --cc=sysadmins@lists.altlinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux sysadmins discussion

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/sysadmins/0 sysadmins/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 sysadmins sysadmins/ http://lore.altlinux.org/sysadmins \
		sysadmins@lists.altlinux.org sysadmins@lists.altlinux.ru sysadmins@lists.altlinux.com
	public-inbox-index sysadmins

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.sysadmins


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git