Re: warn: smtpd: parent_forward_open

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

Re: warn: smtpd: parent_forward_open

Edgar Pettijohn III-2
On Fri, Jan 05, 2018 at 11:09:13PM +0000, Mik J wrote:

> Hello all,
> What do you think about my initial question.When I receive an email, I have the following messagewarn: smtpd: parent_forward_open: /var/mail/_vmail: No such file or directory
>  With /var/mail... not /var/rep... like I wrote in my first message
> I don't store my mails in /var/mail/_vmail. I mounted a NFS share to another server and the mount point is not /var/mail
> This message comes from smtpd.c
>         if (stat(directory, &sb) < 0) {
>                 log_warn("warn: smtpd: parent_forward_open: %s", directory);
>                 return -1;
>         }
>
>
> or                if (errno == ELOOP)
> ...
>                 else
>                         log_warn("warn: smtpd: parent_forward_open: %s", pathname);
>                 return -1;
>
>
> Regards
>
>
>     Le mercredi 3 janvier 2018 à 15:25:25 UTC+1, Scott Court <[hidden email]> a écrit :  
>

You should include your entire smtpd.conf.
 

>  
> That's ok; it's all good.
>  
>  
> One thing though: I noticed that there have been several API version bumps between 6.0.2 and the current git version in smtpd/smtpd-api.h (namely PROC_*_API_VERSION has been bumped from 1 to 2). When I was working with the git version the other day I realized that this change in the API version breaks backwards compatibility with any extras that have been installed (from OpenSMTPD-extras).
>  
> This makes me wonder if this 6.0.3 release might actually warrant a larger version number bump (maybe to 6.1.0 or even 7.0.0) to signify this backwards incompatible change.
>  
>  On Tue, Jan 02, 2018 at 09:43:52AM -0500, Scott Court wrote:
>  
>  On 01/01/2018 07:19 PM, Mik J wrote:
>  
>  # smtpd -h
> version: OpenSMTPD 6.0.0
>
> Also, if anyone knows why 6.0.2 is not the version shipped in the
> latest 6.2 openbsd.
>
> Thanks
>  
>  I have been wondering about this myself. After taking a look at the code
> in the OpenBSD CVS tree though, it looks like the "6.0.0" version of
> OpenSMTPD shipped with OpenBSD 6.2 is actually not the 6.0.0 version
> available on opensmtpd.org. It appears that it is actually closer to a
> recent fork of the CVS version of OpenSMTPD.
>
> Additionally, the OpenSMTPD version in OpenBSD has been upgraded with
> the release of OpenBSD 6.1 and 6.2; however, the version number seems to
> stay at "6.0.0" for some reason. I tried building OpenSMTPD 6.0.2 from
> source the other day, just to find out it was actually older than the
> "6.0.0" version in my stock OpenBSD 6.2.
>
> This seems very strange to me.
>
>  
>  You are absolutely right.
>
> We used to have a release process specifically for OpenSMTPD when it was
> using git as a main repository and synchronized to OpenBSD but since the
> switch we never discussed our versionning despite the fact that there is
> a different workflow and we often have many minor commits that we do not
> think warrant a version update... but causes OpenSMTPD to have different
> code for identical versions.
>
> In the meantime, I have bumped the version in OpenBSD -current to 6.0.3,
> this will make it obvious that the code is more ahead than on github.
>
> This weekend, I will update the code on github and prepare a 6.0.3 minor
> release so everyone gets the same code for that version, then we'll have
> a discussion on how we will prevent this from happening in the future.
>
> This was entirely my fault so... apologies
>
>  
>  
>    

Reply | Threaded
Open this post in threaded view
|

Re: warn: smtpd: parent_forward_open

Mik J
Hello Edgar,
I just found that the path is related to the home directory of the virtual user that is specified in /etc/passwd
If you have a configuration that uses virtual users and that relies on a unix user _vmail then this unix user has an entry in /etc/passwd
So the smtpd deamon uses the home directory path specified in /etc/passwd although it's might not be specified in the smtpd.confIs it normal that the home directory of that user should be used ?

 

    Le samedi 6 janvier 2018 à 00:52:15 UTC+1, Edgar Pettijohn <[hidden email]> a écrit :  
 
 On Fri, Jan 05, 2018 at 11:09:13PM +0000, Mik J wrote:

