nfs as storage for mail queue

classic Classic list List threaded Threaded
5 messages Options
JDN
Reply | Threaded
Open this post in threaded view
|

nfs as storage for mail queue

JDN

Hello

 

Can somebody help me?

 

So I have setup the nfs share on a windows server 2016 with nfs server role.

 

Security is set on the device ip of the postfix server read-write with allow root access.

 

In the main conf of postfix I have set the queue to the right dir

 

queue_directory = /mnt/mail

 

fstab is set as:

10.7.248.45:/Mailq /mnt/mail nfs defaults 0 0

 

When I start the postfix service it writes all the folder structure on the share but fails to start with error.

 

● postfix.service - Postfix Mail Transport Agent

   Loaded: loaded (/usr/lib/systemd/system/postfix.service; enabled; vendor preset: enabled)

   Active: failed (Result: exit-code) since Tue 2019-04-02 08:15:59 CEST; 1min 5s ago

  Process: 1730 ExecStopPost=/etc/postfix/system/cond_slp deregister (code=exited, status=0/SUCCESS)

  Process: 1510 ExecStartPost=/etc/postfix/system/cond_slp register (code=exited, status=0/SUCCESS)

  Process: 1508 ExecStartPost=/etc/postfix/system/wait_qmgr 60 (code=exited, status=0/SUCCESS)

  Process: 1634 ExecStart=/usr/sbin/postfix start (code=exited, status=1/FAILURE)

  Process: 1623 ExecStartPre=/etc/postfix/system/update_postmaps (code=exited, status=0/SUCCESS)

  Process: 1622 ExecStartPre=/etc/postfix/system/update_chroot (code=exited, status=0/SUCCESS)

  Process: 1621 ExecStartPre=/etc/postfix/system/config_postfix (code=exited, status=0/SUCCESS)

  Process: 1620 ExecStartPre=/bin/echo Starting mail service (Postfix) (code=exited, status=0/SUCCESS)

    Tasks: 0 (limit: 19660)

   CGroup: /system.slice/postfix.service

 

Apr 02 08:15:57 eqx-postfix01 systemd[1]: Starting Postfix Mail Transport Agent...

Apr 02 08:15:57 eqx-postfix01 echo[1620]: Starting mail service (Postfix)

Apr 02 08:15:57 eqx-postfix01 postfix[1634]: postsuper: fatal: scan_dir_push: open directory defer: Permission denied

Apr 02 08:15:57 eqx-postfix01 postfix/postsuper[1728]: fatal: scan_dir_push: open directory defer: Permission denied

Apr 02 08:15:58 eqx-postfix01 postfix/postfix-script[1729]: fatal: Postfix integrity check failed!

Apr 02 08:15:59 eqx-postfix01 systemd[1]: postfix.service: Control process exited, code=exited status=1

Apr 02 08:15:59 eqx-postfix01 systemd[1]: Failed to start Postfix Mail Transport Agent.

Apr 02 08:15:59 eqx-postfix01 systemd[1]: postfix.service: Unit entered failed state.

Apr 02 08:15:59 eqx-postfix01 systemd[1]: postfix.service: Failed with result 'exit-code'.

 

 

Where or what am I doing wrong?

Do I need to change other parameters in Main.cf as well?

 

Please help I’m stuck on this.

 

 

Met vriendelijke groeten                        

Kind regards                                                 

De Petter Mattheas                                  

Technical support engineer – projects team    

IT-Department Jan De Nul Dredging N.V.

T +32 (0)53 73 95 53                                         

F +32 (0)53 21 00 31                                         

www.jandenul.com                                           

 

************************************************************
Any reaction to this e-mail or any other mail, including any
files transmitted therewith to sender's e-mail address(es)
shall be dealt with not as private, but as business
communication(s) and shall be registered as such.
************************************************************

Reply | Threaded
Open this post in threaded view
|

Re: nfs as storage for mail queue

Dominic Raferd


On Tue, 2 Apr 2019 at 07:40, De Petter Mattheas <[hidden email]> wrote:

Hello

 

Can somebody help me?

 

So I have setup the nfs share on a windows server 2016 with nfs server role.

 

Security is set on the device ip of the postfix server read-write with allow root access.

 

In the main conf of postfix I have set the queue to the right dir

 

queue_directory = /mnt/mail

 

fstab is set as:

10.7.248.45:/Mailq /mnt/mail nfs defaults 0 0

 

When I start the postfix service it writes all the folder structure on the share but fails to start with error.

 

