juanluisbaptiste / docker-otrs

The unofficial Znuny/OTRS Ticketing System docker image
https://www.juanbaptiste.tech/category/otrs
GNU Lesser General Public License v3.0
172 stars 101 forks source link

procmail routing #102

Closed perler closed 3 years ago

perler commented 3 years ago

We want to switch to mail routing via procmail according to https://doc.otrs.com/doc/manual/admin/6.0/en/html/email-settings.html#procmail-queue-routing

is this possible with the docker images and is there some documentation for this?

juanluisbaptiste commented 3 years ago

Hi @perler , currently is not possible, PR welcome.

perler commented 3 years ago

ok, I am thinking about how to do this in general and welcome input. the reason why this may be a bit more urgent for other users as well is, that email fetching with pop3 is getting more and more difficult with cloud bases services as google workspace and office 365 which phase out pop3/imap for oauth based authentication.

so, we have two containers, smtp (postfix) and otrs. what otrs expects is an smtp server which pipes the emails via procmail to $SYS_HOME/bin/otrs.Console.pl. as far as I know you cannot pipe between servers. I see three options:

  1. moving the smtp server to the otrs container (at least optionally)
  2. creating some kind of daemon who listens for the procmail pipes from the smtp container on the otrs container. the obvious "daemon" is postfix, go to 1 ;)
  3. quick and dirty: add a pop3 server (dovecot) to the postfix container and hold the mails locally for fetching from the otrs container. this way there is no need to pop3 authenticate with the cloud services anymore, we can authenticate with the postfix container.

@juanluisbaptiste do you have an opinion/idea?

juanluisbaptiste commented 3 years ago

Installing a smtp server in the OTRS container is not an option, the idea of containerized applications is that they should do only one function. You should use a container for the specific function you need, a mail server container that downloads the emails in whatever form you need and then feeds them to the otrs container, for example via pop3/imap.

juanluisbaptiste commented 3 years ago

The SMTP server used on the compose file is only for sending email, you can look at that project documentation for more details. I don't understand what you mean with which path the email will take, also why is the mail server pointing to OTRS ? I do not understand this either.

perler commented 3 years ago

Sorry, I sent this comment by accident. It was a brain fart. what we are going to do is replace your SMTP container with a full-fledged mail server with postfix and this will solve our problems.

juanluisbaptiste commented 3 years ago

Ahh ok, yes, the best solution on this case is to use a mail server that can retrireve the email instead of OTRS and then feed it to it with procmail.

perler commented 3 years ago

this on the other hand will not work as procmail needs to run inside the otrs container. but we will forward mail for otrs from office365 (which lacks proper pop3 support) to the postfix/dovecot container and fetch it from there with otrs pop3 import..

On Fri, 4 Dec 2020 at 17:29, Juan Luis Baptiste notifications@github.com wrote:

Ahh ok, yes, the best solution on this case is to use a mail server that can retrireve the email instead of OTRS and then feed it to it with procmail.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/juanluisbaptiste/docker-otrs/issues/102#issuecomment-738879427, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEYD5CE3MP6WXNACZYKFTDSTEE6BANCNFSM4UCHNO2Q .

alie2n commented 3 years ago

Would it be possible to have the smtp server running on the docker host, execute procmailrc on the host which calls otrs.Console.pl inside the otrs container and pipes stdin to the docker command?

juanluisbaptiste commented 3 years ago

If you mean running a smtp server inside the docker container, then no, it was already explained before why.

alie2n commented 3 years ago

No. I thought about running the smtp server outside of the containers. Somthing like this: SMTP -> Postfix (running on the host os) -> procmail (running on the host os) | docker exec -it su otrs -c "/opt/otrs/bin/otrs.Console.pl Maint::Postmaster::Read"