Thanks Lonnie

Interestingly all my other mails have a from address of 
r...@ipcsolutions.com.au but from my script its 3...@ipcsolutions.com.au and 
being rejected by my mail server. What specifies the from address?

e.g.
Sep 30 09:32:38 3999-IBCBuild-CM1 mail.err msmtp: host=smtp.ipcsolutions.com.au 
tls=on auth=on user=nore...@ipcsolutions.com.au from=3...@ipcsolutions.com.au 
recipients=r...@ipcsolutions.com.au smtpstatus=550 smtpmsg='550 5.7.60 SMTP; 
Client does not have permissions to send as this sender 
[SYAPR01MB2430.ausprd01.prod.outlook.com]' errormsg='the server did not accept 
the mail' exitcode=EX_UNAVAILABLE
Sep 30 09:32:38 3999-IBCBuild-CM1 mail.info msmtpqueue: (69) msmtp: the server 
did not accept the mail msmtp: server message: 550 5.7.60 SMTP; Client does not 
have permissions to send as this sender 
[SYAPR01MB2430.ausprd01.prod.outlook.com] msmtp: could not send mail (account 
default from /etc/msmtprc)
Sep 30 09:32:38 3999-IBCBuild-CM1 mail.info msmtpqueue: Failure: Keeping mail 
queue /var/spool/mail/2018-09-30-09.29.46-0 msmtp/mail pair.

Regards
Michael Knill

On 30/9/18, 9:21 am, "Lonnie Abelbeck" <li...@lonnie.abelbeck.com> wrote:

    Hi Michael,
    
    You probably got the one of the envelope addresses wrong.
    
    Here is an example where I email myself a note whenever my main AstLinux 
box is rebooted...
    --
    #!/bin/sh
    
    . /etc/rc.conf
    
    mail -r "REBOOT-$HOSTNAME <nore...@abelbeck.com>" -s "Rebooted at 
'$HOSTNAME'" m...@example.com <<EOF
    Rebooted at '$HOSTNAME'
    
    [Generated at $(date "+%H:%M:%S on %B %d, %Y")]
    EOF
    --
    
    Here are the "mail" options ...
    
    $ mail --help
    --
    
    Usage: mail [options...] to_addr
    
    Options:
      -a file      Attach the given file to the message. (Multiple allowed)
      --mime type  Optionally define the MIME Type of each attached file. 
(Multiple allowed)
      -b address   Send blind carbon copies to a comma-separated list of email 
addresses.
      -c address   Send carbon copies to a comma-separated list of email 
addresses.
      -e           Check if mail is present. (Always exit status of "1")
      -H           Print header summaries for all messages and exit. (Always no 
mail)
      -r address   Define the From address.
      -S var=val   Sets the internal option variable, from= and replyto= are 
supported.
      -s subject   Define the subject text.
      -t           The sending message is expected to contain "To:", "Cc:" or 
"Bcc:" fields.
      -u user      Reads the mailbox of the given user name. (Always no mail)
      -V           Print version and exit.
      -v           Verbose mode.
      --help       Show this help text
                   Note: Additional mail/mailx options are silently ignored for 
compatibility.
    --
    
    This is particularly handy if you want to attach a file(s) with one or more 
-a file pairs.
    
    Test from the command-line.
    
    Lonnie
    
    
    > On Sep 29, 2018, at 6:00 PM, Michael Knill 
<michael.kn...@ipcsolutions.com.au> wrote:
    > 
    > Hi group
    >  
    > Sorry this is probably an easy one.
    > I am sending mail from my tarsnap script using the mail command and it 
just ends up in the mail spool and does not send.
    > What am I doing wrong?
    >  
    > Regards
    > Michael Knill
    > _______________________________________________
    > Astlinux-users mailing list
    > Astlinux-users@lists.sourceforge.net
    > https://lists.sourceforge.net/lists/listinfo/astlinux-users
    > 
    > Donations to support AstLinux are graciously accepted via PayPal to 
pay...@krisk.org.
    
    
    
    _______________________________________________
    Astlinux-users mailing list
    Astlinux-users@lists.sourceforge.net
    https://lists.sourceforge.net/lists/listinfo/astlinux-users
    
    Donations to support AstLinux are graciously accepted via PayPal to 
pay...@krisk.org.
    


_______________________________________________
Astlinux-users mailing list
Astlinux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/astlinux-users

Donations to support AstLinux are graciously accepted via PayPal to 
pay...@krisk.org.

Reply via email to