Solved Sending email from the command line using Gmail?

Until recently I have been using FTP to send small incremental backup files to a cloud storage provider (DriveHQ), but recently the service has altered its terms and conditions so I expect not to be able to use the service in the future. In response to this I've been trying other similar services, but with little success. As an alternative I'm thinking it might be possible to get the same effect by sending the files as attachments to emails sent to a web mail provider, say Yahoo or Google, from the command line. Is it possible at all? If it is possible can I use the Google mail (Gmail) SMTP system to replace an internal mail system? Advice please.
 
Re: Sending email from the command line using Gmail?

You could configure sendmail(8) to use GMail as a so-called 'smarthost'. Email sent with mail(1) would then be sent out through GMail. But if I read your requirements correctly that wouldn't even be necessary. A default install should be able to mail to a GMail address. Although you may need to adjust the "From" address as they usually don't like to receive email from root@myserver.non-existing-domain.tld.
 
Re: Sending email from the command line using Gmail?

Look at replacing sendmail(8) with for example mail/dma that is a much more lightweight solution to just handling local and outgoing mail, optionally with SMTP/AUTH and SSL/TLS.

In fact the rumor is that the mail/dma could be the replacement for sendmail(8) in the base system some time in the future, it's BSD licensed (coming from DragonFlyBSD) and very lightweight compared to the mammoth sendmail(8).
 
Re: Sending email from the command line using Gmail?

I am not sure if it meet Your demands but maybe mail/ssmtp
A secure, effective and simple way of getting mail off a system to
your mail hub. It does not include a mail spool to poke around in,
and no daemons running in the background. Mail is simply forwarded
to the configured mailhost. Extremely easy configuration.
 
Back
Top