Postfix instance doesn't start

SYSTEM INFORMATION
OS type and version Debian linux 12
Webmin version 2.202
after setting up a relayhost on a vps to bypass Microsoft’s restrictions on sending emails. postfix no longer restarts. so I put back my main.cf and master.cf file backups but since then it has been impossible to restart postfix@-.service it crashes every time, does anyone have an idea of ​​a solution?
journalctl shows :
Starting postfix@-.service - Postfix Mail Transport Agent (instance -)…
postfix@-.service: Control process exited, code=exited, status=1/FAILURE
postfix@-.service: Failed with result ‘exit-code’.

and i don’t know where to search for some information
Thanks in advance for your help

You’ll need to look at the mail log or the journal for the postfix unit while trying to restart it.

Note that it looks like you’ve created a weirdly named unit (instance, I guess is what you’re calling it) postfix@- which I guess would have its own unit in the journal, so you’ll need to look at that.

Were you trying to create a second instance of Postfix? Did you give its own ports or IP address and paths? You can’t have multiple services listening on the same addresss:port, which would be a simple explanation for instant failure to start.

hello joe ,first sorry for my poor english .
i’ve in bootup and shutdown


I’ve not created this instance it’s present in all my webmin/virtualmin installations.
As you can see postfix service is running and the instance doesn’t start anymore .

here it is systemctl statut for postfix:

and journal :

I look with lsof if some instance arre running for exemple on 25 but the only thing i see is dovecot on 993,143,995,110 but i think it’s normal. My main.cf looks like that :

# See /usr/share/postfix/main.cf.dist for a commented, more complete version
# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

#smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
smtpd_banner = mail.exemple.dom ESMTP Postfix (Debian/GNU)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = no

# See http://www.postfix.org/COMPATIBILITY_README.html -- default to 3.6 on
# fresh installs.
compatibility_level = 3.6



# TLS parameters
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_security_level = may

smtp_tls_CApath=/etc/ssl/certs
smtp_tls_security_level = dane
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache


smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = $myhostname, exemple.dom , localhost.exemple.dom, localhost
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_command = /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
virtual_alias_maps = hash:/etc/postfix/virtual
sender_bcc_maps = hash:/etc/postfix/bcc
sender_dependent_default_transport_maps = hash:/etc/postfix/dependent
home_mailbox = Maildir/
smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination
smtp_dns_support_level = dnssec
smtp_host_lookup = dns
allow_percent_hack = no
resolve_dequoted_address = no
milter_default_action = accept
smtpd_milters = inet:127.0.0.1:8891
non_smtpd_milters = inet:127.0.0.1:8891
tls_server_sni_maps = hash:/etc/postfix/sni_map
debug_peer_list = exemple.dom

Somebody created it. That’s not normal. If it’s on all of your severs, you created it on all of your servers. It didn’t come from the Postfix package.

You’re looking at the wrong configuration files. /etc/postfix/main.cf would not be the configuration for whatever postfix@-.service is. (At least, it shouldn’t be if you expect both to be able to start, since if they have the same config files, they’ll start on the same address:port, which can’t ever work.)

You should figure out what that is before you try to start it.

Look at the service file referenced in the status (/lib/systemd/system/postfix@.service) and figure out where it’s looking for instance information, and check whatever configuration is actually being looked at.

But, in the general case, that wouldn’t exist and you wouldn’t need it for normal email services. It’s not clear to me what you’re trying to do, but you definitely have two instances of Postfix, and one of them is not the usual instance that is provided by the Postfix package. You’ve added another one. For what purpose, I don’t know. Obviously it’s misconfigured, since it won’t start.

But, nobody can give you a general answer about a quite specific thing you’ve created, even if you don’t know you created it. Maybe you should tell us what documentation you were following that got your here. Something weird is going on, and if you don’t know what it is even though you did it, we certainly can’t guess.

Holy heck.

I was wrong. Debian 12 does have an instance named postfix@-. What is this fresh hell?

I have no idea what this is about, actually.

But, it does seem to be using the default /etc/postfix config files on my Debian 12 test system, and it doesn’t seem to conflict with postfix, which doesn’t seem to actually do anything.

So, you probably do need to fix your Postfix configuration in the usual locations.

You’ll need to look at the journal for the postfix@- unit to find out why it’s failing to start, and I guess I need to figure out what the heck the Debian folks are thinking. This feels like the kind of bad idea an Ubuntu developer would come up with.

Seems to be about chrooting Postfix. Still quite ugly. Takes a declarative thing, and makes a bunch of it procedural. Very messy.

what i try to do is in that page :
https://archive.virtualmin.com/node/32825
before i try everything works fine and after reboot postfix never restart …
even when i replace main.cf by the older one
cat of the /lib/systemd/system/postfix@.service looks like that :

[Unit]
Description=Postfix Mail Transport Agent (instance %i)
Documentation=man:postfix(1)
PartOf=postfix.service
Before=postfix.service
ReloadPropagatedFrom=postfix.service
After=network-online.target nss-lookup.target
Wants=network-online.target

