simatec / piler-docker

Mailpiler for Docker
MIT License
32 stars 12 forks source link

Documentation for Import Procedure of MailCow Accounts #14

Closed BastianTeufel-GTR closed 7 months ago

BastianTeufel-GTR commented 7 months ago

Hi,

thanks for this awesome project. Initially setting up mailpiler was super easy 👍

While running the install script I've supplied my mailcow details and API key. I also used this default value

If Use automatic import to 5 minutes interval (yes/no)? / Y|N (Default: no): no

This all worked without any issues and I can login to the mailpiler interface using my e-mail credentials. But I have the mailpiler now up and running for quite a few hours and nothing is happening.

So here are my questions:

Is there some further reading on this?

Thanks in advance

BastianTeufel-GTR commented 7 months ago

hmmm it seems as if I can get no connection from the docker container to the IMAP server. While connecting I always get a timeout.

It does not work using the admin account in the UI, nor does the pilerimport script work. Both are giving a timeout. Connecting to the imap on port 993 works fine from within the company network as well as from outside

but only the IMAP connection seems to be affected. I was able to login using my mail and password from my mailcow server without a problem

simatec commented 7 months ago

Is Mailcow Config for Piler ok?

BastianTeufel-GTR commented 7 months ago

I added an API key by now but thats it. I wanted to import the existing mails as a starting point. The final integration on pushing all incoming emails to mailpiler is not done by now

BastianTeufel-GTR commented 7 months ago

I started the docker setup from scratch but now I can not even connect to the GUI anymore. The default user is not working and the API seems to be not working, too.

I think I setup a new LXC container tomorrow and start again from 0 😞

simatec commented 7 months ago

I'll be a computer tomorrow morning. I can find the Mailcow configuration there

BastianTeufel-GTR commented 7 months ago

Thanks this would be great. I'll continue tomorrow morning as well. For today it's enough 😄

BastianTeufel-GTR commented 7 months ago

What I did this morning:

So I think I need the information on

BastianTeufel-GTR commented 7 months ago

Update:

The IMAP import of existing mail accounts is working now! 🥳 So I think the missing information is now only the Hook into Mailcow for sent and new mails. I read something about some Transport Maps but have no idea on where to look and on how to configure it.

simatec commented 7 months ago

Here is an example of how to automatically import every incoming and outgoing mail into the Piler image Local destination: your Domain BCC destination: archive@yourPilerDomain

For your API Connection is her the Example image Allow API access from these IPs: your Piler IP

A cron runs in the piler for automatic synchronization, which executes tasks cyclically. For example, the indexer for new mails is executed every 30 minutes (5.35 *)

If you want to execute this manually for testing purposes, you can also execute the respective command from the cron manually.

This means that new mails are indexed every 30 minutes and only then appear in the Piler GUI.

# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/usr/share/piler/piler.cron installed on Mon Jan 23 19:48:03 2023)
# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)
### PILERSTART
5,35 * * * * /usr/libexec/piler/indexer.delta.sh
30   2 * * * /usr/libexec/piler/indexer.main.sh
40 3 * * * /usr/libexec/piler/purge.sh
*/15 * * * * /usr/bin/indexer --config /etc/piler/manticore.conf --quiet tag1 --rotate
*/15 * * * * /usr/bin/indexer --config /etc/piler/manticore.conf --quiet note1 --rotate
*/5 * * * *  /usr/bin/find /var/piler/www/tmp -type f -name i.\* -exec rm -f {} \;
*/5 * * * * /usr/bin/find /var/piler/error -type f|wc -l > /var/piler/stat/error

### optional
###30 6 * * * /usr/bin/php /usr/libexec/piler/generate_stats.php --webui /var/piler/www >/dev/null
###*/5 * * * * /usr/libexec/piler/import.sh

### PILEREND
### Piler import added by Piler-Installer
*/5 * * * * /usr/libexec/piler/import.sh
BastianTeufel-GTR commented 7 months ago

Thanks for your detailed instructions

I have some further questions:

simatec commented 7 months ago

Thanks for your detailed instructions

I have some further questions:

  • So is it sufficient to import the mailboxes once via the Imap import on the command line and then the indexer.delta.sh script automatically fetches the new emails twice an hour?

If bcc maps is set up in Mailcow see post above yes

  • or do I need to register the mailboxes in another place for the delta script to know which boxes to sync

no

  • and is it then necessary to have the maps set up for each incoming and outgoing mail?

You can set it up for the entire domain and not just for one e-mail address

Local destination: your Domain
BCC destination: archive@yourPilerDomain
  • how are mails handled which are forwarded to the archive@piler.host.tld? Are they automatically added to the correct inbox?

Yes

  • is there a chance of duplicates when setting the bcc maps to the archive in addition to the indexer.delta.sh script?

As far as I know, Piler handles duplicates automatically

There is a very good telegram group where many topics related to the Piler project are discussed. You can also ask specific questions there

https://t.me/mailpiler

BastianTeufel-GTR commented 7 months ago

Ok, thanks I think I got it so far. One last point: Is the archive@piler.host.tld automatically available or do I need to configure it or set it up in anyway?

simatec commented 7 months ago

archive@piler.host.tld is automatically available

BastianTeufel-GTR commented 7 months ago

Thanks, everything is working now! I think the added details here could be of interest to others running into the same problems...