● postfix.service - Postfix Mail Transport Agent

   Loaded: loaded (/usr/lib/systemd/system/postfix.service; enabled; vendor preset: enabled)

   Active: failed (Result: exit-code) since Tue 2019-04-02 08:15:59 CEST; 1min 5s ago

  Process: 1730 ExecStopPost=/etc/postfix/system/cond_slp deregister (code=exited, status=0/SUCCESS)

  Process: 1510 ExecStartPost=/etc/postfix/system/cond_slp register (code=exited, status=0/SUCCESS)

  Process: 1508 ExecStartPost=/etc/postfix/system/wait_qmgr 60 (code=exited, status=0/SUCCESS)

  Process: 1634 ExecStart=/usr/sbin/postfix start (code=exited, status=1/FAILURE)

  Process: 1623 ExecStartPre=/etc/postfix/system/update_postmaps (code=exited, status=0/SUCCESS)

  Process: 1622 ExecStartPre=/etc/postfix/system/update_chroot (code=exited, status=0/SUCCESS)

  Process: 1621 ExecStartPre=/etc/postfix/system/config_postfix (code=exited, status=0/SUCCESS)

  Process: 1620 ExecStartPre=/bin/echo Starting mail service (Postfix) (code=exited, status=0/SUCCESS)

    Tasks: 0 (limit: 19660)

   CGroup: /system.slice/postfix.service

 

Apr 02 08:15:57 eqx-postfix01 systemd[1]: Starting Postfix Mail Transport Agent...

Apr 02 08:15:57 eqx-postfix01 echo[1620]: Starting mail service (Postfix)

Apr 02 08:15:57 eqx-postfix01 postfix[1634]: postsuper: fatal: scan_dir_push: open directory defer: Permission denied

Apr 02 08:15:57 eqx-postfix01 postfix/postsuper[1728]: fatal: scan_dir_push: open directory defer: Permission denied

Apr 02 08:15:58 eqx-postfix01 postfix/postfix-script[1729]: fatal: Postfix integrity check failed!

Apr 02 08:15:59 eqx-postfix01 systemd[1]: postfix.service: Control process exited, code=exited status=1

Apr 02 08:15:59 eqx-postfix01 systemd[1]: Failed to start Postfix Mail Transport Agent.

Apr 02 08:15:59 eqx-postfix01 systemd[1]: postfix.service: Unit entered failed state.

Apr 02 08:15:59 eqx-postfix01 systemd[1]: postfix.service: Failed with result 'exit-code'.

 

 

Where or what am I doing wrong?

Do I need to change other parameters in Main.cf as well?

 

Please help I’m stuck on this.



On my systems (Ubuntu 18.04) the default queue directory has:

# ls /var/spool/postfix -ld
drwxr-xr-x 20 root root 4096 Dec 15 07:05 /var/spool/postfix

and many of the directories under it are owned by postfix, two of them (/var/spool/postfix/public and /var/spool/postfix/maildrop) with group postdrop. So I think - at the least - 'postfix' user must have r-x permissions on the queue directory.
JDN
Reply | Threaded
Open this post in threaded view
|

RE: nfs as storage for mail queue

JDN
In reply to this post by JDN

Found a solution to my problem in archive

 

http://postfix.1071664.n5.nabble.com/scan-dir-push-open-directory-defer-Permission-denied-td90566.html

 

thanks Witse

 

 

 

Met vriendelijke groeten                        

Kind regards                                                 

De Petter Mattheas                                  

Technical support engineer – projects team    

IT-Department Jan De Nul Dredging N.V.

T +32 (0)53 73 95 53                                         

F +32 (0)53 21 00 31                                         

www.jandenul.com                                           

 

From: De Petter Mattheas
Sent: 02 April 2019 08:39
To: Postfix users <[hidden email]>
Subject: nfs as storage for mail queue

 

Hello

 

Can somebody help me?

 

So I have setup the nfs share on a windows server 2016 with nfs server role.

 

Security is set on the device ip of the postfix server read-write with allow root access.

 

In the main conf of postfix I have set the queue to the right dir

 

queue_directory = /mnt/mail

 

fstab is set as:

10.7.248.45:/Mailq /mnt/mail nfs defaults 0 0

 

When I start the postfix service it writes all the folder structure on the share but fails to start with error.

 

● postfix.service - Postfix Mail Transport Agent

   Loaded: loaded (/usr/lib/systemd/system/postfix.service; enabled; vendor preset: enabled)

   Active: failed (Result: exit-code) since Tue 2019-04-02 08:15:59 CEST; 1min 5s ago

  Process: 1730 ExecStopPost=/etc/postfix/system/cond_slp deregister (code=exited, status=0/SUCCESS)

  Process: 1510 ExecStartPost=/etc/postfix/system/cond_slp register (code=exited, status=0/SUCCESS)

  Process: 1508 ExecStartPost=/etc/postfix/system/wait_qmgr 60 (code=exited, status=0/SUCCESS)

  Process: 1634 ExecStart=/usr/sbin/postfix start (code=exited, status=1/FAILURE)

  Process: 1623 ExecStartPre=/etc/postfix/system/update_postmaps (code=exited, status=0/SUCCESS)

  Process: 1622 ExecStartPre=/etc/postfix/system/update_chroot (code=exited, status=0/SUCCESS)

  Process: 1621 ExecStartPre=/etc/postfix/system/config_postfix (code=exited, status=0/SUCCESS)

  Process: 1620 ExecStartPre=/bin/echo Starting mail service (Postfix) (code=exited, status=0/SUCCESS)

    Tasks: 0 (limit: 19660)

   CGroup: /system.slice/postfix.service

 

