Re: Questions on postfix

2023-12-29 Thread Bill Cole

On 2023-12-28 at 10:53:06 UTC-0500 (Thu, 28 Dec 2023 07:53:06 -0800)
Ubence Quevedo (thatrat) 
is rumored to have said:


Hi,

I’ve installed postfix and have configured it similarly to how I 
have it configured on some Linux systems using this tutorial 
[https://www.tutorialspoint.com/configure-postfix-with-gmail-on-ubuntu],


That's going to be deeply flawed on macOS. Ubuntu (as a Debian 
downstream) does major violence to the Postfix package and a tutorial 
won't map directly to macOS.


and when I install and configure postfix in macOS [and make some 
slight changes because everything is in /opt/local/etc/postfix], mail 
is not sent.


Sent by what means?
On what version of macOS?

What bothers me most is that I can’t find the log files for the 
macports version of postfix.


It's hard to say where you'll find logs, since you haven't mentioned 
your macOS version.


In an older version (10.x, basically,) you will get messages in 
/var/log/mail.log unless you've done something odd to /etc/syslog.conf 
and/or /etc/ASL.conf. The logging subsystem mostly worked like classical 
Unix/Linux syslog.


In modern macOS, Apple wrecked logging worse than Linux did with systemd 
and its rate-limiting. Wietse addressed both platforms' problematic 
logging by creating a logging subsystem just for Postfix called 
postlogd. Use that. Like all of Postfix it is well-documented.


Can someone point me in the right direction to where I can find them 
to see why my sending mail isn’t working?


The most likely root cause if you are using the standard command line 
tools is that you're using the Apple tools that expect to talk to the 
standard system Postfix, with sendmail under /usr, the spool in /var, 
and config in /etc/postfix. To fix that, you will need to put 
/opt/local/bin and /opt/local/sbin ahead of the system directories in 
your PATH environment variable.




--
Bill Cole
b...@scconsult.com or billc...@apache.org
(AKA @grumpybozo and many *@billmail.scconsult.com addresses)
Not Currently Available For Hire


Re: Questions on postfix

2023-12-29 Thread Ubence Quevedo (thatrat)
I was just hoping that the postfix would just “work” after getting it compiled, 
but with Apple doing their own thing with the postfix they ship with macOS 
Sonoma, it doesn’t look like it’ll be as straightforward a thing as I thought 
it would be.

This was a nice-to-have and not absolutely necessary for what I would like to 
do.

I appreciate all of the responses and clarification.

-Ubence

> On Dec 29, 2023, at 1:15 PM, Horst Simon  wrote:
> 
> I have MacPorts postfix with amavisd new, spamassassin and dovecot successful 
> working on macOS Ventura and High Sierra by sending external mail through 
> icloud
> and using getmail to fetch mail from icloud, outlook and gmail. I am using 
> submission
> (port 587) to send mail.
> I had to disable the macOS postfix by running “sudo launchctl unload -w 
> /System/Library/LaunchDaemons/com.apple.postfix.master.plist”.
> 
> Horst
> 
>> On 30 Dec 2023, at 07:28, Rainer Müller  wrote:
>> On 29/12/2023 15.28, Ubence Quevedo (thatrat) wrote:
>>> That’s just it, I am using mail from /opt/local/bin/:
>>> uquevedo@ubence-mini-wired ~ % which mail
>>> /opt/local/bin/mail
>>> 
>>> I shouldn’t have to use a specific executable if it’s attaching to a
>>> standard port for a running service…?
>>> 
>>> Unless there’s something configuration wise that I’m not seeing about
>>> what port the postfix from MacPorts is doing…?
>> 
>> mail(1) does not connect to port 25 or 587 by default, if you wanted to
>> imply that. Unless you configured it differently, /opt/local/bin/mail
>> might probably still use /usr/sbin/sendmail, but I am not sure about that.
>> 
>> Depending on your macOS version, it already ships with postfix. The
>> relevant sockets are already bound by launchd to run the macOS postfix
>> installation on-demand. You won't see any running daemon processes as it
>> is only activated by launchd on an incoming connection as configured in
>> the /System/Library/LaunchDaemons/com.apple.postfix.master.plist file.
>> There is no way to get rid of this postfix setup unless you disable
>> System Integrity Protection (SIP).
>> 
>> If your intention is just to set up a relay over an external SMTP
>> server, you could just use the macOS provided postfix. I described such
>> a setup on my personal blog a while ago with a specific setup that was
>> required for macOS 10.12 Sierra, but the general instructions should
>> still apply today:
>> 
>> https://raimue.blog/2018/03/22/postfix-with-relayhost-over-stunnel-on-macos-10-12-sierra/
>> 
>> Rainer



