0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Postfixの設定変更(gmailのスパム判定のキュー削除、漏洩メールアドレスのDiscard)

Last updated at Posted at 2020-09-20

Gmailに全転送しているのですが、妙に転送が遅い問題があります。
2日くらいかかるメールがあります。

postqueue -p で見てみると、大量のgmailのスパム判定メールが溜まっています。
これが原因かは分かりませんが、問題であることは間違いないので片付けます。

https://qiita.com/aske315/items/daddf2e71f1494bb6e0d
こちらを参考にしました。

もともと転送用でバウンスする必要もないので問答無用でDeleteします。

/etc/cron.daily/cleangmail421
# !/bin/sh

postqueue -p \
 | sed -n  \
  -e '/^[0-9A-Z]*  */N' \
  -e 's/\n/ /g' \
  -e '/(host [^ ]* said: 421[- ]4\.7\.0 /N' \
  -e 's/\n  *\(.*gmail\.com\)/ \1/p' \
 |while read -r qid size wday month mday time sender recipient; do
  postsuper -d "$qid"
done

あと、漏洩しているメールアドレスをheader_checksでDISCARDします。
最終行に追加します。

/^To:.*xxxxxxx@xxxxx\.xxx/ DISCARD

使うメールアドレスは1サイト毎にdelimiter以下で使い分けているので、漏れるとすぐ分かります。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?