Donation from Maigurs Stalidzans. Thanks!
[ikiwiki.git] / docs / howtos / HowTo_dma_gmail.mdwn
1 ## Using dma for sending mails via GMail SMTP 
2
3 ### About 
4
5 This HOWTO helps you to set up dma for sending mails via gmail accounts. It's useful if you do not want to run -- and especially setup -- sendmail, postfix or other big MTA. So it's ideal for home use.
6
7
8
9 Sending mails via gmail reduces the risk that your mail lands in some spam mailbox.
10
11
12
13 ### Why these? 
14
15
16
17 The DragonFly Mail Agent (dma) is a small Mail Transport Agent (MTA), designed for home and office use. On a DragonFly system why should you use anything else?
18
19
20
21 [Mutt](http://www.mutt.org) is a small but very powerful text-based mail client for Unix operating systems. I haven't found any better until now.
22
23
24
25 ### Install 
26
27 dma: part of the base DragonFly system, so you already have it.
28
29
30
31 [Mutt](http://www.mutt.org): You can install it from the pkgsrc tree (mail/mutt or mail/mutt-devel) or you can use prebuilt binaries.
32
33
34
35 ### Setup 
36
37 #### dma 
38
39 /etc/dma/auth.conf
40
41     
42
43     gmail_user@gmail.com|smtp.gmail.com:PaSsWorD
44
45
46
47
48
49 /etc/dma/dma.conf
50
51     
52
53     SMARTHOST smtp.gmail.com
54
55     PORT 587
56
57     AUTHPATH /etc/dma/auth.conf
58
59     SECURETRANSFER
60
61     STARTTLS
62
63     INSECURE
64
65 **Note: read man dma before using the INSECURE directive above
66
67
68
69 #### mutt 
70
71 ~/.muttrc
72
73     
74
75     set sendmail="/usr/libexec/dma"
76
77
78
79 #### Google App Password
80
81 For Google accounts with two-factor authentication enabled, SMTP authorization with your normal password will fail.  Instead, you will need to login and create an [app-specific password](https://myaccount.google.com/apppasswords).