postfix/qmgr[...]: warning: connect to transport private/[myhostname]: No such file or directory

9,065

Here is my solution for a multiple domain configurtion.

This is my main.cf for postfix:

address_verify_map = btree:/var/spool/postfix/data/verify
alias_maps = hash:/etc/aliases
config_directory = /etc/postfix
default_destination_concurrency_limit = 20
default_destination_rate_delay = 60s
default_destination_recipient_limit = 10
inet_interfaces = all
mail_owner = postfix
mydestination = $myhostname, localhost
myhostname = xyz
mynetworks = 127.0.0.0/8 [::1]/128 ip1.xxx.xxx.xxx ip2.xxx.xxx.xxx
myorigin = $myhostname
sender_dependent_default_transport_maps = regexp:/etc/postfix/transport/sender_dependent_default_transport_maps.regexp
smtp_sasl_security_options = noanonymous, noplaintext
smtp_tls_cert_file = /etc/ssl/certs/...
smtp_tls_key_file = /etc/ssl/private/...
smtp_tls_mandatory_ciphers = high
smtp_tls_mandatory_protocols = !SSLv2, !SSLv3
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtp_use_tls = yes
smtpd_banner = $myhostname ESMTP
smtpd_recipient_restrictions = 
   permit_mynetworks,
   permit_sasl_authenticated,
   reject_non_fqdn_sender,
   reject_non_fqdn_recipient,
   reject_unknown_sender_domain,
   reject_unknown_recipient_domain,
   check_policy_service inet:127.0.0.1:12525,
   check_policy_service inet:127.0.0.1:10023,
   reject_unverified_recipient,
   reject_unauth_destination,
   permit
smtpd_sasl_auth_enable = yes
smtpd_sasl_path = private/auth
smtpd_sasl_type = dovecot
smtpd_tls_auth_only = yes
smtpd_tls_cert_file = /etc/ssl/certs/...
smtpd_tls_key_file = /etc/ssl/private/...
smtpd_tls_mandatory_ciphers = high
smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3
smtpd_tls_received_header = no
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
virtual_mailbox_base = /var/spool/vmail/
virtual_mailbox_domains = proxy:hash:/etc/postfix/virtual/mailbox_domains
virtual_mailbox_maps = proxy:hash:/etc/postfix/virtual/mailbox_maps
virtual_transport = lmtp:unix:private/dovecot-lmtp

And here my master.cf:

submission inet  n       -       -       -       -       smtpd    
   -o syslog_name=postfix/submission    
   -o smtpd_tls_security_level=encrypt    
   -o smtpd_sasl_auth_enable=yes    
   -o smtpd_reject_unlisted_recipient=no    
   -o smtpd_recipient_restrictions=    
   -o smtpd_relay_restrictions=permit_sasl_authenticated,reject    
   -o milter_macro_daemon_name=ORIGINATING    
pickup     fifo  n       -       -       60      1       pickup    
   -o content_filter=smtp:[localhost]:10024    
cleanup    unix  n       -       -       -       0       cleanup    
qmgr       fifo  n       -       n       300     1       qmgr    
tlsmgr     unix  -       -       -       1000?   1       tlsmgr    
rewrite    unix  -       -       -       -       -       trivial-rewrite    
bounce     unix  -       -       -       -       0       bounce    
defer      unix  -       -       -       -       0       bounce    
trace      unix  -       -       -       -       0       bounce    
verify     unix  -       -       n       -       1       verify    
flush      unix  n       -       -       1000?   0       flush    
proxymap   unix  -       -       n       -       -       proxymap    
proxywrite unix  -       -       n       -       1       proxymap    
relay      unix  -       -       -       -       -       smtp    
showq      unix  n       -       -       -       -       showq    
error      unix  -       -       -       -       -       error    
retry      unix  -       -       -       -       -       error    
discard    unix  -       -       -       -       -       discard    
local      unix  -       n       n       -       -       local    
virtual    unix  -       n       n       -       -       virtual    
lmtp       unix  -       -       -       -       -       lmtp    
anvil      unix  -       -       -       -       1       anvil    
scache     unix  -       -       -       -       1       scache    
maildrop   unix  -       n       n       -       -       pipe     
   flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}    
uucp       unix  -       n       n       -       -       pipe    
   flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
ifmail     unix  -       n       n       -       -       pipe    
   flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp      unix  -       n       n       -       -       pipe    
   flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender     $recipient    
scalemail-backend unix - n       n       -       2       pipe     
   flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store  ${nexthop} ${user} ${extension}
mailman    unix  -       n       n       -       -       pipe    
   flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py     ${nexthop} ${user}    
localhost:10025 inet n   -       n       -       -       smtpd -v   
   -o content_filter=   
   -o smtpd_proxy_filter=    
   -o smtpd_authorized_xforward_hosts=127.0.0.0/8    
   -o smtpd_client_restrictions=    
   -o smtpd_helo_restrictions=    
   -o smtpd_sender_restrictions=    
   -o smtpd_recipient_restrictions=permit_mynetworks,reject    
   -o smtpd_data_restrictions=    
   -o mynetworks=127.0.0.0/8    
   -o receive_override_options=no_unknown_recipient_checks  