> Hello all,
> What do you think about my initial question.When I receive an email, I have the following messagewarn: smtpd: parent_forward_open: /var/mail/_vmail: No such file or directory
>  With /var/mail... not /var/rep... like I wrote in my first message
> I don't store my mails in /var/mail/_vmail. I mounted a NFS share to another server and the mount point is not /var/mail
> This message comes from smtpd.c
>         if (stat(directory, &sb) < 0) {
>                 log_warn("warn: smtpd: parent_forward_open: %s", directory);
>                 return -1;
>         }
>
>
> or                if (errno == ELOOP)
> ...
>                 else
>                         log_warn("warn: smtpd: parent_forward_open: %s", pathname);
>                 return -1;
>
>
> Regards
>
>
>    Le mercredi 3 janvier 2018 à 15:25:25 UTC+1, Scott Court <[hidden email]> a écrit : 
>

You should include your entire smtpd.conf.
 


> That's ok; it's all good.


> One thing though: I noticed that there have been several API version bumps between 6.0.2 and the current git version in smtpd/smtpd-api.h (namely PROC_*_API_VERSION has been bumped from 1 to 2). When I was working with the git version the other day I realized that this change in the API version breaks backwards compatibility with any extras that have been installed (from OpenSMTPD-extras).

> This makes me wonder if this 6.0.3 release might actually warrant a larger version number bump (maybe to 6.1.0 or even 7.0.0) to signify this backwards incompatible change.

>  On Tue, Jan 02, 2018 at 09:43:52AM -0500, Scott Court wrote:

>  On 01/01/2018 07:19 PM, Mik J wrote:

>  # smtpd -h
> version: OpenSMTPD 6.0.0
>
> Also, if anyone knows why 6.0.2 is not the version shipped in the
> latest 6.2 openbsd.
>
> Thanks

>  I have been wondering about this myself. After taking a look at the code
> in the OpenBSD CVS tree though, it looks like the "6.0.0" version of
> OpenSMTPD shipped with OpenBSD 6.2 is actually not the 6.0.0 version
> available on opensmtpd.org. It appears that it is actually closer to a
> recent fork of the CVS version of OpenSMTPD.
>
> Additionally, the OpenSMTPD version in OpenBSD has been upgraded with
> the release of OpenBSD 6.1 and 6.2; however, the version number seems to
> stay at "6.0.0" for some reason. I tried building OpenSMTPD 6.0.2 from
> source the other day, just to find out it was actually older than the
> "6.0.0" version in my stock OpenBSD 6.2.
>
> This seems very strange to me.
>

>  You are absolutely right.
>
> We used to have a release process specifically for OpenSMTPD when it was
> using git as a main repository and synchronized to OpenBSD but since the
> switch we never discussed our versionning despite the fact that there is
> a different workflow and we often have many minor commits that we do not
> think warrant a version update... but causes OpenSMTPD to have different
> code for identical versions.
>
> In the meantime, I have bumped the version in OpenBSD -current to 6.0.3,
> this will make it obvious that the code is more ahead than on github.
>
> This weekend, I will update the code on github and prepare a 6.0.3 minor
> release so everyone gets the same code for that version, then we'll have
> a discussion on how we will prevent this from happening in the future.
>
> This was entirely my fault so... apologies
>


>   

 
Reply | Threaded
Open this post in threaded view
|

Re: warn: smtpd: parent_forward_open

Edgar Pettijohn III-2
On Sat, Jan 06, 2018 at 02:40:00PM +0000, Mik J wrote:
> Hello Edgar,
> I just found that the path is related to the home directory of the virtual user that is specified in /etc/passwd
> If you have a configuration that uses virtual users and that relies on a unix user _vmail then this unix user has an entry in /etc/passwd
> So the smtpd deamon uses the home directory path specified in /etc/passwd although it's might not be specified in the smtpd.confIs it normal that the home directory of that user should be used ?
>

That depends on how you have the system set up. Hard to begin without
the smtpd.conf though. How did you create this _vmail user?

# useradd -what -options _vmail

How are your users mapped to the _vmail user?

Some logs would probably help.

Basically smtpd is looking for a .forward file in /var/mail/_vmail and
warning you that there isn't one. It can probably be ignored. You should
take a look at https://opensmtpd.org/faq/example1.html.

