Bug 1225597

Summary: /usr/sbin/sendmail: line 83: return: can only `return' from a function or sourced script
Product: [Fedora] Fedora Reporter: Aaron Knowles <aaronknowles79>
Component: esmtpAssignee: Jaroslav Škarvada <jskarvad>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: 23CC: itamar, jskarvad, mlichvar, pertusus, smparrish
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Unspecified   
Whiteboard:
Fixed In Version: esmtp-1.0-15.fc23 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-28 13:58:58 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Patch to correct bug none

Description Aaron Knowles 2015-05-27 18:33:40 UTC
Created attachment 1030744 [details]
Patch to correct bug

Description of problem:
The esmtp-wrapper script reports "line 83: return: can only `return' from a function or sourced script" when it fails to queue a message.  For example, when it's affected by bug 1202562.

Version-Release number of selected component (if applicable):
1.0-13.fc22

How reproducible:
Always

Steps to Reproduce:
1. Ensure sendmail is linked to /usr/bin/esmtp-wrapper
2. unset HOME
3. echo 'Test' | sendmail root

Actual results:
The "line 83" error message appears due to the esmtp-wrapper script attempting to return in response to the queue_mail function failing.

Expected results:
The script should be calling exit instead of return in this instance.

Additional info:
I've attached a unified diff patch to correct the error in the script.

Comment 1 Jan Kurik 2015-07-15 14:06:00 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 23 development cycle.
Changing version to '23'.

(As we did not run this process for some time, it could affect also pre-Fedora 23 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 23 End Of Life. Thank you.)

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora23

Comment 2 Fedora Admin XMLRPC Client 2016-02-12 18:21:08 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 3 Fedora Admin XMLRPC Client 2016-02-14 23:18:25 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 4 Jaroslav Škarvada 2016-07-28 13:58:58 UTC
Thanks for the report it's already fixed in:
esmtp-1.0-15.fc23