myhostname1:smtp inet n -    -       -       -       smtpd -v  
   -o content_filter=  
   -o smtpd_proxy_filter=localhost:10024  
   -o myhostname=myhostname1  

myhostname1      unix - -    n       -       -       smtp  
   -o smtp_bind_address=ip1.xxx.xxx.xxx  
   -o smtp_helo_name=myhostname1  
   -o syslog_name=postfix_myhostname1  

myhostname2:smtp inet n -    -       -       -       smtpd -v    
   -o content_filter=    
   -o smtpd_proxy_filter=localhost:10024    
   -o myhostname=myhostname2    

myhostname2      unix - -    n       -       -       smtp    
   -o smtp_bind_address=ip2.xxx.xxx.xxx    
   -o smtp_helo_name=myhostname2   
   -o syslog_name=postfix_myhostname2   

The content of the file /etc/postfix/transport/sender_dependent_default_transport_maps.regexp is:

/@domain1\.de$/     myhostname1:
/@domain2\.de$/     myhostname2:

And here is the content of the file /etc/postfix/virtual/mailbox_maps:

[email protected]               domain.de/[email protected]/
[email protected]               domain.de/[email protected]/
....

I hope this is helpful for other persons.

Share:
9,065

Related videos on Youtube

M.L.
Author by

M.L.

Updated on September 18, 2022

