nfs as mailq storage?

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

nfs as mailq storage?

JDN

Hello

 

 

Is there a way for postfix to store its mailq on a nfs share?

And what do i need to change to make it store the q over there.

 

The nfs share is mounted to the postfix server in the fstab config file.

 

Case for this is, we are using postfix in a poc case for are vessel mail as=  a relay host.

 

So when we have sat communication mail leaves the vessel on the spot, but w= hen we have not sat comm mail has to stay in queue until sat comes back.

Thing is when are vessel is in voyage on the ocean there are places where t= here is no coverage and mails get for long time in queue.

And in the case are postfix server gets a failure or sow we want to for see=  an option that no mails in queue are lost.

 

And when we reinstall/redeploy the postfix server and remount the nfs share=  the mails stored there are processed again.

 

 

Is this kind of setup possible?

 

I looked at the man page of postfix over the subject nfs, put it dropped me=  no clue if this setup work yes or no!

 

Thx in advanced

 

************************************************************
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 mailq storage?

Wietse Venema
De Petter Mattheas:
> Hello
>
> Is there a way for postfix to store its mailq on a nfs share?

Yes. See also http://www.postfix.org/NFS_README.html.

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: nfs as mailq storage?

Noel Jones-2
In reply to this post by JDN
On 3/26/2019 10:01 AM, De Petter Mattheas wrote:

> So when we have sat communication mail leaves the vessel on the
> spot, but w= hen we have not sat comm mail has to stay in queue
> until sat comes back.
>
> Thing is when are vessel is in voyage on the ocean there are places
> where t= here is no coverage and mails get for long time in queue.
>
> And in the case are postfix server gets a failure or sow we want to
> for see=  an option that no mails in queue are lost.
>
> And when we reinstall/redeploy the postfix server and remount the
> nfs share=  the mails stored there are processed again.
>


You can adjust how long postfix will leave mail in the queue before
it's considered undeliverable and returned to sender.  The default
is 5 days.

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


   -- Noel Jones
JDN
Reply | Threaded
Open this post in threaded view
|

RE: nfs as mailq storage?

JDN
Hello


That we know, we have set this till 100 days the max possible.

But it's in case we have to reinstall the vm, due to error or unrecoverable.
There for we want the queue to be stored on a nfs share, that way when the vm is rebuild and the nfs is mounted he can send the mails stored on the nfs.

Is that possible?

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 Noel Jones
Sent: 26 March 2019 18:32
To: [hidden email]
Subject: Re: nfs as mailq storage?

On 3/26/2019 10:01 AM, De Petter Mattheas wrote:

> So when we have sat communication mail leaves the vessel on the spot,
> but w= hen we have not sat comm mail has to stay in queue until sat
> comes back.
>
> Thing is when are vessel is in voyage on the ocean there are places
> where t= here is no coverage and mails get for long time in queue.
>
> And in the case are postfix server gets a failure or sow we want to
> for see=  an option that no mails in queue are lost.
>
> And when we reinstall/redeploy the postfix server and remount the nfs
> share=  the mails stored there are processed again.
>


You can adjust how long postfix will leave mail in the queue before it's considered undeliverable and returned to sender.  The default is 5 days.

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


   -- Noel Jones
************************************************************
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.
************************************************************

JDN
Reply | Threaded
Open this post in threaded view
|

RE: nfs as mailq storage?

JDN
In reply to this post by Wietse Venema
Hello Wietse

Can you tell me witch param I need to change in main.cf to mount the nfs to the mailq?

Or do I need to make a symbolic link to the current mailq destination?

-----Original Message-----
From: [hidden email] <[hidden email]> On Behalf Of Wietse Venema
Sent: 26 March 2019 17:08
To: Postfix users <[hidden email]>
Subject: Re: nfs as mailq storage?

De Petter Mattheas:
> Hello
>
> Is there a way for postfix to store its mailq on a nfs share?

