Advertisement
Guest User

Untitled

a guest
Apr 3rd, 2018
2,896
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.26 KB | None | 0 0
  1. # protonmail bridge setup over a systemd daemon with msmtp and isync
  2.  
  3. * msmtp
  4.  
  5. ~/.msmtprc
  6. #+BEGIN_SRC
  7. defaults
  8. auth on
  9. tls on
  10.  
  11. logfile ~/.msmtp.log
  12.  
  13. # ProtonMail Bridge
  14. account protonmail
  15. host 127.0.0.1
  16. port 1025
  17. from USERNAME
  18. user USERNAME
  19. password PASS
  20. tls_starttls on
  21. tls_fingerprint XX:XX:XX:XX:...
  22.  
  23. #Set a default account
  24. account default : protonmail
  25. #+END_SRC
  26.  
  27. Get tls fingerprint from this:
  28. #+BEGIN_SRC
  29. openssl s_client -starttls smtp -connect 127.0.0.1:1025 < /dev/null 2>/dev/null | openssl x509 -fingerprint -noout -in /dev/stdin | cut -d'=' -f2
  30. #+END_SRC
  31.  
  32.  
  33. * isync (mbsync)
  34.  
  35. ~/.mbsyncrc
  36. #+BEGIN_SRC
  37. IMAPAccount protonmail
  38. Host 127.0.0.1
  39. Port 1143
  40. User USERNAME
  41. pass PASS
  42. SSLType STARTTLS
  43. CertificateFile LOCATION_OF_CERTFILE
  44.  
  45. IMAPStore protonmail-remote
  46. Account protonmail
  47.  
  48. MaildirStore protonmail-local
  49. Path ~/.mail/protonmail/
  50. Inbox ~/.mail/protonmail/Inbox/
  51.  
  52. Channel protonmail-inbox
  53. Master :protonmail-remote:
  54. Slave :protonmail-local:
  55. Patterns "INBOX"
  56. Create Both
  57. Expunge Both
  58. SyncState *
  59.  
  60. Channel protonmail-sent
  61. Master :protonmail-remote:"Sent"
  62. Slave :protonmail-local:"sent"
  63. Create Both
  64. Expunge Both
  65. SyncState *
  66.  
  67. Channel protonmail-trash
  68. Master :protonmail-remote:"Trash"
  69. Slave :protonmail-local:"trash"
  70. Create Both
  71. Expunge Both
  72. SyncState *
  73.  
  74. Channel protonmail-allmail
  75. Master :protonmail-remote:"All Mail"
  76. Slave :protonmail-local:"allmail"
  77. Create Both
  78. Expunge Both
  79. SyncState *
  80.  
  81. Group protonmail
  82. Channel protonmail-inbox
  83. Channel protonmail-sent
  84. Channel protonmail-trash
  85. Channel protonmail-allmail
  86. #+END_SRC
  87.  
  88. Make certfile. Put the everything from "-----BEGIN CERTIFICATE-----" and "-----END CERTIFICATE-----" in a file.
  89. #+BEGIN_SRC
  90. openssl s_client -starttls imap -connect 127.0.0.1:1143 -showcerts
  91. #+END_SRC
  92.  
  93.  
  94. * daemonize Desktop-Bridge
  95.  
  96. start within a detache screen session. Create a systemd service file.
  97. ~/.config/systemd/user/bridge.service
  98. #+BEGIN_SRC
  99. [Unit]
  100. Description=Desktop-Bridge: Protonmail Bridge - ProtonMail IMAP and SMTP Bridge
  101.  
  102. [Service]
  103. Type=simple
  104. ExecStart=/usr/bin/screen -Dm bash -c "sleep 5; Desktop-Bridge -c"
  105. Restart=always
  106.  
  107. [Install]
  108. WantedBy=default.target
  109. #+END_SRC
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement