Local POSTFIX cannot send to Gmail

From my POSTFIX mail server I want to send a mail directly to an existing account.

ops mail server -> sendmail to [email protected]
Directly sending mail from your (mail)server to the final destination mail server is not (mail)relaying. You can do this if your outgoing smtp port(25) is open and if you have the appropriate dns records setup and configurations setup, including SPF, DKIM and DMARC records because all big mail providers require those now days.
 
Last edited:


Postfix has more functionality, which you don't need. It is only required for VERY large smtp environments, like if you run a mailprovider with hundrets of thousands of human users. Then you "might" not get around postfix in some cases.
My reply is probably better for a new topic specific about Mailservers or Opensmtpd but I'll just reply here for now. I use Postfix for my personal mail, works fine. Opensmtpd does look an interesting project! However what I really like about Postfix is that they have documentation about almost everything such as virtual_domains and virtual_users. The only documentation I see for Opensmtpd are a few man pages, so does it even support that?
 
Last edited:
From my POSTFIX mail server I want to send a mail directly to an existing account.

Then you need SPF records. But I can only say this again - don't do it ;) You WILL be in pain, as nobody will take your mails from you.
Many large providers will complain around asking you to sign up for their weird whitelists, and many small providers use very weird RBL lists that will block you for no reason, often asking for money.

SMTP is broken, and there is nothing you can do about it.

I have one mailsetup with opensmtpd where we do this because $contracts and $compliance and other $nonsense.

Its the same setup I wrote about in the opensmtpd blog, but the config ends with:

Code:
action send relay

relay in this sense doesnt mean realy to a smtp server that actually sends the mail for you but kind of just "send it".

Trust me, its not what you want. You want a mailrelay. Click SMTP accounts, and set them up in postfix, or better opensmtpd, because then you wont have to study postfix (as in university study for half a year) to know what you are doing.

Dont set SPF records to your servers, you will regret it.
 
Last edited by a moderator:
However what I really like about Postfix is that they have documentation about almost everything such as virtual_domains and virtual_users. The only documentation I see for Opensmtpd are a few man pages, so does it even support that?

Thats because you don't need a book to understand it ;)
 
so does it even support that?

I run about 200 mailrelays with opensmtpd, literally one of which uses SPFs (because, as said, $contracts), I wrote a blogpost about it (see my first post) and I run three mailservers with it, one of which is my own and that thing (to my personal surprise) has never made any troubles.

Postfix is like windows. We used it so long so that now we thing "managing SMTP must be hard" (reference to win as in operating systems are all broken and unstable).
Its actually not that hard ;)
It just needed to be re-written. It was called Post-Fix (later fixed) for a reason ;)

I used postfix for many years and have equal knowledge of postfix and opensmtpd and I would recommend opensmtpd any day unless you are a mailprovider with 100.000s of users.
 
Thats because you don't need a book to understand it ;)
You never answered my question, but after scrolling down a bit it seems like it does. I never found Postfix to be hard to manage, I found Sendmail to be hard to manage.

Postfix is like windows. We used it so long so that now we thing "managing SMTP must be hard" (reference to win as in operating systems are all broken and unstable).
I wish people would stop comparing Linux software to Windows because it's not a fair comparison.

I used postfix for many years and have equal knowledge of postfix and opensmtpd and I would recommend opensmtpd any day unless you are a mailprovider with 100.000s of users.
My personal mail setup works as it is, so I'm not planning to fix what ain't broke. Also I use an opensource mailscanner that only has support for Sendmail, Exim and Postfix. So I don't have the time to redo my whole my setup just to try out Opensmtpd. Also after having read a bit through it smtpd.conf man-page it seems like it would take quite a bit of time for me to get the same setup figured out. So it would take even more time to get spf, dkim and dmarc figured out, although I would still be interested in reading a blog or forum post(in a seperate topic) about that just to get a better picture of Opensmtpd.
 
I'm not planning to fix what ain't broke.

thats the correct approach. Just for the next setup you might want to consider switching.

opensource mailscanner

which one?

So I don't have the time to redo my whole my setup just to try out Opensmtpd

yes I'm not telling you to do that, but the OP is at that point right now ;)


yeah I have to write one.. I'm considering writing one about how to setup an actually secure mailserver to bash large providers that say "we are secure!!1!1!ELEVEN!!" a little bit..
Need to find time.
 
yeah I have to write one..
I did read your mailrelay blog post, but that doesn't include running a full mailserver. It would be interesting to read a blog post about running a fullmailserver with opensmtp just for me to get an impression of the setup.

yes I'm not telling you to do that, but the OP is at that point right now ;)
I was getting the impression that you were since we were getting into a light discussion but with only text it's hard to tell sometimes :) I agree if you are starting out it's never bad to try something different if it's more simple.

Just for the next setup you might want to consider switching.
I'll look into it next time, to see if I can replicate my setup. The requirement I mostly have of software is that it can do the same as what I am currently using and that I am able to configure and setup something using only the documentation provided by the official project.

which one?

I'm considering writing one about how to setup an actually secure mailserver to bash large providers that say "we are secure!!1!1!ELEVEN!!" a little bit..
One of the reasons why I setup my own mail setup is to have a bit more control over my own mail, since with big providers you never actually know what kind of crap they do with your mail.
 
Last edited:
I did read your mailrelay blog post, but that doesn't include running a full mailserver.

yes, I still have to write that. Setting up a proper mailserver is a bit extensive.. Also my own mailserver is.. paranoid.. I want to write about that.

I was getting the impression that you were since we were

nono not at all. wasn't my intention. ofc stay with postfix and dont fix the running system. just in general i'd recommend the switch "next time".


hm looks interesting. bookmarked it, ty

if you are the only one using your mailserver, or everyone else is also a hardcore linux nerd, its worth waiting for my blogpost x)
but as said, it'll be paranoid, as in "many many doors", which is not targeted at end-users or those that use "thunderbird" for mails (hint: I use neomutt)
 
if you are the only one using your mailserver, or everyone else is also a hardcore linux nerd, its worth waiting for my blogpost x)
My vps is still running RHEL9/Rocky9 so I won't be due to migrate for a while and am the only user for it.

but as said, it'll be paranoid, as in "many many doors", which is not targeted at end-users or those that use "thunderbird" for mails (hint: I use neomutt)
I think I can see where this will be going, I still want to keep it workable without it becoming some sort of chore but once you write I'll be wanting to read it. I use both Thunderbird and Roundcube to read/send my mail and can read it from my phone as well, since I don't find using a command-line client useful for all of my mail.
 
Then you need SPF records. But I can only say this again - don't do it ;) You WILL be in pain, as nobody will take your mails from you.
Agreed with this. With no previous experience of how to setup something like this it will be faster and easier just to create a Gmail account and configure your Opensmtpd or whatever MTA to use that account to send mail to another existing account for a domain.
 
Last edited:
I use both Thunderbird and Roundcube to read/send my mail and can read it from my phone as well, since I don't find using a command-line client useful for all of my mail.

yeah I fully understand. Personally I think my mail setup is kinda nonsense, I just did it cause I think its funny and a good excercise x)
 


Latest posts

Top