You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -15,9 +15,9 @@ Why? Because we needed it for our startup [jokund.com](http://jokund.com).
15
15
### Show me a demo!
16
16
Sure! A demo is live at [mailin.io](http://mailin.io). Please note that it is running on the smallest Digital Ocean instance, so be fair if it is overloaded.
17
17
18
-
###Initial setup
18
+
###Initial setup
19
19
20
-
####Dependencies
20
+
####Dependencies
21
21
22
22
Mailin can run without any dependencies other than node itself, but having them allow you to use some additional features.
Spamassassin is not enabled by default, enable it in ```/etc/default/spamassassin```.
36
36
37
-
####Node versions
37
+
####Node versions
38
38
39
39
The latest version of Mailin (^3.0.0) runs on node ~0.12.0 or iojs ^2.0.0. If you are running an older version of node such as ~0.10.0, you can install Mailin ^2.0.0:
In order to receive emails, your smtp server address should be made available somewhere. Two records should be added to your DNS records. Let us pretend that we want to receive emails at ```*@subdomain.domain.com```:
47
47
* First an MX record: ```subdomain.domain.com MX 10 mxsubdomain.domain.com```. This means that the mail server for addresses like ```*@subdomain.domain.com``` will be ```mxsubdomain.domain.com```.
@@ -50,8 +50,8 @@ In order to receive emails, your smtp server address should be made available so
50
50
You can fire up Mailin (see next section) and use an [smtp server tester](http://mxtoolbox.com/diagnostic.aspx) to verify that everything is correct.
51
51
52
52
53
-
###Using Mailin
54
-
####From the command line
53
+
###Using Mailin
54
+
####From the command line
55
55
56
56
Install mailin globally.
57
57
@@ -74,7 +74,7 @@ and make sure that your user can write to the log file.
74
74
75
75
At this point, Mailin will listen for incoming emails, parse them and post an urlencoded form ```multipart/form-data``` to your webhook url.
76
76
77
-
#####Webhook format
77
+
#####Webhook format
78
78
The webhook payload is a multipart form with a ```mailinMsg``` fields always present and some optional additional fields containing the content of the attachments. How to handle this? We have got you covered, there is a working example using node and express in [mailin/samples/server.js](https://github.com/Flolagale/mailin/blob/master/samples/server.js). Anyway, once parsed, you should end up with something like:
79
79
```
80
80
{
@@ -129,14 +129,14 @@ The webhook payload is a multipart form with a ```mailinMsg``` fields always pre
129
129
}
130
130
```
131
131
132
-
#####Gotchas
132
+
#####Gotchas
133
133
*```error: listen EACCES```: your user do not have sufficients privileges to run on the given port. Ports under 1000 are restricted to root user. Try with [sudo](http://xkcd.com/149/).
134
134
*```error: listen EADDRINUSE```: the current port is already used by something. Most likely, you are trying to use port 25 and your machine's [mail transport agent](http://en.wikipedia.org/wiki/Message_transfer_agent) is already running. Stop it with something like ```sudo service exim4 stop``` or ```sudo service postfix stop``` before using Mailin.
135
135
*```error: Unable to compute spam score ECONNREFUSED```: it is likely that spamassassin is not enabled on your machine, check the ```/etc/default/spamassassin``` file.
136
136
*```node: command not found```: most likely, your system does not have node installed or it is installed with a different name. For instance on Debian/Ubuntu, the node interpreter is called nodejs. The quick fix is making a symlink: ```ln -s $(which nodejs) /usr/bin/node``` to make the node command available.
137
137
*```Uncaught SenderError: Mail from command failed - 450 4.1.8 <[email protected]>: Sender address rejected: Domain not found```: The smtpOption `disableDNSValidation` is set to `false` and an email was sent from an invalid domain.
0 commit comments