Gnus development mailing list
 help / color / mirror / Atom feed
* Getting started: splitting mail, SMIME, local copies
@ 2012-12-11 20:03 bromley
  2012-12-11 20:31 ` Burton Samograd
  2012-12-12  8:54 ` Alberto Luaces
  0 siblings, 2 replies; 12+ messages in thread
From: bromley @ 2012-12-11 20:03 UTC (permalink / raw)
  To: ding

I'm using IMAP & SMTP(0).

0. How can I split my mail?

There is an example(1). Will it work for IMAP? Should I replace nnml
with nnimap? Should I create the necessary groups before splitting?

1. How to enable SMIME?

I'm familiar with GPG, but I know nothing about X.509 certificates.
Is it necessary to have an X.509 certificate?

I have an X.509 certificate, which is used by Postfix. I used the
following to generate it:

cert.sh:
tmp=$(mktemp cert.pem.XXXXXX)
openssl req -x509 -new -newkey rsa:2048 -nodes -keyout /dev/stdout \
  -days $((365 * 5)) -subj "/CN=mail.example.com" > $tmp
chmod 0600 $tmp
mv $tmp cert.pem

Can I use it? (I usually use Gnus on a different machine.)

What's the difference between PGP, PGP/MIME and S/MIME?

2. How to enable local copies?

I'm fetching email via IMAP and replying via SMTP. How can I store the
fetched and sent messages?

(0) http://article.gmane.org/gmane.emacs.gnus.general/82578
(1)
https://www.gnu.org/software/emacs/manual/html_node/gnus/Group-Mail-Splitting.html






^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Getting started: splitting mail, SMIME, local copies
  2012-12-11 20:03 Getting started: splitting mail, SMIME, local copies bromley
@ 2012-12-11 20:31 ` Burton Samograd
  2012-12-12  7:04   ` Matt Ford
  2012-12-16 13:00   ` bromley
  2012-12-12  8:54 ` Alberto Luaces
  1 sibling, 2 replies; 12+ messages in thread
From: Burton Samograd @ 2012-12-11 20:31 UTC (permalink / raw)
  To: ding

bromley@lavabit.com writes:

> 0. How can I split my mail?
>
> There is an example(1). Will it work for IMAP? Should I replace nnml
> with nnimap? Should I create the necessary groups before splitting?

I am also interested in this answer as I've setup my
nnimap-split-methods but have yet to see any splitting happen.

> 1. How to enable SMIME?
>
> I'm familiar with GPG, but I know nothing about X.509 certificates.
> Is it necessary to have an X.509 certificate?
>
> I have an X.509 certificate, which is used by Postfix. I used the
> following to generate it:
>
> cert.sh:
> tmp=$(mktemp cert.pem.XXXXXX)
> openssl req -x509 -new -newkey rsa:2048 -nodes -keyout /dev/stdout \
>   -days $((365 * 5)) -subj "/CN=mail.example.com" > $tmp
> chmod 0600 $tmp
> mv $tmp cert.pem
>
> Can I use it? (I usually use Gnus on a different machine.)
>
> What's the difference between PGP, PGP/MIME and S/MIME?

Can't help with this one.

> 2. How to enable local copies?
>
> I'm fetching email via IMAP and replying via SMTP. How can I store the
> fetched and sent messages?

For sent message, you can set gnus-message-archive-group to an IMAP or
local folder.  Here's an example for an IMAP folder:

(setq gnus-message-archive-group "nnimap+mail.hostname.com:Sent")

You can look into offline-imap at http://offlineimap.org/. Gnus has
support built in for using it, so just google 'gnus offlineimap'.

--
Burton Samograd






