Skip to content

Commit 31f80dc

Browse files
committed
installation guide
1 parent f5ece72 commit 31f80dc

File tree

3 files changed

+74
-29
lines changed

3 files changed

+74
-29
lines changed

README.md

Lines changed: 66 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,30 @@
1-
### installation
1+
### files_frommail
22

3-
- need mailparse
3+
**Files From Mail** allow an admin to link a drop-mailbox to Nextcloud.
4+
This way, you can set a mail address (_files@example.net_ in our example) and every mails+attachments send to this mail address will be automatically be saved on the cloud.
5+
6+
7+
8+
![](https://raw.githubusercontent.com/nextcloud/files_frommail/master/screenshots/v0.1.0.png)
9+
10+
11+
### dependencies
12+
13+
This app will need [Mailparse](http://php.net/manual/en/book.mailparse.php)
14+
If not already installed on your server:
415

516
```
6-
pecl install mailparse
17+
$ sudo pecl install mailparse
718
```
819

9-
if fail:
20+
If the installation failed with a message about mbstring not installed (but mbstring is already installed) you will need to install the Mailparse extension manually:
1021

1122
```
12-
pecl download mailparse
13-
tar -zxvf mailparse-3.0.2.tgz
14-
cd mailparse-3.0.2/
15-
phpize
16-
edit mailparse.c
23+
$ pecl download mailparse
24+
$ tar -zxvf mailparse-3.0.2.tgz
25+
$ cd mailparse-3.0.2/
26+
$ phpize
27+
$ vi mailparse.c
1728
```
1829

1930
remove lines 34-37:
@@ -22,26 +33,60 @@ remove lines 34-37:
2233
> #endif
2334
2435
```
25-
./configure --with-php-config=/usr/bin/php-config
26-
make
27-
make install
36+
$ ./configure --with-php-config=/usr/bin/php-config
37+
$ make
38+
$ sudo make install
39+
$ sudo echo "extension=mailparse.so" > /etc/php/7.0/mods-available/mailparse.ini
40+
$ sudo ln -s /etc/php/7.0/mods-available/mailparse.ini /etc/php/7.0/apache2/conf.d/20-mailparse.ini
41+
$ sudo apachectl restart
42+
```
43+
44+
45+
46+
### configuration mail server
47+
48+
You now need to tell your mail server that any mails coming to a specific address (in our example: _files@mailserver.example.net_) will be redirected to a PHP script:
49+
Add this line to **/etc/aliases**:
2850

29-
echo "extension=mailparse.so" > /etc/php/7.0/mods-available/mailparse.ini
51+
> files: "|/usr/bin/php -f /path/to/NextcloudMailCatcher.php"
3052
31-
cd /etc/php/7.0/apache2/conf.d/
32-
ln -s /etc/php/7.0/mods-available/mailparse.ini ./20-mailparse.ini
33-
apachectl restart
53+
_The NextcloudMailCatcher.php can be find in the /lib/ folder of the apps. The script is independant of the rest of the app and can be copied alone on your mail server_
54+
55+
Recreate the aliases db:
56+
```
57+
$ sudo newaliases
3458
```
3559

60+
_Edit **NextcloudMailCatcher.php** and edit the few settings:
61+
62+
63+
> $config = [
64+
> 'nextcloud' => 'https://cloud.example.net/',
65+
> 'username' => 'frommail',
66+
> 'password' => 'Ledxc-jRFiR-wBMXD-jyyjt-Y87CZ',
67+
> 'debug' => false
68+
> ];
69+
70+
if **debug** is set to _true_, a log can be find in _/tmp/NextcloudMailParser.log_
71+
72+
### Virtual domain
73+
74+
In case you're using virtual domain (postfix), you will need to create an alias in your MTA:
75+
76+
> files@example.com -> files@mailserver.example.net
77+
78+
79+
80+
### Add the drop mailbox address to Nextcloud
3681

82+
To only create the right folder on the right mail address, the app will filters unknown mail addresses. You will need to add the drop-mailbox:
3783

38-
### configuration MTA:
84+
> ./occ files_frommail:address --add files@example.com
3985
40-
new entry in /etc/aliases:
86+
You can choose to secure the mails and ask for a password:
4187

42-
> files-artificial: "|/usr/bin/php -f /path/to/NextcloudMailCatcher.php"
88+
> ./occ files_frommail:address --password files@example.com your_password
4389
44-
- execute _newaliases_
90+
Doing so, only mails containing '**:your_password**' in their content will be saved.
4591

46-
- if virtual alias, create a new alias: files@artificial-owl.com -> files@hostname.example.net
4792

appinfo/info.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
<summary>Recover your email attachments from your cloud</summary>
77
<description><![CDATA[
88
9-
Recover your email attachments from your cloud
9+
Allows an admin to link a drop-mailbox to Nextcloud.
10+
This way, you can set a mail address and every mails+attachments send to this mail address will be automatically be saved on the cloud.
1011
1112
]]>
1213
</description>
@@ -15,17 +16,16 @@
1516
<author>Maxence Lange</author>
1617
<namespace>Files_FromMail</namespace>
1718
<documentation>
18-
<admin>https://github.com/daita/files_frommail/wiki</admin>
19+
<admin>https://github.com/nextcloud/files_frommail/blob/master/README.md</admin>
1920
</documentation>
2021
<category>tools</category>
2122
<category>files</category>
2223
<category>social</category>
2324

24-
<website>https://github.com/daita/files_frommail</website>
25-
<bugs>https://github.com/daita/files_frommail/issues</bugs>
26-
<repository>https://github.com/daita/files_frommail.git</repository>
27-
<!--<screenshot>-->
28-
<!--</screenshot>-->
25+
<website>https://github.com/nextcloud/files_frommail</website>
26+
<bugs>https://github.com/nextcloud/files_frommail/issues</bugs>
27+
<repository>https://github.com/nextcloud/files_frommail.git</repository>
28+
<screenshot>https://raw.githubusercontent.com/nextcloud/files_frommail/master/screenshots/v0.1.0.png</screenshot>
2929

3030
<dependencies>
3131
<nextcloud min-version="12" max-version="13"/>

lib/NextcloudMailCatcher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727

2828
$config = [
29-
'nextcloud' => 'https://test.artificial-owl.com/',
29+
'nextcloud' => 'https://cloud.example.net/',
3030
'username' => 'frommail',
3131
'password' => 'Ledxc-jRFiR-wBMXD-jyyjt-Y87CZ',
3232
'debug' => false

0 commit comments

Comments
 (0)