Anope IRC Services

Please login or register.

Login with username, password and session length
Advanced search  

News:

Pages: [1]   Go Down

Author Topic: [Guide] Anope and ssmtp  (Read 1606 times)

0 Members and 1 Guest are viewing this topic.

Stefan

  • Anope User
  • Offline Offline
  • Gender: Male
  • Posts: 5
[Guide] Anope and ssmtp
« on: March 28, 2023, 03:09:15 PM »

Hi,

I have for some days trying to figure out how to setup Anope with email support and I finally made it work with "ssmtp"

So the first thing you need to do is install :
Code: [Select]
sudo apt-get update
Code: [Select]
sudo apt-get install ssmtp
then edit the following file:
Code: [Select]
sudo nano /etc/ssmtp/ssmtp.conf
You then need to make some changes to the file:

Code: [Select]
#
# Config file for sSMTP sendmail
#
# The person who gets all mail for userids < 1000
# Make this empty to disable rewriting.
#root=postmaster
root=
#Debug - remove the # if you need to debug (the file you need to look into is : /var/syslog)
#Debug=Yes

# The place where the mail goes. The actual machine name is required no
# MX records are consulted. Commonly mailhosts are named mail.domain.com
mailhub=mail.yourprovider.com:587

AuthUser=YOURMAILADRESS
AuthPass=YOURPASSWORD
UseTLS=YES
UseSTARTTLS=YES

# Where will the mail seem to come from?
#rewriteDomain=

# The full hostname
hostname=YOURHOSTNAME

# Are users allowed to set their own From: address?
# YES - Allow the user to specify their own From: address
# NO - Use the system generated From: address
FromLineOverride=YES

And lastly make this change:
Code: [Select]
sendmailpath = "/usr/sbin/ssmtp -t"
Thats how I made it work :)
« Last Edit: May 15, 2023, 12:16:49 PM by Stefan »
Logged

Jens Voss

  • Team
  • *
  • Offline Offline
  • Posts: 125
Re: [Guide] Anope and ssmtp
« Reply #1 on: April 04, 2023, 12:38:38 PM »

Thank you. :-)
Logged

Moebius

  • Anope User
  • Offline Offline
  • Posts: 4
Re: [Guide] Anope and ssmtp
« Reply #2 on: April 06, 2023, 06:04:06 PM »

Hi,

I have for some days trying to figure how to setup Anope with email support and I finally made it work with "ssmtp"

So the first thing you need to do is install :
Code: [Select]
sudo apt-get update
Code: [Select]
sudo apt-get install ssmtp
then edit the following file:
Code: [Select]
sudo nano /etc/ssmtp/ssmtp.conf
You then need to make some changes to the file:

Code: [Select]
#
# Config file for sSMTP sendmail
#
# The person who gets all mail for userids < 1000
# Make this empty to disable rewriting.
#root=postmaster
root=
#Debug - remove the # if you need to debug (the file you need to look into is : /var/syslog)
#Debug=Yes

# The place where the mail goes. The actual machine name is required no
# MX records are consulted. Commonly mailhosts are named mail.domain.com
mailhub=mail.yourprovider.com:587

AuthUser=YOURMAILADRESS
AuthPass=YOURPASSWORD
UseTLS=YES
UseSTARTTLS=YES

# Where will the mail seem to come from?
#rewriteDomain=

# The full hostname
hostname=YOURHOSTNAME

# Are users allowed to set their own From: address?
# YES - Allow the user to specify their own From: address
# NO - Use the system generated From: address
FromLineOverride=YES

And lastly make this change:
Code: [Select]
sendmailpath = "/usr/sbin/ssmtp -t"
Thats how I made it work :)

May I ask how exactly you went about the app password/less secure authentication? It seems that most email services these days use a 2-step verification and won't allow third-party apps to log into your account unless using a dedicated app password, which is something ssmtp isn't good at or so it seems. I've tried sending an email using a previously generated app password but I keep getting an error saying password is missing or just bad. In the case of gmail.com it looks like this:

Code: [Select]
ssmtp: Authorization failed (535 5.7.8  https://support.google.com/mail/?p=BadCredentials z6-20020a05600c220600b003ed246c1d28sm2044983wml.44 - gsmtp)
So, I figure either I'm doing something wrong or you could be using a different email service altogether, which doesn't require the above authentication method.
« Last Edit: April 06, 2023, 06:15:50 PM by Moebius »
Logged

Moebius

  • Anope User
  • Offline Offline
  • Posts: 4
Re: [Guide] Anope and ssmtp
« Reply #3 on: April 06, 2023, 09:08:15 PM »

Ok, nevermind. I did something and it works now. I've NO idea how I fixed it, though. I even tried to reverse the few random and hopeless changes I made to the ssmtp.conf file and it still just works. Oh well.

Now I have another question. Is there a way to fake the sender's name and address? I know it can be done with sendmail and mailx but I'm not sure they are good options here. The question is, can you pull it off with ssmtp? The farthest I've gone is change the sender's name but I can't seem to change the actual email address. Here's what I mean:

Code: [Select]
ssmtp -v -fservices@retroit.org -Fservices@retroit.org someone@somemail.com < msg.txt
This only changes the name but not the address in angle brackets, it's pretty much stuck there. So, only the -F parameter works. Same happens when I use "From:" in the actual message.
« Last Edit: April 06, 2023, 09:31:15 PM by Moebius »
Logged

Stefan

  • Anope User
  • Offline Offline
  • Gender: Male
  • Posts: 5
Re: [Guide] Anope and ssmtp
« Reply #4 on: April 07, 2023, 10:56:41 AM »

May I ask how exactly you went about the app password/less secure authentication? It seems that most email services these days use a 2-step verification and won't allow third-party apps to log into your account unless using a dedicated app password, which is something ssmtp isn't good at or so it seems. I've tried sending an email using a previously generated app password but I keep getting an error saying password is missing or just bad. In the case of gmail.com it looks like this:

Code: [Select]
ssmtp: Authorization failed (535 5.7.8  https://support.google.com/mail/?p=BadCredentials z6-20020a05600c220600b003ed246c1d28sm2044983wml.44 - gsmtp)
So, I figure either I'm doing something wrong or you could be using a different email service altogether, which doesn't require the above authentication method.

Hi,

I can't speak about gmail. As I don't use that I use https://privateemail.com/ And it works fine.
Logged

Stefan

  • Anope User
  • Offline Offline
  • Gender: Male
  • Posts: 5
Re: [Guide] Anope and ssmtp
« Reply #5 on: April 07, 2023, 10:58:57 AM »

Ok, nevermind. I did something and it works now. I've NO idea how I fixed it, though. I even tried to reverse the few random and hopeless changes I made to the ssmtp.conf file and it still just works. Oh well.

Now I have another question. Is there a way to fake the sender's name and address? I know it can be done with sendmail and mailx but I'm not sure they are good options here. The question is, can you pull it off with ssmtp? The farthest I've gone is change the sender's name but I can't seem to change the actual email address. Here's what I mean:

Code: [Select]
ssmtp -v -fservices@retroit.org -Fservices@retroit.org someone@somemail.com < msg.txt
This only changes the name but not the address in angle brackets, it's pretty much stuck there. So, only the -F parameter works. Same happens when I use "From:" in the actual message.

Hi,

I haven't played with "fake email" so I don't know, sorry
Logged
Pages: [1]   Go Up