I'm struggling to find a solution. I installed heirloom-mailx and msmtp following this site. I can send emails (using gmail) as root user. The problem is with non-root user: the messages go to a queue folder (/var/spool/mqueue) and never are sent.

I have little experience with linux. Could you help me?

System: Cubieboard 1 - Armbian Legacy Jessie server 3.4.112

set sendmail="/usr/bin/msmtp"
set message-sendmail-extra-arguments="-a gmail"
#Gmail account
logfile ~/msmtp.log

account gmail
auth on
host smtp.gmail.com
from XXX@gmail.com
auth on
tls on
# tls_trust_file /etc/ssl/cert.pem
tls_trust_file /usr/share/ca-certificates/mozilla/Equifax_Secure_CA.crt
user XXX@gmail.com
password XXX
port 587

account default : gmail
Oct 30 21:08:52 localhost sm-mta[4429]: u9U129DY004614: to=<XXX@gmail.com>, ctladdr=<root@localhost> (0/0), delay=22:06:43, xdelay=00:00:00, mailer=esmtp, pri=11910461, relay=alt4.gmail-smtp-in.l.google.com., dsn=4.0.0, stat=Deferred: Connection timed out with alt4.gmail-smtp-in.l.google.com.


Nov  1 20:08:27 localhost sendmail[15107]: uA1M8RXu015107: from=debian-transmission, size=380, class=0, nrcpts=1, msgid=<201611012208.uA1M8RXu015107@localhost>, relay=debian-transmission@localhost
Nov  1 20:08:27 localhost sm-mta[15111]: uA1M8RiY015111: from=<debian-transmission@localhost>, size=628, class=0, nrcpts=1, msgid=<201611012208.uA1M8RXu015107@localhost>, proto=ESMTP, daemon=MTA-v4, relay=localhost []
Nov  1 20:08:27 localhost sendmail[15107]: uA1M8RXu015107: to=XXX@gmail.com, ctladdr=debian-transmission (107/114), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30380, relay=[] [], dsn=2.0.0, stat=Sent (uA1M8RiY015111 Message accepted for delivery)
Nov  1 20:13:43 localhost sm-mta[15113]: uA1M8RiY015111: to=<XXX@gmail.com>, ctladdr=<debian-transmission@localhost> (107/114), delay=00:05:16, xdelay=00:05:16, mailer=esmtp, pri=120628, relay=alt4.gmail-smtp-in.l.google.com. [], dsn=4.0.0, stat=Deferred: Connection timed out with alt4.gmail-smtp-in.l.google.com.

Debian-transmission is an user created by transmission. Transmission calls the bellow script after downloading:

printf "The torrent $TR_TORRENT_NAME was downloaded successfully at $TR_TIME_LOCATIME" | /usr/bin/mailx -s "Transmission downloaded : $TR_TORRENT_NAME" XXX@gmail.com

Maybe I could add the mailrc and msmtprc parameters to the script?

  • Do you see anything in /var/log/maillog? – DopeGhoti Nov 1 '16 at 18:10
  • I added the mail.log above. Maybe the debian-transmission user is using sendmail instead of mailx? – shinjidf Nov 1 '16 at 22:28

You need to put the files .mailrc and .msmtprc also in your home directory.

Check if that program can read also configuration files from /etc/.

  • Thanks Giacomo for the tip. Now my user marcio can send email too. The problem is the debian-transmission user created by transmission torrent client. I tried creating /home/debian-transmission/.mailrc and .msmtprc but it does not work. – shinjidf Nov 1 '16 at 22:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.