Re: Questions on postfix

2023-12-29 Thread Horst Simon via macports-users
I have MacPorts postfix with amavisd new, spamassassin and dovecot successful 
working on macOS Ventura and High Sierra by sending external mail through icloud
and using getmail to fetch mail from icloud, outlook and gmail. I am using 
submission
(port 587) to send mail.
I had to disable the macOS postfix by running “sudo launchctl unload -w 
/System/Library/LaunchDaemons/com.apple.postfix.master.plist”.

Horst

> On 30 Dec 2023, at 07:28, Rainer Müller  wrote:
> On 29/12/2023 15.28, Ubence Quevedo (thatrat) wrote:
>> That’s just it, I am using mail from /opt/local/bin/:
>> uquevedo@ubence-mini-wired ~ % which mail
>> /opt/local/bin/mail
>> 
>> I shouldn’t have to use a specific executable if it’s attaching to a
>> standard port for a running service…?
>> 
>> Unless there’s something configuration wise that I’m not seeing about
>> what port the postfix from MacPorts is doing…?
> 
> mail(1) does not connect to port 25 or 587 by default, if you wanted to
> imply that. Unless you configured it differently, /opt/local/bin/mail
> might probably still use /usr/sbin/sendmail, but I am not sure about that.
> 
> Depending on your macOS version, it already ships with postfix. The
> relevant sockets are already bound by launchd to run the macOS postfix
> installation on-demand. You won't see any running daemon processes as it
> is only activated by launchd on an incoming connection as configured in
> the /System/Library/LaunchDaemons/com.apple.postfix.master.plist file.
> There is no way to get rid of this postfix setup unless you disable
> System Integrity Protection (SIP).
> 
> If your intention is just to set up a relay over an external SMTP
> server, you could just use the macOS provided postfix. I described such
> a setup on my personal blog a while ago with a specific setup that was
> required for macOS 10.12 Sierra, but the general instructions should
> still apply today:
> 
> https://raimue.blog/2018/03/22/postfix-with-relayhost-over-stunnel-on-macos-10-12-sierra/
> 
> Rainer


Re: Questions on postfix

2023-12-29 Thread Rainer Müller
On 29/12/2023 15.28, Ubence Quevedo (thatrat) wrote:
> That’s just it, I am using mail from /opt/local/bin/:
> uquevedo@ubence-mini-wired ~ % which mail
> /opt/local/bin/mail
> 
> I shouldn’t have to use a specific executable if it’s attaching to a
> standard port for a running service…?
> 
> Unless there’s something configuration wise that I’m not seeing about
> what port the postfix from MacPorts is doing…?

mail(1) does not connect to port 25 or 587 by default, if you wanted to
imply that. Unless you configured it differently, /opt/local/bin/mail
might probably still use /usr/sbin/sendmail, but I am not sure about that.

Depending on your macOS version, it already ships with postfix. The
relevant sockets are already bound by launchd to run the macOS postfix
installation on-demand. You won't see any running daemon processes as it
is only activated by launchd on an incoming connection as configured in
the /System/Library/LaunchDaemons/com.apple.postfix.master.plist file.
There is no way to get rid of this postfix setup unless you disable
System Integrity Protection (SIP).

If your intention is just to set up a relay over an external SMTP
server, you could just use the macOS provided postfix. I described such
a setup on my personal blog a while ago with a specific setup that was
required for macOS 10.12 Sierra, but the general instructions should
still apply today:

https://raimue.blog/2018/03/22/postfix-with-relayhost-over-stunnel-on-macos-10-12-sierra/

Rainer


Re: Questions on postfix

2023-12-29 Thread Ubence Quevedo (thatrat)
That’s just it, I am using mail from /opt/local/bin/:
uquevedo@ubence-mini-wired ~ % which mail
/opt/local/bin/mail

I shouldn’t have to use a specific executable if it’s attaching to a standard 
port for a running service…?

Unless there’s something configuration wise that I’m not seeing about what port 
the postfix from MacPorts is doing…?

-Ubence

On Dec 28, 2023, at 7:12 PM, Horst Simon  wrote:

You should have only the postfix.log file and don’t worry about the warning not 
owned by postfix on the .turd_postfix file.

I think you use the macOS mail command which will not use macports postfix. 
Check the /opt/local/bin directory for the mail or mailx command, which you 
should use.

instead of just using mail,  use the full path /opt/local/bin/mail or 
/opt/local/bin/mailx.

Horst

