Issue with sending mail, msmtp

I recently configured msmtp on a pi (so i know its a valid configuration)
I tried to install msmtp on openwrt and copy over the configuration but receive this error

root@GL-MT6000:/etc# echo "hello there owen." | sendmail -a default
sendmail: /root/.msmtprc: line 1: unknown command GNU
root@GL-MT6000:/etc# cat msmtprc
# Set default values for all following accounts.
auth           on
tls            on
tls_trust_file /etc/ssl/certs/ca-certificates.crt
logfile        ~/.msmtp.log

# Gmail
account        gmail
port           587
tls_starttls   on
user           og
password       <app password>

# Set a default account
account default: gmail
root@GL-MT6000:/etc# cat mail.rc
set sendmail="/usr/bin/msmtp -t"

Ive googled the error but havnt really found anything.
any ideas?

Looks like sendmail is grabbing the configuration from /root/.msmtprc, instead of /etc/msmtprc:

sendmail: /root/.msmtprc: line 1: unknown command GNU

thank you, yes it was
and configuration file was there, but had a bad line (at position 1)
after fixing that line, mail works now

any idea where i would configure it to use the /etc config file?

See if sendmail has a parameter to specify the config file, 'sendmail -h' or 'sendmail--help' will probably give you a hint.

1 Like

thanks again
ya its kinda weird

root@GL-MT6000:~# sendmail -C --file=/etc/msmtprc

just hangs, nothing ever returns,
o well though as long as it works thats all that matters

is the demon running in the foreground, perhaps ?

add a & at the end of the command line.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.