^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Getting started: splitting mail, SMIME, local copies
  2012-12-11 20:31 ` Burton Samograd
@ 2012-12-12  7:04   ` Matt Ford
  2012-12-16 13:00   ` bromley
  1 sibling, 0 replies; 12+ messages in thread
From: Matt Ford @ 2012-12-12  7:04 UTC (permalink / raw)
  To: ding

Burton Samograd <burton@samograd.ca> writes:

> bromley@lavabit.com writes:
>
>> 0. How can I split my mail?
>>
>> There is an example(1). Will it work for IMAP? Should I replace nnml
>> with nnimap? Should I create the necessary groups before splitting?
>
> I am also interested in this answer as I've setup my
> nnimap-split-methods but have yet to see any splitting happen.
>

Here's a much simplified example from my configuration:

(setq gnus-secondary-select-methods
      '((nnimap "Dancingfrog"
                (nnimap-address "imap.gmail.com")
                (nnimap-server-port 993)
                (nnimap-stream ssl)
                (nnimap-expunge t)
                (nnimap-inbox "INBOX")
                (nnimap-split-methods nnimap-split-fancy)
                (nnimap-split-fancy
                 (| (from "kiddivouchers.com"
                          "KiddiVouchers")
                    (from "portlandnuseries.co.uk"
                          "PortlandNursery")
                    (from "paypal.co.uk"
                          "PayPal")
                    "INBOX"))
                )))

See Info->Gnus->Fancy Mail Splitting

It does seem to occasionally hang but a Ctrl-G doesn't seem to hurt any.

Cheers,
-- 
Matt




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Getting started: splitting mail, SMIME, local copies
  2012-12-11 20:03 Getting started: splitting mail, SMIME, local copies bromley
  2012-12-11 20:31 ` Burton Samograd
@ 2012-12-12  8:54 ` Alberto Luaces
  1 sibling, 0 replies; 12+ messages in thread
From: Alberto Luaces @ 2012-12-12  8:54 UTC (permalink / raw)
  To: ding

bromley@lavabit.comwrites:

> I'm using IMAP & SMTP(0).
>
> 0. How can I split my mail?
>
> There is an example(1). Will it work for IMAP?

Yes, splitting works for IMAP.

> Should I replace nnml with nnimap?

Check the exact details for your version at its manual.

> Should I create the necessary groups before splitting?

No, they are created as needed within the moving operations.  For
example, try to move (B-m) or copy (B-c) a message to a non existent
group: it will be created.

-- 
Alberto




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Getting started: splitting mail, SMIME, local copies
  2012-12-11 20:31 ` Burton Samograd
  2012-12-12  7:04   ` Matt Ford
@ 2012-12-16 13:00   ` bromley
  2012-12-16 13:17     ` Adam Sjøgren
  1 sibling, 1 reply; 12+ messages in thread
From: bromley @ 2012-12-16 13:00 UTC (permalink / raw)
  To: ding

> Here's an example for an IMAP folder:

> (setq gnus-message-archive-group "nnimap+mail.hostname.com:Sent")

Here is mine:

(setq gnus-message-archive-group "Sent")


I'd like to save all incoming mail from some-list@example.com to the
"some-list" group and save the rest to "INBOX".

Will the following work?

(setq nnimap-inbox "INBOX")
(nnimap-split-methods nnimap-split-fancy)
(nnimap-split-fancy
  (| (from "some-list@example.com"
           "some-list")
      "INBOX"))

Actually, it's not the desired workflow. I'd like to configure Gnus to
copy the fetched messages to the corresponding local groups and
expunge the remote ones (on the IMAP server). Could you help with this?

Also I'd like to see my replies in "INBOX" and "some-list"* because
it's easier to read threads this way.

* In addition to "Sent".





^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Getting started: splitting mail, SMIME, local copies
  2012-12-16 13:00   ` bromley
@ 2012-12-16 13:17     ` Adam Sjøgren
  2012-12-16 17:10       ` bromley
  0 siblings, 1 reply; 12+ messages in thread
From: Adam Sjøgren @ 2012-12-16 13:17 UTC (permalink / raw)
  To: ding

On Sun, 16 Dec 2012 08:00:09 -0500 (EST), bromley@lavabit.com wrote:

> I'd like to configure Gnus to copy the fetched messages to the
> corresponding local groups and expunge the remote ones (on the IMAP
> server). Could you help with this?