> On 29 Dec 2023, at 10:50, Ubence Quevedo (thatrat)  wrote:
> 
> Huh, I’m only getting a /opt/local/var/log/postfix/postfix.log generated:
> uquevedo@ubence-mini-wired ~ % tree /opt/local/var/log
> /opt/local/var/log
> └── postfix
> └── postfix.log
> 
> 2 directories, 1 file
> 
> With the following contents [which I fixed a few things and restarted the 
> service]:
> uquevedo@ubence-mini-wired ~ % cat /opt/local/var/log/postfix/postfix.log
> Dec 28 14:24:27 ubence-mini-wired postfix/postsuper[31269]: warning: bogus 
> file name: maildrop/.turd_postfix
> Dec 28 14:24:27 ubence-mini-wired postfix/postfix-script[31284]: warning: not 
> owned by _postfix: /opt/local/var/lib/postfix/./.turd_postfix
> Dec 28 14:24:27 ubence-mini-wired postfix/postfix-script[31290]: warning: not 
> owned by _postfix: /opt/local/var/spool/postfix/public/.turd_postfix
> Dec 28 14:24:27 ubence-mini-wired postfix/postfix-script[31295]: starting the 
> Postfix mail system
> Dec 28 14:24:27 ubence-mini-wired postfix/master[31297]: daemon started -- 
> version 3.8.3, configuration /opt/local/etc/postfix
> Dec 28 14:26:05 ubence-mini-wired postfix/postfix-script[31400]: stopping the 
> Postfix mail system
> Dec 28 14:26:07 ubence-mini-wired postfix/postsuper[31451]: warning: bogus 
> file name: maildrop/.turd_postfix
> Dec 28 14:26:07 ubence-mini-wired postfix/postfix-script[31471]: warning: not 
> owned by _postfix: /opt/local/var/spool/postfix/public/.turd_postfix
> Dec 28 14:26:07 ubence-mini-wired postfix/postfix-script[31476]: starting the 
> Postfix mail system
> Dec 28 14:26:07 ubence-mini-wired postfix/master[31478]: daemon started -- 
> version 3.8.3, configuration /opt/local/etc/postfix
> Dec 28 14:27:07 ubence-mini-wired postfix/postfix-script[31549]: stopping the 
> Postfix mail system
> Dec 28 14:27:09 ubence-mini-wired postfix/postsuper[31601]: warning: bogus 
> file name: maildrop/.turd_postfix
> Dec 28 14:27:09 ubence-mini-wired postfix/postfix-script[31625]: starting the 
> Postfix mail system
> Dec 28 14:27:09 ubence-mini-wired postfix/master[31627]: daemon started -- 
> version 3.8.3, configuration /opt/local/etc/postfix
> 
> I don’t get anything from running the following command:
> echo "Postfix setting test" | mail -s "Hello Postfix" "that...@gmail.com”
> 
> Should I be getting the send attempt in the above log file?  Or should l be 
> looking somewhere else?
> 
> -Ubence
> 
> On Dec 28, 2023, at 3:26 PM, Horst Simon  wrote:
> 
> You should with this logging you should get the information in your postfix 
> log as in mail.log, this is what I get.
> 
> Sent from my iPhone
> 
>> On 29 Dec 2023, at 09:36, Ubence Quevedo (thatrat)  wrote:
>> 
>> Thanks for pointing that out.  I added that and tweaked the permissions, 
>> and I’m getting some logging about the service starting/stopping, but I’m 
>> not getting the same type of logging I’m expecting from my Linux systems.
>> 
>> I can usually look in /var/log/mail.log on my Ubuntu server to see the 
>> status of the outgoing mail.
>> 
>> Looking further, it looks like it’s related to syslog on that system, which 
>> isn’t quite the same functionality that macOS has.
>> 
>> Any suggestions on how to be able to log the output of mail commands to 
>> postfix similar to how it is done in Linux?
>> 
>> -Ubence
>> 
>> On Dec 28, 2023, at 1:51 PM, Horst Simon  wrote:
>> 
>> I have postfix login to a file enabled as follow:
>> in the main.cf I added:
>> 
>> maillog_file = /opt/local/var/log/postfix/postfix.log
>> 
>> and in the master.cf:
>> 
>> postlog   unix-dgram n  -   n   -   1   postlogd
>> 
>> Make sure the directory /opt/local/var/log/postfix exists and is writeable 
>> vy postfix.
>> 
>> Horst Simon
>> 
>>> On 29 Dec 2023, at 02:54, Ubence Quevedo (thatrat)  
>>> wrote:
>>> 
>>> Hi,
>>> 
>>> I’ve installed postfix and have configured it similarly to how I have it 
>>> configured on some Linux systems using this tutorial 
>>> [https://www.tutorialspoint.com/configure-postfix-with-gmail-on-ubuntu], 
>>> and when I install and configure postfix in macOS [and make some slight 
>>> changes because everything is in /opt/local/etc/postfix], mail is not sent.
>>> 
>>> What