Re: question for the part location of multipart message

2021-12-31 Thread Bill Cole

On 2021-12-31 at 22:40:37 UTC-0500 (Sat, 01 Jan 2022 11:40:37 +0800)
Frank Hwa 
is rumored to have said:


Hello

For a multipart message, is text/plain part always in the first 
location?


No.

Arguably it SHOULD be first in a multipart/alternative, but it isn't 
always. Also, there are other subtypes of multipart that can include 
text/plain subparts elsewhere.


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


question for the part location of multipart message

2021-12-31 Thread Frank Hwa

Hello

For a multipart message, is text/plain part always in the first 
location?
I just want to extract the plain text body of a message. I use the code 
below (python), but was not very sure.


b = email.message_from_string(x)

if b.is_multipart():
for part in b.get_payload():
print part.get_payload()
break
else:
print b.get_payload()


Thank you.


Re: postfix will not send

2021-12-31 Thread Doug Denault

On Fri, 31 Dec 2021, Wietse Venema wrote:


John Fawcett:

On 31/12/2021 10:36, Doug Denault wrote:

This is a postfix/cyrus/mysql system running in a FreeBSD jail. It is
(as far as I can make it) identical to a bare metal with the same
configuration. Delivery & reading email works fine, the jailed system
will not send email failing with:

cyrus postfix/smtpd[51745]: warning: SASL: Connect to smtpd failed: No
such file or directory
cyrus postfix/smtpd[51745]: fatal: no SASL authentication mechanisms


The warning message (at least in the latest version of postfix) is given
only for smtpd_sasl_type = dovecot, so seems that dovecot SASL is
configured, not cyrus SASL and postfix is interpreting "smtpd" which is
your smtpd_sasl_path setting as the dovecot socket path to connect to
for authentication.


That message neewds to be improved. As of Postfix 3.7 it will be:

   warning: SASL: Connect to Dovecot auth socket 'smtpd' failed: ...

which would save some head scratching.


Thank you all. That is indeed the problem. My problem is further compounded 
by FreeBSD in postfix-3.5.6,1 the package is built with cyrus support 
however postfix-3.6.2_1,1 is apparently built without cyrus support.


cyrus:~> postconf -A
cyrus:

cyrus:~> postconf -a
dovecot

setting smtpd_sasl_type = cyrus begets
   warning: unsupported SASL server implementation: cyrus
   fatal: SASL per-process initialization failed

Fix is trivial but not without the help I got here, Thank again to all and 
Happy New Year


Doug

_
Douglas Denault
http://www.safeport.com
d...@safeport.com
Voice: 301-217-9220
  Fax: 301-217-9277


Re: postfix will not send

2021-12-31 Thread Wietse Venema
John Fawcett:
> On 31/12/2021 10:36, Doug Denault wrote:
> > This is a postfix/cyrus/mysql system running in a FreeBSD jail. It is 
> > (as far as I can make it) identical to a bare metal with the same 
> > configuration. Delivery & reading email works fine, the jailed system 
> > will not send email failing with:
> >
> > cyrus postfix/smtpd[51745]: warning: SASL: Connect to smtpd failed: No 
> > such file or directory
> > cyrus postfix/smtpd[51745]: fatal: no SASL authentication mechanisms
> 
> The warning message (at least in the latest version of postfix) is given 
> only for smtpd_sasl_type = dovecot, so seems that dovecot SASL is 
> configured, not cyrus SASL and postfix is interpreting "smtpd" which is 
> your smtpd_sasl_path setting as the dovecot socket path to connect to 
> for authentication.

That message neewds to be improved. As of Postfix 3.7 it will be:

warning: SASL: Connect to Dovecot auth socket 'smtpd' failed: ...

which would save some head scratching.

Wietse


Re: postfix will not send

2021-12-31 Thread John Fawcett

On 31/12/2021 11:56, John Fawcett wrote:

On 31/12/2021 10:36, Doug Denault wrote:
This is a postfix/cyrus/mysql system running in a FreeBSD jail. It is 
(as far as I can make it) identical to a bare metal with the same 
configuration. Delivery & reading email works fine, the jailed system 
will not send email failing with:


cyrus postfix/smtpd[51745]: warning: SASL: Connect to smtpd failed: 
No such file or directory

cyrus postfix/smtpd[51745]: fatal: no SASL authentication mechanisms


The warning message (at least in the latest version of postfix) is 
given only for smtpd_sasl_type = dovecot, so seems that dovecot SASL 
is configured, not cyrus SASL and postfix is interpreting "smtpd" 
which is your smtpd_sasl_path setting as the dovecot socket path to 
connect to for authentication.




postconf -n
...

don't see it and all the internet seems to use dovecot but I don't 
see how whatever imap impacks smtp. Thanks for any thoughts


_
Douglas Denault
http://www.safeport.com
d...@safeport.com
Voice: 301-217-9220
  Fax: 301-217-9277


Doug

Which imap server you use is irrelevant. It is relevant which SASL 
implementation you use.


postconf -a will give the available SASL implementations.

postconf smtpd_sasl_type will give the configured one. However, you 
may have some override to that parameter configured in master.cf.


Hope that helps you track it down.

John


Just a further bit of info. If I read the following correctly, looks 
like FreeBSD has a default of smtpd_sasl_type = dovecot since postfix 2.11.7


