Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add MAILFROM parameter #5

Open
vitalibertas opened this issue Nov 11, 2021 · 6 comments
Open

Add MAILFROM parameter #5

vitalibertas opened this issue Nov 11, 2021 · 6 comments

Comments

@vitalibertas
Copy link

vitalibertas commented Nov 11, 2021

Could you add the MAILFROM parameter to be used in addition to the MAILTO? Certain mail services require the FROM name to be the same as the username that is authenticated to send mail and will not send if the FROM is the usernm. See do_command.c line 432.

@vixie
Copy link
Owner

vixie commented Nov 12, 2021

in the sendmail interface used by cron to send job output, the header sender (From will default to the authenticated user. would your needs be met if this header sender was not transmitted, thus invoking the sendmail default?

i ask, because a MAILFROM variable would be wrong often, leading to either forged or lost email, and such a feature would be unpopular among system administrators. but, excluding the From: header would be fine, and i could add a setting for that.

@vitalibertas
Copy link
Author

I assume the sendmail default would be just fine. I only asked about MAILFROM because other forks like cronie use it.

@vixie
Copy link
Owner

vixie commented Nov 12, 2021

:-). for the record, this is not a fork. anyway if MAILFROM is in common use we should probably adopt it here. do you have ambition to submit a pull request that includes both code and documentation changes? if not i'll look for a round tuit.

@vitalibertas
Copy link
Author

I didn't mean to imply this was a fork -- I meant to imply forks of this software have it. However, I'm not sure it is common use. If you search for MAILFROM in the context of cron or crontab, it's hard to find. I think your suggestion could be just as helpful to allow for the use of the default sendmail header sender. I actually found MAILFROM by accident because of my issue with using Ubuntu Server and Nullmailer sending to Microsoft Exchange.

Unfortunately, I do not have the knowledge of C, or I would absolutely submit a PR.

@vixie
Copy link
Owner

vixie commented Jan 29, 2023

can you extract the documentation which defines MAILFROM and post it here?

@BrianInglis
Copy link

Just passing, checking for known issues for a Cygwin user, so thought I'd supply:
man7 5 crontab

Otherwise, mail is sent to the owner of the crontab. This option
is useful if you decide to use /bin/mail instead of
/usr/lib/sendmail as your mailer. Note that /bin/mail does not
provide aliasing and UUCP usually does not read its mail. If
MAILFROM is defined (and non-empty), it is used as the envelope
sender address, otherwise, ``root'' is used.
(Note: Both MAILFROM and MAILTO variables are expanded, so
setting them as in the following example works as expected:
MAILFROM=cron-$[email protected] ($USER is replaced by the system
user) )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants