<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Cannot send mail in crontab in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/cannot-send-mail-in-crontab/m-p/5069304#M438472</link>
    <description>MANPATH, COLUMNS, EDITOR, HISTFILE, ERASE, PS1, TERM, LINES&lt;BR /&gt;&amp;gt;I don't think this will be important...&lt;BR /&gt;&lt;BR /&gt;It doesn't seem like it.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;for the output of /tmp/testemailx.err is&lt;BR /&gt;ttytype: couldn't open /dev/tty for reading&lt;BR /&gt;stty: : Not a typewriter&lt;BR /&gt;&lt;BR /&gt;You need to clean up your .profile and /etc/profile to not execute stty and ttytype if you are not interactive.  You can guard it by either:&lt;BR /&gt;if [ "${-%%*i*}" != "$-" ]; then&lt;BR /&gt;if tty -s; then&lt;BR /&gt;&lt;BR /&gt;&amp;gt;I also tried with sendmail comand in the script&lt;BR /&gt;&lt;BR /&gt;If you can echo something after sendmail, then it would show the issue with the mail system and not cron.</description>
    <pubDate>Wed, 19 Sep 2007 05:54:47 GMT</pubDate>
    <dc:creator>Dennis Handly</dc:creator>
    <dc:date>2007-09-19T05:54:47Z</dc:date>
    <item>
      <title>Cannot send mail in crontab</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cannot-send-mail-in-crontab/m-p/5069300#M438468</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;In command line I send mail do internet addresses but when i put the same command in crontab it doesn’t work.&lt;BR /&gt;&lt;BR /&gt;Can anybody tell me why?&lt;BR /&gt;&lt;BR /&gt;It is HP-UX 11.23&lt;BR /&gt;&lt;BR /&gt;the content of the script testemailx is:&lt;BR /&gt;&lt;BR /&gt;su - username -c "/usr/bin/rm /tmp/obj_create.out; sqlplus '/as sysdba' @ /cron_scripts/obj_create.sql;"&lt;BR /&gt;/usr/bin/mailx -s "TestMailx " name@somewhere.com &amp;lt; /tmp/obj_create.out &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;the line in crontab:&lt;BR /&gt;* * * * * /tmp/testemailx &amp;gt; /tmp/testemailx.out  2&amp;gt;/tmp/testemailx.err&lt;BR /&gt;</description>
      <pubDate>Tue, 18 Sep 2007 12:19:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cannot-send-mail-in-crontab/m-p/5069300#M438468</guid>
      <dc:creator>Margarida Brito</dc:creator>
      <dc:date>2007-09-18T12:19:13Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot send mail in crontab</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cannot-send-mail-in-crontab/m-p/5069301#M438469</link>
      <description>Well, the simple answer is that not all environmental variables are set when running through cron.&lt;BR /&gt;Try adding any obvious envirnmental variables to the script as well as full paths to any command you are using.&lt;BR /&gt;&lt;BR /&gt;Regards, &lt;BR /&gt;&lt;BR /&gt;-dl</description>
      <pubDate>Tue, 18 Sep 2007 12:40:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cannot-send-mail-in-crontab/m-p/5069301#M438469</guid>
      <dc:creator>Dave La Mar</dc:creator>
      <dc:date>2007-09-18T12:40:46Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot send mail in crontab</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cannot-send-mail-in-crontab/m-p/5069302#M438470</link>
      <description>Anything in /tmp/testemailx.err?&lt;BR /&gt;You seem to have absolute paths for everything except sqlplus.&lt;BR /&gt;&lt;BR /&gt;Do you have read permission on /tmp/obj_create.out, created by a different user?</description>
      <pubDate>Tue, 18 Sep 2007 20:44:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cannot-send-mail-in-crontab/m-p/5069302#M438470</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-09-18T20:44:23Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot send mail in crontab</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cannot-send-mail-in-crontab/m-p/5069303#M438471</link>
      <description>environmental variables:&lt;BR /&gt;I make in the script env &amp;gt; /tmp/testeMailxEnv and the result is the same as my user env, except for the following variables:&lt;BR /&gt;MANPATH, COLUMNS, EDITOR, HISTFILE, ERASE, PS1, TERM, LINES&lt;BR /&gt;I don't think this will be important...&lt;BR /&gt;&lt;BR /&gt;for the output of /tmp/testemailx.err is&lt;BR /&gt;ttytype: couldn't open /dev/tty for reading&lt;BR /&gt;stty: : Not a typewriter&lt;BR /&gt;Not a terminal&lt;BR /&gt;stty: : Not a typewriter&lt;BR /&gt;stty: : Not a typewriter&lt;BR /&gt;&lt;BR /&gt;Yes I have permissions for /tmp/obj_create.out&lt;BR /&gt;&lt;BR /&gt;I also tried with sendmail comand in the script but the result was the same, no mail was send.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 19 Sep 2007 05:27:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cannot-send-mail-in-crontab/m-p/5069303#M438471</guid>
      <dc:creator>Margarida Brito</dc:creator>
      <dc:date>2007-09-19T05:27:54Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot send mail in crontab</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cannot-send-mail-in-crontab/m-p/5069304#M438472</link>
      <description>MANPATH, COLUMNS, EDITOR, HISTFILE, ERASE, PS1, TERM, LINES&lt;BR /&gt;&amp;gt;I don't think this will be important...&lt;BR /&gt;&lt;BR /&gt;It doesn't seem like it.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;for the output of /tmp/testemailx.err is&lt;BR /&gt;ttytype: couldn't open /dev/tty for reading&lt;BR /&gt;stty: : Not a typewriter&lt;BR /&gt;&lt;BR /&gt;You need to clean up your .profile and /etc/profile to not execute stty and ttytype if you are not interactive.  You can guard it by either:&lt;BR /&gt;if [ "${-%%*i*}" != "$-" ]; then&lt;BR /&gt;if tty -s; then&lt;BR /&gt;&lt;BR /&gt;&amp;gt;I also tried with sendmail comand in the script&lt;BR /&gt;&lt;BR /&gt;If you can echo something after sendmail, then it would show the issue with the mail system and not cron.</description>
      <pubDate>Wed, 19 Sep 2007 05:54:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cannot-send-mail-in-crontab/m-p/5069304#M438472</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-09-19T05:54:47Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot send mail in crontab</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cannot-send-mail-in-crontab/m-p/5069305#M438473</link>
      <description>the output from sendmail is one:&lt;BR /&gt;&lt;BR /&gt;username@somewhere.com... Connecting to proxymail.domain.com via relay...&lt;BR /&gt;220 proxyserver.domain.com Microsoft ESMTP MAIL Service, Version: 6.0.3790.1830 ready at  Wed, 19 Sep 2007 11:58:53 +0100&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; EHLO server.domain.com&lt;BR /&gt;250-proxyserver.domain.com Hello [110.111.134.140]&lt;BR /&gt;250-AUTH GSSAPI NTLM&lt;BR /&gt;250-TURN&lt;BR /&gt;250-SIZE 15728640&lt;BR /&gt;250-ETRN&lt;BR /&gt;250-PIPELINING&lt;BR /&gt;250-DSN&lt;BR /&gt;250-ENHANCEDSTATUSCODES&lt;BR /&gt;250-8bitmime&lt;BR /&gt;250-BINARYMIME&lt;BR /&gt;250-CHUNKING&lt;BR /&gt;250-VRFY&lt;BR /&gt;250 OK&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; MAIL From:&lt;ROOT&gt; SIZE=16 AUTH=root@+81w.domain.com&lt;BR /&gt;250 2.1.0 root@server.domain.com....Sender OK&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; RCPT To:&lt;USERNAME&gt;&lt;BR /&gt;250 2.1.5 username@somewhere.com&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; DATA&lt;BR /&gt;354 Start mail input; end with &lt;CRLF&gt;.&lt;CRLF&gt;&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; .&lt;BR /&gt;250 2.6.0  &amp;lt;200709191100.l8JB00a11727@server.domain.com&amp;gt; Queued mail for delivery&lt;BR /&gt;username@somewhere.com... Sent ( &amp;lt;200709191100.l8JB00a11727@server.domain.com&amp;gt; Queued mail for delivery)&lt;BR /&gt;Closing connection to proxymail.domain.com&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; QUIT&lt;BR /&gt;221 2.0.0 proxyserver.domain.com Service closing transmission channel&lt;/CRLF&gt;&lt;/CRLF&gt;&lt;/USERNAME&gt;&lt;/ROOT&gt;</description>
      <pubDate>Wed, 19 Sep 2007 07:48:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cannot-send-mail-in-crontab/m-p/5069305#M438473</guid>
      <dc:creator>Margarida Brito</dc:creator>
      <dc:date>2007-09-19T07:48:49Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot send mail in crontab</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cannot-send-mail-in-crontab/m-p/5069306#M438474</link>
      <description>ok it is now working.&lt;BR /&gt;The output of sendemail helped.&lt;BR /&gt;&lt;BR /&gt;I edit the /etc/mail/sendmail.cf&lt;BR /&gt;&lt;BR /&gt;where is was &lt;BR /&gt;# class E: names that should be exposed as from this host, even if we masquerade&lt;BR /&gt;CE root&lt;BR /&gt;I change to&lt;BR /&gt;CE&lt;BR /&gt;&lt;BR /&gt;where it was &lt;BR /&gt;# class L: names that should be delivered locally, even if DH is set&lt;BR /&gt;CL root&lt;BR /&gt;I change to&lt;BR /&gt;CL&lt;BR /&gt;&lt;BR /&gt;Thanks for the input.&lt;BR /&gt;</description>
      <pubDate>Wed, 19 Sep 2007 11:13:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cannot-send-mail-in-crontab/m-p/5069306#M438474</guid>
      <dc:creator>Margarida Brito</dc:creator>
      <dc:date>2007-09-19T11:13:27Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot send mail in crontab</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cannot-send-mail-in-crontab/m-p/5069307#M438475</link>
      <description>The solution is in the above message</description>
      <pubDate>Wed, 19 Sep 2007 11:33:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cannot-send-mail-in-crontab/m-p/5069307#M438475</guid>
      <dc:creator>Margarida Brito</dc:creator>
      <dc:date>2007-09-19T11:33:11Z</dc:date>
    </item>
  </channel>
</rss>