Yes. See also http://www.postfix.org/NFS_README.html.

        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.
************************************************************

Reply | Threaded
Open this post in threaded view
|

Re: nfs as mailq storage?

Andrey Repin-2
Greetings, De Petter Mattheas!

> Hello Wietse

>>> Is there a way for postfix to store its mailq on a nfs share?
>
>> Yes. See also http://www.postfix.org/NFS_README.html.

> Can you tell me witch param I need to change in main.cf to mount the nfs to the mailq?

None. This has nothing to do with postfix.

> Or do I need to make a symbolic link to the current mailq destination?

No.
You should mount the directory first.


--
With best regards,
Andrey Repin
Wednesday, March 27, 2019 10:55:27

Sorry for my terrible english...

Reply | Threaded
Open this post in threaded view
|

Re: nfs as mailq storage?

Dominic Raferd
In reply to this post by JDN
On Wed, 27 Mar 2019 at 07:44, De Petter Mattheas <[hidden email]> wrote:
Hello Wietse

Can you tell me witch param I need to change in main.cf to mount the nfs to the mailq?

Or do I need to make a symbolic link to the current mailq destination?

#  postconf -d queue_directory
queue_directory = /var/spool/postfix

JDN
Reply | Threaded
Open this post in threaded view
|

RE: nfs as mailq storage?

JDN

thnks

 

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: [hidden email] <[hidden email]> On Behalf Of Dominic Raferd
Sent: 27 March 2019 09:05
To: Postfix users <[hidden email]>
Subject: Re: nfs as mailq storage?

 

On Wed, 27 Mar 2019 at 07:44, De Petter Mattheas <[hidden email]> wrote:

Hello Wietse

Can you tell me witch param I need to change in main.cf to mount the nfs to the mailq?

Or do I need to make a symbolic link to the current mailq destination?

 

#  postconf -d queue_directory
queue_directory = /var/spool/postfix

 

************************************************************
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 mailq storage?

Wietse Venema
In reply to this post by JDN
De Petter Mattheas:
> Hello Wietse
>
> Can you tell me witch param I need to change in main.cf to mount the nfs to the mailq?

Postfix does not mount or unmount file systems.

You MUST start Postfix AFTER you mount the file systems that Postfix
needs.

You MUST stop Postfix BEFORE you remove any file system that Postfix
needs.

        Wietse
Reply | Threaded
Open this post in threaded view
|

RE: nfs as mailq storage?

John Stoffel-2
In reply to this post by JDN

De> Can you tell me witch param I need to change in main.cf to mount
De> the nfs to the mailq?

As others have said, you need to mount the NFS data store holding your
mailq onto the server.  But then you need to make sure your NFS server
is robust and reliable as well.  This starts to get into system
design, and how your system is designed with influence you Postfix
(and other) design choices.

De> Or do I need to make a symbolic link to the current mailq destination?

- Boot the VM/server running postfix.
- mount the NFS volume(s) you need.
- start networking
- start postfix

All of the above is setup in the VM's linux boot order.  I'm assuming
you're running postfix on Linux.

So put your NFS mounts into /etc/fstab on the postfix server, and the
system will boot up with the needed setup.

You will probably want to mount /var/spool/postfix  and /var/mail from
your NFS server.  If you have just one postfix server, then you don't
need to be careful, but if you have multiple postfix servers, they
each need to have their OWN dedicated /var/spool/postfix directory on
the NFS storage.

Making sure your NFS server is reliable is another problem.

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

RE: nfs as mailq storage?

JDN
Thanks for the help john

Now the fstab is working and mounting correct
Fstab entry
10.7.248.45:/mnt/nfs-pool1 /mnt/nfspool1 nfs defaults 0 0

Rights on the freenas nfs share

User root
Group wheel

Now I have the problem that my postfix does not start any more due to user rights error.


