ubuntu: gmail.com does not accept mail sent from the command line

3

1

In my ubuntu trusty sending email on the command line (mutt, mail, mailx, or sendemail) works fine, except when sending the mail to any of my two @gmail.com addresses. Mail does not arrive there, silently, except when using sendemail, which causes a "Mail delivery failed: returning message to sender" message saying:

Our system has detected that this message is likely unsolicited mail.

The same message sent by thunderbird or from my iPad is accepted with no problem.

Is there a way to tell gmail.com that mail sent from the command line is not necessarily spam?

Maybe by faking the Useragent in the header? But how?

Wybo Dekker

Posted 2014-11-08T12:23:29.063

Reputation: 81

How is your mail delivered? Directly to the target server? Or via your mail service’s SMTP server? – Daniel B – 2014-11-08T12:32:56.327

what is the outgoing mail server in thunderbird and ipad, is the machine you are using as outgoing server on those two clients, the same machine from which you are trying to send the mail from command line? Also what are you using SMTP authentication when sending from command line, what it the from address, you are using in command line, and in thunderbird/ipad? – rAlen – 2014-11-08T12:34:42.170

How do I find that out? Can it be exim4? (sendmail or postfix are not installed here) – Wybo Dekker – 2014-11-08T12:48:46.950

Answers

5

Solved it by specifying:

for mutt in .muttrc:

 set smtp_url=smtp://smtp.xs4all.nl:587

on the sendemail command line:

 -s smtp.xs4all.nl:587

Still to find out how to do that for mailx. (Thanks for the above comments which lead to the solution)

Wybo Dekker

Posted 2014-11-08T12:23:29.063

Reputation: 81

mailx reads ~/.mailrc – macns – 2014-12-10T18:33:07.537

0

mailx reads ~./mailrc

set smtp=smtp://your.smtp.server

if authentication is required:

set smtp-auth-user=user
set smtp-auth-password=password

for system-wide configuration, edit /etc/nail.rc

man mail for all available settings

macns

Posted 2014-11-08T12:23:29.063

Reputation: 356