You are not logged in.

#51 2009-10-17 09:38:47

Lonsas
Member
Registered: 2008-12-23
Posts: 22

Re: SSMTP with GMail

I took me a while to get this working when I did it, hadn't found this guide back then.

I just have two questions:

1. How do I stop the mailing of system mails, i.e like mentioned before - cron errors which flooded my mail for a while?

2. Is there any workaround for passwords containing " (quote)?
had to change the password and remove the " because I was unable to log in through ssmtp.

Offline

#52 2009-10-19 14:22:14

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,796
Website

Re: SSMTP with GMail

Lonsas wrote:

1. How do I stop the mailing of system mails, i.e like mentioned before - cron errors which flooded my mail for a while?

man crontab wrote:

If MAILTO is defined but empty (MAILTO=""), no mail
will be sent

looks like you can just add MAILTO="" to your crontab and cron will stop attempting to send mail (and stop flooding your logs).

i use a similar option in fcron, which hopefully Arch will be moving to by default soon smile.


but now i'm thinking, the easiest way to stop system mails all together (i.e. if you have no sendmail executable anyway)...

sudo echo -e '#!/bin/sh\nexit 0' > /usr/bin/sendmail && sudo chmod +x /usr/bin/sendmail

NOTE: this could cause issues i'm not considering and is meant only in a 'thinking-out-loud' context

Offline

#53 2010-01-26 03:08:26

bushmannt
Member
From: Charlston, SC
Registered: 2008-08-07
Posts: 7
Website

Re: SSMTP with GMail

I have spent 3hrs trying to get this thing to run with gmail and no success.

I installed heirloom-mailx and it worked the first time.  Apparently ssmtp doesn't get updated anymore.

Offline

#54 2010-07-22 10:58:28

dtw
Forum Fellow
From: UK
Registered: 2004-08-03
Posts: 4,436
Website

Re: SSMTP with GMail

I'm having some probs with this.

This makes sense, if I

chmod 600 /etc/ssmtp/ssmtp.conf

I get an error because sSMTP can't read the config.
Needless to say

chmod 660 /etc/ssmtp/ssmtp.conf

Fixes that.

However, I've run:

echo test | mail -s "testing ssmtp setup" user@domain.com

And now I just keep getting:

send-mail: Connection lost in middle of processing

Any ideas?

Offline

#55 2010-07-23 04:52:39

print
Member
From: teh cloud
Registered: 2007-02-27
Posts: 173

Re: SSMTP with GMail

brisbin33 wrote:
Lonsas wrote:

1. How do I stop the mailing of system mails, i.e like mentioned before - cron errors which flooded my mail for a while?

man crontab wrote:

If MAILTO is defined but empty (MAILTO=""), no mail
will be sent

looks like you can just add MAILTO="" to your crontab and cron will stop attempting to send mail (and stop flooding your logs).

This trick doesn't work for me.  I just get a bunch of lines like this in /var/log/crond.log:

Jul 22 23:49:01 myhost crond[17953]: failed parsing crontab for user root: MAILTO=""

% whereis whatis whence which whoami whois who

Offline

#56 2010-08-16 00:24:42

archman-cro
Member
From: Croatia
Registered: 2010-04-04
Posts: 943
Website

Re: SSMTP with GMail

print wrote:

This trick doesn't work for me.  I just get a bunch of lines like this in /var/log/crond.log:

Jul 22 23:49:01 myhost crond[17953]: failed parsing crontab for user root: MAILTO=""

I get this one too, unfortunately...

Offline

#57 2010-08-16 02:59:33

fukawi2
Forum Moderator
From: .vic.au
Registered: 2007-09-28
Posts: 5,304
Website

Re: SSMTP with GMail

Why wont this thread die....?!

Offline

#58 2010-08-16 08:46:23

kgas
Member
From: Qatar
Registered: 2008-11-08
Posts: 718

Re: SSMTP with GMail

Why wont this thread die....?!

command line simplicity tongue.

Offline

#59 2010-08-16 21:05:58

PiousMinion
Member
Registered: 2009-07-21
Posts: 11

Re: SSMTP with GMail

EDIT:  I think I'm going to try msmtp in the mean time, but I'd still like assistance with ssmtp if anyone is willing and able.  smile

I can't get this to work to save my life.  sad

These are the errors in /var/log/everything:
Aug 16 12:50:13 shitty sSMTP[2044]: Connection lost in middle of processing
Aug 16 12:54:10 shitty sSMTP[2102]: Creating SSL connection to host

Occasionally I get this in my terminal:
send-mail: Connection lost in middle of processing

This is my config, "nospam" being replaced with my own email:
ssmtp.conf
-------------------------------
root=nospam@gmail.com
mailhub=smtp.gmail.com:587
hostname=gmail.com
UseSTARTTLS=YES
AuthUser=nospam@gmail.com
AuthPass=password
FromLineOverride=YES

revaliases
-------------------------------
root:nospam@gmail.com:smtp.gmail.com:465
nospam:nospam@gmail.com:smtp.gmail.com:465


Any help with this would be greatly appreciated.

Last edited by PiousMinion (2010-08-17 18:12:28)

Offline

#60 2010-08-19 18:26:56

luke
Member
From: US
Registered: 2004-06-22
Posts: 54

Re: SSMTP with GMail

PiousMinion wrote:

ssmtp.conf
-------------------------------
root=nospam@gmail.com
mailhub=smtp.gmail.com:587
hostname=gmail.com
UseSTARTTLS=YES
AuthUser=nospam@gmail.com
AuthPass=password
FromLineOverride=YES

revaliases
-------------------------------
root:nospam@gmail.com:smtp.gmail.com:465
nospam:nospam@gmail.com:smtp.gmail.com:465

