Eğer MTA olarak Sendmail kullanıyorsanız posta kuyruğunu temizlemek için:
1 |
$ sendmail q |
komutunu kullanın.
Postfix Mail Queue Flush Etme için Postfix MTA altında, sadece posta kuyruğunu temizlemek için aşağıdaki komutu girin:
1 |
$ postfix flush |
ya da
1 |
$ postfix -f |
Mail queue’daki maillleri görmek için aşağıdaki komutu girin:
1 |
$ mailq |
Kuyruktaki tüm postaları kaldırmak için aşağıdaki komutu girin:
1 |
$ postsuper -d ALL |
Ertelenmiş Kuyruktaki tüm postaları kaldırmak için aşağıdaki komutu girin:
1 |
$ postsuper -d ALL deferred |
Postfix Mail Queue Flush Etme için “postfix-delete.pl script”
Aşağıdaki komut dosyası ilk argüman olarak belirtilen düzenli ifadeyle eşleşen mailQ’daki tüm postaları siler.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
#!/usr/bin/perl $REGEXP = shift || die "no email-adress given (regexp-style, e.g. bl.*\@yahoo.com)!"; @data = qx</usr/sbin/postqueue -p>; for (@data) { if (/^(\w+)(\*|\!)?\s/) { $queue_id = $1; } if($queue_id) { if (/$REGEXP/i) { $Q{$queue_id} = 1; $queue_id = ""; } } } #open(POSTSUPER,"|cat") || die "couldn't open postsuper" ; open(POSTSUPER,"|postsuper -d -") || die "couldn't open postsuper" ; foreach (keys %Q) { print POSTSUPER "$_\n"; }; close(POSTSUPER); |
örnek kullanım
1 |
$ ./postfix-delete.pl xyz |
1 |
$ ./postfix-delete.pl spamdomain.com |
So, what do you think ?