SHARE
TWEET

.muttrc maker for Gmail & Other IMAP

a guest Jan 19th, 2014 246 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. # Config suitable for mutt-1.5.21. Check compatability for other versions.
  3. today=`date`
  4. muttrc="$HOME/.muttrc"
  5. clear
  6.  
  7. echo ".muttrc Maker for GMail (or other IMAP) by Alistair Ross"
  8. echo
  9.  
  10. if [ -e $muttrc ]
  11. then
  12.         printf "\a"
  13.         echo "WARNING: There is already a .muttrc config file in your home directory"
  14.         echo "This setup wizard will overwrite this file if you continue."
  15.         echo "To abort this process at any time, press Ctrl-C"
  16.         echo "Hit RETURN to continue."
  17. read x
  18. fi
  19.  
  20. echo
  21.  
  22. echo "Enter your email address>"
  23. read imap_user
  24.  
  25. echo "Enter your IMAP password (note this will be echoed to the screen) >"
  26. read imap_pass
  27.  
  28. echo "Enter your name as you wish to appear to your recipients, eg, John Smith >"
  29. read realname
  30.  
  31. echo "Enter the IMAP folder URI, press return for imaps://imap.gmail.com:993 >"
  32. read folder
  33. if [ -z $folder ]
  34. then
  35.         folder="imaps://imap.gmail.com:993"
  36. fi
  37.  
  38. echo "Enter your SMTP URL (just hit return if you are using GMail, otherwise format is smtp://username@domain.com:587/ >"
  39. read smtp_url
  40. if [ -z $smtp_url ]
  41. then
  42.         smtp_url="smtp://$imap_user:587/"
  43. fi
  44.  
  45. echo "Enter your from address (hit return to assume $imap_user) >"
  46. read from
  47. if [ -z $from ]
  48. then
  49.         from="$imap_user"
  50. fi
  51.  
  52. echo "Enter the hostname of your email provider (hit enter for gmail.com) >"
  53. read hostname
  54. if [ -z $hostname ]
  55. then
  56.         hostname="gmail.com"
  57. fi
  58.  
  59. echo "Enter the name of the IMAP Drafts folder (hit enter for +[Gmail]/Drafts) >"
  60. read postponed
  61.         if [ -z $postponed ]
  62. then
  63.         postponed="+[Gmail]/Drafts"
  64. fi
  65.  
  66. clear
  67. printf "\a"
  68. echo "Thanks. I'm going to set a whole bunch of defaults for you. Including the below
  69. settings regarding certificate authentication which may or may not be pertinent
  70. to your mail server and/or preferences.
  71.  
  72. For example, here's a few below that may be of interest. To change any setting,
  73. simply edit ~/.muttrc
  74.  
  75. ignore 'Authentication-Results:'
  76. ignore 'DomainKey-Signature:'
  77. ignore 'DKIM-Signature:'
  78. hdr_order Date From To Cc
  79. set askcc = no
  80. set ascii_chars = yes # default: no
  81. set editor = '/usr/bin/vim'"
  82.  
  83.  
  84.  
  85. echo "# .muttrc configuration generated by muttrcmaker for Gmail/IMAP
  86. # Configuration written on $today
  87. set imap_user = '$imap_user'
  88. set imap_pass = '$imap_pass'
  89.  
  90. set imap_login = '$imap_user'
  91. set folder = 'imaps://imap.gmail.com:993'
  92. #set imap_authenticators = 'set imap_authenticators='digest-md5:gssapi:cram-md5:login'
  93.  
  94. set smtp_url = '$smtp_url'
  95. set smtp_pass = '$imap_pass'
  96. set from = '$from'
  97. set realname = '$realname'
  98. set signature = '~/.signature'
  99. set hostname = '$hostname'
  100. set use_ipv6 = no
  101.  
  102. set spoolfile = '+INBOX'
  103. set postponed='$postponed'
  104.  
  105. set header_cache=~/.mutt/cache/headers
  106. set message_cachedir=~/.mutt/cache/bodies
  107. set certificate_file=~/.mutt/certificates
  108.  
  109. set move = no
  110.  
  111. set sort = 'threads'
  112. set sort_aux = 'last-date-received'
  113. set imap_check_subscribed
  114.  
  115. ignore 'Authentication-Results:'
  116. ignore 'DomainKey-Signature:'
  117. ignore 'DKIM-Signature:'
  118. hdr_order Date From To Cc
  119.  
  120. set askcc = no
  121. set ascii_chars = yes # default: no
  122. set editor = '/usr/bin/vim'
  123.  
  124. # Colors
  125.  
  126. color attachment brightmagenta default
  127. color error      brightred    default
  128. color hdrdefault red          default
  129. color indicator  brightyellow red
  130. color markers    brightcyan   default
  131. color message    brightcyan   default
  132. color normal     default      default
  133. color quoted     brightblue   default
  134. color search     default      green
  135. color signature  red          default
  136. color status     yellow       blue
  137. color tilde      magenta      default
  138. color tree       magenta      default
  139.  
  140.  
  141. # set abort_nosubject = ask-yes
  142. # set abort_unmodified = yes
  143. # set alias_file = '~/.muttrc'
  144. # set alias_format = '%4n %2f %t %-10a   %r'
  145. # set allow_8bit = yes
  146. # set allow_ansi = no
  147. # set arrow_cursor = no
  148. # set askbcc = no
  149. # set assumed_charset = '(empty)'
  150. # set attach_charset = '(empty)'
  151. # set attach_format = '%u%D%I %t%4n %T%.40d%> [%.7m/%.10M, %.6e%?C?, %C?, %s] '
  152. # set attach_sep = '\n'
  153. # set attach_split = yes
  154. # set attribution = 'On %d, %n wrote:'
  155. # set auto_tag = no
  156. # set autoedit = no
  157. # set beep = yes
  158. # set beep_new = no
  159. # set bounce = ask-yes
  160. # set bounce_delivered = yes
  161. # set braille_friendly = no
  162. # set certificate_file = '~/.mutt_certificates'
  163. # set charset = '(empty)'
  164. # set check_mbox_size = no
  165. # set check_new = yes
  166. # set collapse_unread = yes
  167. # set compose_format = '-- Mutt: Compose  [Approx. msg size: %l   Atts: %a]%>-'
  168. # set config_charset = '(empty)'
  169. # set confirmappend = yes
  170. # set confirmcreate = yes
  171. # set connect_timeout = '30'
  172. # set content_type = 'text/plain'
  173. # set copy = yes
  174. # set crypt_autoencrypt = no
  175. # set crypt_autopgp = yes
  176. # set crypt_autosign = no
  177. # set crypt_autosmime = yes
  178. # set crypt_replyencrypt = yes
  179. # set crypt_replysign = no
  180. # set crypt_replysignencrypted = no
  181. # set crypt_timestamp = yes
  182. # set crypt_use_gpgme = no
  183. # set crypt_use_pka = no
  184. # set crypt_verify_sig = yes
  185. # set date_format = '!%a, %b %d, %Y at %I:%M:%S%p %Z'
  186. # set default_hook = '~f %s !~P | (~P ~C %s)'
  187. # set delete = ask-yes
  188. # set delete_untag = yes
  189. # set digest_collapse = yes
  190. # set display_filter = '(empty)'
  191. # set dotlock_program = '/usr/local/bin/mutt_dotlock'
  192. # set dsn_notify = '(empty)'
  193. # set dsn_return = '(empty)'
  194. # set duplicate_threads = yes
  195. # set edit_headers = no
  196. # set encode_from = no
  197. # set entropy_file = '(empty)'
  198. # set envelope_from_address = '(empty)'
  199. # set escape = '~'
  200. # set fast_reply = no
  201. # set fcc_attach = yes
  202. # set fcc_clear = no
  203. # set folder = '~/Mail'
  204. # set folder_format = '%2C %t %N %F %2l %-8.8u %-8.8g %8s %d %f'
  205. # set followup_to = yes
  206. # set force_name = no
  207. # set forward_decode = yes
  208. # set forward_decrypt = yes
  209. # set forward_edit = yes
  210. # set forward_quote = no
  211. # set gecos_mask = '^[^,]*'
  212. # set hdrs = yes
  213. # set header = no
  214. # set header_cache = '(empty)'
  215. # set header_cache_compress = yes
  216. # set header_cache_pagesize = '16384'
  217. # set help = yes
  218. # set hidden_host = no
  219. # set hide_limited = no
  220. # set hide_missing = yes
  221. # set hide_thread_subject = yes
  222. # set hide_top_limited = no
  223. # set hide_top_missing = yes
  224. # set history = '10'
  225. # set history_file = '~/.mutthistory'
  226. # set honor_disposition = no
  227. # set honor_followup_to = yes
  228. # set ignore_linear_white_space = no
  229. # set ignore_list_reply_to = no
  230. # set imap_check_subscribed = no
  231. # set imap_delim_chars = '/.'
  232. # set imap_headers = '(empty)'
  233. # set imap_idle = no
  234. # set imap_keepalive = '900'
  235. # set imap_list_subscribed = no
  236. # set imap_passive = yes
  237. # set imap_peek = yes
  238. # set imap_pipeline_depth = '15'
  239. # set imap_servernoise = yes
  240. # set implicit_autoview = no
  241. # set include = ask-yes
  242. # set include_onlyfirst = no
  243. # set indent_string = '> '
  244. # set index_format = '%4C %Z %{%b %d} %-15.15L (%?l?%4l&%4c?) %s'
  245. # set ispell = 'ispell'
  246. # set keep_flagged = no
  247. # set locale = 'C'
  248. # set mail_check = '5'
  249. # set mail_check_recent = yes
  250. # set mailcap_path = '(empty)'
  251. # set mailcap_sanitize = yes
  252. # set maildir_header_cache_verify = yes
  253. # set maildir_trash = no
  254. # set mark_old = yes
  255. # set markers = yes
  256. # set mask = '!^\.[^.]'
  257. # set mbox = '~/mbox'
  258. # set mbox_type = 'mbox'
  259. # set menu_context = '0'
  260. # set menu_move_off = yes
  261. # set menu_scroll = no
  262. # set message_cache_clean = no
  263. # set message_cachedir = '(empty)'
  264. # set message_format = '%s'
  265. # set meta_key = no
  266. # set metoo = no
  267. # set mh_purge = no
  268. # set mh_seq_flagged = 'flagged'
  269. # set mh_seq_replied = 'replied'
  270. # set mh_seq_unseen = 'unseen'
  271. # set mime_forward = no
  272. # set mime_forward_decode = no
  273. # set mime_forward_rest = yes
  274. # set mix_entry_format = '%4n %c %-16s %a'
  275. # set mixmaster = '1'
  276. # set move = no
  277. # set narrow_tree = no
  278. # set net_inc = '10'
  279. # set pager = 'builtin'
  280. # set pager_context = '0'
  281. # set pager_format = '-%Z- %C/%m: %-20.20n   %s%*  -- (%P)'
  282. # set pager_index_lines = '0'
  283. # set pager_stop = no
  284. # set pgp_auto_decode = no
  285. # set pgp_autoinline = no
  286. # set pgp_check_exit = yes
  287. # set pgp_clearsign_command = '(empty)'
  288. # set pgp_decode_command = '(empty)'
  289. # set pgp_decrypt_command = '(empty)'
  290. # set pgp_encrypt_only_command = '(empty)'
  291. # set pgp_encrypt_sign_command = '(empty)'
  292. # set pgp_entry_format = '%4n %t%f %4l/0x%k %-4a %2c %u'
  293. # set pgp_export_command = '(empty)'
  294. # set pgp_getkeys_command = '(empty)'
  295. # set pgp_good_sign = '(empty)'
  296. # set pgp_ignore_subkeys = yes
  297. # set pgp_import_command = '(empty)'
  298. # set pgp_list_pubring_command = '(empty)'
  299. # set pgp_list_secring_command = '(empty)'
  300. # set pgp_long_ids = no
  301. # set pgp_mime_auto = ask-yes
  302. # set pgp_replyinline = no
  303. # set pgp_retainable_sigs = no
  304. # set pgp_show_unusable = yes
  305. # set pgp_sign_as = '(empty)'
  306. # set pgp_sign_command = '(empty)'
  307. # set pgp_sort_keys = 'address'
  308. # set pgp_strict_enc = yes
  309. # set pgp_timeout = '300'
  310. # set pgp_use_gpg_agent = no
  311. # set pgp_verify_command = '(empty)'
  312. # set pgp_verify_key_command = '(empty)'
  313. # set pipe_decode = no
  314. # set pipe_sep = '\n'
  315. # set pipe_split = no
  316. # set pop_auth_try_all = yes
  317. # set pop_authenticators = '(empty)'
  318. # set pop_checkinterval = '60'
  319. # set pop_delete = ask-no
  320. # set pop_host = '(empty)'
  321. # set pop_last = no
  322. # set pop_pass = '(empty)'
  323. # set pop_reconnect = ask-yes
  324. # set pop_user = '(empty)'
  325. # set post_indent_string = '(empty)'
  326. # set postpone = ask-yes
  327. # set postponed = '~/postponed'
  328. # set preconnect = '(empty)'
  329. # set print = ask-no
  330. # set print_command = 'lpr'
  331. # set print_decode = yes
  332. # set print_split = no
  333. # set prompt_after = yes
  334. # set query_command = '(empty)'
  335. # set query_format = '%4c %t %-25.25a %-25.25n %?e?(%e)?'
  336. # set quit = yes
  337. # set quote_regexp = '^([ \t]*[|>:}#])+'
  338. # set read_inc = '10'
  339. # set read_only = no
  340. # set recall = ask-yes
  341. # set record = '~/sent'
  342. # set reply_regexp = '^(re([\[0-9\]+])*|aw):[ \t]*'
  343. # set reply_self = no
  344. # set reply_to = ask-yes
  345. # set resolve = yes
  346. # set reverse_alias = no
  347. # set reverse_name = no
  348. # set reverse_realname = yes
  349. # set rfc2047_parameters = no
  350. # set save_address = no
  351. # set save_empty = yes
  352. # set save_history = '0'
  353. # set save_name = no
  354. # set score = yes
  355. # set score_threshold_delete = '-1'
  356. # set score_threshold_flag = '9999'
  357. # set score_threshold_read = '-1'
  358. # set search_context = '0'
  359. # set send_charset = 'us-ascii:iso-8859-1:utf-8'
  360. # set sendmail = '/usr/sbin/sendmail -oem -oi'
  361. # set sendmail_wait = '0'
  362. # set shell = '(empty)'
  363. # set sig_dashes = yes
  364. # set sig_on_top = no
  365. # set simple_search = '~f %s | ~s %s'
  366. # set sleep_time = '1'
  367. # set smart_wrap = yes
  368. # set smileys = '(>From )|(:[-^]?[][)(><}{|/DP])'
  369. # set smime_ask_cert_label = yes
  370. # set smime_ca_location = '(empty)'
  371. # set smime_certificates = '(empty)'
  372. # set smime_decrypt_command = '(empty)'
  373. # set smime_decrypt_use_default_key = yes
  374. # set smime_default_key = '(empty)'
  375. # set smime_encrypt_command = '(empty)'
  376. # set smime_encrypt_with = '(empty)'
  377. # set smime_get_cert_command = '(empty)'
  378. # set smime_get_cert_email_command = '(empty)'
  379. # set smime_get_signer_cert_command = '(empty)'
  380. # set smime_import_cert_command = '(empty)'
  381. # set smime_is_default = no
  382. # set smime_keys = '(empty)'
  383. # set smime_pk7out_command = '(empty)'
  384. # set smime_sign_command = '(empty)'
  385. # set smime_sign_opaque_command = '(empty)'
  386. # set smime_timeout = '300'
  387. # set smime_verify_command = '(empty)'
  388. # set smime_verify_opaque_command = '(empty)'
  389. # set smtp_authenticators = '(empty)'
  390. # set smtp_pass = '(empty)'
  391. # set smtp_url = '(empty)'
  392. # set sort = 'date'
  393. # set sort_alias = 'alias'
  394. # set sort_aux = 'date'
  395. # set sort_browser = 'alpha'
  396. # set sort_re = yes
  397. # set spam_separator = ','
  398. # set spoolfile = '(empty)'
  399. # set ssl_ca_certificates_file = '(empty)'
  400. # set ssl_client_cert = '(empty)'
  401. # set ssl_force_tls = no
  402. # set ssl_min_dh_prime_bits = '0'
  403. # set ssl_starttls = yes
  404. # set ssl_use_sslv2 = no
  405. # set ssl_use_sslv3 = yes
  406. # set ssl_use_tlsv1 = yes
  407. # set ssl_usesystemcerts = yes
  408. # set ssl_verify_dates = yes
  409. # set ssl_verify_host = yes
  410. # set status_chars = '-*%A'
  411. # set status_format = '-%r-Mutt: %f [Msgs:%?M?%M/?%m%?n? New:%n?%?o? Old:%o?%?d? Del:%d?%?F? Flag:%F?%?t? Tag:%t?%?p? Post:%p?%?b? Inc:%b?%?l? %l?]---(%s/%S)-%>-(%P)---'
  412. # set status_on_top = no
  413. # set strict_threads = no
  414. # set suspend = yes
  415. # set text_flowed = no
  416. # set thorough_search = yes
  417. # set thread_received = no
  418. # set tilde = no
  419. # set time_inc = '0'
  420. # set timeout = '600'
  421. # set tmpdir = '(empty)'
  422. # set to_chars = ' +TCFL'
  423. # set tunnel = '(empty)'
  424. # set uncollapse_jump = no
  425. # set use_8bitmime = no
  426. # set use_domain = yes
  427. # set use_envelope_from = no
  428. # set use_from = yes
  429. # set use_idn = yes
  430. # set user_agent = yes
  431. # set visual = '(empty)'
  432. # set wait_key = yes
  433. # set weed = yes
  434. # set wrap = '0'
  435. # set wrap_headers = '78'
  436. # set wrap_search = yes
  437. # set wrapmargin = '0'
  438. # set write_bcc = yes
  439. # set write_inc = '10'
  440. " > .muttrc
  441.  
  442. echo
  443. echo "$HOME/.muttrc Created."
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top