1 | (setq ;; You need to replace this email address with your own!
|
---|
2 | user-mail-address "w96k.ru@gmail.com"
|
---|
3 | ;; You need to replace this key ID with your own key ID!
|
---|
4 | mml-secure-openpgp-signers '("08948CB6")
|
---|
5 | ;; This tells Gnus to get email from Gmail via IMAP.
|
---|
6 | gnus-select-method
|
---|
7 | '(nnimap "gmail"
|
---|
8 | ;; It could also be imap.googlemail.com if that's your server.
|
---|
9 | (nnimap-address "imap.gmail.com")
|
---|
10 | (nnimap-server-port 993)
|
---|
11 | (nnimap-stream ssl))
|
---|
12 | ;; This tells Gnus to use the Gmail SMTP server. This
|
---|
13 | ;; automatically leaves a copy in the Gmail Sent folder.
|
---|
14 | smtpmail-smtp-server "smtp.gmail.com"
|
---|
15 | smtpmail-smtp-service 587
|
---|
16 | ;; Tell message mode to use SMTP.
|
---|
17 | message-send-mail-function 'smtpmail-send-it
|
---|
18 | ;; Gmail system labels have the prefix [Gmail], which matches
|
---|
19 | ;; the default value of gnus-ignored-newsgroups. That's why we
|
---|
20 | ;; redefine it.
|
---|
21 | gnus-ignored-newsgroups "^to\\.\\|^[0-9. ]+\\( \\|$\\)\\|^[\"]\"[#'()]"
|
---|
22 | ;; The agent seems to confuse nnimap, therefore we'll disable it.
|
---|
23 | gnus-agent nil
|
---|
24 | ;; We don't want local, unencrypted copies of emails we write.
|
---|
25 | gnus-message-archive-group nil
|
---|
26 | ;; We want to be able to read the emails we wrote.
|
---|
27 | mml-secure-openpgp-encrypt-to-self t)
|
---|
28 |
|
---|
29 | ;; Attempt to encrypt all the mails we'll be sending.
|
---|
30 | (add-hook 'message-setup-hook 'mml-secure-message-encrypt)
|
---|
31 |
|
---|
32 | ;; Add two key bindings for your Gmail experience.
|
---|
33 | (add-hook 'gnus-summary-mode-hook 'my-gnus-summary-keys)
|
---|
34 |
|
---|
35 | (defun my-gnus-summary-keys ()
|
---|
36 | (local-set-key "y" 'gmail-archive)
|
---|
37 | (local-set-key "$" 'gmail-report-spam))
|
---|
38 |
|
---|
39 | (defun gmail-archive ()
|
---|
40 | "Archive the current or marked mails.
|
---|
41 | This moves them into the All Mail folder."
|
---|
42 | (interactive)
|
---|
43 | (gnus-summary-move-article nil "nnimap+imap.gmail.com:[Gmail]/All Mail"))
|
---|
44 |
|
---|
45 | (defun gmail-report-spam ()
|
---|
46 | "Report the current or marked mails as spam.
|
---|
47 | This moves them into the Spam folder."
|
---|
48 | (interactive)
|
---|
49 | (gnus-summary-move-article nil "nnimap+imap.gmail.com:[Gmail]/Spam"))
|
---|