Home

Awesome

Mournmail

Mournmail is a message user agent for Textbringer.

Installation

$ gem install mournmail

Configuration

CONFIG[:mournmail_accounts] = {
  "example.com" => {
    from: "Shugo Maeda <shugo@example.com>",
    delivery_method: :smtp,
    delivery_options: {
      address: "smtp.example.com",
      port: 465,
      domain: Socket.gethostname,
      user_name: "shugo",
      password: File.read("/path/to/smtp_passwd").chomp,
      authentication: "login",
      tls: true,
      ca_file: "/path/to/ca.pem"
    },
    imap_host: "imap.example.com",
    imap_options: {
      auth_type: "PLAIN",
      user_name: "shugo",
      password: File.read("/path/to/imap_passwd").chomp,
      ssl: { ca_file: "/path/to/ca.pem" }
    },
    spam_mailbox: "spam",
    outbox_mailbox: "outbox",
    archive_mailbox_format: "archive/%Y",
    signature: <<~EOF
      -- 
      Shugo Maeda <shugo@example.com>
    EOF
  },
  "gmail.com" => {
    from: "Example <example@gmail.com>",
    delivery_method: :smtp,
    delivery_options: {
      address: "smtp.gmail.com",
      port: 587,
      domain: Socket.gethostname,
      user_name: "example@gmail.com",
      password: File.read("/path/to/gmail_passwd").chomp,
      authentication: "login",
      enable_starttls_auto: true
    },
    imap_host: "imap.gmail.com",
    imap_options: {
      auth_type: "PLAIN",
      user_name: "example@gmail.com",
      password: File.read(File.expand_path("~/.textbringer/gmail_passwd")).chomp,
      ssl: true
    },
    spam_mailbox: "[Gmail]/迷惑メール",
    archive_mailbox_format: false
  },
}

Usage

Type M-x mail to send a mail.

Type M-x mournmail to visit INBOX.

Key bindings

Summary

KeyCommandDescription
smournmail_summary_syncSync summary. With C-u sync all mails
SPCsummary_read_commandRead a mail
C-hsummary_scroll_down_commandScroll down the current message
nsummary_next_commandDisplay the next mail
wsummary_write_commandWrite a new mail
asummary_reply_commandReply to the current message
Asummary_reply_commandReply to the current message
fsummary_forward_commandForward the current message
usummary_toggle_seen_commandToggle Seen
$summary_toggle_flagged_commandToggle Flagged
dsummary_toggle_deleted_commandToggle Deleted
xsummary_toggle_mark_commandToggle mark
* asummary_mark_all_commandMark all mails
* nsummary_unmark_all_commandUnmark all mails
* rsummary_mark_read_commandMark read mails
* usummary_mark_unread_commandMark unread mails
* ssummary_mark_flagged_commandMark flagged mails
* tsummary_mark_unflagged_commandMark unflagged mails
ysummary_archive_commandArchive mails. Archived mails will be deleted or refiled from the server, and only shown by summary_search_command
osummary_refile_commandRefile marked mails
!summary_refile_spam_commandRefile marked mails as spam
psummary_prefetch_commandPrefetch mails
Xsummary_expunge_commandExpunge deleted mails
vsummary_view_source_commandView source of a mail
Msummary_merge_partial_commandMerge marked message/partial
qmournmail_quitQuit Mournmail
kprevious_lineMove up
jnext_lineMove down
mmournmail_visit_mailboxVisit mailbox
Smournmail_visit_spam_mailboxVisit spam mailbox
/summary_search_commandSearch mails
tsummary_show_thread_commandShow the thread of the current mail
@summary_change_account_commandChange the current account

Message

KeyCommandDescription
RETmessage_open_link_or_part_commandOpen link or MIME part
smessage_save_part_commandSave the MIME part
TABmessage_next_link_or_part_commandGo to the next link or MIME part

Draft

KeyCommandDescription
C-c C-cdraft_send_commandSend a mail
C-c C-kdraft_kill_commandKill the draft buffer
C-c C-x TABdraft_attach_file_commandAttach a file
C-c C-x vdraft_pgp_sign_commandPGP sign
C-c C-x edraft_pgp_encrypt_commandPGP encrypt
C-c TABinsert_signature_commandInsert signature
C-c @draft_change_account_commandChange account
TABdraft_complete_or_insert_tab_commandComplete a mail address or insert a tab

Development

After checking out the repo, run bin/setup to install dependencies. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/shugo/mournmail.

License

The gem is available as open source under the terms of the MIT License.