Hello everyone!
Infos:
- Used Zammad version: 6.1.0
- Used Zammad installation type: docker-compose
- Operating system: Rocky Linux 8.8
- Browser + version: Firefox 119
I am running zammad 6.1.0 installed with docker from zammad-docker-compose
repo.
Due to limitations of configuration of mail system in our company (only proprietary exchange protocol is allowed) i was forced to use davmail as an adapter between exchange and imap/smtp protocols. Email test is passed successfully after imap/smtp configuration.
I can see with tcpdump that zammad successfully gets emails via imap:
* OK [CAPABILITY IMAP4REV1 AUTH=LOGIN MOVE SPECIAL-USE] IMAP4rev1 DavMail 6.1.0-3423 server ready
RUBY0001 LOGIN *** "***"
RUBY0001 OK Authenticated
RUBY0002 SELECT INBOX
* 384 EXISTS
* 7 RECENT
* OK [UIDVALIDITY 1]
* OK [UIDNEXT 775]
* FLAGS (\Answered \Deleted \Draft \Flagged \Seen $Forwarded Junk)
* OK [PERMANENTFLAGS (\Answered \Deleted \Draft \Flagged \Seen $Forwarded Junk \*)]
RUBY0002 OK [READ-WRITE] SELECT completed
RUBY0003 SORT (DATE) US-ASCII NOT SEEN
RUBY0003 BAD command unrecognized
RUBY0004 SEARCH NOT SEEN
* SEARCH 374 375 376 377 378 381 384
RUBY0004 OK SEARCH completed
RUBY0005 FETCH 374 (RFC822.SIZE FLAGS INTERNALDATE RFC822.HEADER)
* 374 FETCH (UID 762 RFC822.SIZE 14814 FLAGS (\Recent) INTERNALDATE "21-Nov-2023 06:42:32 +0000" RFC822.HEADER {1693}
Received: from *** by ***
...
and so on
Expected behavior:
New tickets appear in system.
Actual behavior:
No new tickets in the system.
Steps to reproduce the behavior:
I found that usage of davmail with zammad caused problems in a past. community(dot)zammad(dot)org/t/solved-zammad-with-davmail/2151
(cannot post urls)
And i tried to apply proposed workaround with reading emails from stdin. admin-docs(dot)zammad(dot)org/en/latest/channels/email/advanced/fetchmail.html
This also did not help.
I have copied test email from test/fixtures/mail67.box
to zammad_zammad-railsserver_1
docker container.
Then i run cat /tmp/mail67.box | rails r 'Channel::Driver::MailStdin.new(trusted: true)'
with 2 ways.
If i use docker exec -it -u zammad zammad_zammad-railsserver_1 bash
that gives:
zammad@c5e68348544a:~$ cat /tmp/mail67.box | rails r 'Channel::Driver::MailStdin.new(trusted: true)'
I, [2023-11-23T06:45:12.937902 #230] INFO -- : ActionCable is using the redis instance at redis://zammad-redis:6379.
I, [2023-11-23T06:45:12.946853#230-5520] INFO -- : Using memcached as Rails cache store.
I, [2023-11-23T06:45:12.946944#230-5520] INFO -- : Using the Redis back end for Zammad's web socket session store.
I, [2023-11-23T06:45:14.205209#230-5520] INFO -- : read main from STDIN
I, [2023-11-23T06:45:14.208101#230-5520] INFO -- : Process email with msgid '<20180704080232.343463D42403@dd38536.example.com>'
"ERROR: Can't process email, you will find it for bug reporting under /opt/zammad/var/spool/unprocessable_mail/2f12667ac6bc0ecaaacad9de1495bba0.eml, please create an issue at https://github.com/zammad/zammad/issues"
"ERROR: #<RuntimeError: No x-zammad-session-user-id, no sender set!>"
E, [2023-11-23T06:45:14.213065#230-5520] ERROR -- : Can't process email, you will find it for bug reporting under /opt/zammad/var/spool/unprocessable_mail/2f12667ac6bc0ecaaacad9de1495bba0.eml, please create an issue at https://github.com/zammad/zammad/issues
E, [2023-11-23T06:45:14.213094#230-5520] ERROR -- : No x-zammad-session-user-id, no sender set! (RuntimeError)
app/models/channel/email_parser.rb:192:in `block in _process'
app/models/transaction.rb:17:in `block in execute'
app/models/transaction.rb:14:in `execute'
app/models/transaction.rb:26:in `execute'
app/models/channel/email_parser.rb:187:in `_process'
app/models/channel/email_parser.rb:126:in `block in process'
app/models/channel/email_parser.rb:125:in `process'
app/models/channel/driver/mail_stdin.rb:30:in `initialize'
/opt/zammad/app/models/channel/email_parser.rb:141:in `rescue in process': #<RuntimeError: No x-zammad-session-user-id, no sender set!> (RuntimeError)
...
If using docker exec -it -u root zammad_zammad-railsserver_1 bash
and then su - zammad
(directly as instruction above has told) then i get:
root@c5e68348544a:/opt/zammad# su - zammad
zammad@c5e68348544a:~$ pwd
/opt/zammad
zammad@c5e68348544a:~$ cat /tmp/mail67.box | rails r 'Channel::Driver::MailStdin.new(trusted: true)'
-bash: rails: command not found
zammad@c5e68348544a:~$ cat /tmp/mail67.box | bin/rails r 'Channel::Driver::MailStdin.new(trusted: true)'
https://github.com/zammad-deps/omniauth-weibo-oauth2 (at unpin-dependencies@06803ef) is not yet checked out. Run `bundle install` first.
Both options are not working.
Are there opportunities how to get email through davmail somehow else? Or might be it is me who doing something wrong?