administrator@eqx-postfix01:~> sudo service postfix status
* postfix.service - Postfix Mail Transport Agent
   Loaded: loaded (/usr/lib/systemd/system/postfix.service; enabled; vendor preset: enabled)
   Active: failed (Result: timeout) since Thu 2019-03-28 11:36:01 CET; 7s ago
  Process: 3995 ExecStopPost=/etc/postfix/system/cond_slp deregister (code=exited, status=0/SUCCESS)
  Process: 3984 ExecStartPost=/etc/postfix/system/cond_slp register (code=exited, status=0/SUCCESS)
  Process: 3982 ExecStartPost=/etc/postfix/system/wait_qmgr 60 (code=exited, status=0/SUCCESS)
  Process: 3893 ExecStart=/usr/sbin/postfix start (code=exited, status=0/SUCCESS)
  Process: 3882 ExecStartPre=/etc/postfix/system/update_postmaps (code=exited, status=0/SUCCESS)
  Process: 3881 ExecStartPre=/etc/postfix/system/update_chroot (code=exited, status=0/SUCCESS)
  Process: 3880 ExecStartPre=/etc/postfix/system/config_postfix (code=exited, status=0/SUCCESS)
  Process: 3879 ExecStartPre=/bin/echo Starting mail service (Postfix) (code=exited, status=0/SUCCESS)
    Tasks: 0 (limit: 19660)
   CGroup: /system.slice/postfix.service

Mar 28 11:34:31 eqx-postfix01 postfix/postfix-script[3972]: warning: not owned by group maildrop: /mnt/nfspool1/public
Mar 28 11:34:31 eqx-postfix01 postfix/postfix-script[3973]: warning: not owned by group maildrop: /mnt/nfspool1/maildrop
Mar 28 11:34:31 eqx-postfix01 postfix/postfix-script[3977]: starting the Postfix mail system
Mar 28 11:34:31 eqx-postfix01 postfix/master[3979]: daemon started -- version 3.3.1, configuration /etc/postfix
Mar 28 11:34:31 eqx-postfix01 systemd[1]: postfix.service: PID file /var/spool/postfix/pid/master.pid not readable (yet?) after start-post: No such file or directory
Mar 28 11:36:01 eqx-postfix01 systemd[1]: postfix.service: Start-post operation timed out. Stopping.
Mar 28 11:36:01 eqx-postfix01 postfix/master[3979]: terminating on signal 15
Mar 28 11:36:01 eqx-postfix01 systemd[1]: Failed to start Postfix Mail Transport Agent.
Mar 28 11:36:01 eqx-postfix01 systemd[1]: postfix.service: Unit entered failed state.
Mar 28 11:36:01 eqx-postfix01 systemd[1]: postfix.service: Failed with result 'timeout'.

Can anybody help on what to do ?
What do I need to change further more sow postfix can own the files.

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: John Stoffel <[hidden email]>
Sent: 27 March 2019 15:05
To: De Petter Mattheas <[hidden email]>
Cc: Postfix users <[hidden email]>
Subject: RE: nfs as mailq storage?


De> Can you tell me witch param I need to change in main.cf to mount the
De> nfs to the mailq?

As others have said, you need to mount the NFS data store holding your mailq onto the server.  But then you need to make sure your NFS server is robust and reliable as well.  This starts to get into system design, and how your system is designed with influence you Postfix (and other) design choices.

De> Or do I need to make a symbolic link to the current mailq destination?

- Boot the VM/server running postfix.
- mount the NFS volume(s) you need.
- start networking
- start postfix

All of the above is setup in the VM's linux boot order.  I'm assuming you're running postfix on Linux.

So put your NFS mounts into /etc/fstab on the postfix server, and the system will boot up with the needed setup.

You will probably want to mount /var/spool/postfix  and /var/mail from your NFS server.  If you have just one postfix server, then you don't need to be careful, but if you have multiple postfix servers, they each need to have their OWN dedicated /var/spool/postfix directory on the NFS storage.

Making sure your NFS server is reliable is another problem.

John
************************************************************
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.
************************************************************