>  
>
>     Le samedi 6 janvier 2018 ?? 00:52:15 UTC+1, Edgar Pettijohn <[hidden email]> a ??crit :  
>  
>  On Fri, Jan 05, 2018 at 11:09:13PM +0000, Mik J wrote:
> > Hello all,
> > What do you think about my initial question.When I receive an email, I have the following messagewarn: smtpd: parent_forward_open: /var/mail/_vmail: No such file or directory
> >?? With /var/mail... not /var/rep... like I wrote in my first message
> > I don't store my mails in /var/mail/_vmail. I mounted a NFS share to another server and the mount point is not /var/mail
> > This message comes from smtpd.c
> > ?????????????? if (stat(directory, &sb) < 0) {
> > ?????????????????????????????? log_warn("warn: smtpd: parent_forward_open: %s", directory);
> > ?????????????????????????????? return -1;
> > ?????????????? }
> >
> >
> > or?????????????????????????????? if (errno == ELOOP)
> > ...
> > ?????????????????????????????? else
> > ?????????????????????????????????????????????? log_warn("warn: smtpd: parent_forward_open: %s", pathname);
> > ?????????????????????????????? return -1;
> >
> >
> > Regards
> >
> >
> >?? ?? Le mercredi 3 janvier 2018 ?? 15:25:25 UTC+1, Scott Court <[hidden email]> a ??crit :??
> >
>
> You should include your entire smtpd.conf.
> ??
> >??
> > That's ok; it's all good.
> >??
> >??
> > One thing though: I noticed that there have been several API version bumps between 6.0.2 and the current git version in smtpd/smtpd-api.h (namely PROC_*_API_VERSION has been bumped from 1 to 2). When I was working with the git version the other day I realized that this change in the API version breaks backwards compatibility with any extras that have been installed (from OpenSMTPD-extras).
> >??
> > This makes me wonder if this 6.0.3 release might actually warrant a larger version number bump (maybe to 6.1.0 or even 7.0.0) to signify this backwards incompatible change.
> >??
> >?? On Tue, Jan 02, 2018 at 09:43:52AM -0500, Scott Court wrote:
> >??
> >?? On 01/01/2018 07:19 PM, Mik J wrote:
> >??
> >?? # smtpd -h
> > version: OpenSMTPD 6.0.0
> >
> > Also, if anyone knows why 6.0.2 is not the version shipped in the
> > latest 6.2 openbsd.
> >
> > Thanks
> >??
> >?? I have been wondering about this myself. After taking a look at the code
> > in the OpenBSD CVS tree though, it looks like the "6.0.0" version of
> > OpenSMTPD shipped with OpenBSD 6.2 is actually not the 6.0.0 version
> > available on opensmtpd.org. It appears that it is actually closer to a
> > recent fork of the CVS version of OpenSMTPD.
> >
> > Additionally, the OpenSMTPD version in OpenBSD has been upgraded with
> > the release of OpenBSD 6.1 and 6.2; however, the version number seems to
> > stay at "6.0.0" for some reason. I tried building OpenSMTPD 6.0.2 from
> > source the other day, just to find out it was actually older than the
> > "6.0.0" version in my stock OpenBSD 6.2.
> >
> > This seems very strange to me.
> >
> >??
> >?? You are absolutely right.
> >
> > We used to have a release process specifically for OpenSMTPD when it was
> > using git as a main repository and synchronized to OpenBSD but since the
> > switch we never discussed our versionning despite the fact that there is
> > a different workflow and we often have many minor commits that we do not
> > think warrant a version update... but causes OpenSMTPD to have different
> > code for identical versions.
> >
> > In the meantime, I have bumped the version in OpenBSD -current to 6.0.3,
> > this will make it obvious that the code is more ahead than on github.
> >
> > This weekend, I will update the code on github and prepare a 6.0.3 minor
> > release so everyone gets the same code for that version, then we'll have
> > a discussion on how we will prevent this from happening in the future.
> >
> > This was entirely my fault so... apologies
> >
> >??
> >??
> >?? ??
>
>  

Reply | Threaded
Open this post in threaded view
|

Re: warn: smtpd: parent_forward_open

Mik J
Hello Edgar,
Thank you for your answser. I created the user exactly as written on the page you specified.
The smtpd.conf has nothing really special that's why I posted the only lines that were of interest.
But you are right, if smtpd is looking for the .forward in the user's home directory the error message doesn't surprise me.
=>> Maybe the error message could be a bit more explicit because we tend to search what's going wrong in the smtpd.conf file

The idea behind is that I don't want to have my mails in /var. I wanted my mails to be on a specific partition and also on a different machine with a nfs share

