Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Out Of Date Documentation #209

Open
laserjet25 opened this issue Dec 12, 2024 · 11 comments
Open

[FEATURE] Out Of Date Documentation #209

laserjet25 opened this issue Dec 12, 2024 · 11 comments
Assignees

Comments

@laserjet25
Copy link

Describe the feature
The documentation page HERE does not contain complete information about all required packages and tools required to build and install this application. It was also unclear if it is required to build (as per docs) or if the .deb can be used instead as the docs do not tell you where to get the tar.gz or .deb. There also seems to be some lingering link to a possibly old repo on bitbucket.

To top all of this off there seems to be an install script that closely follows an old guide I found here for the paid version that installs a slightly differnt version that locked me out after not providing a license file.

Items I could not find:
-Full install guide
-ALL Dependant packages
-Where to change the smarthost
-Where to set smarthost credentials (I'm using AWS SES)
-A full list of configurable items in configs or the web interface
-A list of useful configs and their purposes

I'm likely going to drop the steps I took to install on my Ubuntu 24.0.4 to hopefully get some feedback if I was able to get it right.

@jsuto
Copy link
Owner

jsuto commented Dec 12, 2024

You may find the tar.gz and the built deb package on the release page https://github.com/jsuto/piler/releases

The commercial edition has somewhat different dependencies, and it requires a valid license. The linked "HERE" page is supposed to be the full install guide. Please clarify which dependency / package is missing.

The smarthost should be fixed in config-site.php, eg.

$config['SMARTHOST'] = 'smtp.aaa.fu';
$config['SMARTHOST_PORT'] = 25; 
$config['SMARTHOST_USER'] = 'my-user'; 
$config['SMARTHOST_PASSWORD'] = 'my-password';

For piler.conf variables explanation, see https://github.com/jsuto/piler/blob/master/etc/example.conf
For the UI https://github.com/jsuto/piler/blob/master/config.php.in The variable names are self explaining, and there are some comments to describe more.

@laserjet25
Copy link
Author

Thanks for the quick reply!

-I'll try to get a list of dependencies I needed to install. This may have only been for make/make install and could have possibly been caused by me using minimized Ubuntu.
-The example.conf and config.php.in linked are exactly what I was looking for. It might be nice to have that included in the install documentation.

Could you provide some clarification if there is a difference between installing from source and the deb? Again, the install doc only gives instructions for the .tar.gz (without a link) and it would have been nice to know that either are an option.

@laserjet25
Copy link
Author

This was done on Ubuntu 24.4 non-minimized.

The install guide provides no mention of the .deb installer. I installed the noted deps under mandatory and these optional: catdoc, memcached. Installing with the .deb I receive the following error.

>>$dpkg -i piler_1.4.6-noble-80dadac_amd64.deb
Selecting previously unselected package piler.
(Reading database ... 92198 files and directories currently installed.)
Preparing to unpack piler_1.4.6-noble-80dadac_amd64.deb ...
Unpacking piler (1.4.6-noble-80dadac) ...
Setting up piler (1.4.6-noble-80dadac) ...
DEBUG: adding setuid permissions to piler binaries
DEBUG: Generating piler.key
DEBUG: Making an ssl certificate
DEBUG: fixing /var/run/piler ownership
DEBUG: Checking for /var/piler/customer
DEBUG: Checking for /etc/piler/config-site.php
DEBUG: Checking for /etc/piler/sites
DEBUG: Checking for /etc/piler/sites/customer-sites.php
piler: error while loading shared libraries: libtre.so.5: cannot open shared object file: No such file or directory
dpkg: error processing package piler (--install):
 installed piler package post-installation script subprocess returned error exit status 127
Errors were encountered while processing:
 piler

This was fixed by installing libtre5.

Deb install issues:

  • There is an inconsistency that the .deb does not prompt for postinstall items.
  • Related to above, the piler sql user is not setup like in source install (make postinstall) and DB not seeded.

Source install issues:

  • A .zip is provided, not tar.gz.
  • The following packages are not installed on base ubuntu and are not noted: build-essentials, libssl-dev, libtre-dev, libmariadb-dev (might just by my unfamiliarity with building from source).
  • "--with-database" switch is not recognized: configure: WARNING: unrecognized options: --with-database.
  • rc.piler & rc.searchd are not installed as systemd services like with the .deb.

General issues:

  • There is no list of configuration files or links to examples. I don't have a large interest in digging through a git project to find hidden example files. (web config, any piler configs) I'm not saying they aren't in the project but that it would be nice to have these links provided in the guide.
  • The required setup differences between .deb and source are not mentioned (no mention of .deb).
  • The search bar on www.mailpiler.org finds some items on www.mailpiler.com which may not be related because of differences between enterprise/community versions.

Side note: I am intending on using this as an SMTP relay to AWS SES for my home network since port 25 is blockaded by ATT (zabbix>25>piler>2587>AWS SES>my inbox). I can't seem to get piler to send anything out to the smarthost (SES). With debug on, the logs seem to indicate the mail is received then nothing is done with it. Am I using this application wrong and cannot use this as a relay or is this an actual issue? I'll open another issue if it should be working.

$config['SMARTHOST'] = 'email-smtp.us-east-1.amazonaws.com';
$config['SMARTHOST_PORT'] = '2587';
$config['SMARTHOST_USER'] = 'XXXXX';
$config['SMARTHOST_PASSWORD'] = 'XXXX';
$config['RT'] = 1;

@jsuto
Copy link
Owner

jsuto commented Dec 14, 2024

https://www.mailpiler.org/installation/ applies to installing it from source, not .deb.
On the github release page you have both .zip and .tar.gz packages, pick your favourite one.

The deb file spares you only the build, not the other postinstall tasks or installing the dependencies. The docs indeed needs some polishing here, as well as updating the install from source part.

Regarding your usage, piler is an email archive, not an smtp relay. When you send an email to piler, it merely stores and archives it. The smarthost settings above apply when you want to restore an already archived email. So I'm not sure if you use piler properly.

@laserjet25
Copy link
Author

Overall, love the project. Apparently it is difficult to find FOSS mail archivers currently. I intend to do a writeup once I finish setting up my homelab wiki. I would love to help with updating your documentation wherever possible. Have you considered using the wiki on Github?

@jsuto
Copy link
Owner

jsuto commented Dec 17, 2024

It is on github, see https://github.com/jsuto/mailpilerorg-site. Feel free to create a PR.

@laserjet25
Copy link
Author

Would you be able to recommend a mail relay that would be able to support this? Looking at some common relays (postfix, dovecot, IIS SMTP relay) they only seem to be able to add a BCC address, which would not work with this.

What are some setups you have seen people run?

@jsuto
Copy link
Owner

jsuto commented Dec 25, 2024

So you need an smtp relay that receives email from zabbix, then forwrads them to AWS SES to port 2587, and passes a copy to the archive as well. It seems like an easy task to me. Postfix support always_bcc that does the job fine.

@laserjet25
Copy link
Author

laserjet25 commented Dec 26, 2024

Is there support for external databases? The below part of the installer seems to suggest piler will not install without MySQL/MariaDB installed locally. I have a MariaDB cluster I think may be better suited than a local install.

if test "$have_mysql" = "no"; then
   echo "MySQL support is not found"
   exit 1
fi

Edit:
After playing around a bit, I realized that there are questions in the postinstall script to provide the DB host/username. When going through the defaults with MariaDB setup, the root user is set to localhost login only. This seems to be an issue as the postinstall script is hardcoded to use root. Is there a reason for this instead of being able to provide a DBA account that is not root?

@jsuto
Copy link
Owner

jsuto commented Dec 26, 2024

Yes, you can use a remote database. However, piler still needs the mysql client libraries.

@laserjet25
Copy link
Author

● rc.piler.service - LSB: piler email archiver
     Loaded: loaded (/etc/init.d/rc.piler; generated)
     Active: active (running) since Thu 2024-12-26 20:07:29 UTC; 45s ago
       Docs: man:systemd-sysv-generator(8)
    Process: 25875 ExecStart=/etc/init.d/rc.piler start (code=exited, status=0/SUCCESS)
      Tasks: 3 (limit: 4605)
     Memory: 3.1M (peak: 3.7M)
        CPU: 77ms
     CGroup: /system.slice/rc.piler.service
             ├─25883 /usr/local/sbin/piler -d
             ├─25884 /usr/local/sbin/piler -d
             └─25885 /usr/local/sbin/piler -d

Dec 26 20:07:29 SERVER1 piler[25884]: ERROR: cant connect to 127.0.0.1:9306
Dec 26 20:07:29 SERVER1 piler[25885]: ERROR: cant connect to 127.0.0.1:9306
Dec 26 20:07:39 SERVER1 piler[25884]: ERROR: cant connect to 127.0.0.1:9306
Dec 26 20:07:39 SERVER1 piler[25885]: ERROR: cant connect to 127.0.0.1:9306
Dec 26 20:07:49 SERVER1 piler[25884]: ERROR: cant connect to mysql server
Dec 26 20:07:49 SERVER1 piler[25885]: ERROR: cant connect to mysql server
Dec 26 20:07:59 SERVER1 piler[25884]: ERROR: cant connect to mysql server
Dec 26 20:07:59 SERVER1 piler[25885]: ERROR: cant connect to mysql server
Dec 26 20:08:09 SERVER1 piler[25884]: ERROR: cant connect to mysql server
Dec 26 20:08:09 SERVER1 piler[25885]: ERROR: cant connect to mysql server

The postinstall script was able to create the database, but piler does not seem to be able to connect to it after install is completed. There seems to be some user@localhost entries hard coded such as below in util/db-mysql-root.sql.in

grant all privileges on MYSQL_DATABASE.* to MYSQL_USERNAME@localhost identified by 'MYSQL_PASSWORD';

Are you able to confirm you have tested a remote database install with the current version? Want to have all my bases covered while I continue to poke through the files. I did confirm the config file has the right creds and I can use mysql -h on the same system to connect to the database.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants