Hi everyone,

(amature to linux) anyway I have Observium install and running however am unable to get postfix to work I have done the config to work with office365 however i am getting the fallow errors.

 

root@observium /etc/postfix# service postfix status
* postfix.service - Postfix Mail Transport Agent
   Loaded: loaded (/lib/systemd/system/postfix.service; enabled; vendor preset: enabled)
   Active: active (exited) since Wed 2019-09-11 14:52:48 EST; 1 day 23h ago
  Process: 999 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
 Main PID: 999 (code=exited, status=0/SUCCESS)
    Tasks: 0 (limit: 4915)
   CGroup: /system.slice/postfix.service

 

and

 

Sep 13 13:08:27 observium postfix/error[16111]: F26BAE1D28: to=<help@mydomain.com>, relay=none, delay=334484, delays=334482/1.4/0/0.45, dsn=4.3.0, status=deferred (unknown mail transport error)

any suggestion?

 

 

 

 

Forum: 
Tags: 
Jeremy Davis's picture

FWIW the Postfix status info you've posted is expected in TurnKey v15.x.

How did you configure the SMTP relay for Postfix? The "unknown mail transport error" suggests that you may have missed something, or the config is not quite correct.

FWIW we include a Confconsole plugin to set up Email relaying. It provides an easy way to integrate with "Send-In-Blue" email provider, but there is also a "custom" option which should support any/all other providers. Admittedly, I haven't explicitly tested it with Office365, but I have tested it with a range of other providers (e.g. Google, AWS, etc) and all the ones I've tested worked fine.

Although it's possibly also worth noting, that to get Google to work, you actually need to make some tweaks to the config in your Google account. Perhaps you also need to tweaks some config within your Office365 account?

If you haven't already tried using Confconsole, I suggest that you revert any config changes you've made, and try using that to set it up. If you did use Confconsole, please let me know abut any other config tweaks you've tried.

Hi Jeremy 

thanks for your response. below is the config I have am using it for mail relay. No i didnt use the Confconsole because I didnt know of it. 

 

# 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
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 2 on
# fresh installs.
compatibility_level = 2

# 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_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = mydomain.com
mydomain = mydomain.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = $mydomain
mydestination = $myhostname, localhost.localdomain, localhost
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
relayhost = [smtp.office365.com]587
mailbox_size_limit = 0
recipient_delimiter = +
inet_protocols = ipv4
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_tls_security_level = may
header_size_limit = 4096000
sender_canonical_maps = regexp:/etc/postfix/sender_canonical
smtp_tls_CAfile = /etc/postfix/cacert.pem
smtp_use_tls = yes
smtp_generic_maps = hash:/etc/postfix/generic

#myorigin = /etc/mailname
mynetworks_style = subnet

Jeremy Davis's picture

In your config I see:

relayhost = [smtp.office365.com]587

But by my understanding, that should be in the form of [$host]:$port. I.e. should look like this:

relayhost = [smtp.office365.com]:587

Note the missing colon (':')!

Assuming that the relevant password is stored in /etc/postfix/sasl_passwd, then hopefully that might get you over the line?! If not, then perhaps it's worth trying to use the Confconsole plugin. If you try that, I suggest running the "deconfigure" option first.

Please let me know how you get on.

Thanks again Jeremy,

 

I have added the missing colon to the config you have highlighted, However am still not able to send email below is the output from the journalctl. Also why am I getting a " Active: (exited) ?

 

