sh shell 电子邮件 var/usr/email/dave 转发

发布于 2024-08-17 19:12:26 字数 325 浏览 4 评论 0原文

我是 openSuse 11.1 的新手,我有几个正在运行的 crontab 作业,其中一个每天都会创建一个动态的“at”作业列表。有没有办法将“sh”shell 发送到 /var/usr/email/dave 的电子邮件转发到其他电子邮件地址,我的研究结果一片空白,主要是因为我不确定我在看什么为了。如果有人能提供帮助,请欢呼。

自从研究了这一点以来,当在 /bin/sh shell 中执行脚本后从 perl 打印时, /bin/sh 将打印输出通过电子邮件发送到 /var/usr/mail/dave ,我想简单地将这封电子邮件转发到其他 pop3 帐户,一个其中可以通过我的手机访问。我很抱歉我原来的问题不够清楚

I'm new to openSuse 11.1, I have several crontab jobs running, one of which creates a dynamic list of 'at' jobs each day. Is there a way for the emails which the 'sh' shell sends to /var/usr/email/dave to be forwarded to other email addresses, my research has come up blank, mainly because I'm not sure what I'm looking for. Cheers if anyone can help.

Since looking into this, when printing from perl after script executed in /bin/sh shell, /bin/sh emails the printout to /var/usr/mail/dave, I would like to simple forward this email to other pop3 accounts, one of which is accessible by my phone. My apologies my original question wasn't clear enough

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

遮云壑 2024-08-24 19:12:26

crontab 文件中的 MAILTO 环境变量设置为您希望接收邮件的用户的名称。如果不存在,请添加它。

来自 man 5 crontab

       In addition to LOGNAME, HOME, and SHELL, cron(8) will look at MAILTO if
       it  has  any  reason  to  send  mail as a result of running commands in
       ``this'' crontab.  If MAILTO is defined (and non-empty), mail  is  sent
       to the user so named.  MAILTO may also be used to direct mail to multi‐
       ple recipients by separating recipient users with a comma. If MAILTO is
       defined but empty (MAILTO=""), no mail will be sent.  Otherwise mail is
       sent to the owner of the crontab.

Set the MAILTO environment variable in the crontab file to the name of the user you'd like to receive the mail. Add it if it's not there.

From man 5 crontab:

       In addition to LOGNAME, HOME, and SHELL, cron(8) will look at MAILTO if
       it  has  any  reason  to  send  mail as a result of running commands in
       ``this'' crontab.  If MAILTO is defined (and non-empty), mail  is  sent
       to the user so named.  MAILTO may also be used to direct mail to multi‐
       ple recipients by separating recipient users with a comma. If MAILTO is
       defined but empty (MAILTO=""), no mail will be sent.  Otherwise mail is
       sent to the owner of the crontab.
梦在深巷 2024-08-24 19:12:26

如果您想转发戴夫的所有邮件,请查看简单的 .forward 文件是否有效。

如果您想对此有所选择,请研究 procmail。

If you want to forward all of dave's mail, see if a simple .forward file works.

If you want to be selective about it, investigate procmail.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文