helpyio / helpy

Helpy is a modern, open source helpdesk customer support application. Features include knowledgebase, community discussions and support tickets integrated with email.
http://helpy.io/?source=ghh
MIT License
2.38k stars 497 forks source link

E-mail is not sent when the job is triggered by an incoming e-mail #1688

Open Luap99 opened 4 years ago

Luap99 commented 4 years ago

Every time a new ticket is created via e-mail the notification and the welcome user e-mail fails to send. When the Ticket is submitted via web interface this works fine. The same happens if an agent replies to an e-mail the user e-email will also fail to deliver.If you're responding through the web interface the e-mail is send the user as expected.

I am using the imap provider to receive e-mails.

I got the following error message in the production.log file:

I, [2020-04-17T10:27:55.627778 #171] INFO -- : [ActiveJob] [ActionMailer::DeliveryJob] [f4c8e712-90d4-4fce-a791-6294a08cef0c] Performed ActionMailer::DeliveryJob from SuckerPunch(mailers) in 248.0ms E, [2020-04-17T10:27:55.627903 #171] ERROR -- : Sucker Punch job error for class: 'ActiveJob::QueueAdapters::SuckerPunchAdapter::JobWrapper' args: [{"job_class"=>"ActionMailer::DeliveryJob", "job_id"=>"f4c8e712-90d4-4fce-a791-6294a08cef0c", "queue_name"=>"mailers", "arguments"=>["NotificationMailer", "new_private", "deliver_now", 52], "locale"=>:en}] Errno::ENETUNREACH Network is unreachable - connect(2) for "localhost" port 25 /usr/local/lib/ruby/2.4.0/net/smtp.rb:539:in initialize' /usr/local/lib/ruby/2.4.0/net/smtp.rb:539:inopen' /usr/local/lib/ruby/2.4.0/net/smtp.rb:539:in tcp_socket' /usr/local/lib/ruby/2.4.0/net/smtp.rb:549:inblock in do_start' /usr/local/lib/ruby/2.4.0/timeout.rb:93:in block in timeout' /usr/local/lib/ruby/2.4.0/timeout.rb:103:intimeout' /usr/local/lib/ruby/2.4.0/net/smtp.rb:548:in do_start' /usr/local/lib/ruby/2.4.0/net/smtp.rb:518:instart' /opt/helpy-bundle/gems/mail-2.7.1/lib/mail/network/delivery_methods/smtp.rb:109:in start_smtp_session' /opt/helpy-bundle/gems/mail-2.7.1/lib/mail/network/delivery_methods/smtp.rb:100:indeliver!' /opt/helpy-bundle/gems/mail-2.7.1/lib/mail/message.rb:2159:in do_delivery' /opt/helpy-bundle/gems/mail-2.7.1/lib/mail/message.rb:260:inblock in deliver' /opt/helpy-bundle/gems/actionmailer-4.2.11.1/lib/action_mailer/base.rb:543:in block in deliver_mail' /opt/helpy-bundle/gems/activesupport-4.2.11.1/lib/active_support/notifications.rb:164:inblock in instrument' /opt/helpy-bundle/gems/activesupport-4.2.11.1/lib/active_support/notifications/instrumenter.rb:20:in instrument' /opt/helpy-bundle/gems/activesupport-4.2.11.1/lib/active_support/notifications.rb:164:ininstrument' /opt/helpy-bundle/gems/actionmailer-4.2.11.1/lib/action_mailer/base.rb:541:in deliver_mail' /opt/helpy-bundle/gems/mail-2.7.1/lib/mail/message.rb:260:indeliver' /opt/helpy-bundle/gems/actionmailer-4.2.11.1/lib/action_mailer/message_delivery.rb:85:in deliver_now' /opt/helpy-bundle/gems/actionmailer-4.2.11.1/lib/action_mailer/delivery_job.rb:10:inperform' /opt/helpy-bundle/gems/activejob-4.2.11.1/lib/active_job/execution.rb:32:in block in perform_now' /opt/helpy-bundle/gems/activesupport-4.2.11.1/lib/active_support/callbacks.rb:117:incall' /opt/helpy-bundle/gems/activesupport-4.2.11.1/lib/active_support/callbacks.rb:555:in block (2 levels) in compile' /opt/helpy-bundle/gems/activesupport-4.2.11.1/lib/active_support/callbacks.rb:505:incall' /opt/helpy-bundle/gems/activesupport-4.2.11.1/lib/active_support/callbacks.rb:498:in block (2 levels) in around' /opt/helpy-bundle/gems/activesupport-4.2.11.1/lib/active_support/callbacks.rb:343:inblock (2 levels) in simple' /opt/helpy-bundle/gems/i18n-0.9.5/lib/i18n.rb:268:in with_locale' /opt/helpy-bundle/gems/activejob-4.2.11.1/lib/active_job/translation.rb:7:inblock (2 levels) in ' /opt/helpy-bundle/gems/activesupport-4.2.11.1/lib/active_support/callbacks.rb:441:in instance_exec' /opt/helpy-bundle/gems/activesupport-4.2.11.1/lib/active_support/callbacks.rb:441:inblock in make_lambda' /opt/helpy-bundle/gems/activesupport-4.2.11.1/lib/active_support/callbacks.rb:342:in block in simple' /opt/helpy-bundle/gems/activesupport-4.2.11.1/lib/active_support/callbacks.rb:497:inblock in around' /opt/helpy-bundle/gems/activesupport-4.2.11.1/lib/active_support/callbacks.rb:505:in call' /opt/helpy-bundle/gems/activesupport-4.2.11.1/lib/active_support/callbacks.rb:498:inblock (2 levels) in around' /opt/helpy-bundle/gems/activesupport-4.2.11.1/lib/active_support/callbacks.rb:343:in block (2 levels) in simple' /opt/helpy-bundle/gems/activejob-4.2.11.1/lib/active_job/logging.rb:23:inblock (4 levels) in ' /opt/helpy-bundle/gems/activesupport-4.2.11.1/lib/active_support/notifications.rb:164:in block in instrument' /opt/helpy-bundle/gems/activesupport-4.2.11.1/lib/active_support/notifications/instrumenter.rb:20:ininstrument' /opt/helpy-bundle/gems/activesupport-4.2.11.1/lib/active_support/notifications.rb:164:in instrument' /opt/helpy-bundle/gems/activejob-4.2.11.1/lib/active_job/logging.rb:22:inblock (3 levels) in ' /opt/helpy-bundle/gems/activejob-4.2.11.1/lib/active_job/logging.rb:43:in block in tag_logger' /opt/helpy-bundle/gems/activesupport-4.2.11.1/lib/active_support/tagged_logging.rb:68:inblock in tagged' /opt/helpy-bundle/gems/activesupport-4.2.11.1/lib/active_support/tagged_logging.rb:26:in tagged' /opt/helpy-bundle/gems/activesupport-4.2.11.1/lib/active_support/tagged_logging.rb:68:intagged' /opt/helpy-bundle/gems/activejob-4.2.11.1/lib/active_job/logging.rb:43:in tag_logger' /opt/helpy-bundle/gems/activejob-4.2.11.1/lib/active_job/logging.rb:19:inblock (2 levels) in ' /opt/helpy-bundle/gems/activesupport-4.2.11.1/lib/active_support/callbacks.rb:441:in instance_exec' /opt/helpy-bundle/gems/activesupport-4.2.11.1/lib/active_support/callbacks.rb:441:inblock in make_lambda' /opt/helpy-bundle/gems/activesupport-4.2.11.1/lib/active_support/callbacks.rb:342:in block in simple' /opt/helpy-bundle/gems/activesupport-4.2.11.1/lib/active_support/callbacks.rb:497:inblock in around' /opt/helpy-bundle/gems/activesupport-4.2.11.1/lib/active_support/callbacks.rb:505:in call' /opt/helpy-bundle/gems/activesupport-4.2.11.1/lib/active_support/callbacks.rb:92:inrun_callbacks__' /opt/helpy-bundle/gems/activesupport-4.2.11.1/lib/active_support/callbacks.rb:778:in _run_perform_callbacks' /opt/helpy-bundle/gems/activesupport-4.2.11.1/lib/active_support/callbacks.rb:81:inrun_callbacks' /opt/helpy-bundle/gems/activejob-4.2.11.1/lib/active_job/execution.rb:31:in perform_now' /opt/helpy-bundle/gems/activejob-4.2.11.1/lib/active_job/execution.rb:21:inexecute' /opt/helpy-bundle/gems/activejob-4.2.11.1/lib/active_job/queue_adapters/sucker_punch_adapter.rb:35:in perform' /opt/helpy-bundle/gems/sucker_punch-2.1.2/lib/sucker_punch/job.rb:60:inrun_perform' /opt/helpy-bundle/gems/sucker_punch-2.1.2/lib/sucker_punch/job.rb:38:in block in perform_async' /opt/helpy-bundle/gems/concurrent-ruby-1.1.6/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:353:inrun_task' /opt/helpy-bundle/gems/concurrent-ruby-1.1.6/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:342:in block (3 levels) in create_worker' /opt/helpy-bundle/gems/concurrent-ruby-1.1.6/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:325:inloop' /opt/helpy-bundle/gems/concurrent-ruby-1.1.6/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:325:in block (2 levels) in create_worker' /opt/helpy-bundle/gems/concurrent-ruby-1.1.6/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:324:incatch' /opt/helpy-bundle/gems/concurrent-ruby-1.1.6/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:324:in `block in create_worker'

sparrowme commented 2 years ago

I have the same issue, but the reason seems a bit different. I have confirmed settings in DB match admin all point to my server at 587 Using the web interface to open a ticket seems to trigger emails as expected, but pulling IMAP mail does not.

All IMAP mail fetching causes the below in the production.log

Starting at the end of a generated massage...

0eJ5ts46uSR63jmuipa2zqQsYJCdGnqpets5Ceq2I+cxbmq2u7kdeN5tJ+7h
zdRoZT3WR5D3stbpODkT1Zvtjv4zyHuddvOkjV2pRrPVbnd7vV7FJw6W/+y2
263mn2u8E9d/AcgnzBH5DA7YAAAAAElFTkSuQmCC

----==_mimepart_62b49282dedee_1b1f2afcb551365099993--

I, [2022-06-23T16:19:15.333045 #6943]  INFO -- : [ActiveJob] [ActionMailer::DeliveryJob] [df117652-38d4-45e7-81c0-c55a808da8bc] Performed ActionMailer::DeliveryJob from SuckerPunch(mailers) in 565.4ms
E, [2022-06-23T16:19:15.333393 #6943] ERROR -- : Sucker Punch job error for class: 'ActiveJob::QueueAdapters::SuckerPunchAdapter::JobWrapper' args: [{"job_class"=>"ActionMailer::DeliveryJob", "job_id"=>"df117652-38d4-45e7-81c0-c55a808da8bc", "queue_name"=>"mailers", "arguments"=>["NotificationMailer", "new_private", "deliver_now", 26], "locale"=>:en}]
Errno::EADDRNOTAVAIL Cannot assign requested address - connect(2) for "localhost" port 25