Apr 02 08:15:57 eqx-postfix01 systemd[1]: Starting Postfix Mail Transport Agent...

Apr 02 08:15:57 eqx-postfix01 echo[1620]: Starting mail service (Postfix)

Apr 02 08:15:57 eqx-postfix01 postfix[1634]: postsuper: fatal: scan_dir_push: open directory defer: Permission denied

Apr 02 08:15:57 eqx-postfix01 postfix/postsuper[1728]: fatal: scan_dir_push: open directory defer: Permission denied

Apr 02 08:15:58 eqx-postfix01 postfix/postfix-script[1729]: fatal: Postfix integrity check failed!

Apr 02 08:15:59 eqx-postfix01 systemd[1]: postfix.service: Control process exited, code=exited status=1

Apr 02 08:15:59 eqx-postfix01 systemd[1]: Failed to start Postfix Mail Transport Agent.

Apr 02 08:15:59 eqx-postfix01 systemd[1]: postfix.service: Unit entered failed state.

Apr 02 08:15:59 eqx-postfix01 systemd[1]: postfix.service: Failed with result 'exit-code'.

 

 

Where or what am I doing wrong?

Do I need to change other parameters in Main.cf as well?

 

Please help I’m stuck on this.

 

 

Met vriendelijke groeten                        

Kind regards                                                 

De Petter Mattheas                                  

Technical support engineer – projects team    

IT-Department Jan De Nul Dredging N.V.

T +32 (0)53 73 95 53                                         

F +32 (0)53 21 00 31                                         

www.jandenul.com                                           

 

************************************************************
Any reaction to this e-mail or any other mail, including any
files transmitted therewith to sender's e-mail address(es)
shall be dealt with not as private, but as business
communication(s) and shall be registered as such.
************************************************************

Reply | Threaded
Open this post in threaded view
|

Re: nfs as storage for mail queue

Wietse Venema
In reply to this post by JDN
De Petter Mattheas:
> Hello
> Can somebody help me?

$ su
[password here]
# postfix set-permissions
# postfix check

Repeat until there are no warnings.

BTW I cannot confirm whether a WINDOWS server can satisfy the file
system properties that Postfix requires: see the section "Postfix file
system requirements" in http://www.postfix.org/features.html

If those file system requirements are not satisfied, then Postfix
is not supported, end of story, you are on your own.

Since you decided to use NFS, you also need to read up on the NFS
workarounds in http://www.postfix.org/NFS_README.html

In particular this one:

* Problem: when a file server's "time of day" clock is not synchronized
with the [Postfix server]'s "time of day" clock, email deliveries
are delayed by a minute or more.

* Workaround: Postfix explicitly sets file time stamps to avoid
delays with new mail (Postfix uses "last modified" file time stamps
to decide when a queue file is ready for delivery).

How are you going to synchronize file server clock and Postfix
server clocks? If they differ then Postfix will work poorly.

        Wietse
JDN
Reply | Threaded
Open this post in threaded view
|

RE: nfs as storage for mail queue

JDN
Hello


We have a ntp server onboard our vessels that syncs time true gps sat.
All our servers get there time from that server that how we sync time.




Met vriendelijke groeten                        
Kind regards                                                 
De Petter Mattheas                                  
Technical support engineer - projects team    
IT-Department Jan De Nul Dredging N.V.
T +32 (0)53 73 95 53                                         
F +32 (0)53 21 00 31                                         
www.jandenul.com                                           

-----Original Message-----
From: [hidden email] <[hidden email]> On Behalf Of Wietse Venema
Sent: 02 April 2019 13:16
To: Postfix users <[hidden email]>
Subject: Re: nfs as storage for mail queue

De Petter Mattheas:
> Hello
> Can somebody help me?

$ su
[password here]
# postfix set-permissions
# postfix check

Repeat until there are no warnings.

BTW I cannot confirm whether a WINDOWS server can satisfy the file system properties that Postfix requires: see the section "Postfix file system requirements" in http://www.postfix.org/features.html

If those file system requirements are not satisfied, then Postfix is not supported, end of story, you are on your own.

Since you decided to use NFS, you also need to read up on the NFS workarounds in http://www.postfix.org/NFS_README.html

In particular this one:

* Problem: when a file server's "time of day" clock is not synchronized with the [Postfix server]'s "time of day" clock, email deliveries are delayed by a minute or more.

* Workaround: Postfix explicitly sets file time stamps to avoid delays with new mail (Postfix uses "last modified" file time stamps to decide when a queue file is ready for delivery).

How are you going to synchronize file server clock and Postfix server clocks? If they differ then Postfix will work poorly.

        Wietse
************************************************************
Any reaction to this e-mail or any other mail, including any
files transmitted therewith to sender's e-mail address(es)
shall be dealt with not as private, but as business
communication(s) and shall be registered as such.
************************************************************