• Re: [gentoo-user] /etc/crontab - sending notification to a different us

    From Joost Roeleveld@21:1/5 to All on Tue Aug 27 09:20:01 2024
    ----------------------- Original message -----------------------
    From: syscon edm <[email protected] >
    To: [email protected]
    Date: Tue, 27 Aug 2024 07:10:18 +0200 ----------------------------------------------------------------


    In "/etc/crontab" I have:

    # for cronie

    # Global variables
    SHELL=/bin/bash
    PATH=/sbin:/bin:/usr/sbin:/usr/bin
    MAILTO=syscon8
    HOME=/

    But when it run a cron-job, the email is still going to "mailto:[email protected] " instead of mailto:[email protected]

    How to adjust the entry to the email notification will go to a specific user.

    Specify the full email address instead of just a username.

    --
    Joost

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From J. Aho@21:1/5 to syscon edm on Tue Aug 27 22:20:01 2024
    On 27/08/2024 19.09, syscon edm wrote:
    That is not it.

    I changed in /etc/crontab
    MAILTO=[email protected] <mailto:[email protected]>

    restart cronie but system is still emailing it to [email protected] <mailto:[email protected]>

    What job is run? Some jobs has their own configuration to where the mail
    is sent.
    You could give an example...

    --
    //Aho

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael@21:1/5 to All on Sat Aug 31 17:56:15 2024
    On Tuesday, 27 August 2024 21:14:56 BST J. Aho wrote:
    On 27/08/2024 19.09, syscon edm wrote:
    That is not it.

    I changed in /etc/crontab
    MAILTO=[email protected] <mailto:[email protected]>

    Does it work if you try:

    MAILTO="[email protected]"


    restart cronie but system is still emailing it to [email protected] <mailto:[email protected]>

    What job is run? Some jobs has their own configuration to where the mail
    is sent.
    You could give an example...


    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCAAdFiEEXqhvaVh2ERicA8Ceseqq9sKVZxkFAmbTSy8ACgkQseqq9sKV ZxnNFw//eH4XpuWS3TaRdh2eitIRe4ye7H+WpzBVmBdBxmPSL6IorwEWNcRKfGmI PJ8uLVrBUZ/z88aFFMSAxrjeKCcXMGnwQsBc7/VOoValMJvEd8YHDJsv1Ll8UCpl AIEwePKsu6craYOGHvxLDfL1fF0KdKV/qM9CCEYuYUQxP6EusSQL+E7byvaLfms6 nVhs2hFXj2ivsubzBPgNPWxtltlSCrtGb9jns0J7GP+XiMmDVjKXT7MVcw7VSZ+t TalVrhThjrQYwUCIhBgg0FzqyA1NplHu59IVz4e202m/Oqz892obeFWZkMTQSJxU mdrHVL+xnOtVsSXaqFhAxJvAP56awx4QxgTUvuZq6mIwMK8el6KyX1yKJPLQjmdc /f+4ppx+CIuia75WV20xT0N5vp9tRUegS9hHQZ6hyWOzQnWFXLviqmrV0f+6T7zh jyh/5f1zBtBYiSPtujsPgfJcpYziPXyor57zfPzucAZdYtcciDqwKkF1bMDor+HY 2T3CP9eGswHVkcJSSfIi6N49/vAHHyXDdeE2ZMaYkngDM526REvc7TUVK486wsMY B8dIs/cZzCUCfdF9OXl7r81yrcAY5hxwS1eq61QfodSUBELgTpnZzWvy/k4Zrw7c Z7WWVksdZ1DtT9xPyy6m8wAqx4DLgcKahZ/vZ3TcIyAG50GSKt4=
    =yJGq
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From ralfconn@21:1/5 to All on Sat Aug 31 19:30:01 2024
    Il 27/08/24 07:10, syscon edm ha scritto:
    In "/etc/crontab" I have:
    # for cronie

    # Global variables
    SHELL=/bin/bash
    PATH=/sbin:/bin:/usr/sbin:/usr/bin
    MAILTO=syscon8
    HOME=/

    But when it run a cron-job, the email is still going to "[email protected] <mailto:[email protected]>" instead of [email protected] <mailto:[email protected]>

    How to adjust the entry to the email notification will go to a specific
    user.

    I suppose you want email delivered through an external email server. I
    had to configure the MTA for that, nullmailer in my case, it's not
    cronie's job.

    raffaele

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael@21:1/5 to All on Sat Aug 31 20:16:03 2024
    On Saturday, 31 August 2024 20:11:34 BST syscon edm wrote:
    MAILTO="[email protected]"

    MAILTO="[email protected]"
    MAILTO='[email protected]'
    MAILTO=syscon8

    I've tried single quote, double quotes, but it doesn't work; now even
    without quotes I don't get email from cronie
    After every change I restart "/etc/init.d/cronie restart

    My simple cron entry:
    55 12 * * 1-5 mv /var/spool/asterisk/monitor/* /home/thelma/mon/

    I should receive email from cron

    What errors do you get from your MTA in your logs? Increase verbosity if you need to get more info.
    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCAAdFiEEXqhvaVh2ERicA8Ceseqq9sKVZxkFAmbTa/MACgkQseqq9sKV ZxltNRAAqLtnPqMHot7TIrlmnQi+kwL2kZ/xt/dNrVd8FDs4igAfE9aWdLacu5Vi Ob/gRbZLMmhSb5AXNU0qiRqyzH8GEjDgZYl/3MSgWXl54YNbz55DcNRNNgfyG6vW R2Zj4YxBkWe41LKke2Fcyas769KjO5NZPGzX+txOpB+g2d3GPCuNy0bUNVg2jJ7n ZAbMBj2Px1V64NMyP+1YFSfjTtUV9bW92nADxU5I+f5Nv1sNVP4aPiavlKx0lVUY dHNNvp8dkntSTVDzahUTgWBofx1A3b5v2hRXE+P7r6yXw4j5jlRyYSVOZPyKMOGF 38MQl7riP05e+TALL9mBOtQ7J+pZfpiftKcm1XWprCG4p1zrQqLQ4TgvohwvF27u o0CE8aTSgKs3zB0uMtD0di7NQo81eCkXeqiL5gUvlTwLe/gwUGYytMfcGAtBBR2f FUv9miuV9DXW58pTKcoP2Xahn9f4OGjnyl0j5BHWzxlXvcXO02SdHcSrYZTSWsU0 cBhp4pbDVyCRhcFMqbUhs3P2UySW9tf22JSaBbDXJxwSL9yUKmOnoNonUX3DB5T3 oKEoYFtR525+tjaPr1dXahFMV6PeQdMql0Fz2xggGlyCau1754nOR24xnF1uLiRz EETdPgGvdMHGHIFgSSHiA72dJjP2dMj7GqL53WZ4elVQ3mt2Jco=
    =T5wm
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael@21:1/5 to All on Sat Aug 31 21:16:03 2024
    On Saturday, 31 August 2024 20:34:49 BST syscon edm wrote:
    Sorry, the cron entry should be:
    55 12 * * * mv /var/spool/asterisk/monitor/* /home/thelma/mon/
    1-5 is Monday to Friday

    mail.log:

    Aug 31 13:24:01 i5 postfix/qmgr[32301]: 0880F17E00EB: from=< [email protected]>, size=699, nrcpt=1 (queue active)
    Aug 31 13:24:02 i5 postfix/smtp[9110]: 0880F17E00EB: to=<[email protected]>, orig_to=<root>,

    You probably have in your /etc/postfix/main.cf:

    myorigin = $some_user@some_domain.com

    where some_user@some_domain.com is not [email protected], but root@*?


    relay=smtp.gmail.com[142.250.99.108]:587, delay=1.3, delays=0.02/0.01/0.55/0.68, dsn=2.0.0, status=sent (250 2.0.0 OK
    1725132231 98e67ed59e1d1-2d85b0fdf44sm6088797a91.6 - gsmtp)
    Aug 31 13:24:02 i5 postfix/qmgr[32301]: 0880F17E00EB: removed

    Gmail is accepting the mail but it is sending to "root" instead of "syscon8"

    My cat /etc/mail/aliases
    # Basic system aliases -- these MUST be present.
    MAILER-DAEMON: postmaster
    postmaster: root

    # General redirections for pseudo accounts.
    adm: root
    bin: root
    daemon: root
    exim: root
    lp: root
    mail: root
    named: root
    nobody: root
    postfix: root

    # Well-known aliases -- these should be filled in!
    root: [email protected]
    fd: [email protected]
    # operator:

    # Standard RFC2142 aliases
    abuse: postmaster
    ftp: root
    hostmaster: root
    news: usenet
    noc: root
    security: root
    usenet: root
    uucp: root
    webmaster: root
    www: webmaster

    You can grep your postfix files for root and root@ to find the culprit. It seems your postfix configuration is rewriting the 'Send As' name, if not whole address. My Postfix knowledge is rather out of date, but current users should be able to advise with a specific fix for this problem.

    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCAAdFiEEXqhvaVh2ERicA8Ceseqq9sKVZxkFAmbTegMACgkQseqq9sKV Zxmkjg/+PxsuPknxHloVFfyeoX4tRMg3nbC1ecPJgjuIjhT/dRx1VH5/yHoWAixy +/5Uh/Np50WYnrGTv7NapzFwEg0Fa+msU0PtSMfaW3lUWYHteF1ICigqsxOZF1LG qBvbdl0c1MIf4N4jaJw9+KCYDklnBgY6IPsfppOY2QlBQnN2M5C60aILuAiSMi1O /Ns0l0YBmfEIS34nFpj1Bqcj1hE8uv7uFbUF5TBfC7X1/wiJbce1H+/9Jm6DsYQk FO+NMRXF7DDmBSOCNhl1hIwqBbHproSl9AMRGBu8dwAFCw7K7q2UMVLjy+EBB4LD vf874tNSoAdTaRv/IF3Qua83cjqnKYgdiZOU49WCueeuJ/cG8B44+pOx4Glgww+C LFWw9RnHOypBI0VtrgeYuIptHJO05dcBdvcIKukA4R0ALoOHJDgXMtnbJcwOCUxz q6VjxC5gj79Rpcx/7NPSwfZ8apJckZK5sppZ8KGEtxnIJULl7++Nce12o8KpfSgB XFhfepqLREET90YY5cgH09Ck0EH2+sBWBLrO7U3kfIK65WiDuneyunGRj/3FnrVI vVpM03hh0nLTg7gYXg3+dxlHvLW7+RtbYtqupAynrAMkMzQQfInPGjFLcimdhmF+ tFXfHt7AckpB9whsUfWe40HfVOmztFm/2r5phOAIZ/IAVlzikG8=
    =uAk0
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael@21:1/5 to All on Sun Sep 1 10:23:35 2024
    On Saturday, 31 August 2024 21:56:59 BST syscon edm wrote:
    In /etc/postfix/main.cf I only have:

    myorigin = gmail.com

    If I use:
    myorigin = [email protected]

    I get an error message;
    Aug 31 14:28:02 i5 postfix/smtp[25841]: 1A31217E00EC: to=<root@syscon8@ gmail.com>,

    OK, I expect you'd need to set an alias instead. Try:

    My cat /etc/mail/aliases
    # Basic system aliases -- these MUST be present.
    # Redirect mail for local recipients
    MAILER-DAEMON: postmaster
    postmaster: root
    root: syscon8

    or try:

    root: [email protected]


    then run 'newaliases' each time to rebuild the database. One of these aliases ought to work.


    relay=smtp.gmail.com[142.250.99.109]:587, delay=0.54,
    delays=0.01/0/0.5/0.03, dsn=5.1.3, status=bounced (host smtp.gmail.com[142.250.99.109]
    said: 553-5.1.3 The recipient address <root@[email protected]> is not a
    valid RFC 553-5.1.3 5321 address.

    my /etc/postfix/sender_canonical
    /^root@gmail\.com$/ [email protected]

    I don't think you should be using canonical - this will be rewriting addresses within the header *and* body of messages.

    Use an alias instead.



    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCAAdFiEEXqhvaVh2ERicA8Ceseqq9sKVZxkFAmbUMpcACgkQseqq9sKV ZxnTIg//dh8C+wRepr8Ubi8oxq1dDN4fq7ACn0jGPN4HluSE9e4uMVHkgzMga0HJ 7fXBUb1XaqQC0T6aY7PzQSsMdQ66ut7uwuZNx0/BV0euZQi+aTRSwHBuIOlIhc0p xDy3JvafFLN3Mp7r3YPA1qSoB/XnYTaXTnFyA4e0EgLvnBHIcPIakpPFjOaEI82i 433y+O+S/pmT2ZAAlnSAjk065wdxbck5YfSyMWpMa09HM1/ehp0ifjPVW5bQ7sG9 IPV5y76UOnAg5UBFVvdlIr/f+ct4wrjAOZrRyHxI/4I4wcboI/msr/Uq9Z1vldKF 6XagiOkMvIqxxP7vDo/nE5TnEuYirzZdIW5o9gB078H4DFCBzr3L469ogp+7UxAe ZpAVd8Ta+xjvwgqVdKSZfXmJemvNq/fNego/Uv69EWlC+NPEQ52EaaDVaGp+N8N1 3R08jbcwuhHVmJ+PZzW8hhSCWiSCiiQhO48kTiAXSlu00TQIG1G0II1J4M6izSM+ OH8icE3AsBL6XEnH8EM5jD/pvSoxtHepZNPOZBW3lYqtKGpzQlCfEZ/R2peDUVCF cptT/hzjaEdV6ng2EPwlrXKCTdChn3aUnjiaYDB+vRSx6bSjTSLqWFijbxWyqtyt +oColTrSiZAMJRL7AKBhH+KMTFCU9PCSjusgtWocF56KTnavhiQ=
    =avCV
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)