[Service]
Type=forking
GuessMainPID=no
ExecStartPre=/usr/lib/postfix/configure-instance.sh %i
ExecStart=/usr/sbin/postmulti -i %i -p start
ExecStop=/usr/sbin/postmulti -i %i -p stop
ExecReload=/usr/sbin/postmulti -i %i -p reload

[Install]
WantedBy=multi-user.target

and i don’t code it …

journal for postfix@- look like that :

Feb 01 01:06:58  systemd[1]: Failed to start postfix@-.service - Postfix Mail Transport Agent (instance -).
Feb 01 01:06:58 systemd[1]: postfix@-.service: Failed with result 'exit-code'.
Feb 01 01:06:58 systemd[1]: postfix@-.service: Control process exited, code=exited, status=1/FAILURE
Feb 01 01:06:57  systemd[1]: Starting postfix@-.service - Postfix Mail Transport Agent (instance -)...

so journal is not very interesting, do you know if i install rsyslog i will have more details on what append ?

if i copy my virtuals and other config files elsewhere and i do a reinstall of postfix without uninstall it and after i do a
virtualmin config-system -i Postfix
virtualmin config-system -i SASL
do i have chance to make it work again ?

No! Don’t go looking for more problems.

Is that really all that’s in the journal? Is there no mail.log?

No. For virtualmin config-system to do something useful, you have to give it default config files, the ones that would be installed on a freshly installed OS.

You could delete all the config files you modified, use apt reinstall to reinstall those config files, and then use virtualmin config-system to tweak them for Virtualmin, and that would make Postfix start again as long as whatever broke it was in the config files you deleted and replaced with defaults.

If it were me, I’d figure out where the heck the logs are going and read the danged logs.

If you need to use a translator, please do. This is one instance where AI is considered appropriate. ANYTHING that helps you clearly state your problem is good.

hello and thank you for your answers, I was able to get a slightly more precise log this morning apparently the crash occurs in the ExecStartPre part but I can’t get more details at the moment if you know how to make it more verbose I am interested.

The job identifier is 3932.
Feb 01 11:50:11 exemple.com systemd[1]: Starting postfix@-.service - Postfix Mail Transport Agent (instance -)...
░░ Subject: A start job for unit postfix@-.service has begun execution
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░ 
░░ A start job for unit postfix@-.service has begun execution.
░░ 
░░ The job identifier is 4008.
Feb 01 11:50:12 exemple.com systemd[1]: postfix@-.service: Control process exited, code=exited, status=1/FAILURE
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░ 
░░ An ExecStartPre= process belonging to unit postfix@-.service has exited.
░░ 
░░ The process' exit code is 'exited' and its exit status is 1.
Feb 01 11:50:12 exemple.com systemd[1]: postfix@-.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support

the systemctl status postfix@-.service :

debian@vps:~$ systemctl status postfix@-.service                                                                                              
× postfix@-.service - Postfix Mail Transport Agent (instance -)
     Loaded: loaded (/lib/systemd/system/postfix@.service; enabled-runtime; preset: enabled)
     Active: failed (Result: exit-code) since Sat 2025-02-01 11:51:18 CET; 12min ago
       Docs: man:postfix(1)
    Process: 155516 ExecStartPre=/usr/lib/postfix/configure-instance.sh - (code=exited, status=1/FAILURE)
        CPU: 146ms

Feb 01 11:51:17 exemple.com systemd[1]: Starting postfix@-.service - Postfix Mail Transport Agent (instance -)...
Feb 01 11:51:18 exemple.com systemd[1]: postfix@-.service: Control process exited, code=exited, status=1/FAILURE
Feb 01 11:51:18 exemple.com systemd[1]: postfix@-.service: Failed with result 'exit-code'.
Feb 01 11:51:18 exemple.com systemd[1]: Failed to start postfix@-.service - Postfix Mail Transport Agent (instance -).
debian@vps:~$ 

and the journalctl -xeu postfix@-.service

debian@vps:~$ journalctl -xeu postfix@-.service
░░ 
░░ A start job for unit postfix@-.service has begun execution.
░░ 
░░ The job identifier is 4094.
Feb 01 11:50:50 exemple.com systemd[1]: postfix@-.service: Control process exited, code=exited, status=1/FAILURE
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░ 
░░ An ExecStartPre= process belonging to unit postfix@-.service has exited.
░░ 
░░ The process' exit code is 'exited' and its exit status is 1.
Feb 01 11:50:50 exemple.com systemd[1]: postfix@-.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░ 
░░ The unit postfix@-.service has entered the 'failed' state with result 'exit-code'.
Feb 01 11:50:50 exemple.com systemd[1]: Failed to start postfix@-.service - Postfix Mail Transport Agent (instance -).
░░ Subject: A start job for unit postfix@-.service has failed
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░ 
░░ A start job for unit postfix@-.service has finished with a failure.
░░ 
░░ The job identifier is 4094 and the job result is failed.
Feb 01 11:51:17 exemple.com systemd[1]: Starting postfix@-.service - Postfix Mail Transport Agent (instance -)...
░░ Subject: A start job for unit postfix@-.service has begun execution
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░ 
░░ A start job for unit postfix@-.service has begun execution.
░░ 
░░ The job identifier is 4104.
Feb 01 11:51:18 exemple.com systemd[1]: postfix@-.service: Control process exited, code=exited, status=1/FAILURE
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░ 
░░ An ExecStartPre= process belonging to unit postfix@-.service has exited.
░░ 
░░ The process' exit code is 'exited' and its exit status is 1.
Feb 01 11:51:18 exemple.com systemd[1]: postfix@-.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░ 
░░ The unit postfix@-.service has entered the 'failed' state with result 'exit-code'.
Feb 01 11:51:18 exemple.com systemd[1]: Failed to start postfix@-.service - Postfix Mail Transport Agent (instance -).
░░ Subject: A start job for unit postfix@-.service has failed
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░ 
░░ A start job for unit postfix@-.service has finished with a failure.
░░ 
░░ The job identifier is 4104 and the job result is failed.

