Installation

mail Relay access denied error after Ubuntu 18.04 upgrade (webwork 2.13)

mail Relay access denied error after Ubuntu 18.04 upgrade (webwork 2.13)

by George Jennings -
Number of replies: 4
Hi,

After we upgraded our webwork 2.13 server to Ubuntu 18.04 we discovered that students can't email their instructors. It used to work a few months ago, but now when I try it I get this error message

Failed to send message: 5.7.1 : Relay access denied Trace begun at /usr/share/perl5/Email/Sender/Transport/SMTP.pm line 218 Email::Sender::Transport::SMTP::send_email('Email::Sender::Transport::SMTP=HASH(0x56130729a718)', 'Email::Abstract=ARRAY(0x561307285778)', 'HASH(0x561307285dd8)') called at /usr/share/perl5/Email/Sender/Role/CommonSending.pm line 45 Email::Sender::Role::CommonSending::try {...} at /usr/share/perl5/Try/Tiny.pm line 102 eval {...} at /usr/share/perl5/Try/Tiny.pm line 93 Try::Tiny::try('CODE(0x56130736ecb8)', 'Try::Tiny::Catch=REF(0x56130727bd50)') called at /usr/share/perl5/Email/Sender/Role/CommonSending.pm line 58 Email::Sender::Role::CommonSending::send('Email::Sender::Transport::SMTP=HASH(0x56130729a718)', 'Email::Abstract=ARRAY(0x561307285778)', 'HASH(0x56130736ace0)') called at /usr/share/perl5/Email/Sender/Simple.pm line 119 Email::Sender::Simple::send_email('Email::Sender::Simple', 'Email::Abstract=ARRAY(0x561307285778)', 'HASH(0x56130727b3c0)') called at /usr/share/perl5/Email/Sender/Role/CommonSending.pm line 45 Email::Sender::Role::CommonSending::try {...} at /usr/share/perl5/Try/Tiny.pm line 102 eval {...} at /usr/share/perl5/Try/Tiny.pm line 93 Try::Tiny::try('CODE(0x561307285d48)', 'Try::Tiny::Catch=REF(0x561307277870)') called at /usr/share/perl5/Email/Sender/Role/CommonSending.pm line 58 Email::Sender::Role::CommonSending::send('Email::Sender::Simple', 'Email::Simple=HASH(0x561303e832a8)', 'HASH(0x561307285190)') called at /usr/share/perl5/Sub/Exporter/Util.pm line 18 Sub::Exporter::Util::__ANON__('Email::Simple=HASH(0x561303e832a8)', 'HASH(0x561307285190)') called at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Feedback.pm line 322 WeBWorK::ContentGenerator::Feedback::try {...} at /usr/share/perl5/Try/Tiny.pm line 102 eval {...} at /usr/share/perl5/Try/Tiny.pm line 93 Try::Tiny::try('CODE(0x561307277150)', 'Try::Tiny::Catch=REF(0x561307277138)') called at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Feedback.pm line 329 WeBWorK::ContentGenerator::Feedback::body('WeBWorK::ContentGenerator::Feedback=HASH(0x561305f916d0)', 'HASH(0x56130722c2a0)') called at /opt/webwork/webwork2/lib/WeBWorK/Template.pm line 155 WeBWorK::Template::template('/opt/webwork/webwork2/htdocs/themes/math4/system.template', 'WeBWorK::ContentGenerator::Feedback=HASH(0x561305f916d0)') called at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator.pm line 560 WeBWorK::ContentGenerator::content('WeBWorK::ContentGenerator::Feedback=HASH(0x561305f916d0)') called at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator.pm line 232 WeBWorK::ContentGenerator::go('WeBWorK::ContentGenerator::Feedback=HASH(0x561305f916d0)') called at /opt/webwork/webwork2/lib/WeBWorK.pm line 384 WeBWorK::dispatch('Apache2::RequestRec=SCALAR(0x561305d0b978)') called at /opt/webwork/webwork2/lib/Apache/WeBWorK.pm line 121 eval {...} at /opt/webwork/webwork2/lib/Apache/WeBWorK.pm line 121 Apache::WeBWorK::handler('Apache2::RequestRec=SCALAR(0x561305d0b978)') called at -e line 0 eval {...} at -e line 0

The mail.log reports

Sep 20 18:23:17 math postfix/smtpd[30563]: connect from localhost[127.0.0.1]
Sep 20 18:23:17 math postfix/smtpd[30563]: NOQUEUE: reject: RCPT from localhost[127.0.0.1]: 554 5.7.1 <gjennings@csudh.edu>: Relay access denied; from=<gjennings@localhost> to=<gjennings@csudh.edu> proto=ESMTP helo=<localhost.localdomain>
Sep 20 18:23:17 math postfix/smtpd[30563]: lost connection after RCPT from localhost[127.0.0.1]
Sep 20 18:23:17 math postfix/smtpd[30563]: disconnect from localhost[127.0.0.1] ehlo=1 mail=1 rcpt=0/1 commands=2/3

I can send mail out from the server using mutt so I think we're not being blocked.

I tested perl Email::sender using the script I found on
https://metacpan.org/pod/Email::Sender::Manual::QuickStart
to send a message out. That worked too.

Ubuntu 18.04 uses postfix to send mail.

If somebody has seen this problem and cured it please let me know!

Best,

George


In reply to George Jennings

Re: mail Relay access denied error after Ubuntu 18.04 upgrade (webwork 2.13)

by Michael Gage -
The upgrade to 2.13 involved switching over to Email::sender from Mail::sender and we changed a configuration item in site.conf. (See the release notes for 2.13). You might just check to make sure the appropriate change was made in your site.conf file. It wouldn't be automatically updated (although site.conf.dist would be updated).
In reply to Michael Gage

Re: mail Relay access denied error after Ubuntu 18.04 upgrade (webwork 2.13)

by George Jennings -
No, that wasn't the problem, unfortunately. We've been running webwork 2.13 for a while, and it worked fine before we upgraded the server to Ubuntu 18.04. I think something must be screwed up in the mail server's (it's postfix) configuration, which I really don't understand. I'll ask one of our IT people to take a look at that. If he cures the problem I'll post his cure here.
In reply to Michael Gage

Re: mail Relay access denied error after Ubuntu 18.04 upgrade (webwork 2.13)

by George Jennings -
Mike,
It turns out that there is a bug in the postfix package that was included in the Ubuntu 18.04 upgrade. The last line in the following report fixes the bug:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=892218

--George
In reply to George Jennings

Re: mail Relay access denied error after Ubuntu 18.04 upgrade (webwork 2.13)

by Siman Wong -
I've belatedly come upon this bug. As a unix non-expert I would appreciate a more precise description of how to patch this (quoted from the debian bug report):

Using dpkg-reconfigure postfix at a suitable priority and with an appropriate debconf front end installed (always true except in very, very minimal systems) will resolve it.