It sounds like you want to use IMAP as if it were POP; take a look at
the "imap" section of the "Mail Source Specifiers" section of the
manual:

 "imap

    Get mail from a IMAP server. If you don't want to use IMAP as
    intended, as a network mail reading protocol (ie with nnimap), for
    some reason or other, Gnus let you treat it similar to a POP server
    and fetches articles from a given IMAP mailbox. See section 6.5
    IMAP, for more information."

      - http://gnus.org/manual/gnus_179.html


  Best regards,

    Adam

-- 
 "It's not denial. I'm just very selective about the          Adam Sjøgren
  reality I accept."                                     asjo@koldfront.dk




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Getting started: splitting mail, SMIME, local copies
  2012-12-16 13:17     ` Adam Sjøgren
@ 2012-12-16 17:10       ` bromley
  2012-12-16 17:24         ` Adam Sjøgren
  0 siblings, 1 reply; 12+ messages in thread
From: bromley @ 2012-12-16 17:10 UTC (permalink / raw)
  To: ding

> It sounds like you want to use IMAP as if it were POP;

You're right. Actually, I was using it before `nnimap'.

Here is what I have in `.gnus.el':

(setq mail-sources '((imap :server "mail.example.com"
	                       :port 993
                           :stream ssl
                           :dontexpunge nil)))

I'm getting `Unable to open server nntp+news, go offline?' when I run
`M-x gnus'. Have I forgotten to enable something?


When I enable the following, Gnus will raise the above error. Then it
will try fetch new messages and copy them to `nnml:mail.misc'.

(add-to-list 'gnus-secondary-select-methods '(nnml ""))

I have two questions:

1. How to fix the `Unable to open server nntp+news, go offline?'
error?

2. How to split incoming mails?

Buffers:

*Server*:

{nnfolder:archive} (opened)
{nnml:} (opened)
{nntp:news} (denied) (agent)

*Group*:

*: nndraft:drafts
*: nndraft:queue
*: nnfolder+archive:Sent
*: nnml+-ephemeral:mail.misc
*: nnml:mail.misc

*Messages*:

nntp (news) open error: ''.  Continue? (y or n)
Reading /home/user/.newsrc.eld...
Opening nntp server on news...
Denied server nntp+news
Opening nntp server on news...failed
Reading active file via nnml...
Opening nnml server...done
nnml: Reading incoming mail from imap...
imap: Connecting to mail.example.com...
imap: Opening SSL connection with `openssl s_client -quiet -ssl3 -connect
%s:%p'...done
Waiting for response from mail.example.com...done
imap: Authenticating to `mail.example.com' using `login'...
imap: Plaintext authentication...
imap: Login successful...
imap: Store password for this IMAP session? (y or n)
imap: Authenticating to `mail.example.com' using `login'...done
Creating mail directory /home/user/Mail/mail/misc/
Wrote /home/user/Mail/mail/misc/1
nnml: Reading incoming mail (1 new)...done
Reading active file via nnml...done







^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Getting started: splitting mail, SMIME, local copies
  2012-12-16 17:10       ` bromley
@ 2012-12-16 17:24         ` Adam Sjøgren
  2012-12-17 13:02           ` bromley
  0 siblings, 1 reply; 12+ messages in thread
From: Adam Sjøgren @ 2012-12-16 17:24 UTC (permalink / raw)
  To: ding

On Sun, 16 Dec 2012 12:10:35 -0500 (EST), bromley@lavabit.com wrote:

> I'm getting `Unable to open server nntp+news, go offline?' when I run
> `M-x gnus'. Have I forgotten to enable something?

If you don't have a news server called "news" on your network, you'll
probably want to set your primary server to be nnnil, like so:

  (setq gnus-select-method '(nnnil ""))

The default of nntp+news is perhaps a relic in this day and age - from
when universities usually had a news server you could reach as the host
"news", and most people firing up Gnus for the first time was looking
for, well, just that.

(The only difference, as far as I know, between the select method and
the secondary select methods is that in the latter group names are
prefixed with the server name).

> 2. How to split incoming mails?

Configure splitting or fancy splitting:

 * http://gnus.org/manual/gnus_177.html
 * http://gnus.org/manual/gnus_184.html

I would probably start simple, adding a rule at a time, testing them.
Regexps and the word boundary stuff can be fiddly.

Nice commands to test is: B q which will show you where the current
email would be split to, and B r which will move the email according to
the splitting rules.


  Best regards,

    Adam

-- 
 "The key to performance is elegance, not battalions          Adam Sjøgren
  of special cases."                                     asjo@koldfront.dk




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Getting started: splitting mail, SMIME, local copies
  2012-12-16 17:24         ` Adam Sjøgren