debian@vps:~$ 

Could it not be a rightsl problem that I inadvertently modified for saslauth for example and which would prevent the instance from starting?
do you know how to have a more detailed log of the
/usr/lib/postfix/configure-instance.sh %i
in order to determine when it crashes?

thanks in advance for your answers

a little update on the problem i was able to restart half of the postfix ( it can send email but no local delivery for the moment )
What i have done for that :
in a terminal I do :

root@vps:/home/debian# postfix stop
postfix/postfix-script: stopping the Postfix mail system
root@vps:/home/debian# systemctl status postfix
● postfix.service - Postfix Mail Transport Agent
     Loaded: loaded (/lib/systemd/system/postfix.service; disabled; preset: enabled)
     Active: active (exited) since Sat 2025-02-01 19:42:54 CET; 22s ago
       Docs: man:postfix(1)
    Process: 288552 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
   Main PID: 288552 (code=exited, status=0/SUCCESS)
        CPU: 1ms

Feb 01 19:42:54 vps.chaps.com systemd[1]: Starting postfix.service - Postfix Mail Transport Agent...
Feb 01 19:42:54 vps.chaps.com systemd[1]: Finished postfix.service - Postfix Mail Transport Agent.
root@vps:/home/debian# systemctl stop postfix
root@vps:/home/debian# systemctl status postfix
○ postfix.service - Postfix Mail Transport Agent
     Loaded: loaded (/lib/systemd/system/postfix.service; disabled; preset: enabled)
     Active: inactive (dead) since Sat 2025-02-01 19:43:51 CET; 4s ago
   Duration: 57.025s
       Docs: man:postfix(1)
    Process: 288552 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
   Main PID: 288552 (code=exited, status=0/SUCCESS)
        CPU: 1ms

Feb 01 19:42:54 exemple.com systemd[1]: Starting postfix.service - Postfix Mail Transport Agent...
Feb 01 19:42:54 exemple.com systemd[1]: Finished postfix.service - Postfix Mail Transport Agent.
Feb 01 19:43:51 exemple.com systemd[1]: postfix.service: Deactivated successfully.
Feb 01 19:43:51 exemple.com systemd[1]: Stopped postfix.service - Postfix Mail Transport Agent.
root@vps:/home/debian# systemctl enable postfix
Synchronizing state of postfix.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable postfix
Created symlink /etc/systemd/system/multi-user.target.wants/postfix.service → /lib/systemd/system/postfix.service.
root@vps:/home/debian# postfix start
postfix/postfix-script: starting the Postfix mail system

when now i go to Servers>Postfix it is shown as started but i can’t reload the conf
emails are send but not received.
when i go to System>Bootup and Shutdown
postfix.service is stated but postfix@-.service is stopped

I think it’s probably a trouble between systemd and sysV.

I reboot to see what happen :
Servers>Postfix not started
in a terminal
postfix start
Server>Postfix started
Emails are send but not received

hello everyone, a little update on my problem. After inspection my problem occurs during file execution:
/usr/lib/postfix/configure-instance.sh
more precisely it is the command which does not execute:
openssl rehash “$dest_dir” >/dev/null 2>&1

So I executed this command manually on the folder:
openssl rehash /var/spool/postfix/etc/ssl/certs.NEW/

and restarted the startup of the instance and tada everything and got back to normal but hey I don’t really understand what happened.
on the other hand if someone can explain to me how to use postfix smtp with ipV6
or set up a relayhost because this bug happened because of the bad reputation of my provider’s IPv4 IP range
thanks to google translate for translation

1 Like

Thanks for following up with your solution!

I’m completely baffled by why they have that shell mess involved in starting Postfix or an instance for the primary postfix configuration. It all feels unnecessarily complex and fragile.

I’m sure we can help, but make new topics for new problems. No one can keep up when the problem diverges completely from the original topic.

https://forum.virtualmin.com/guidelines

Hello Joe,

maybe it can help someone with same problem.

indeed it’s better
https://forum.virtualmin.com/t/postfix-relayhost-and-ipv6-configuration/131923

thanks Joe for being here and for your support

1 Like

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.