Comments

  • M.L.
    M.L. almost 2 years

    If I send an email from my client to an other person, the following I found with systemctl status -l postfix:

    postfix[20012]: Starting Postfix Mail Transport Agent: postfix.
    postfix/master[20119]: daemon started -- version 2.11.3, configuration /etc/postfix
    postfix/qmgr[20121]: 6A07F80F0DF9: from=<...>, size=1812, nrcpt=1 (queue active)
    postfix/qmgr[20121]: warning: connect to transport private/myhostname: No such file or directory
    postfix/error[20124]: 6A07F80F0DF9: to=<...>, relay=none, delay=100971, delays=100971/0.01/0/0.1, dsn=4.3.0, status=deferred (mail transport unavailable)
    

    Have anyone an idea what this means?

    Here ist the output of postconf -n:

    address_verify_map = btree:/var/spool/postfix/data/verify
    alias_maps = hash:/etc/aliases
    config_directory = /etc/postfix
    default_destination_concurrency_limit = 20
    default_destination_rate_delay = 60s
    default_destination_recipient_limit = 10
    inet_interfaces = all
    mail_owner = postfix
    mydestination = $myhostname, localhost
    myhostname = ...
    mynetworks = 127.0.0.0/8 [::1]/128 ip1.xxx.xxx.xxx ip2.xxx.xxx.xxx
    myorigin = $myhostname
    sender_dependent_default_transport_maps = 
    regexp:/etc/postfix/transport/sender_dependent_default_transport_maps.regexp
    smtp_sasl_security_options = noanonymous, noplaintext
    smtp_tls_cert_file = /etc/ssl/certs/...
    smtp_tls_key_file = /etc/ssl/private/...
    smtp_tls_mandatory_ciphers = high
    smtp_tls_mandatory_protocols = !SSLv2, !SSLv3
    smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
    smtp_use_tls = yes
    smtpd_banner = $myhostname ESMTP
    smtpd_recipient_restrictions = 
       permit_mynetworks,
       permit_sasl_authenticated,
       reject_non_fqdn_sender,
       reject_non_fqdn_recipient,
       reject_unknown_sender_domain,
       reject_unknown_recipient_domain,
       check_policy_service inet:127.0.0.1:12525,
       check_policy_service inet:127.0.0.1:10023,
       reject_unverified_recipient,
       reject_unauth_destination,
       permit
    smtpd_sasl_auth_enable = yes
    smtpd_sasl_path = private/auth
    smtpd_sasl_type = dovecot
    smtpd_tls_auth_only = yes
    smtpd_tls_cert_file = /etc/ssl/certs/...
    smtpd_tls_key_file = /etc/ssl/private/...
    smtpd_tls_mandatory_ciphers = high
    smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3
    smtpd_tls_received_header = no
    smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
    smtpd_use_tls = yes
    virtual_mailbox_base = /var/spool/vmail/
    virtual_mailbox_domains = proxy:hash:/etc/postfix/virtual/mailbox_domains
    virtual_mailbox_maps = proxy:hash:/etc/postfix/virtual/mailbox_maps
    virtual_transport = lmtp:unix:private/dovecot-lmtp
    

    And the output of postconf -M:

    submission inet  n       -       -       -       -       smtpd 
      -o syslog_name=postfix/submission 
      -o smtpd_tls_security_level=encrypt 
      -o smtpd_sasl_auth_enable=yes 
      -o smtpd_reject_unlisted_recipient=no 
      -o smtpd_recipient_restrictions= 
      -o smtpd_relay_restrictions=permit_sasl_authenticated,reject 
      -o milter_macro_daemon_name=ORIGINATING
    pickup     fifo  n       -       -       60      1       pickup 
      -o content_filter=smtp:[localhost]:10024
    cleanup    unix  n       -       -       -       0       cleanup
    qmgr       fifo  n       -       n       300     1       qmgr
    tlsmgr     unix  -       -       -       1000?   1       tlsmgr
    rewrite    unix  -       -       -       -       -       trivial-rewrite
    bounce     unix  -       -       -       -       0       bounce
    defer      unix  -       -       -       -       0       bounce
    trace      unix  -       -       -       -       0       bounce
    verify     unix  -       -       n       -       1       verify
    flush      unix  n       -       -       1000?   0       flush
    proxymap   unix  -       -       n       -       -       proxymap
    proxywrite unix  -       -       n       -       1       proxymap
    relay      unix  -       -       -       -       -       smtp
    showq      unix  n       -       -       -       -       showq
    error      unix  -       -       -       -       -       error
    retry      unix  -       -       -       -       -       error
    discard    unix  -       -       -       -       -       discard
    local      unix  -       n       n       -       -       local
    virtual    unix  -       n       n       -       -       virtual
    lmtp       unix  -       -       -       -       -       lmtp
    anvil      unix  -       -       -       -       1       anvil
    scache     unix  -       -       -       -       1       scache
    maildrop   unix  -       n       n       -       -       pipe 
       flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
    uucp       unix  -       n       n       -       -       pipe
       flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
    ifmail     unix  -       n       n       -       -       pipe 
       flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
    bsmtp      unix  -       n       n       -       -       pipe 
       flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient
    scalemail-backend unix - n       n       -       2       pipe 
       flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
    mailman    unix  -       n       n       -       -       pipe 
       flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py ${nexthop} ${user}
    localhost:10025 inet n   -       n       -       -       smtpd -v 
       -o content_filter= -o smtpd_proxy_filter= 
       -o smtpd_authorized_xforward_hosts=127.0.0.0/8 
       -o smtpd_client_restrictions= 
       -o smtpd_helo_restrictions= 
       -o smtpd_sender_restrictions= 
       -o smtpd_recipient_restrictions=permit_mynetworks,reject 
       -o smtpd_data_restrictions= 
       -o mynetworks=127.0.0.0/8 
       -o receive_override_options=no_unknown_recipient_checks
    ip1.xxx.xxx.xxx:smtp inet n -    -       -       -       smtpd -v 
       -o content_filter= 
       -o smtpd_proxy_filter=localhost:10024 
       -o myhostname=myhostname  
    

    The content of the file /etc/postfix/transport/sender_dependent_default_transport_maps.regexp:

    /@domain\.de$/     myhostname:    
    

    And here is the content of /etc/postfix/virtual/mailbox_maps:

    [email protected]               domain.de/[email protected]/
    [email protected]               domain.de/[email protected]/
    ....
    
    • M.L.
      M.L. almost 9 years
      @sebix: I added the information to my first post. In the mailbox_maps I define the directories that dovecot with mdbox use.
    • masegaloeh
      masegaloeh almost 9 years
      The error came from this parameter sender_dependent_default_transport_maps. What's the purpose of this parameter? Why do you add it?
    • M.L.
      M.L. almost 9 years
      I have read it in an other post for multple domains. But I think I solved the problem now.
    • M.L.
      M.L. almost 9 years
      I changed in master.cf ip1.xxx.xxx.xxx:smtp to myhostname:smtp and add a new part. myhostname unix - - n - - smtp -o smtp_bind_address=ip1.xxx.xxx.xxx -o smtp_helo_name=myhostname -o syslog_name=postfix_abcd
    • masegaloeh
      masegaloeh almost 9 years
      If you think that you have a solution, please post it in answer section below. Don't edit title indicated that the problem was solved
    • M.L.
      M.L. almost 9 years
      @masegaloeh: Sorry. I am new here. But i hope it is right now.
    • masegaloeh
      masegaloeh almost 9 years
      It's okay. Thanks for sharing the solution with us.
  • masegaloeh
    masegaloeh almost 9 years
    Instead post the full working configuration, can you post the answer like this: "I think this problem was caused by bla bla bla... So the solution is changing line xxxx becomes yyyyy"
  • B. Shea
    B. Shea about 7 years
    Agreed - just posting a config that 'works' helps very little and may hurt. It's explained far better in any of the numerous guides for Postfix+Dovecot+Amavis-new,Roundcube,etc setups. There is plenty on the internet for a given distribution. Doing a copy/paste, remove/replace config is always a bad idea on something as complicated as a postfix box. Adding virtual mail domains only makes it more so. You need to understand (basically) what it is doing as well. READ/FOLLOW A GUIDE.