https://svnweb.freebsd.org/ports/head/mail/postfix/Makefile?r1=409551=409550=409551

In officially released postfix the default is cyrus. This is probably 
why you are getting dovecot SASL even though you didn't specify a non 
default smtpd_sasl_type. So if you've got Cyrus SASL installed you can 
configure


smtpd_sasl_type= cyrus in your main.cf.

John





Re: postfix will not send

2021-12-31 Thread Benny Pedersen

On 2021-12-31 10:36, Doug Denault wrote:


broken_sasl_auth_clients = yes


not needed in 2022


smtpd_sasl_auth_enable = yes


this is undesired since it open sasl auth on port 25


don't see it and all the internet seems to use dovecot but I don't see
how whatever imap impacks smtp. Thanks for any thoughts


you have mixed horissont :)

https://doc.dovecot.org/admin_manual/submission_server/

https://doc.dovecot.org/configuration_manual/howto/postfix_and_dovecot_sasl/

both is good, make your choice on one of them


Re: postfix will not send

2021-12-31 Thread John Fawcett

On 31/12/2021 10:36, Doug Denault wrote:
This is a postfix/cyrus/mysql system running in a FreeBSD jail. It is 
(as far as I can make it) identical to a bare metal with the same 
configuration. Delivery & reading email works fine, the jailed system 
will not send email failing with:


cyrus postfix/smtpd[51745]: warning: SASL: Connect to smtpd failed: No 
such file or directory

cyrus postfix/smtpd[51745]: fatal: no SASL authentication mechanisms


The warning message (at least in the latest version of postfix) is given 
only for smtpd_sasl_type = dovecot, so seems that dovecot SASL is 
configured, not cyrus SASL and postfix is interpreting "smtpd" which is 
your smtpd_sasl_path setting as the dovecot socket path to connect to 
for authentication.




postconf -n
...

don't see it and all the internet seems to use dovecot but I don't see 
how whatever imap impacks smtp. Thanks for any thoughts


_
Douglas Denault
http://www.safeport.com
d...@safeport.com
Voice: 301-217-9220
  Fax: 301-217-9277


Doug

Which imap server you use is irrelevant. It is relevant which SASL 
implementation you use.


postconf -a will give the available SASL implementations.

postconf smtpd_sasl_type will give the configured one. However, you may 
have some override to that parameter configured in master.cf.


Hope that helps you track it down.

John




postfix will not send

2021-12-31 Thread Doug Denault
This is a postfix/cyrus/mysql system running in a FreeBSD jail. It is (as 
far as I can make it) identical to a bare metal with the same 
configuration. Delivery & reading email works fine, the jailed system will 
not send email failing with:


cyrus postfix/smtpd[51745]: warning: SASL: Connect to smtpd failed: No such 
file or directory
cyrus postfix/smtpd[51745]: fatal: no SASL authentication mechanisms

postconf -n
allow_untrusted_routing = no
broken_sasl_auth_clients = yes
command_directory = /usr/local/sbin
compatibility_level = 2
daemon_directory = /usr/local/libexec/postfix
data_directory = /var/db/postfix
debug_peer_level = 2
debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd 
$daemon_directory/$process_name $process_id & sleep 5

html_directory = /usr/local/share/doc/postfix
inet_interfaces = $myhostname, localhost
inet_protocols = ipv4
local_recipient_maps =
mail_owner = postfix
mailbox_size_limit = 2
mailbox_transport = lmtp:unix:/var/imap/socket/lmtp
mailq_path = /usr/local/bin/mailq
manpage_directory = /usr/local/man
message_size_limit = 1
meta_directory = /usr/local/libexec/postfix
mynetworks = xxx.xxx.157.16/32, 127.0.0.0/8
mynetworks_style = subnet
myorigin = $myhostname
newaliases_path = /usr/local/bin/newaliases
queue_directory = /var/spool/postfix
readme_directory = /usr/local/share/doc/postfix
recipient_delimiter = +
relay_domains = $mydestination mail2.safeport.com
sample_directory = /usr/local/etc/postfix
sendmail_path = /usr/local/sbin/sendmail
setgid_group = maildrop
shlib_directory = /usr/local/lib/postfix
smtpd_enforce_tls = no
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = cyrus.safeport.com
smtpd_sasl_path = smtpd
smtpd_tls_CAfile = /usr/local/etc/postfix/ssl/ov_safeport_ca-bundle.crt
smtpd_tls_ask_ccert = no
smtpd_tls_auth_only = yes
smtpd_tls_cert_file = /usr/local/etc/postfix/ssl/ov_safeport_com.crt
smtpd_tls_key_file = /usr/local/etc/postfix/ssl/ov_safeport_com.key
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_req_ccert = no
smtpd_tls_session_cache_timeout = 3600s
smtpd_use_tls = yes
unknown_local_recipient_reject_code = 550
virtual_alias_domains = $virtual_alias_maps
virtual_alias_maps = hash:/usr/local/etc/postfix/virtual 
regexp:/usr/local/etc/postfix/virtual.regexp


don't see it and all the internet seems to use dovecot but I don't see how 
whatever imap impacks smtp. Thanks for any thoughts


_
Douglas Denault
http://www.safeport.com
d...@safeport.com
Voice: 301-217-9220
  Fax: 301-217-9277