Try these:
ssmtp.conf

root=postmaster
FromLineOverride=Yes

mailhub=smtp.gmail.com:587
rewriteDomain=
UseTLS=Yes
UseSTARTTLS=YES
AuthUser=nospam@gmail.com
AuthPass=password

revaliases

root:nospam@gmail.com:smtp.gmail.com:587
nospam:nospam@gmail.com:smtp.gmail.com:587

The permissions on the ssmtp.conf file will dictate who can send mail with the setup like this. That is, if you follow the wiki, only root will be able to send mail.

Edit: I updated the wiki to show 587 in all three places.

Last edited by luke (2010-08-19 18:30:40)

Offline

#61 2010-10-07 17:32:12

android
Member
From: San Diego
Registered: 2003-04-18
Posts: 144

Re: SSMTP with GMail

fukawi2 wrote:

Why wont this thread die....?!

8-) Apparently we just aren't keeping it simple _enough_ 8-)

I've setup ssmtp on 3 different kinds of systems: freebsd, arch, cygwin

All installations are sending to a postfix mail server hosted here, not google (since google is part of the evil empire, and a big part of running linux is to make one's life _less_ dependent on the evil empire and more self reliant)

However the mail server uses submission port (587) and STARTTLS, so much of the configuration of ssmtp mail clients has been very similliar to the instructions given for gmail.

On arch, I'm experiencing the issue of only root being able to send mail.

On both freebsd and cygwin, once the ssmtp.conf file had the correct username/password, the UseSTARTTLS and UseTLS options set I was able to send mail from all users, not just root.

On freebsd the ssmtp.conf permissions are:

epicenter# ls -l /usr/local/etc/ssmtp/ssmtp.conf
-rw-r-----  1 ssmtp  wheel  1478 Apr  6  2010 /usr/local/etc/ssmtp/ssmtp.conf

There is no revailiases file in th is installation.

And No, the users sending mail are not in the wheel group.

Has anyone uncovered WHY can only root send mail on arch with ssmtp?

It doesn't seem to be required for all users to have access to the ssmtp.conf on other systems.

This could have to do with mailwrapper or the mail executable.

android

ARCH: even when it doesn't work it's a lot of fun to work on 8-)

Offline

#62 2012-05-20 17:57:03

cthulhu
Member
Registered: 2012-04-26
Posts: 8

Re: SSMTP with GMail

Thanks! Works perfectly here.

Offline

#63 2014-06-06 17:53:20

firekage
Member
From: Eastern Europe, Poland
Registered: 2013-06-30
Posts: 491

Re: SSMTP with GMail

Sorry for refreshing - one question. I would like to have the ability of sending emails but ssmtp.conf needs password in .conf. It is not secure. Is there a way to bypass typing password in plain text of .conf?

Offline

#64 2014-06-06 18:20:34

ANOKNUSA
Member
Registered: 2010-10-22
Posts: 2,141

Re: SSMTP with GMail

man ssmtp

Don't necrobump old threads.

EDIT: I use msmtp, which asks for a password if none is specified. Still, most people just change the permissions on their configs; it's only insecure if you give an untrustworthy person access to your machine.

Last edited by ANOKNUSA (2014-06-06 18:22:30)

Offline

#65 2014-06-06 18:23:05

firekage
Member
From: Eastern Europe, Poland
Registered: 2013-06-30
Posts: 491

Re: SSMTP with GMail

What's the point of starting another thread when this one covers all of maters regarding ssmtp? You like to swim in garbage?

Offline

#66 2014-06-06 18:23:57

ANOKNUSA
Member
Registered: 2010-10-22
Posts: 2,141

Re: SSMTP with GMail

firekage wrote:

What's the point of starting another thread when this one covers all of maters regarding ssmtp?

Apparently it doesn't, or you wouldn't be asking.

Offline

#67 2014-06-06 18:32:08

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,079

Re: SSMTP with GMail

firekage, you should know the rules about necrobumping. Also there is no need to get snippy or personal when told to follow the rules.


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#68 2014-06-06 18:40:15

firekage
Member
From: Eastern Europe, Poland
Registered: 2013-06-30
Posts: 491

Re: SSMTP with GMail

It's not getting personal. I just follow basic logic when searching info. I found a good thread, is it really neccesary to start new one only to ask one thing about it when there is a goos old topics? That's strange, just like garbaging clean environement because it is the way to do it. I know the rules but haven't we should think more about this only rule?

Offline

#69 2014-06-06 18:46:43

headkase
Member
From: Canada
Registered: 2011-12-06
Posts: 1,539
Website

Re: SSMTP with GMail

People have to read through three full pages of replies before they can be deemed "competent" to reply to you.  You could instead start your own thread and judicially link to anything relevant from this one..  Y'know, just sayin'..


We all make choices, but in the end, our choices make us.

Offline

#70 2014-06-06 18:50:09

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,079

Re: SSMTP with GMail

firekage wrote:

It's not getting personal. I just follow basic logic when searching info. I found a good thread, is it really neccesary to start new one only to ask one thing about it when there is a goos old topics? That's strange, just like garbaging clean environement because it is the way to do it. I know the rules but haven't we should think more about this only rule?

Then you should be aware that with the rolling release nature of Arch, things change very often. What was valid in 2009 may not be valid anymore. What else do you need to think about in this rule ??


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#71 2014-06-06 21:16:20

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 13,405

Re: SSMTP with GMail

Closing...


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
You assume people are rational and influenced by evidence.  You must not work with the public much. -- Trilby
----
How to Ask Questions the Smart Way

Offline

Board footer

Powered by FluxBB