USA Linux Users Group Forum Index
Log in Register FAQ Memberlist Search USA Linux Users Group Forum Index Album

SSMTP with GMail
Goto page 1, 2  Next
 
Post new topic   Reply to topic   printer-friendly view    USA Linux Users Group Forum Index » Servers and Server Administration
View previous topic :: View next topic  
Author Message
crouse
Site Admin


Joined: 17 Apr 2024
Posts: 11833
Location: Iowa

PostPosted: Sun Oct 05, 2024 8:48 pm    Post subject: SSMTP with GMail Reply with quote

SSMTP with GMail
In arch this is very simple to setup Wink
If your like me, you don't need a full blown mail server, since I use gmail for most everything. But it's nice to have a quick easy way to get automated mail off your machine and to a mail hub. Enter ssmtp Wink

Code:
[crouse@VistaCrusher ~]$ pacman -Ss ssmtp
extra/ssmtp 2.62-2
    Extremely simple MTA to get mail off the system to a mailhub


Installing in arch.... piece of cake.....
Code:

[root@VistaCrusher ~]# pacman -S ssmtp
resolving dependencies...
looking for inter-conflicts...

Targets (1): ssmtp-2.62-2

Total Download Size:    0.02 MB
Total Installed Size:   0.07 MB

Proceed with installation? [Y/n] y
:: Retrieving packages from extra...
 ssmtp-2.62-2-x86_64       21.4K   63.6K/s 00:00:00 [######################] 100%
checking package integrity...
(1/1) checking for file conflicts                   [######################] 100%
(1/1) installing ssmtp                              [######################] 100%
[root@VistaCrusher ~]#


Now you have 2 files to edit.

In /etc/ssmtp/ssmtp.conf, set the following:

root=youraccount@gmail.com
mailhub=smtp.gmail.com:587
rewriteDomain=
hostname=youraccount@gmail.com
UseSTARTTLS=YES
AuthUser=youraccount
AuthPass=yourpasword
FromLineOverride=YES

In /etc/ssmtp/revaliases:

root:youraccount@gmail.com:smtp.gmail.com:587
mainuser:youraccount@gmail.com:smtp.gmail.com:587


I setup mine for my @usalug.net account...... works great Wink
You can test if it's working by sending your email (to a different account than what you setup for Wink ) by opening a terminal......

Code:
echo test | mail -s "testing ssmtp setup" USERNAME@SOMEDOMAIN.COM



USERNAME@SOMEDOMAIN.COM would of course be an email YOU can check Wink

That's all folks, it's THAT simple Wink



_________________
Veronica - Arch Linux 64-bit -- Kernel 2.6.33.4-1
Archie/Jughead - Arch Linux 32-bit -- Kernel 2.6.33.4-1
Betty/Reggie - Arch Linux (VBox) 32-bit -- Kernel 2.6.33.4-1
BumbleBee - OpenSolaris-SunOS 5.11
Back to top
View user's profile Send private message Visit poster's website AIM Address
crouse
Site Admin


Joined: 17 Apr 2024
Posts: 11833
Location: Iowa

PostPosted: Wed Oct 08, 2024 10:12 pm    Post subject: Reply with quote

An article on ssmtp
http://www.linux.com/feature/132006



_________________
Veronica - Arch Linux 64-bit -- Kernel 2.6.33.4-1
Archie/Jughead - Arch Linux 32-bit -- Kernel 2.6.33.4-1
Betty/Reggie - Arch Linux (VBox) 32-bit -- Kernel 2.6.33.4-1
BumbleBee - OpenSolaris-SunOS 5.11
Back to top
View user's profile Send private message Visit poster's website AIM Address
bdquick
Advanced Member


Joined: 26 Jun 2024
Posts: 883
Location: Little north of DSM and south of Ames

PostPosted: Wed Oct 08, 2024 11:55 pm    Post subject: Reply with quote

I'm lazier and just pull my gmail into thunderbird.



_________________
OpenSuse 11.1 11, 10.2
Arch Linux
Back to top
View user's profile Send private message
inactive
Sr. Member


Joined: 29 Aug 2024
Posts: 1207

PostPosted: Thu Oct 23, 2024 12:58 am    Post subject: Reply with quote

I'm even lazier than that; a lot lazier. I leave it on their server and check it from the web so all that junk mail in it doesn't eat up my hdd space.



_________________
Mandriva 2024.1 PWP
Mandriva Cooker
ArtistX live
Back to top
View user's profile Send private message
bdquick
Advanced Member


Joined: 26 Jun 2024
Posts: 883
Location: Little north of DSM and south of Ames

PostPosted: Thu Oct 23, 2024 2:48 am    Post subject: Reply with quote

I leave mine on their server too, but I just find the gmail interface slooooowwwwwww.



_________________
OpenSuse 11.1 11, 10.2
Arch Linux
Back to top
View user's profile Send private message
inactive
Sr. Member


Joined: 29 Aug 2024
Posts: 1207

PostPosted: Thu Oct 23, 2024 4:39 am    Post subject: Reply with quote

It is, but IMHO it's a heckuva lot better than downloading it.



_________________
Mandriva 2024.1 PWP
Mandriva Cooker
ArtistX live
Back to top
View user's profile Send private message
crouse
Site Admin


Joined: 17 Apr 2024
Posts: 11833
Location: Iowa

PostPosted: Thu Oct 23, 2024 1:24 pm    Post subject: Reply with quote

bdquick wrote:
I'm lazier and just pull my gmail into thunderbird.


uhm ..... I don't think you are understanding what SSMTP really IS. This app doesn't "pull"....... it would be more equated with "push" Wink



_________________
Veronica - Arch Linux 64-bit -- Kernel 2.6.33.4-1
Archie/Jughead - Arch Linux 32-bit -- Kernel 2.6.33.4-1
Betty/Reggie - Arch Linux (VBox) 32-bit -- Kernel 2.6.33.4-1
BumbleBee - OpenSolaris-SunOS 5.11
Back to top
View user's profile Send private message Visit poster's website AIM Address
masinick
Linux Guru


Joined: 03 Apr 2024
Posts: 8615
Location: Concord, NH

PostPosted: Thu Oct 23, 2024 3:07 pm    Post subject: Where SSMTP fits into the overall picture Reply with quote

crouse wrote:
bdquick wrote:
I'm lazier and just pull my gmail into thunderbird.


uhm ..... I don't think you are understanding what SSMTP really IS. This app doesn't "pull"....... it would be more equated with "push" Wink


That's right. POP3 and/or IMAP4 are what you use to read messages from a mail server to an external program and that is what they use.

SMTP is what those same programs, such as Thunderbird, Mutt, Pine, Eudora, etc. use when you create a message and attempt to send it.

I take it that the extra S is for simple or super simple, because SSMTP is a functional replacement for SMTP, just as IMAP4 is a functional replacement for POP3,

Interestingly enough, some of the functions in IMAP4 have worked their way into POP3, most notably the capability of reading a message and optionally either retaining it or removing it from the server. The original POP3 spec did not include this function. Ten years ago when I first used it, that feature was not there; when you'd read messages off the mail server with a POP3 server, they were GONE from the mail server, marked read and then deleted. Now, they are marked read, but can optionally be retained and reread by another application, which also has the ability to retain or remove the information.

I do not yet know much about SSMTP, so Dave, I will have to read up on it. But I expect that is a pretty simple plug in replacement for SMTP. Am I correct in the statements that I have made here?



_________________
Brian Masinick
Distros: SimplyMEPIS
sidux - no CAPS!, antiX, Debian
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
crouse
Site Admin


Joined: 17 Apr 2024
Posts: 11833
Location: Iowa

PostPosted: Thu Oct 23, 2024 3:15 pm    Post subject: Reply with quote

Yes...... basically it's a very simple "sendmail" mail server replacement.



_________________
Veronica - Arch Linux 64-bit -- Kernel 2.6.33.4-1
Archie/Jughead - Arch Linux 32-bit -- Kernel 2.6.33.4-1
Betty/Reggie - Arch Linux (VBox) 32-bit -- Kernel 2.6.33.4-1
BumbleBee - OpenSolaris-SunOS 5.11
Back to top
View user's profile Send private message Visit poster's website AIM Address
masinick
Linux Guru


Joined: 03 Apr 2024
Posts: 8615
Location: Concord, NH

PostPosted: Thu Oct 23, 2024 3:35 pm    Post subject: Email components explained in detail Reply with quote

DedannaRocks! wrote:
I'm even lazier than that; a lot lazier. I leave it on their server and check it from the web so all that junk mail in it doesn't eat up my hdd space.


I do something similar. First, I keep my main Email on the Yahoo! Mail server. I first read the Spam/Bulk folder to see if there are any messages worth retaining at all. I review the headers, 100 at a time. If there are any to keep, I move them to the Inbox, then I remove the remaining messages with "Empty Bulk", Spam, or whatever it says.

Then I go through my Inbox. If there are any one time reads, I read them, then delete. I also go through to look if there is SPAM that the SPAM filter did not detect, and I delete it without even reading it.

I do all of these things at the Web interface level. That significantly cuts down on the number of messages that I am reading in to my Email client.

However, keep in mind this important point. When I DO bring in my Email, I am using a POP3 access point to bring it in. This has nothing to do with the SSMTP component that Dave described above. The SMTP or SSMTP component in a messaging system is what is called the MTA or Mail Transport Agent. SSMTP and SMTP are both considered to be MTAs.

POP3 and IMAP4 are known as MDAs or Mail Delivery Agents.

Thunderbird, Eudora, and Outlook Express are all examples of MUAs or Mail User Agents, and they are more commonly referred to as Email clients.

The article here nicely describes the components of an Email system.

What DedannaRocks! was referring to is that she uses a WebMail client to pull out most junk before she ever imports it (if at all). I personally heavily use WebMail clients as well, but I do use an MDA and an MUA to pull in stuff that I want to keep and store locally as well.



_________________
Brian Masinick
Distros: SimplyMEPIS
sidux - no CAPS!, antiX, Debian
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
masinick
Linux Guru


Joined: 03 Apr 2024
Posts: 8615
Location: Concord, NH

PostPosted: Thu Oct 23, 2024 5:24 pm    Post subject: This is about SENDING mail, let's discuss RECEIVING mail Reply with quote

crouse wrote:
An article on ssmtp
http://www.linux.com/feature/132006


This really is a good article. If you read it, you will see that what we are talking about here is SENDING (not receiving) mail.

Since this topic DID bring up several comments about RECEIVING mail, and doing it with WebMail, Thunderbird, and other MUAs (Email clients), perhaps we ought to start another thread to look into nice alternatives to bring in mail from POP3 and IMAP4 mail servers. I know that there are a number of them out there; Fetchmail comes immediately to mind? Do any of you use, or have you ever explored or considered such tools? If so, let's start another topic to discuss them.



_________________
Brian Masinick
Distros: SimplyMEPIS
sidux - no CAPS!, antiX, Debian
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
bdquick
Advanced Member


Joined: 26 Jun 2024
Posts: 883
Location: Little north of DSM and south of Ames

PostPosted: Thu Oct 23, 2024 5:56 pm    Post subject: Reply with quote

crouse wrote:
bdquick wrote:
I'm lazier and just pull my gmail into thunderbird.


uhm ..... I don't think you are understanding what SSMTP really IS. This app doesn't "pull"....... it would be more equated with "push" Wink


Guess I didn't read very well. Thought maybe you were using it to send your gmail to another account, not send through your gmail account.



_________________
OpenSuse 11.1 11, 10.2
Arch Linux
Back to top
View user's profile Send private message
inactive
Sr. Member


Joined: 29 Aug 2024
Posts: 1207

PostPosted: Fri Oct 24, 2024 1:58 am    Post subject: Reply with quote

The thing is though, why would one want to download it or send it even then to (or through) their hdd (unless it's something awfully imperatively important)?

The best backup IMHO is right there on the internet; takes no hdd space, and never gets lost; if your system crashes, there it is.



_________________
Mandriva 2024.1 PWP
Mandriva Cooker
ArtistX live
Back to top
View user's profile Send private message
crouse
Site Admin


Joined: 17 Apr 2024
Posts: 11833
Location: Iowa

PostPosted: Fri Oct 24, 2024 2:14 am    Post subject: Reply with quote

Try to send an email using a cron job .... you'll soon see WHY i like ssmtp Wink
Say you wanted a cron job to send you a status email of say a computer you installed linux on for a "non-techie" friend.... it could automatically send you an email every night, or you could setup a script to send an email when disk space runs low etc........... i can see MANY reasons to use this application. In fact, i DO use it Wink



_________________
Veronica - Arch Linux 64-bit -- Kernel 2.6.33.4-1
Archie/Jughead - Arch Linux 32-bit -- Kernel 2.6.33.4-1
Betty/Reggie - Arch Linux (VBox) 32-bit -- Kernel 2.6.33.4-1
BumbleBee - OpenSolaris-SunOS 5.11
Back to top
View user's profile Send private message Visit poster's website AIM Address
inactive
Sr. Member


Joined: 29 Aug 2024
Posts: 1207

PostPosted: Fri Oct 24, 2024 2:16 am    Post subject: Reply with quote

In a situation like that, yes.

However, we're talking more for (whatever, general) gmail here -- I fail to see how it could be relevant for it for the reasons stated above.

If one's keeping an eye on a system, yeah, but elsewise, generally, I just don't see it.

Thanks!



_________________
Mandriva 2024.1 PWP
Mandriva Cooker
ArtistX live
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    USA Linux Users Group Forum Index » Servers and Server Administration All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All content © 2024-2009 - Usa Linux Users Group
This forum is powered by phpBB. © 2024-2009 phpBB Group
Theme created by phpBBStyles.com and modified by Crouse