* The logs
Jan  7 11:16:30 serv1 smtpd[46249]: e3402a16880c5076 mta event=connecting address=smtp://127.0.0.1:10023 host=localhost
Jan  7 11:16:30 serv1 smtpd[46249]: e3402a16880c5076 mta event=connected
Jan  7 11:16:30 serv1 clamsmtpd: 100001: accepted connection from: 127.0.0.1
Jan  7 11:16:30 serv1 smtpd[46249]: e3402a17756e7ba5 smtp event=connected address=127.0.0.1 host=localhost
Jan  7 11:16:30 serv1 smtpd[60943]: warn: smtpd: parent_forward_open: /var/mail/_vmail: No such file or directory

* The configuration
table domaines file:/etc/mail/domaines
table spamdomaines file:/etc/mail/spamdomaines
table aliases file:/etc/mail/aliases
table utilisateurs file:/etc/mail/utilisateurs
table courriels file:/etc/mail/courriels
table passwords file:/etc/mail/passwords
table clients file:/etc/mail/clients
table gmail_secrets file:/etc/mail/gmail.passwords

# Les messages expires depuis 4h sont renvoyes a l'emetteur
expire 4h
max-message-size 50M
# Evite ipv6 pour le domaine gmail.com
limit mta for domain gmail.com inet4

pki serv1.domaine1.net certificate "/etc/ssl/certs/serv1.domaine1.net_chaine.crt"
pki serv1.domaine1.net key "/etc/ssl/private/serv1.domaine1.net.key"
pki serv1.domaine2.fr certificate "/etc/ssl/certs/serv1.domaine1.fr_chaine.crt"
pki serv1.domaine2 key "/etc/ssl/private/serv1.domaine1.fr.key"

#########################################
# CONFIGURATION POUR COURRIELS ENTRANTS #
#########################################
listen on 127.0.0.1 port 10024 tag CLAM_IN # Emails provenant de Clamav
listen on 127.0.0.1 port 10028 tag DKIM_IN # Emails provenant de dkimproxy
# Rejette les domaines spammers
reject sender <spamdomaines> for any
# Accepte la reception pour tous les vdoms et vusers au format maildir
accept tagged CLAM_IN for domain <domaines> virtual <utilisateurs> deliver to maildir "/home/mail/%{dest.domain:lowercase}/%{dest.user:lowercase}/Maildir"
accept tagged CLAM_IN for local alias <aliases> deliver to maildir "/home/mail/%{rcpt.domain:lowercase}/%{dest.user:lowercase}/Maildir"
accept tagged DKIM_IN for any relay via smtp://127.0.0.1:10023
accept from source <clients> for domain <domaines> relay via smtp://127.0.0.1:10027
accept from any sender !<courriels> for domain <domaines> relay via smtp://127.0.0.1:10027

#########################################
# CONFIGURATION POUR COURRIELS SORTANTS #
#########################################
listen on 127.0.0.1
listen on 127.0.0.1 port 10026 tag CLAM_OUT # Emails provenant de Clamav
listen on 127.0.0.1 port 10030 tag DKIM_OUT # Emails provenant de dkimproxy
listen on 10.255.89.250 port 25
listen on 10.255.89.250 port 587 tls-require pki serv1.domaine1.net auth <passwords>

# Emails recus du site web avec l adresse [hidden email], on s authentifie sur GMail
accept tagged CLAM_OUT from source <clients> sender " [hidden email]" for any relay via tls+auth://[hidden email]:587 auth <gmail_secrets>
# Les mails taggues CLAM_OUT recus depuis Clamav_out sont relayes vers dkimproxy
accept tagged CLAM_OUT for any relay via smtp://127.0.0.1:10029
accept tagged DKIM_OUT for any relay
# Les mails recu des clients locaux ou sur des reseaux autorises sont envoyes a clamsmtpd-out pour inspection
accept from local for any relay via smtp://127.0.0.1:10025
accept from source <clients> for any relay via smtp://127.0.0.1:10025





 

    Le samedi 6 janvier 2018 à 17:00:55 UTC+1, Edgar Pettijohn <[hidden email]> a écrit :  
 
 On Sat, Jan 06, 2018 at 02:40:00PM +0000, Mik J wrote:
> Hello Edgar,
> I just found that the path is related to the home directory of the virtual user that is specified in /etc/passwd
> If you have a configuration that uses virtual users and that relies on a unix user _vmail then this unix user has an entry in /etc/passwd
> So the smtpd deamon uses the home directory path specified in /etc/passwd although it's might not be specified in the smtpd.confIs it normal that the home directory of that user should be used ?
>

