WeBWorK Main Forum

Problem with sending email from within webwork

Problem with sending email from within webwork

by Michael Nyenhuis -
Number of replies: 3

A student has notified me about errors when sending email from within webwork. Webwork knows the student's email, fills it in for the "From" field, but then produces an error message. I've been able to recreate the error by logging in as an admin and setting my email address in the Classlist Editor to anything ending in "@student.kpu.ca", while anything ending in "@kpu.ca" causes no problems. If I leave my email unset, and enter any email manually in the From field (making sure there is a domain name), it gets sent.

Any help would be appreciated.

Webwork was updated to 2.17 on RHEL in August 2022, and hasn't been updated since. Email was working fine until this month.

FYI, the complete error message is:


Failed to send message: 5.7.1 Unable to relay Trace begun at /usr/local/perlbrew/perls/perl-5.20.3/lib/site_perl/5.20.3/Email/Sender/Transport/SMTP.pm line 256 Email::Sender::Transport::SMTP::send_email('Email::Sender::Transport::SMTP=HASH(0x55cdd473a938)', 'Email::Abstract=ARRAY(0x55cddb17a6f0)', 'HASH(0x55cddb23b8d8)') called at /usr/local/perlbrew/perls/perl-5.20.3/lib/site_perl/5.20.3/Email/Sender/Role/CommonSending.pm line 45 Email::Sender::Role::CommonSending::try {...} at /usr/local/perlbrew/perls/perl-5.20.3/lib/site_perl/5.20.3/Try/Tiny.pm line 102 eval {...} at /usr/local/perlbrew/perls/perl-5.20.3/lib/site_perl/5.20.3/Try/Tiny.pm line 93 Try::Tiny::try('CODE(0x55cddb225478)', 'Try::Tiny::Catch=REF(0x55cddb18eee0)') called at /usr/local/perlbrew/perls/perl-5.20.3/lib/site_perl/5.20.3/Email/Sender/Role/CommonSending.pm line 58 Email::Sender::Role::CommonSending::send('Email::Sender::Transport::SMTP=HASH(0x55cdd473a938)', 'Email::Abstract=ARRAY(0x55cddb17a6f0)', 'HASH(0x55cddb1af248)') called at /usr/local/perlbrew/perls/perl-5.20.3/lib/site_perl/5.20.3/Email/Sender/Simple.pm line 119 Email::Sender::Simple::send_email('Email::Sender::Simple', 'Email::Abstract=ARRAY(0x55cddb17a6f0)', 'HASH(0x55cddb206e28)') called at /usr/local/perlbrew/perls/perl-5.20.3/lib/site_perl/5.20.3/Email/Sender/Role/CommonSending.pm line 45 Email::Sender::Role::CommonSending::try {...} at /usr/local/perlbrew/perls/perl-5.20.3/lib/site_perl/5.20.3/Try/Tiny.pm line 102 eval {...} at /usr/local/perlbrew/perls/perl-5.20.3/lib/site_perl/5.20.3/Try/Tiny.pm line 93 Try::Tiny::try('CODE(0x55cddb1fc4f8)', 'Try::Tiny::Catch=REF(0x55cddace2278)') called at /usr/local/perlbrew/perls/perl-5.20.3/lib/site_perl/5.20.3/Email/Sender/Role/CommonSending.pm line 58 Email::Sender::Role::CommonSending::send('Email::Sender::Simple', 'Email::MIME=HASH(0x55cddb1784e8)', 'HASH(0x55cdd473ac50)') called at /usr/local/perlbrew/perls/perl-5.20.3/lib/site_perl/5.20.3/Email/Stuffer.pm line 757 Email::Stuffer::send_or_die('Email::Stuffer=HASH(0x55cddb18c340)', 'HASH(0x55cddb279ec8)') called at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Feedback.pm line 280 WeBWorK::ContentGenerator::Feedback::try {...} at /usr/local/perlbrew/perls/perl-5.20.3/lib/site_perl/5.20.3/Try/Tiny.pm line 102 eval {...} at /usr/local/perlbrew/perls/perl-5.20.3/lib/site_perl/5.20.3/Try/Tiny.pm line 93 Try::Tiny::try('CODE(0x55cddb14c1a8)', 'Try::Tiny::Catch=REF(0x55cddb18e9d0)') called at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Feedback.pm line 290 WeBWorK::ContentGenerator::Feedback::body('WeBWorK::ContentGenerator::Feedback=HASH(0x55cddb19d888)', 'HASH(0x55cddb0d96f8)') called at /opt/webwork/webwork2/lib/WeBWorK/Template.pm line 154 WeBWorK::Template::template('/opt/webwork/webwork2/htdocs/themes/math4/system.template', 'WeBWorK::ContentGenerator::Feedback=HASH(0x55cddb19d888)') called at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator.pm line 599 WeBWorK::ContentGenerator::content('WeBWorK::ContentGenerator::Feedback=HASH(0x55cddb19d888)') called at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator.pm line 218 WeBWorK::ContentGenerator::go('WeBWorK::ContentGenerator::Feedback=HASH(0x55cddb19d888)') called at /opt/webwork/webwork2/lib/WeBWorK.pm line 371 WeBWorK::dispatch('Apache2::RequestRec=SCALAR(0x55cdd97ed718)') called at /opt/webwork/webwork2/lib/Apache/WeBWorK.pm line 99 eval {...} at /opt/webwork/webwork2/lib/Apache/WeBWorK.pm line 99 Apache::WeBWorK::handler('Apache2::RequestRec=SCALAR(0x55cdd97ed718)') called at -e line 0 eval {...} at -e line 0



In reply to Michael Nyenhuis

Re: Problem with sending email from within webwork

by Danny Glin -

If this was working recently and nothing has changed on your WeBWorK server then there is a good chance that it has something to do with your email provider.  Have you checked with your IT folks to see if they have changed any security settings on their SMTP servers?  You may need to have your WeBWorK server whitelisted to send messages.

Another thought: do @kpu.ca and @student.kpu.ca email addresses use different SMTP servers?  It's possible that the SMTP server that you have set in the WeBWorK config is now restricted to @kpu.ca email addresses, and is therefore rejecting messages from @student.kpu.ca email addresses.

In reply to Michael Nyenhuis

Re: Problem with sending email from within webwork

by Tim Alderson -

We are having the same problem.  Any update on what the cause/fix may have been?

In reply to Tim Alderson

Re: Problem with sending email from within webwork

by Tim Alderson -
Follow up: Danny's suggestion regarding SMTP did the trick. The IT folks fixed the issue later same day.