setup issue -- debian /ubuntu 16.04.1 "bad string length 0 < 1: setgid_group ="

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

setup issue -- debian /ubuntu 16.04.1 "bad string length 0 < 1: setgid_group ="

Gary Aitken
Hi all,

I'm new to postfix and trying to administer a debian google-compute
box, also new to me (coming from fbsd).  So lots of opportunities
for learning...

I modified /etc/crontable to fire off some backup stuff (a shell
script that does a "gcloud compute disks snapshot ...".  Cron logs
attempting to start the script, then logs:
cron[1214]: sendmail: fatal: bad string length 0 < 1: setgid_group =
postfix/sendmail[8628]: fatal: bad string length 0 < 1: setgid_group =

As I did not set this system up, it's not clear to me what has been
properly installed and what came as a result of other stuff.
Initially, I was getting a
   "/etc/postfix/main.cf: No such file or directory"
error.  I copied main.cf.proto to main.cf without change, as it
seemed to be ok as is.

It appears postfix was installed as a result of a mysql installation:

aptitude why postfix:
i   automysqlbackup Depends  bsd-mailx | mailx
i A bsd-mailx       Depends  default-mta | mail-transport-agent
i A postfix         Provides mail-transport-agent

but the setup not completed?  This machine is not intended to serve
as a mail server; I only need it to post mail appropriately.

I modified /etc/aliases to forward root, then tried sudo newaliases
but I get the same error:
newaliases: fatal: bad string length 0 < 1: setgid_group =

Any helpful clues would be much appreciated.

Thanks,

Gary
Reply | Threaded
Open this post in threaded view
|

Re: setup issue -- debian /ubuntu 16.04.1 "bad string length 0 < 1: setgid_group ="

Wietse Venema
Gary Aitken:

> Hi all,
>
> I'm new to postfix and trying to administer a debian google-compute
> box, also new to me (coming from fbsd).  So lots of opportunities
> for learning...
>
> I modified /etc/crontable to fire off some backup stuff (a shell
> script that does a "gcloud compute disks snapshot ...".  Cron logs
> attempting to start the script, then logs:
> cron[1214]: sendmail: fatal: bad string length 0 < 1: setgid_group =
> postfix/sendmail[8628]: fatal: bad string length 0 < 1: setgid_group =

Please DO follow a proper Postfix installation procedure.

- Either install from package.

- Or install from source code.

This is not something that you should be fixing by hand.

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: setup issue -- debian /ubuntu 16.04.1 "bad string length 0 < 1: setgid_group ="

Matus UHLAR - fantomas
In reply to this post by Gary Aitken
On 31.05.20 10:40, Gary Aitken wrote:
>Subject: setup issue -- debian /ubuntu 16.04.1 "bad string length 0 < 1: setgid_group ="

16.04 is ubuntu version

>I'm new to postfix and trying to administer a debian google-compute
>box, also new to me (coming from fbsd).  So lots of opportunities
>for learning...
>
>I modified /etc/crontable to fire off some backup stuff (a shell
>script that does a "gcloud compute disks snapshot ...".  Cron logs
>attempting to start the script, then logs:
>cron[1214]: sendmail: fatal: bad string length 0 < 1: setgid_group =
>postfix/sendmail[8628]: fatal: bad string length 0 < 1: setgid_group =
>
>As I did not set this system up, it's not clear to me what has been
>properly installed and what came as a result of other stuff.
>Initially, I was getting a
>  "/etc/postfix/main.cf: No such file or directory"
>error.  I copied main.cf.proto to main.cf without change, as it
>seemed to be ok as is.
>
>It appears postfix was installed as a result of a mysql installation:
>
>aptitude why postfix:
>i   automysqlbackup Depends  bsd-mailx | mailx
>i A bsd-mailx       Depends  default-mta | mail-transport-agent
>i A postfix         Provides mail-transport-agent
>
>but the setup not completed?  This machine is not intended to serve
>as a mail server; I only need it to post mail appropriately.
>
>I modified /etc/aliases to forward root, then tried sudo newaliases
>but I get the same error:
>newaliases: fatal: bad string length 0 < 1: setgid_group =

you should try to run:

dpkg --configure -a

to configure all packages that aren't configured yet.

however, so far this problem looks more like ubuntu than postfix problem.

--
Matus UHLAR - fantomas, [hidden email] ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
I drive way too fast to worry about cholesterol.
Reply | Threaded
Open this post in threaded view
|

Re: setup issue -- debian /ubuntu 16.04.1 "bad string length 0 < 1: setgid_group ="

Gary Aitken
On 5/31/20 11:34 AM, Matus UHLAR - fantomas wrote:

>> I'm new to postfix and trying to administer a debian
>> google-compute box, also new to me (coming from fbsd).  So lots of
>> opportunities for learning...
>>
>> I modified /etc/crontable to fire off some backup stuff (a shell
>> script that does a "gcloud compute disks snapshot ...".  Cron logs
>> attempting to start the script, then logs: cron[1214]: sendmail:
>> fatal: bad string length 0 < 1: setgid_group =
>> postfix/sendmail[8628]: fatal: bad string length 0 < 1:
>> setgid_group =
>>
>> As I did not set this system up, it's not clear to me what has
>> been properly installed and what came as a result of other stuff.
>> Initially, I was getting a "/etc/postfix/main.cf: No such file or
>> directory" error.  I copied main.cf.proto to main.cf without
>> change, as it seemed to be ok as is.
>>
>> It appears postfix was installed as a result of a mysql
>> installation:
>>
>> aptitude why postfix: i   automysqlbackup Depends  bsd-mailx |
>> mailx i A bsd-mailx       Depends  default-mta |
>> mail-transport-agent i A postfix         Provides
>> mail-transport-agent
>>
>> but the setup not completed?  This machine is not intended to
>> serve as a mail server; I only need it to post mail appropriately.
>>
>> I modified /etc/aliases to forward root, then tried sudo
>> newaliases but I get the same error: newaliases: fatal: bad string
>> length 0 < 1: setgid_group =
>
> you should try to run:
>
> dpkg --configure -a to configure all packages that aren't configured
> yet.
>
> however, so far this problem looks more like ubuntu than postfix
> problem.

On 5/31/20 10:59 AM, Wietse Venema wrote:
>
> Please DO follow a proper Postfix installation procedure.
>
> - Either install from package.
>
> - Or install from source code.
>
> This is not something that you should be fixing by hand.

Thank you both.  Before doing something stupid...
This system has been running in a production environment for
some time, although what the mail situation has been I'm not sure.
The production environment involves a redmine installation.

The postfix package was already installed, which is what troubles
me; it was apparently not properly configured.  Will an attempt to
reconfigure an already installed and configured package screw
things up?  Perhaps it was configured automatically by the
mysqlbackup install?

$ dpkg-query --list postfix
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                   Version          Architecture     Description
+++-======================-================-================-==================================================
ii  postfix                3.1.0-3ubuntu0.3 amd64            High-performance mail transport agent

$ dpkg-query --status postfix
Package: postfix
Status: install ok installed
Priority: extra
Section: mail
Installed-Size: 3610
Maintainer: Ubuntu Developers <[hidden email]>
Architecture: amd64
Version: 3.1.0-3ubuntu0.3
Replaces: mail-transport-agent
Provides: default-mta, mail-transport-agent
Depends: libc6 (>= 2.14), libdb5.3, libicu55 (>= 55.1-1~), libsasl2-2, libsqlite3-0 (>= 3.5.9), libssl1.0.0 (>= 1.0.0), debconf (>= 0.5) | debconf-2.0, netbase, adduser (>= 3.48), dpkg (>= 1.8.3), lsb-base (>= 3.0-6), ssl-cert, cpio
Recommends: python3
Suggests: procmail, postfix-mysql, postfix-pgsql, postfix-ldap, postfix-pcre, sasl2-bin, libsasl2-modules, dovecot-common, resolvconf, postfix-cdb, mail-reader, ufw, postfix-doc
Conflicts: libnss-db (<< 2.2-3), mail-transport-agent, smail

debconf-show shows the one item which *has* been configured is
   postfix/main_mailer_type: No configuration

$ debconf-show postfix
debconf: DbDriver "passwords" warning: could not open /var/cache/debconf/passwords.dat: Permission denied
   postfix/root_address:
   postfix/mailname: xblgx-ops.c.insidexblgx.internal
* postfix/main_mailer_type: No configuration
   postfix/compat_conversion_warning: true
   postfix/mailbox_limit: 0
   postfix/relayhost:
   postfix/destinations:
   postfix/sqlite_warning:
   postfix/protocols:
   postfix/procmail:
   postfix/dynamicmaps_conversion_warning:
   postfix/retry_upgrade_warning:
   postfix/tlsmgr_upgrade_warning:
   postfix/bad_recipient_delimiter:
   postfix/mynetworks: 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
   postfix/chattr: false
   postfix/relay_restrictions_warning:
   postfix/mydomain_warning:
   postfix/kernel_version_warning:
   postfix/recipient_delim: +
   postfix/rfc1035_violation: false
   postfix/not_configured:
   postfix/main_cf_conversion_warning: true
Reply | Threaded
Open this post in threaded view
|

Re: setup issue -- debian /ubuntu 16.04.1 "bad string length 0 < 1: setgid_group ="

Scott Kitterman-4
On Sunday, May 31, 2020 4:31:23 PM EDT Gary Aitken wrote:

> On 5/31/20 11:34 AM, Matus UHLAR - fantomas wrote:
> >> I'm new to postfix and trying to administer a debian
> >> google-compute box, also new to me (coming from fbsd).  So lots of
> >> opportunities for learning...
> >>
> >> I modified /etc/crontable to fire off some backup stuff (a shell
> >> script that does a "gcloud compute disks snapshot ...".  Cron logs
> >> attempting to start the script, then logs: cron[1214]: sendmail:
> >> fatal: bad string length 0 < 1: setgid_group =
> >> postfix/sendmail[8628]: fatal: bad string length 0 < 1:
> >> setgid_group =
> >>
> >> As I did not set this system up, it's not clear to me what has
> >> been properly installed and what came as a result of other stuff.
> >> Initially, I was getting a "/etc/postfix/main.cf: No such file or
> >> directory" error.  I copied main.cf.proto to main.cf without
> >> change, as it seemed to be ok as is.
> >>
> >> It appears postfix was installed as a result of a mysql
> >> installation:
> >>
> >> aptitude why postfix: i   automysqlbackup Depends  bsd-mailx |
> >> mailx i A bsd-mailx       Depends  default-mta |
> >> mail-transport-agent i A postfix         Provides
> >> mail-transport-agent
> >>
> >> but the setup not completed?  This machine is not intended to
> >> serve as a mail server; I only need it to post mail appropriately.
> >>
> >> I modified /etc/aliases to forward root, then tried sudo
> >> newaliases but I get the same error: newaliases: fatal: bad string
> >> length 0 < 1: setgid_group =
> >
> > you should try to run:
> >
> > dpkg --configure -a to configure all packages that aren't configured
> > yet.
> >
> > however, so far this problem looks more like ubuntu than postfix
> > problem.
>
> On 5/31/20 10:59 AM, Wietse Venema wrote:
> > Please DO follow a proper Postfix installation procedure.
> >
> > - Either install from package.
> >
> > - Or install from source code.
> >
> > This is not something that you should be fixing by hand.
>
> Thank you both.  Before doing something stupid...
> This system has been running in a production environment for
> some time, although what the mail situation has been I'm not sure.
> The production environment involves a redmine installation.
>
> The postfix package was already installed, which is what troubles
> me; it was apparently not properly configured.  Will an attempt to
> reconfigure an already installed and configured package screw
> things up?  Perhaps it was configured automatically by the
> mysqlbackup install?

> debconf-show shows the one item which *has* been configured is
>    postfix/main_mailer_type: No configuration

The Debian configuration that Ubuntu inherits does have an option to not
configure postfix when installed.  This is intended to  be used by an admin that
intends to do their own configuration from scratch.  It is not intended to be
left that way indefinitely.

Unfortunately, when postfix is installed as a package dependency of some
package that wants a local MTA installed, people don't always configure it.  
Since postfix is the default MTA in Ubuntu (it's not in Debian), that means it
is not unusual to find Ubuntu installations with postfix that are not well
configured because it was only installed as a side effect of installing some
other package.

The advice to use dpkg-reconfigure to set up the basic postfix installation
(that you may then further configure) is the correct approach here.

Scott K


Reply | Threaded
Open this post in threaded view
|

Re: setup issue -- debian /ubuntu 16.04.1 "bad string length 0 < 1: setgid_group ="

Gary Aitken
In reply to this post by Gary Aitken
I apologize for the interruption in this thread, fires to put out so slow
getting back to this.

> On Sunday, May 31, 2020 4:31:23 PM EDT Gary Aitken wrote:
>> On 5/31/20 11:34 AM, Matus UHLAR - fantomas wrote:
>>>> I'm new to postfix and trying to administer a debian
>>>> google-compute box, also new to me (coming from fbsd).  So lots
>>>> of opportunities for learning...
...

>>>>>> It appears postfix was installed as a result of a mysql
>>>> installation:
>>>>>> aptitude why postfix: i   automysqlbackup Depends
>>>>>> bsd-mailx |
>>>> mailx i A bsd-mailx       Depends  default-mta |
>>>> mail-transport-agent i A postfix         Provides
>>>> mail-transport-agent
>>>>>> but the setup not completed?  This machine is not intended
>>>>>> to
>>>> serve as a mail server; I only need it to post mail
>>>> appropriately.
...
>> On 5/31/20 10:59 AM, Wietse Venema wrote:
>>> Please DO follow a proper Postfix installation procedure.
>>>> - Either install from package. - Or install from source code.
>>>> This is not something that you should be fixing by hand.
...

> The Debian configuration that Ubuntu inherits does have an option to
> not configure postfix when installed.  This is intended to  be used
> by an admin that intends to do their own configuration from scratch.
> It is not intended to be left that way indefinitely.
>
> Unfortunately, when postfix is installed as a package dependency of
> some package that wants a local MTA installed, people don't always
> configure it. Since postfix is the default MTA in Ubuntu (it's not in
> Debian), that means it is not unusual to find Ubuntu installations
> with postfix that are not well configured because it was only
> installed as a side effect of installing some other package.
>
> The advice to use dpkg-reconfigure to set up the basic postfix
> installation (that you may then further configure) is the correct
> approach here.

Thanks, that probably explains what's going on.
I ran dpkg-reconfigure postfix but that didn't solve the problem:

$ sudo dpkg-reconfigure postfix
setting synchronous mail queue updates: true
changing /etc/mailname to xbiologix.net
setting myorigin
setting destinations: xbiologix.net, $myhostname, xblgx-ops.c.insidexblgx.internal, localhost.c.insidexblgx.internal, localhost
setting relayhost: aspmx3.googlemail.com.
setting mynetworks: 127.0.0.0/8
setting mailbox_size_limit: 51200000
setting recipient_delimiter: +
setting inet_interfaces: loopback-only
setting inet_protocols: ipv4

Postfix is now set up with the changes above.  If you need to make changes, edit
/etc/postfix/main.cf (and others) as needed.  To view Postfix configuration
values, see postconf(1).

After modifying main.cf, be sure to run '/etc/init.d/postfix reload'.

Running newaliases
Job for postfix.service failed because the control process exited with error code. See "systemctl status postfix.service" and "journalctl -xe" for details.
invoke-rc.d: initscript postfix, action "restart" failed.
● postfix.service - LSB: Postfix Mail Transport Agent
    Loaded: loaded (/etc/init.d/postfix; bad; vendor preset: enabled)
   Drop-In: /run/systemd/generator/postfix.service.d
            └─50-postfix-$mail-transport-agent.conf
    Active: failed (Result: exit-code) since Fri 2020-06-12 18:09:40 UTC; 10ms ago
      Docs: man:systemd-sysv-generator(8)
   Process: 2009 ExecStart=/etc/init.d/postfix start (code=exited, status=1/FAILURE)

Jun 12 18:09:38 xblgx-ops systemd[1]: Stopped LSB: Postfix Mail Transport Agent.
Jun 12 18:09:38 xblgx-ops systemd[1]: Starting LSB: Postfix Mail Transport Agent...
Jun 12 18:09:38 xblgx-ops postfix[2009]:  * Starting Postfix Mail Transport Agent postfix
Jun 12 18:09:39 xblgx-ops postfix[2102]: fatal: bad string length 0 < 1: mailq_path =
Jun 12 18:09:40 xblgx-ops postfix[2009]:    ...fail!
Jun 12 18:09:40 xblgx-ops systemd[1]: postfix.service: Control process exited, code=exited status=1
Jun 12 18:09:40 xblgx-ops systemd[1]: Failed to start LSB: Postfix Mail Transport Agent.
Jun 12 18:09:40 xblgx-ops systemd[1]: postfix.service: Unit entered failed state.
Jun 12 18:09:40 xblgx-ops systemd[1]: postfix.service: Failed with result 'exit-code'.
-------------

I had previously edited main.cf to set
   sendmail_path = /usr/sbin/sendmail
   setgid_group = postdrop

$ sudo postfix check
postfix: fatal: bad string length 0 < 1: mailq_path =

Not sure what mailq_path should be set to... /var/spool/postfix/ ?

Do all of these need to be set?  I thought the re-configure should
have taken care of this, and reasonable defaults would be applied?
Do I need to remove main.cf before doing a dpkg-reconfigure?

Thanks,

Gary
Reply | Threaded
Open this post in threaded view
|

Re: setup issue -- debian /ubuntu 16.04.1 "bad string length 0 < 1: setgid_group ="

Wietse Venema
Gary Aitken:
> I had previously edited main.cf to set
>    sendmail_path = /usr/sbin/sendmail
>    setgid_group = postdrop
>
> $ sudo postfix check
> postfix: fatal: bad string length 0 < 1: mailq_path =
>
> Not sure what mailq_path should be set to... /var/spool/postfix/ ?

http://www.postfix.org/postconf.5.html#mailq_path

    Sendmail compatibility feature that specifies where the Postfix
    mailq(1) command is installed. This command can be used to list
    the Postfix mail queue.

> Do all of these need to be set?  I thought the re-configure should
> have taken care of this, and reasonable defaults would be applied?
> Do I need to remove main.cf before doing a dpkg-reconfigure?

Perhaps you're better of with

- uninstall Postfix
- reinstall Postfix

and only after doing that edit Postfix config files.

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: setup issue -- debian /ubuntu 16.04.1 "bad string length 0 < 1: setgid_group ="

Gary Aitken
On 6/12/20 12:26 PM, Wietse Venema wrote:

> Gary Aitken:
>> I had previously edited main.cf to set
>>     sendmail_path = /usr/sbin/sendmail
>>     setgid_group = postdrop
>>
>> $ sudo postfix check
>> postfix: fatal: bad string length 0 < 1: mailq_path =
>>
>> Not sure what mailq_path should be set to... /var/spool/postfix/ ?
>
> http://www.postfix.org/postconf.5.html#mailq_path
>
>      Sendmail compatibility feature that specifies where the Postfix
>      mailq(1) command is installed. This command can be used to list
>      the Postfix mail queue.
>
>> Do all of these need to be set?  I thought the re-configure should
>> have taken care of this, and reasonable defaults would be applied?
>> Do I need to remove main.cf before doing a dpkg-reconfigure?
>
> Perhaps you're better of with
>
> - uninstall Postfix
> - reinstall Postfix
>
> and only after doing that edit Postfix config files.

A simple uninstall and reinstall of postfix could not be used, as the uninstall
would remove another package (automysqlbackup) which depended on postfix.
That package was already working, and I didn't want to disturb it.  I got
around that by installing nullmailer, which satisfied the default-mta and
mail-transfer-agent dependencies from automysqlbackup; then uninstalled
postfix without removing/uninstalling anything else.  Then purge postfix
to remove the config files, then reinstall postfix.

So, now I have it installed "properly".  yea!
However...

This is a satellite system which should receive no mail, but which needs to
post mail from root and other daemon-users.  I thought I had it set up by
answering the setup questions as:
   Type of system: Satellite
   Domain: xbiologix.net
   mail relay: aspmx3.googlemail.com

I have modified main.cf by adding:

smtpd_tls_cert_file=/etc/letsencrypt/live/xbiologix.net/fullchain.pem
smtpd_tls_key_file=/etc/letsencrypt/live/xbiologix.net/privkey.key
...
smtp_tls_security_level = may
smtp_tls_loglevel = 1

$ postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
html_directory = /usr/share/doc/postfix/html
inet_interfaces = loopback-only
inet_protocols = all
mailbox_size_limit = 0
mydestination =
myhostname = xblgx-ops.c.insidexblgx.internal
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = /etc/mailname
readme_directory = /usr/share/doc/postfix
recipient_delimiter = +
relay_domains =
relayhost = aspmx3.googlemail.com
smtp_tls_loglevel = 1
smtp_tls_security_level = may
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
smtpd_tls_cert_file = /etc/letsencrypt/live/xbiologix.net/fullchain.pem
smtpd_tls_key_file = /etc/letsencrypt/live/xbiologix.net/privkey.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes

When attempting to send mail, /var/log/mail.log shows the following:

Jun 16 17:18:11 xblgx-ops postfix/smtp[26224]: connect to aspmx3.googlemail.com[142.250.10.27]:25: Connection timed out

It is using default mail port, 25; I need port 465 or 587 because it's my
understanding google blocks everything on port 25.
During the setup, I was not (I don't think) given the option of specifying
smtps or the port.

There is supposedly a default egress rule from google cloud vm instances,
but I don't see it listed in my firewall rules.  However, I think the listed
firewall rules do not include the default *implied* rules imposed at a higher
level; at least the google cloud docs kind of imply this:

"Firewall rules must allow egress traffic from the instance. Unless overridden by a higher priority rule, the implied allow rule for egress traffic permits outbound traffic from all instances."

In any case, I added an explicit rule to allow egress on port 465.
tcpdump shows attempts going out, but on port 25, not 465.

struggling along, any help much appreciated

Gary
Reply | Threaded
Open this post in threaded view
|

Re: setup issue -- debian /ubuntu 16.04.1 "bad string length 0 < 1: setgid_group ="

Scott Kitterman-4
On Tuesday, June 16, 2020 11:36:27 PM EDT Gary Aitken wrote:
> It is using default mail port, 25; I need port 465 or 587 because it's my
> understanding google blocks everything on port 25.
> During the setup, I was not (I don't think) given the option of specifying
> smtps or the port.

There's no preconfigured option for that setup.  The satellite system option
does relay on port 25.  If you want Postfix to do submission, you need to set
that up manually.

Scott K


Reply | Threaded
Open this post in threaded view
|

Re: setup issue -- debian /ubuntu 16.04.1 "bad string length 0 < 1: setgid_group ="

Gary Aitken
On 6/16/20 9:49 PM, Scott Kitterman wrote:
> On Tuesday, June 16, 2020 11:36:27 PM EDT Gary Aitken wrote:
>> It is using default mail port, 25; I need port 465 or 587 because
>> it's my understanding google blocks everything on port 25. During
>> the setup, I was not (I don't think) given the option of
>> specifying smtps or the port.
>
> There's no preconfigured option for that setup.  The satellite system
> option does relay on port 25.  If you want Postfix to do submission,
> you need to set that up manually.

ok, I'm willing, but I haven't the faintest idea what setting it up manually
means.  I presume some settings in main.cf, but postconf -d shows 979 things
to choose from.  suggestions?

Thanks,

Gary
Reply | Threaded
Open this post in threaded view
|

Re: setup issue -- debian /ubuntu 16.04.1 "bad string length 0 < 1: setgid_group ="

Bob Proulx
In reply to this post by Gary Aitken
Gary Aitken wrote:

> Wietse Venema wrote:
> > Perhaps you're better of with
> > - uninstall Postfix
> > - reinstall Postfix
> >
> > and only after doing that edit Postfix config files.
>
> A simple uninstall and reinstall of postfix could not be used, as the uninstall
> would remove another package (automysqlbackup) which depended on postfix.
> That package was already working, and I didn't want to disturb it.  I got
> around that by installing nullmailer, which satisfied the default-mta and
> mail-transfer-agent dependencies from automysqlbackup; then uninstalled
> postfix without removing/uninstalling anything else.  Then purge postfix
> to remove the config files, then reinstall postfix.

For future reference it is also possible to use dpkg to remove postfix
ignoring the dependency and then install it again satisfying the
dependency.

  dpkg --purge --force-depends postfix
  ...verify /etc/postfix/ and other locations are clean...
  apt-get install postfix
  ...configure it as desired...

That would have avoided the clever use of an alternate MTA such as
nullmailer as a dependency placeholder. :-)

> This is a satellite system which should receive no mail, but which needs to
> post mail from root and other daemon-users.  I thought I had it set up by
> answering the setup questions as:
>   Type of system: Satellite
>   Domain: xbiologix.net
>   mail relay: aspmx3.googlemail.com
...
> When attempting to send mail, /var/log/mail.log shows the following:
>
> Jun 16 17:18:11 xblgx-ops postfix/smtp[26224]: connect to aspmx3.googlemail.com[142.250.10.27]:25: Connection timed out
>
> It is using default mail port, 25; I need port 465 or 587 because it's my
> understanding google blocks everything on port 25.
> During the setup, I was not (I don't think) given the option of specifying
> smtps or the port.

It was there.  I ran through a test just now.  dpkg --purge as above
and the installed.  Selected Satellite.  I see this:

    Please specify a domain, host, host:port, [address] or [address]:port. Use the form
    [destination] to turn off MX lookups. Leave this blank for no relay host.
   
    Do not specify more than one host.
   
    The relayhost parameter specifies the default host to send mail to when no entry is
    matched in the optional transport(5) table. When no relay host is given, mail is routed
    directly to the destination.
   
    SMTP relay host (blank for none):

When I specified the following to that form:

    smtp.proulx.com:587

It resulted in this configuration entry.

    root@turmoil:~# postconf relayhost
    relayhost = smtp.proulx.com:587

And so it is possible to use that Debian specific installation
option.  Any more details here should be on a Debian specific mailing
list.

However personally I always simply choose Internet Site and then
configure everything I want on top of that template.  It's a good
default to start from but I always want more specific customizations
on top of it.

Bob
Reply | Threaded
Open this post in threaded view
|

Re: setup issue -- debian /ubuntu 16.04.1 "bad string length 0 < 1: setgid_group ="

Scott Kitterman-4
On Wednesday, June 17, 2020 12:39:06 AM EDT Bob Proulx wrote:
> It resulted in this configuration entry.
>
>     root@turmoil:~# postconf relayhost
>     relayhost = smtp.proulx.com:587
>
> And so it is possible to use that Debian specific installation
> option.  Any more details here should be on a Debian specific mailing
> list.

Those are both good points, but it's also worth noting that typically
submission requires SMTP Auth which you will have to configure manually after
doing the above.

Scott K



Reply | Threaded
Open this post in threaded view
|

Re: setup issue -- debian /ubuntu 16.04.1 "bad string length 0 < 1: setgid_group ="

Bob Proulx
Scott Kitterman wrote:
> Those are both good points, but it's also worth noting that typically
> submission requires SMTP Auth which you will have to configure manually after
> doing the above.

Right.  But there are many good guides on the net available that
describe setting up SMTP Auth in detail.  And setting up Postfix for
use with Gmail.  I didn't want to replicate those guides, poorly.  I
was simply commenting upon the Debian package installation forms.

And furthering that comment...  I am pretty sure that anything entered
into the form at that point becomes set as the relayhost value.  Which
means enclosing with brackets to avoid the MX lookup or using only the
domain name or whatever.  I am pretty sure it is simply transfered
verbatim.  But agreed that further configuration will still be needed.

As to guides on the net...  I am not using Google's Gmail so I don't
know about the quality of these guides below but a quick search found
these that seem topical.

  https://www.linode.com/docs/email/postfix/configure-postfix-to-send-mail-using-gmail-and-google-apps-on-debian-or-ubuntu/

  https://www.howtoforge.com/tutorial/configure-postfix-to-use-gmail-as-a-mail-relay/

And this one is in the www.postfix.org/docs.html page.

  http://souptonuts.sourceforge.net/postfix_tutorial.html

Bob
Reply | Threaded
Open this post in threaded view
|

Re: setup issue -- debian /ubuntu 16.04.1 "bad string length 0 < 1: setgid_group ="

Gary Aitken
In reply to this post by Bob Proulx
On 6/16/20 10:39 PM, Bob Proulx wrote:
> Gary Aitken wrote:
...

> For future reference it is also possible to use dpkg to remove
> postfix ignoring the dependency and then install it again satisfying
> the dependency.
>
> dpkg --purge --force-depends postfix ...verify /etc/postfix/ and
> other locations are clean... apt-get install postfix ...configure it
> as desired...
>
> That would have avoided the clever use of an alternate MTA such as
> nullmailer as a dependency placeholder. :-)

Thanks, saw that but then saw "These options are mostly intended to be
used by experts only.  Using them without fully understanding their
effects may break your whole system."  However, I was about to ask about
some means of restoring / regenerating the whole dependency graph when
the problem got solved.

>> Jun 16 17:18:11 xblgx-ops postfix/smtp[26224]: connect to
>> aspmx3.googlemail.com[142.250.10.27]:25: Connection timed out
>>
>> It is using default mail port, 25; I need port 465 or 587 because
>> it's my understanding google blocks everything on port 25. During
>> the setup, I was not (I don't think) given the option of
>> specifying smtps or the port.
>
> It was there.  I ran through a test just now.  dpkg --purge as above
> and the installed.  Selected Satellite.  I see this:
>
> Please specify a domain, host, host:port, [address] or
> [address]:port. Use the form [destination] to turn off MX lookups.
> Leave this blank for no relay host.
>
> Do not specify more than one host.
>
> The relayhost parameter specifies the default host to send mail to
> when no entry is matched in the optional transport(5) table. When no
> relay host is given, mail is routed directly to the destination.
>
> SMTP relay host (blank for none):
>
> When I specified the following to that form:
>
> smtp.proulx.com:587
>
> It resulted in this configuration entry.
>
> root@turmoil:~# postconf relayhost
> relayhost = smtp.proulx.com:587
>
> And so it is possible to use that Debian specific installation
> option.  Any more details here should be on a Debian specific
> mailing list.
>
> However personally I always simply choose Internet Site and then
> configure everything I want on top of that template.  It's a good
> default to start from but I always want more specific customizations
> on top of it.

Thanks.  Looking back on it, I remember expecting it to ask me for a default
port after that and was surprised when it didn't.  I obviously didn't read it
carefully enough.

On 6/16/20 10:53 PM, Scott Kitterman wrote:

> On Wednesday, June 17, 2020 12:39:06 AM EDT Bob Proulx wrote:
>> It resulted in this configuration entry.
>>
>>      root@turmoil:~# postconf relayhost
>>      relayhost = smtp.proulx.com:587
>>
>> And so it is possible to use that Debian specific installation
>> option.  Any more details here should be on a Debian specific mailing
>> list.
>
> Those are both good points, but it's also worth noting that typically
> submission requires SMTP Auth which you will have to configure manually after
> doing the above.

Thanks, noted; will try to get that when I get back on this; other things
to deal with at the moment.

Thanks all for your thoughtful and helpful answers.

Gary



Reply | Threaded
Open this post in threaded view
|

Re: setup issue -- debian /ubuntu 16.04.1 "bad string length 0 < 1: setgid_group ="

Viktor Dukhovni
In reply to this post by Gary Aitken
On Tue, Jun 16, 2020 at 10:04:15PM -0600, Gary Aitken wrote:

> ok, I'm willing, but I haven't the faintest idea what setting it up manually
> means.  I presume some settings in main.cf, but postconf -d shows 979 things
> to choose from.  suggestions?

Intro:

    http://www.postfix.org/SOHO_README.html
    http://www.postfix.org/BASIC_CONFIGURATION_README.html
    http://www.postfix.org/OVERVIEW.html

But to actually understand Postfix, try Patrick and Ralf's book or Kyle
Dent's book.  Neither covers shiny new features, but the basics are
unchanged.

--
    Viktor.