That depends on how you have the system set up. Hard to begin without
the smtpd.conf though. How did you create this _vmail user?

# useradd -what -options _vmail

How are your users mapped to the _vmail user?

Some logs would probably help.

Basically smtpd is looking for a .forward file in /var/mail/_vmail and
warning you that there isn't one. It can probably be ignored. You should
take a look at https://opensmtpd.org/faq/example1.html.


>
>    Le samedi 6 janvier 2018 ?? 00:52:15 UTC+1, Edgar Pettijohn <[hidden email]> a ??crit : 

>  On Fri, Jan 05, 2018 at 11:09:13PM +0000, Mik J wrote:
> > Hello all,
> > What do you think about my initial question.When I receive an email, I have the following messagewarn: smtpd: parent_forward_open: /var/mail/_vmail: No such file or directory
> >?? With /var/mail... not /var/rep... like I wrote in my first message
> > I don't store my mails in /var/mail/_vmail. I mounted a NFS share to another server and the mount point is not /var/mail
> > This message comes from smtpd.c
> > ?????????????? if (stat(directory, &sb) < 0) {
> > ?????????????????????????????? log_warn("warn: smtpd: parent_forward_open: %s", directory);
> > ?????????????????????????????? return -1;
> > ?????????????? }
> >
> >
> > or?????????????????????????????? if (errno == ELOOP)
> > ...
> > ?????????????????????????????? else
> > ?????????????????????????????????????????????? log_warn("warn: smtpd: parent_forward_open: %s", pathname);
> > ?????????????????????????????? return -1;
> >
> >
> > Regards
> >
> >
> >?? ?? Le mercredi 3 janvier 2018 ?? 15:25:25 UTC+1, Scott Court <[hidden email]> a ??crit :??
> >
>
> You should include your entire smtpd.conf.
> ??
> >??
> > That's ok; it's all good.
> >??
> >??
> > One thing though: I noticed that there have been several API version bumps between 6.0.2 and the current git version in smtpd/smtpd-api.h (namely PROC_*_API_VERSION has been bumped from 1 to 2). When I was working with the git version the other day I realized that this change in the API version breaks backwards compatibility with any extras that have been installed (from OpenSMTPD-extras).
> >??
> > This makes me wonder if this 6.0.3 release might actually warrant a larger version number bump (maybe to 6.1.0 or even 7.0.0) to signify this backwards incompatible change.
> >??
> >?? On Tue, Jan 02, 2018 at 09:43:52AM -0500, Scott Court wrote:
> >??
> >?? On 01/01/2018 07:19 PM, Mik J wrote:
> >??
> >?? # smtpd -h
> > version: OpenSMTPD 6.0.0
> >
> > Also, if anyone knows why 6.0.2 is not the version shipped in the
> > latest 6.2 openbsd.
> >
> > Thanks
> >??
> >?? I have been wondering about this myself. After taking a look at the code
> > in the OpenBSD CVS tree though, it looks like the "6.0.0" version of
> > OpenSMTPD shipped with OpenBSD 6.2 is actually not the 6.0.0 version
> > available on opensmtpd.org. It appears that it is actually closer to a
> > recent fork of the CVS version of OpenSMTPD.
> >
> > Additionally, the OpenSMTPD version in OpenBSD has been upgraded with
> > the release of OpenBSD 6.1 and 6.2; however, the version number seems to
> > stay at "6.0.0" for some reason. I tried building OpenSMTPD 6.0.2 from
> > source the other day, just to find out it was actually older than the
> > "6.0.0" version in my stock OpenBSD 6.2.
> >
> > This seems very strange to me.
> >
> >??
> >?? You are absolutely right.
> >
> > We used to have a release process specifically for OpenSMTPD when it was
> > using git as a main repository and synchronized to OpenBSD but since the
> > switch we never discussed our versionning despite the fact that there is
> > a different workflow and we often have many minor commits that we do not
> > think warrant a version update... but causes OpenSMTPD to have different
> > code for identical versions.
> >
> > In the meantime, I have bumped the version in OpenBSD -current to 6.0.3,
> > this will make it obvious that the code is more ahead than on github.
> >
> > This weekend, I will update the code on github and prepare a 6.0.3 minor
> > release so everyone gets the same code for that version, then we'll have
> > a discussion on how we will prevent this from happening in the future.
> >
> > This was entirely my fault so... apologies
> >
> >??
> >??
> >?? ??
>