cfg.lua 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. -- -*- madmutt configuration file -*-
  2. --
  3. -- Madmutt configuration file
  4. -- 2008, kolter <kolter@openics.org>
  5. --
  6. -- This file is distributed in the hope that it will be useful,
  7. -- but WITHOUT ANY WARRANTY
  8. --
  9. -- Lua configuration file for Madmutt.
  10. --
  11. mod_core.editor = 'emacs -nw'
  12. mod_core.shell = '/bin/zsh'
  13. mod_core.tmpdir = mod_core.homedir..'/.madmutt/tmp'
  14. -- mod_core.quit = 1
  15. -- mod_core.hostname = 'mx0.openics.org'
  16. local maildir = "/home/manu/Mail/imap/"
  17. local mailboxes = { maildir }
  18. mod_buffy.mail_check = 2
  19. MAlias.record = maildir..'/.Sent'
  20. MAlias.alias_file = "~/.madmutt/aliases"
  21. MAlias.signature = "~/.signatures/kolter_openics"
  22. MTransport.use_envelope_from =1
  23. -- misc functions
  24. function iter(fun, arr)
  25. for _, v in ipairs(arr) do fun(v) end
  26. end
  27. function expand_mailboxes (pattern)
  28. local ls = io.popen("find "..maildir.." -mindepth 1 -maxdepth 1 -type d -name \""..pattern.."\"")
  29. for line in ls:lines() do
  30. table.insert(mailboxes, line)
  31. end
  32. ls:close()
  33. end
  34. --------
  35. local alternates = {
  36. "kolter@openics.org",
  37. "emmanuel@bouthenot.name",
  38. "kolter@free.fr",
  39. "emmanuel.bouthenot@free.fr",
  40. }
  41. iter(MAlias.alternates, alternates)
  42. local subscribes = {
  43. "weechat-(dev|cvs)",
  44. "debian-.*@lists\.debian\.org",
  45. "(asso|sl)@france\.debian\.net",
  46. "backports.*@lists\.backports\.org",
  47. "(ca|asso|abonnes|inscrits|tech|debutants|blahblah|annonces|party|devel|web|hourtin)@abul\.org",
  48. "hurdfr@hurdfr\.org",
  49. "(shell|emacs|sysadmin)@asyd\.net",
  50. "(communication|themes|org|2008)@rmll\.info",
  51. "organisation@rmll2008.org",
  52. }
  53. iter(MAlias.subscribe, subscribes)
  54. local mailboxes_pattern = {
  55. ".Drafts",
  56. ".Sent",
  57. ".Spam",
  58. ".Trash",
  59. ".sys.dak",
  60. ".sys.sympa",
  61. ".sys.reports",
  62. ".sys.infos",
  63. ".my.debian-nm",
  64. ".my.cnam",
  65. ".my.misc",
  66. ".friends.tbs.tiacfooting",
  67. ".my.soft.weechat.ml.*",
  68. ".my.soft.galette.devel",
  69. ".my.ml.rmll.*",
  70. ".my.ml.asyd.*",
  71. ".my.ml.abul.*",
  72. ".my.ml.debian.france.*",
  73. ".my.soft.debian.pkg.phototools",
  74. ".my.ml.debian.*",
  75. ".my.ml.hurd.hurdfr",
  76. ".my.soft.debian.*",
  77. }
  78. for _, v in pairs(mailboxes_pattern) do
  79. expand_mailboxes(v)
  80. end
  81. iter(mod_buffy.mailboxes, mailboxes)
  82. --mod_cset.assumed_charset = "cp1252"
  83. --mod_cset.send_charset = "us-ascii:utf-8"
  84. --
  85. -- MIME settings
  86. --
  87. -- mod_mime.spam("x-dspam-result: *spam", "spam")
  88. mod_mime.auto_view("text/html")
  89. mod_mime.alternative_order("text/plain")
  90. mod_mime.alternative_order("text")
  91. mod_mime.mailcap_path = "~/.madmutt/mailcap:/etc/mailcap"
  92. mod_mime.ignore("*");
  93. mod_mime.unhdr_order("*");
  94. local headers = {
  95. "From:",
  96. "Resent-From:",
  97. "Subject:",
  98. "To:",
  99. "Cc:",
  100. "Bcc:",
  101. "Return-Path:",
  102. "Reply-To:",
  103. "Mail-Followup-To:",
  104. "Followup-To:",
  105. "Date:",
  106. "Resent-Date:",
  107. "Organization:",
  108. "User-Agent:",
  109. "X-Mailer:",
  110. "X-Newsreader:",
  111. "Newsgroups:",
  112. "Summary:",
  113. "Keywords:",
  114. "Mail-Copies-To:",
  115. "Sender:",
  116. "X-Sent:",
  117. "X-Mailman-Version:",
  118. "Posted-To:",
  119. "Mail-Copies-To:",
  120. "Apparently-To:",
  121. "Gnus-Warning:",
  122. "Resent-From:",
  123. "X-Accept-Language:",
  124. "gpg-key-ID:",
  125. "X-GPG-Fingerprint:",
  126. "X-PGP-Fingerprint:",
  127. "X-GnuPG-KeyID:",
  128. "fingerprint:",
  129. "X-Spam-Status:",
  130. "X-Junked-Because:",
  131. "X-SpamProbe:",
  132. "X-Virus-hagbard:",
  133. "X-Originating-IP:",
  134. "X-Originating-Email:",
  135. "X-Bogosity:",
  136. "X-Operating-System:",
  137. "X-Apparently-From:",
  138. "X-Virus-Scanned:",
  139. "Message-ID:",
  140. "X-Org-Mail:",
  141. "X-Org-Id:",
  142. "X-CRM114-Score:",
  143. "X-CRM114-Spam:",
  144. }
  145. iter(mod_mime.unignore, headers)
  146. iter(mod_mime.hdr_order, headers)
  147. --
  148. -- GPG settings
  149. --
  150. -- mod_crypt.autosign = 1
  151. -- mod_crypt.replysign = 1
  152. mod_crypt.verify_sig = 1