Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Setting up an MTA on Gentoo
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
EliasJonsson
n00b
n00b


Joined: 18 Oct 2017
Posts: 53

PostPosted: Wed Oct 27, 2021 10:42 am    Post subject: Setting up an MTA on Gentoo Reply with quote

I have searched the Internet but failed to find a good guide on how to set up an MTA so that I can run
Code:
sendmail someone@email.address < 1.mail

with the someone@email.address replaced with a real email address.

I own the domain eliax.trade. The mx-record, mx.eliax.trade is pointing towards the eliasjonsson.freemyip.com, the DDNS pointing towards my public Internet IP address.
The router is forwarding all traffic from port 25 to the local Gentoo box.
The Gentoo box is running sendmail.

No emails sent from the command line are reaching their recipient.
Now how do I configure the system to successfully send email?
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3875

PostPosted: Wed Oct 27, 2021 3:03 pm    Post subject: Reply with quote

If you do not properly configure sendmail to use your above domain,it will probably send the mail from "localhost" and it will be rejected on the way.
There is quite a lot of config you have to do.
Plz see
https://wiki.archlinux.org/title/sendmail
In postfix I use a google email account as a "smart host" ie relay router so to speak.
This gives "legitimacy" to your emails.
I do not know how to achieve this in sendmail.
You will also need Letsencrypt certificates for your domain.
The whole thing will be an involved process but this is good no?
_________________
:)
Back to top
View user's profile Send private message
figueroa
Advocate
Advocate


Joined: 14 Aug 2005
Posts: 2913
Location: Edge of marsh USA

PostPosted: Thu Oct 28, 2021 5:08 am    Post subject: Reply with quote

Like almahant, I also use sendmail from postfix and configure postfix in /etc/postfix files. The smtp password configuration is done in /etc/postfix/saslpass

I keep a cheatsheet in /etc/postfix to remind me the steps effecting changes made to saslpass:
Code:
$ cat saslhowto.txt
/usr/sbin/postmap hash:/etc/postfix/saslpass


In the beginning, (circa 2005 more or less) there was a forum post for setting up a Gentoo mailserver using postfix and courier. In the meantime, keeping it up-to-date has become muscle memory.

I use the command mail -s in scripts to send nicely formatted mail. The mail command is from mail-client/mailx.

You can also use Mutt on the commandline to send mail, which in practice is easier because all of the configuration can be done in your ~/.muttrc. Search for "mutt send mail command line" with DuckDuckGo and you'll find plenty of help.
_________________
Andy Figueroa
hp pavilion hpe h8-1260t/2AB5; spinning rust x3
i7-2600 @ 3.40GHz; 16 gb; Radeon HD 7570
amd64/17.1/desktop (stable), OpenRC, -systemd -pulseaudio -uefi
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
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