root@observium ~# systemctl status postfix*
* postfix@-.service - Postfix Mail Transport Agent (instance -)
   Loaded: loaded (/lib/systemd/system/postfix@.service; disabled; vendor preset: enabled)
   Active: active (running) since Mon 2019-09-16 09:39:49 EST; 5min ago
     Docs: man:postfix(1)
  Process: 902 ExecStart=/usr/sbin/postmulti -i - -p start (code=exited, status=0/SUCCESS)
  Process: 591 ExecStartPre=/usr/lib/postfix/configure-instance.sh - (code=exited, status=0/SUCCESS)
    Tasks: 16 (limit: 4915)
   CGroup: /system.slice/system-postfix.slice/postfix@-.service
           |-1103 /usr/lib/postfix/sbin/master -w
           |-1117 qmgr -l -t unix -u
           |-1124 trivial-rewrite -n rewrite -t unix -u -c
           |-1239 trivial-rewrite -n rewrite -t unix -u -c
           |-1303 pickup -l -t unix -u -c
           |-1690 cleanup -z -t unix -u -c
           |-1694 local -t unix
           |-1718 cleanup -z -t unix -u -c
           |-1719 cleanup -z -t unix -u -c
           |-1725 local -t unix
           |-1760 local -t unix
           |-1795 bounce -z -t unix -u -c
           |-1796 bounce -z -t unix -u -c
           |-1802 bounce -z -t unix -u -c
           |-1807 local -t unix
           `-1847 bounce -z -t unix -u -c

Sep 16 09:45:13 observium postfix/bounce[1796]: 1E164E0388: sender non-delivery notification: A6803E13E9
Sep 16 09:45:13 observium postfix/qmgr[1117]: A67D0E128F: from=<ifax@mydomain.com>, size=50661, nrcpt=1 (queue active)
Sep 16 09:45:13 observium postfix/local[1807]: 2E92FE1294: to=<provenit@mydomain.com>, orig_to=<ifax@mydomain.com>, relay=local, delay=4.6, delays=0.07/4.4/0/0.11, dsn=5.1.1, status=bounced (unknown user: "provenit")
Sep 16 09:45:13 observium postfix/qmgr[1117]: 1E164E0388: removed
Sep 16 09:45:13 observium postfix/bounce[1795]: 1E2D7E117E: sender non-delivery notification: A67D0E128F
Sep 16 09:45:13 observium postfix/qmgr[1117]: A6803E13E9: from=<ifax@mydoamin.com>, size=48733, nrcpt=1 (queue active)
Sep 16 09:45:13 observium postfix/local[1725]: 2E8DFE0003: to=<provenit@mydomain.com>, orig_to=<ifax@mydomain.com>, relay=local, delay=4.6, delays=0.07/4.4/0/0.11, dsn=5.1.1, status=bounced (unknown user: "provenit")
Sep 16 09:45:13 observium postfix/qmgr[1117]: 1E2D7E117E: removed
Sep 16 09:45:13 observium postfix/cleanup[1690]: C2D78E117E: message-id=<20190916144513.C2D78E117E@mydomain.com>
Sep 16 09:45:13 observium postfix/cleanup[1718]: C2CBDE0388: message-id=<20190916144513.C2CBDE0388@mydomain.com>

* postfix.service - Postfix Mail Transport Agent
   Loaded: loaded (/lib/systemd/system/postfix.service; enabled; vendor preset: enabled)
   Active: active (exited) since Mon 2019-09-16 09:39:49 EST; 5min ago
  Process: 1118 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
 Main PID: 1118 (code=exited, status=0/SUCCESS)
    Tasks: 0 (limit: 4915)
   CGroup: /system.slice/postfix.service

Sep 16 09:39:49 observium systemd[1]: Starting Postfix Mail Transport Agent...
Sep 16 09:39:49 observium systemd[1]: Started Postfix Mail Transport Agent.

Hey got it to work however there active (exited) still there when show status

root@observium ~# systemctl status postfix*
* postfix.service - Postfix Mail Transport Agent
   Loaded: loaded (/lib/systemd/system/postfix.service; enabled; vendor preset: enabled)
   Active: active (exited) since Mon 2019-09-16 12:26:19 EST; 3h 20min ago
  Process: 18102 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
 Main PID: 18102 (code=exited, status=0/SUCCESS)
    Tasks: 0 (limit: 4915)
   CGroup: /system.slice/postfix.service

Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.

* postfix@-.service - Postfix Mail Transport Agent (instance -)
   Loaded: loaded (/lib/systemd/system/postfix@.service; disabled; vendor preset: enabled)
   Active: active (running) since Mon 2019-09-16 12:26:19 EST; 3h 20min ago
     Docs: man:postfix(1)
  Process: 17928 ExecStop=/usr/sbin/postmulti -i - -p stop (code=exited, status=0/SUCCESS)
  Process: 17996 ExecStart=/usr/sbin/postmulti -i - -p start (code=exited, status=0/SUCCESS)
  Process: 17939 ExecStartPre=/usr/lib/postfix/configure-instance.sh - (code=exited, status=0/SUCCESS)
    Tasks: 4 (limit: 4915)
   CGroup: /system.slice/system-postfix.slice/postfix@-.service
           |-13170 pickup -l -t unix -u -c
           |-18099 /usr/lib/postfix/sbin/master -w
           |-18101 qmgr -l -t unix -u
           `-18337 tlsmgr -l -t unix -u -c

 

Jeremy Davis's picture

Awesome news that you got it going! :)

Re why the service says "active (exited)", I can the immediate reason why that is the case. It's because if you look a little closely, the 'ExecStart' command of postfix.service is /bin/true (which is a tiny commandline program which simply returns the boolean value of True - or in the case of bash, exit code 0 aka "success"). So the all the service does is runs a command that always returns "success", then exits.

But I'm guessing that doesn't really answer your question. I'm guessing your real question is why it's like that at all... TBH, I have no idea...!

Although I think the clue is that there is also a postfix@-.service. When a service name has an '@' in the name, it means that it's an instance of a service generated from a template. My guess is that Postfix has a single generic service (postfix.service) which doesn't actually do anything, other than act as a "master service" for at least one (but likely more, depending on load and/or some other condition(s)) individual instance service (i.e. postfix@-.service) that actually do the work. Those individual instances are likely triggered by something else. Perhaps the volume in the mail queue?

TBH, I'm only guessing and I have no idea why they've gone that route. But it all seems to be running as it should, so that's all good.

If you are particular interested in trying to understand why Postfix is setup the way that it is, I suggest some you do some reading. I suggest starting with the Debian Postfix changelog, then probably broadening to searching on the Debian bugtracker and mailing lists (TurnKey is based on Debian; v15.x = Debian 9/Stretch). The answer to why it's the way it is is was almost certainly discussed and decided 3 or 4 (+/-) years ago by people way smarter than me! :)

Add new comment