MuttとSpamassassimの設定方法

MuttとSpamassassimの設定方法

私のGmailにアクセスして読み取ることができるMuttがありますが、受信トレイにはGmailインターフェースが「Social」と「Promotions」という2つのタブ(ラベルだと思う)に隠されたすべてのメッセージが含まれています。

コンソール専用のメールインターフェイスに切り替えたいのですが、このように追加のスパムを見ることは我慢できません! POPの代わりにIMAPを使用していることを考慮すると、この問題を処理するために使用できるオプションは少しあいまいです。また、Spamassassinのようなツールを助けるためにこれらのメッセージをローカルに抽出するとは思わない。

理想的には、メールにアクセスして並べ替え、スパムを削除し、Muttで整理された受信トレイを表示し、Gmailサーバーにも反映したいと思います。

オンラインでさまざまなページを見てきましたが、fetchmail、procmail、特にSpamassassinに関連するすべてのページは、(ホストされたメールサーバーを使用せずに)独自のメールサーバーを実行するトピックに関連しているようです。 Muttのマニュアルは私に脳手術に関する本を読むのと同じで、多くの人が持っている解決策をどこで見つけるべきかわかりませんでした... Muttを使ってGmailを整理する方法。

muttrc、.procmail、および.forwardを添付しました...また、Archリポジトリにspamassassinをインストールしましたが、それをどこに指定するのか、このシステム統合が現在行われていることを確認する方法がわかりません。

助けてくれてありがとう。

set ssl_starttls=yes
set ssl_force_tls=yes
set imap_user = '[email protected]'
set imap_pass = 'XXXXXXXXX'
set from='[email protected]'
set realname='XXXXXXXXX'
set folder = imaps://imap.gmail.com/
set spoolfile = imaps://imap.gmail.com/INBOX
set postponed="imaps://imap.gmail.com/[Gmail]/Drafts"
set header_cache = "~/.mutt/cache/headers"
set message_cachedir = "~/.mutt/cache/bodies"
set certificate_file = "~/.mutt/certificates"
set smtp_url = 'smtps:// [email protected]:[email protected]:465/'
set move = no
set imap_keepalive = 900
mailboxes +GMail/INBOX +GMail/Social +GMail/Promotions
set sort=threads
set sort_browser=date
set sort_aux=reverse-last-date-received
set editor=nvim


source ~/.mutt/mutt-colors-solarized/mutt-colors-solarized-light-256.muttrc



# Sanely handle multi-part messages (prefer text part, but yield to
# mailcap-configured rendering for html-only)
alternative_order text/plain text/html
auto_view text/html

set sleep_time = 0

bind pager j next-line
bind pager k previous-line
bind attach,index,pager \CD next-page
bind attach,index,pager \CU previous-page
bind pager g top
bind pager G bottom
bind attach,index g first-entry
bind attach,index G last-entry

これは~/.procmailです

# SpamAssassin sample procmailrc
#
# Pipe the mail through spamassassin (replace 'spamassassin' with 'spamc'
# if you use the spamc/spamd combination)
#
# The condition line ensures that only messages smaller than 250 kB
# (250 * 1024 = 256000 bytes) are processed by SpamAssassin. Most spam
# isn't bigger than a few k and working with big messages can bring
# SpamAssassin to its knees.
#
# The lock file ensures that only 1 spamassassin invocation happens
# at 1 time, to keep the load down.
#
:0fw: spamassassin.lock
* < 256000
| spamassassin

# Mails with a score of 15 or higher are almost certainly spam (with 0.05%
# false positives according to rules/STATISTICS.txt). Let's put them in a
# different mbox. (This one is optional.)
:0:
* ^X-Spam-Level: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
almost-certainly-spam

# All mail tagged as spam (eg. with a score higher than the set threshold)
# is moved to "probably-spam".
:0:
* ^X-Spam-Status: Yes
probably-spam

# Work around procmail bug: any output on stderr will cause the "F" in "From"
# to be dropped.  This will re-add it.
:0
* ^^rom[ ]
{
  LOG="*** Dropped F off From_ header! Fixing up. "

  :0 fhw
  | sed -e '1s/^/F/'
}

メッセージをローカルに取得し、ここで実行する必要がありますか?混乱していましたが、一つは知っていました。私はいくつかのことをとても間違っていました。

助けてくれてありがとう!

ベストアンサー1

おすすめ記事