You are not logged in.
I've been using isync + nmh + msmtp for a while now, but recently attempted to set up mail sorting and spam filtering with procmail and SpamAssassin. In the process, I set up fetchmail in place of isync, and promptly broke everything. In searching the documentation for where I went wrong, I became progressively more confused by the definitions and explanations given. All of the information seems to point me towards setting up a mail server, and no documentation exists for using any of these programs together with an IMAP account on a separate server. To the best of my knowledge, NMH and procmail are set up correctly; the trouble comes with setting up a mail-fetching program and getting procmail invoked on the incoming mail, then shuffling that to NMH. Fetchmail also appears to work correctly, though it eats my emails alive and, having deleted them from the remote account (in both IMAP and POP3 mode), the messages are nowhere to be found on my local system. I was under the impression that fetchmail delivers mail to /var/spool/mail/$USER, then invokes procmail, which invokes SpamAssassin and sorts the messages into my local MNH folder. I've pulled bits of the configs from a number of sources, but mostly from the wiki. All of them seem to work fine, up until the part where no mail is to be found on the system. Fetchmail pulls my mail off the server just fine, but it seems to go nowhere but /dev/null, rather than my mail spool. I know I'm grossly misunderstanding something here, but I can't tell what it is.
My .fetchmailrc:
poll imap.gmx.de with proto IMAP user "<user>" password "<pass>" ssl mda "/usr/bin/procmail -d %T"My .procmailrc:
# assignments
PATH=/bin:/usr/bin
MAILDIR=$HOME/mail
DEFAULT=$HOME/mail/inbox
LOGFILE=/dev/null
SHELL=/bin/sh
STORE=/usr/lib/mh/rcvstore
LOCKEXT=.lock
# Just store everything in the inbox
:0 w :inbox/$LOCKEXT
| $STORE +inbox
# recipes
#
# these use regular expressions, double check your shit and test it on
# junk or chaff messages first before you implement them mailbox-wide.
#
# the format is:
# :0 [flags] [ : [locallockfile] ]
# <zero or more conditions (one per line)>
# <exactly one action line>
# conditions start with an asterisk.
# basic sorting recipes:
# (integrate the folders with NMH later)
# note for future self: fix your MTA at some point. Last I checked, it didn't send
# messages correctly.
# sort all ASU-domain emails into the ASU folder.
:0:
* ^From.*@asu.edu
$HOME/mail/asu
# Pipe the mail through spamassassin
#
# 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/'
}
# TODO:
# strip out attachments, if they exist, scan them for viruses, and put
# them in ~/downloads. Put a line in the message header pointing to the
# file for user referenceMy .mh_profile:
Path: /home/<user>/mail
From: <name> <address>
Editor: vim
postproc: /usr/bin/sendmailLast edited by ParanoidAndroid (2016-01-16 07:43:48)
Offline