@ 2012-12-17 13:02           ` bromley
  2012-12-17 16:28             ` Adam Sjøgren
  0 siblings, 1 reply; 12+ messages in thread
From: bromley @ 2012-12-17 13:02 UTC (permalink / raw)
  To: ding

> If you don't have a news server called "news" on your network, you'll
> probably want to set your primary server to be nnnil, like so:
>
>  (setq gnus-select-method '(nnnil ""))

That's great, but gnus won't connect to the IMAP server if I set the
above. How can I initialize a connection?

> Configure splitting or fancy splitting:

>  * http://gnus.org/manual/gnus_177.html
>  * http://gnus.org/manual/gnus_184.html

Thanks for the links, but I've already seen them.

These links show how splitting works using various backends as
examples (e.g. nnml, nnimap), but I'm using
(setq gnus-select-method '(nnnil "")) and
(setq mail-sources '((imap ...))). There are no such examples.

Should I use nnml-split-methods? Should I use nnnil-split-methods?
(Does it exist?)

Also it's hard to understand those examples. They are too complex.

I've tried the following:

1. Changed (setq gnus-select-method '(nnnil "")) to
(setq gnus-select-method '(nnml "")). (Because nnnil isn't documented.)

2. Added

(nnml-split-methods nnml-split-fancy)
(nnml-split-fancy
 (| (from "some-list@example.com"
          "some-list")
    "INBOX"))

It raised "byte-code: Error in ~/.gnus: nnml-split-methods".

Could you show how to do it?





^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Getting started: splitting mail, SMIME, local copies
  2012-12-17 13:02           ` bromley
@ 2012-12-17 16:28             ` Adam Sjøgren
  2012-12-18 20:57               ` bromley
  0 siblings, 1 reply; 12+ messages in thread
From: Adam Sjøgren @ 2012-12-17 16:28 UTC (permalink / raw)
  To: ding

On Mon, 17 Dec 2012 08:02:43 -0500 (EST), bromley@lavabit.com wrote:

>> (setq gnus-select-method '(nnnil ""))

> That's great, but gnus won't connect to the IMAP server if I set the
> above. How can I initialize a connection?

You aren't giving us much information to go on...

You added an imap entry to mail-sources? You added a local mail-server
to gnus-secondary-select-methods (for instance nnml)?

At work I use IMAP-as-POP, and have a setup that looks like this:

    ; No primary server:
    (setq gnus-select-method '(nnnil ""))

    ; Get email, and store in nnml:
    (setq gnus-secondary-select-methods '((nnml "")))

    ; Mail sources:
    (setq mail-sources '((file)
                         (imap :server "something.example.com"
                               :stream ssl
                               :fetchflag "\\Seen"
                               )))

I would guess that is pretty close to what you need?

For archiving outgoing messages I use this:

    ; Archive outgoing email in nnml+archive:(mail|news)-{year}:
    (setq gnus-message-archive-method '(nnml "archive"
                                             (nnml-directory "~/Mail/archive")
                                             (nnml-active-file "~/Mail/archive/active")
                                             (nnml-get-new-mail nil)
                                             (nnml-inhibit-expiry t)))
    (setq gnus-message-archive-group
          '((if (message-news-p)
                (concat "news-" (format-time-string "%Y"))
              (concat "mail-" (format-time-string "%Y")))))

I use fancy splitting; a simplified version of my setup is:

    (setq nnmail-split-methods 'nnmail-split-fancy)
    (setq nnmail-split-fancy
          '(|
            ("x-trac-project" "SomeProject" "trac.someproject")
            ("x-trac-project" "AnotherProject" "trac.anotherproject")
            ("Subject" "Spam: .*" "spam")
            ("Subject" ".*\\[Commits\\].*" "commits.git")
            (: (lambda ()
                 (car (bbdb/gnus-split-method))))
            ("Content-class" "urn:content-classes:calendarmessage" "kalender")
            ("From" "Bacula <root@localhost>.*" "bacula")
            ("X-Cron-Env" ".*" "cron")
            (any "tracadmin@example.com" "tracadmin")
            (: split-on-text-calendar-in-body "kalender")
            "normal"))

    ; Each email appears in max. one email-split group:
    (setq nnmail-crosspost nil)

(The bbdb part and the split-on-text-calendar-in-body part needs more
setup; this nnmail-split-fancy is a non-complete example).

>> Configure splitting or fancy splitting:

>> * http://gnus.org/manual/gnus_177.html
>> * http://gnus.org/manual/gnus_184.html

> Thanks for the links, but I've already seen them.

Then you need to ask more specific questions than "How do I split?" :-)

> These links show how splitting works using various backends as
> examples (e.g. nnml, nnimap), but I'm using
> (setq gnus-select-method '(nnnil "")) and
> (setq mail-sources '((imap ...))). There are no such examples.

I think you're missing the part where you tell Gnus where, locally, you
want to store the emails that are fetched.

> 1. Changed (setq gnus-select-method '(nnnil "")) to
> (setq gnus-select-method '(nnml "")). (Because nnnil isn't documented.)

It is in the version I'm running:

,----
| File: gnus,  Node: The Empty Backend,  Prev: Mail-To-News Gateways,  Up: Other Sources
| 
| 6.6.5 The Empty Backend
| -----------------------
| 
| `nnnil' is a backend that can be used as a placeholder if you have to
| specify a backend somewhere, but don't really want to.  The classical
| example is if you don't want to have a primary select methods, but want
| to only use secondary ones:
| 
|      (setq gnus-select-method '(nnnil ""))
|      (setq gnus-secondary-select-methods
|            '((nnimap "foo")
|              (nnml "")))
| 
`----

But it has only been that way for ~2 years:

 * http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7653


  Best regards,

    Adam

-- 
 "Faktum er, at Delphi er det bedste all-round                Adam Sjøgren
  værktøj, der eksisterer i dag. Og mest produktive."    asjo@koldfront.dk




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Getting started: splitting mail, SMIME, local copies
  2012-12-17 16:28             ` Adam Sjøgren
@ 2012-12-18 20:57               ` bromley
  2012-12-18 20:59                 ` Adam Sjøgren
  0 siblings, 1 reply; 12+ messages in thread
From: bromley @ 2012-12-18 20:57 UTC (permalink / raw)
  To: ding

Thanks, Adam.

Last question: I have to restart Gnus to see new messages in
`Sent'. Is it supposed to be like that?






^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Getting started: splitting mail, SMIME, local copies
  2012-12-18 20:57               ` bromley
@ 2012-12-18 20:59                 ` Adam Sjøgren
  0 siblings, 0 replies; 12+ messages in thread
From: Adam Sjøgren @ 2012-12-18 20:59 UTC (permalink / raw)
  To: ding

On Tue, 18 Dec 2012 15:57:13 -0500 (EST), bromley@lavabit.com wrote:

> Last question: I have to restart Gnus to see new messages in
> `Sent'. Is it supposed to be like that?

g in the *Group* buffer doesn't show them?


  Best regards,

    Adam

-- 
 "KOMPRESSOR crush american burger"                           Adam Sjøgren
                                                         asjo@koldfront.dk




^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2012-12-18 20:59 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-11 20:03 Getting started: splitting mail, SMIME, local copies bromley
2012-12-11 20:31 ` Burton Samograd
2012-12-12  7:04   ` Matt Ford
2012-12-16 13:00   ` bromley
2012-12-16 13:17     ` Adam Sjøgren
2012-12-16 17:10       ` bromley
2012-12-16 17:24         ` Adam Sjøgren
2012-12-17 13:02           ` bromley
2012-12-17 16:28             ` Adam Sjøgren
2012-12-18 20:57               ` bromley
2012-12-18 20:59                 ` Adam Sjøgren
2012-12-12  8:54 ` Alberto Luaces

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).