[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[SOLVED] Re: how to setup mail server to use (Yahoo|Gmail) smtp servers



H.S. wrote:
> H.S. wrote:
>> Ron Johnson wrote:
>>>> exim and postfix are overkill if you just want to send mails to a
>>>> smarthost. msmtp could do the job; another option is esmtp.
>>> But then you can't receive local (intra-system) mail.
>>
>> Interesting. Couldn't I have both, exim4 and msmtp? I ask because I am
>> trying out msmtp's configuration on my computer which already has exim4
>> installed for local delivery. In the computer where I eventually intend
>> to install the feature, there is going to be just msmtp.
>>
> 
> Now, on this machine which already has exim4 installed (for local main
> delivery only), I installed msmtp and configured it and tried sending a
> test mail. I got this email back:
> ----------------------------------------------------------------
> This message was created automatically by mail delivery software.
> 
> A message that you sent could not be delivered to one or more of its
> recipients. This is a permanent error. The following address(es) failed:
> 
>   <username>@gmail.com
>     Mailing to remote domains not supported
> ----------------------------------------------------------------
> 
> hmm ...so exim4 involved in this? Should I remove exim4 to get msmtp to
> work?


No, exim4 was not the problem. I was forgetting the "-A <account name>"
argument of my mailer (heirloom-mailx).

This works (from:
http://phosphorusandlime.blogspot.com/2008/05/ubuntu-command-line-email.html):
----------------------------------------------------------------
{~}> cat ~/.msmtprc
# gmail account
account gmail
host smtp.gmail.com
port 587
auth on
user <username>@gmail.com
password <pasword here>
from <username>@gmail.com
tls on
#tls_trust_file /home/USER/etc/.certs/ThawtePremiumServerCA.crt
tls_starttls on
tls_certcheck off


# default account to use
account default : gmail
----------------------------------------------------------------


----------------------------------------------------------------
~}> cat .mailrc
# gmail account
account gmail {
set from="<username>@gmail.com (Full Name)"
set sendmail="/usr/bin/msmtp"
set message-sendmail-extra-arguments="-a gmail"
}
----------------------------------------------------------------

I was missing this .mailrc file earlier.

Then, if the message to be sent is in /tmp/mgs.txt file, it can be sent
using this command (from package heirloom-mailx):
{~}> heirloom-mailx -A gmail -s "mta test" <username>@gmail.com <
/tmp/msg.txt


Regards.


-- 

Please reply to this list only. I read this list on its corresponding
newsgroup on gmane.org. Replies sent to my email address are just
filtered to a folder in my mailbox and get periodically deleted without
ever having been read.


Reply to: