<<< Date Index >>>     <<< Thread Index >>>

Re: Folders, Sorting, SSH



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Friday, February 29 at 05:00 PM, quoth wishi:
> I'm going to use mutt as MUA... but I'm new here, and so I have got 
> 3  questions. Hopefully, it's possible:

Glad to have you aboard! Let's see what we can do.

> 1. I'm using mailing lists, and a key-feature of mutt, I think, is 
> the thread sorting, that comes in very handy. (Really, thanks for 
> this live-changing option! :))
>
> Can I sort mailing lists into separate folders, too? 
> - I found the list command... but it's not sorting my stuff at all.

You're using the word "sort" with two entirely different meanings 
(kinda like saying "Okay, I think I understand baseball, and I love 
being able to hit things with a bat, but now I'd like to get some 
winged mammals (bats) to fly around as well!").

For what it's worth, mutt does not automatically file the contents of 
your INBOX (or any other folder) away into sub-folders. The reason for 
this is relatively simple: there are great standalone tools for doing 
that, and the authors of mutt didn't see any point in duplicating that 
work.

The most common way that mutt folk file their email into given folders 
is they change the way the mail is delivered, such that each mail is 
put into the correct folder as it is delivered rather than later, 
after the fact. The usual way to do this is either procmail or 
maildrop, though some IMAP systems support the SIEVE filter language 
as well. If you fetch your mail from a remote server and store it 
locally (e.g. with fetchmail or getmail), this is easy, just tell 
fetchmail/getmail to hand the mail to your filter program 
(procmail/maildrop). If you keep your mail on a remote server and 
access it via IMAP, and assuming you have no way to filter your mail 
on the server, then you probably want something like IMAPFilter.

> I. e. I'm on the list foo@xxxxxxx and the subject is always [bar]. 
> Is there any sorting feature to put the eMails into local folders? 
> Sorted by sender or subject?

Once messages have been delivered to whatever folder they're destined 
for, you can sort them however you like.

> 2. I want to use mutt's pop and imap features, but mutt itself 
> doesn't provide any spam filtering, does it? - Would be perfect, if 
> I could mark eMails being spam and filter them with spamassasin or 
> so, to see as little spam as possible.

No; once again, that's more appropriately done by a mail filter, such 
as procmail or maildrop.

> With an external MRA this is possible:
> I tried to setup fetchmail, but it's really slow and my third problem is, 
> I'd like to tunnel the incoming mail transfers through an ssh tunnel. 
> fetchmail has a --plugin option, but I didn't understand the 
> documentation.

This is the format:

     fetchmail --plugin 'ssh user@host'

The more complicated parts of that (e.g. with %h and %p) are probably 
things you don't need to deal with.

You can also put that same information into your fetchmailrc.

> So I searched for alternative options, found getmail. My python 
> doesn't have SSL support - so I can't use getmail - like I want. So, 
> does anybody know how to get SSL support for getmail with python; or 
> a direct spam-filtering option into mutt? (Two things one aim) Could 
> be really helpful.

I don't know much about getmail; but what's the point of using SSL if 
you're tunneling the connection over SSH to begin with? Are you really 
getting an important increase in security by encrypting your 
communication twice?

> 3. I'm using a proxy to encrypt traffic via ssh.
>
> Normally, I'm starting a Socks5 proxy with ssh -D, and making all 
> requests through this tunnel. mutt itself, which is another key-feature I 
> like, is extremely portable, and I could use it at my server directly. 
> But if I just want to use mutt locally at my machine here, and sending 
> through an ssh-tunnel, is this possible, too? I'd prefer to keep logins 
> and mails locally, and just using a tunnel. 
> I tryed dsocks and tsocks... doesn't work... so I'm looking for something 
> built into mutt, that makes it using a Socks to connect...

Mutt doesn't understand SOCKS, but mutt DOES understand using tunnels. 
 From the mutt documentation:

     tunnel
         Type: string
         Default: ""

         Setting this variable will cause mutt to open a pipe to a
         command instead of a raw socket. You may be able to use this
         to set up preauthenticated connections to your IMAP/POP3
         server. Example:

         tunnel="ssh -q mailhost.net /usr/local/libexec/imapd"

         NOTE: For this example to work you must be able to log in to
         the remote machine without having to enter a password.

So, if you can use ssh to set up a tunnel through your SOCKS proxy, 
just set $tunnel to the right ssh command, and mutt will use it for 
accessing your email.

The issue about using a password can be mitigated by using ssh's 
ControlMaster/ControlPath settings (check out the ssh documentation 
for details). Then, all you have to do is set up an initial ssh 
connection to the SOCKS proxy and leave it running; subsequent ssh 
invocations can use the same connection without requiring that you 
enter the password again.

Hope that helps,

~Kyle
- -- 
Almost everything about a human creature is ridiculous, except its 
ability to suffer bravely and die gallantly for whatever it loves and 
believes in. The validity of that belief, the appropriateness of that 
love, is irrelevant; it is the bravery and the gallantry that count.
                        -- Robert A. Heinlein, Job: A Comedy of Justice
-----BEGIN PGP SIGNATURE-----
Comment: Thank you for using encryption!

iD8DBQFHyDOlBkIOoMqOI14RAvKNAKC0kYjSKhz6+ZxblWlXGDplxXjKRQCg+yso
/t7Jp4tp96Ieo0hKkgJ8SkI=
=ZzJY
-----END PGP SIGNATURE-----