# problem directing mail to users [SOLVED]

## NotQuiteSane

OK, I'm having a blonde moment.  i think i know the solution to this problem, just not te file.

i was having problems with post fix and I finally did a complete uninstall + delete files then re-install.

works to send.

now i'm getting errors like this:

```
Nov  3 21:45:16 [postfix/local] 709951E2D9: to=<nqs@nqs.is-a-geek.net>, relay=local, delay=0.06, delays=0.01/0.01/0/0.04, dsn=5.2.0, status=bounced (cannot update mailbox /home/nqs/.maildir for user nqs. cannot open file: Is a directory)
```

ok, before I had a file that postfix would use and if mail came in for user@domain, it would know to redirect it to user.  what is that file, and is that my problem?

NQS

----------

## flophousejoe

 *NotQuiteSane wrote:*   

> 
> 
> ```
> Nov  3 21:45:16 [postfix/local] 709951E2D9: to=<nqs@nqs.is-a-geek.net>, relay=local, delay=0.06, delays=0.01/0.01/0/0.04, dsn=5.2.0, status=bounced (cannot update mailbox /home/nqs/.maildir for user nqs. cannot open file: Is a directory)
> ```
> ...

 

I'm guessing that your problem is this part:

 *Quote:*   

> status=bounced (cannot update mailbox /home/nqs/.maildir for user nqs. cannot open file: Is a directory)

 

It looks like you have a maildir-style mailbox-- a directory-- but postfix expects you to have an mbox-style mailbox-- a file.

Try checking out your home_mailbox parameter in /etc/postfix/main.cf .  Make sure that you've appended a trailing slash to the name of your maildir directory; this is a standard convention that means "this is a maildir-style directory, not an mbox-style file".  (Likewise, there exists a standard convention to find maildir-style directories as ~/.maildir/ and to find mbox-style files as /var/spool/mail/username .)

To reiterate, you'd use the below if you had a maildir-style directory called ~/.maildir/ ...

```
/etc/postfix/main.cf:

     home_mailbox = .maildir/
```

... and you'd use the below if you had a traditional mbox-style file called ~/.maildir (very unlikely, as it breaks the convention) :

```
/etc/postfix/main.cf:

     home_mailbox = .maildir
```

----------

## dambacher

maybe you had an alias table? the file is called "aliases" 

I think in /etc or /etc/postfix. Look in your configuration file for the correct position.

And with postfix, if you change this file you have to recreate the aliases.db with postfix db tools.

----------

## NotQuiteSane

 *flophousejoe wrote:*   

> I'm guessing that your problem is this part:
> 
>  *Quote:*   status=bounced (cannot update mailbox /home/nqs/.maildir for user nqs. cannot open file: Is a directory) 

 

That was my thought.  however:

```
[root@mike nqs]# cat /etc/postfix/main.cf|grep maildir                                   

home_mailbox = .maildir/

[root@mike nqs]#   
```

NQS

----------

## NotQuiteSane

 *dambacher wrote:*   

> maybe you had an alias table? the file is called "aliases" 
> 
> I think in /etc or /etc/postfix. Look in your configuration file for the correct position.
> 
> And with postfix, if you change this file you have to recreate the aliases.db with postfix db tools.

 

Ok, that gave me a clue.  found http://www.postfix.org/VIRTUAL_README.html#virtual_alias

changed main.cf to 

```
[root@mike postfix]# cat main.cf| grep virtual_a                                         

#   /etc/passwd, /etc/aliases, or the $virtual_alias_maps files.

# - destinations that match $virtual_alias_domains,

virtual_alias_domains = nqs.is-a-geek.net

virtual_alias_maps = hash:/etc/postfix/virtual

[root@mike postfix]#                  
```

/etc/postfix/virtual:

```
[root@mike nqs]# cat /etc/postfix/virtual                                                

nqs@nqs.is-a-geek.net   nqs

[root@mike nqs]#      
```

however...

```
[root@mike postfix]# postalias virtual                                                   

postalias: warning: virtual, line 1: need name:value pair

[root@mike postfix]#         
```

so I change virtural to:

```
[root@mike postfix]# cat virtual                                                         

nqs@nqs.is-a-geek.net:   nqs

[root@mike postfix]# 
```

and get:

```
[root@mike postfix]# postalias virtual

postalias: warning: virtual, line 1: name must be local

[root@mike postfix]#  
```

any suggestions?

NQS

----------

## NotQuiteSane

ok, I'm making some pregress on this.

I went and found my last full backup and extracted it to a seperate directory.

found this in my old .config:

```
 virtual_alias_maps = hash:/etc/postfix/virtual

virtual_alias_domains = hash:/etc/postfix/virtual

transport_maps = hash:/etc/postfix/transport

relay_domains = $mydestination,$transport_maps
```

so i recreated virtual & transport, and ran postmap hash:/path/to/file on them 9along with the chmod/chown commands first)

for refrence:

```
[root@mike nqs]# cat /etc/postfix/transport                                              

nqs.is-a-geek.net   virtual:

[root@mike nqs]#         
```

```
[root@mike nqs]# cat /etc/postfix/virtual

nqs@nqs.is-a-geek.net   nqs

[root@mike nqs]#    
```

I belive those were the files i was thinking of

however I was doing some searching , and running postqueue -p shows 203 messages in line.  and running cat on individual messages in /var/spool/postfix/active/ shows them to be my mail

interestingly tail /var/log/mail/current shows

```
[root@mike nqs]# tail /var/log/mail/current                                              

Nov  6 21:19:53 [postfix/master] warning: /usr/lib/postfix/virtual: bad command startup -- throttling

Nov  6 21:20:53 [postfix/virtual] fatal: bad string length 0 < 1: virtual_mailbox_base = 

Nov  6 21:20:54 [postfix/master] warning: process /usr/lib/postfix/virtual pid 10026 exit status 1

Nov  6 21:20:54 [postfix/master] warning: /usr/lib/postfix/virtual: bad command startup -- throttling

Nov  6 21:21:54 [postfix/virtual] fatal: bad string length 0 < 1: virtual_mailbox_base = 

Nov  6 21:21:55 [postfix/master] warning: process /usr/lib/postfix/virtual pid 10042 exit status 1

Nov  6 21:21:55 [postfix/master] warning: /usr/lib/postfix/virtual: bad command startup -- throttling

Nov  6 21:22:55 [postfix/virtual] fatal: bad string length 0 < 1: virtual_mailbox_base = 

Nov  6 21:22:56 [postfix/master] warning: process /usr/lib/postfix/virtual pid 10043 exit status 1

Nov  6 21:22:56 [postfix/master] warning: /usr/lib/postfix/virtual: bad command startup -- throttling

[root@mike nqs]#        
```

from this i defer the problem is in either "virtual_mailbox_base =" or /usr/lib/postfix/virtual.   

hmm.  i'm gonna try adding virtual_mailbox_base =" to /etc/postfix/main.cf

hmm.  now i get: 

```
[root@mike nqs]# /etc/init.d/postfix reload                                        

 * Caching service dependencies ...                                                 [ ok ]

 * Reloading postfix ...                                                            [ ok ]

[root@mike nqs]# mail nqs                                                                

Subject: test

gkifjfyjfyuj

.

EOT

[root@mike nqs]# tail /var/log/mail/current                                      

Nov  6 21:28:05 [postfix/qmgr] warning: transport virtual failure -- see a previous warning/fatal/panic logfile record for the problem description

Nov  6 21:28:05 [postfix/qmgr] 71ACF1EB03: to=<nqs@nqs.is-a-geek.net>, orig_to=<nqs>, relay=none, delay=114168, delays=114144/25/0/0, dsn=4.3.0, status=deferred (unknown mail transport error)

Nov  6 21:28:05 [postfix/qmgr] warning: premature end-of-input on private/virtual socket while reading input attribute name

Nov  6 21:28:05 [postfix/qmgr] warning: private/virtual socket: malformed response

Nov  6 21:28:05 [postfix/qmgr] warning: transport virtual failure -- see a previous warning/fatal/panic logfile record for the problem description

Nov  6 21:28:05 [postfix/qmgr] 77BE61EB34: to=<nqs@nqs.is-a-geek.net>, orig_to=<nqs>, relay=none, delay=51168, delays=51143/25/0/0, dsn=4.3.0, status=deferred (unknown mail transport error)

Nov  6 21:28:05 [postfix/qmgr] warning: premature end-of-input on private/virtual socket while reading input attribute name

Nov  6 21:28:05 [postfix/qmgr] warning: private/virtual socket: malformed response

Nov  6 21:28:05 [postfix/qmgr] warning: transport virtual failure -- see a previous warning/fatal/panic logfile record for the problem description

Nov  6 21:28:05 [postfix/qmgr] 7CCA61E2D9: to=<nqs@nqs.is-a-geek.net>, orig_to=<nqs>, relay=none, delay=113268, delays=113244/25/0/0, dsn=4.3.0, status=deferred (unknown mail transport error)

[root@mike nqs]#       
```

which i almost think i saw here.  gonna search for      unknown mail transport error

NQS

----------

## NotQuiteSane

ok, i found nothing that helped me in my last search.

i'm pretty sure the problem is in a configuration file (and probably real simple)

here's my main.cf,  anyone see any obvious problems with it?:

```
[root@mike nqs]# cat /etc/postfix/main.cf| grep -vh '^#' "$@" | grep -v '^$'             

queue_directory = /var/spool/postfix

command_directory = /usr/sbin

daemon_directory = /usr/lib/postfix

mail_owner = postfix

myhostname = nqs.is-a-geek.net

mydomain = nqs.is-a-geek.net

myorigin = $mydomain

mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain 

unknown_local_recipient_reject_code = 450

mynetworks_style = subnet

mynetworks = 192.169.0.0/24, 127.0.0.0/8

 

mailbox_command = /usr/bin/procmail

  

debug_peer_level = 2

debugger_command =

    PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin

    xxgdb $daemon_directory/$process_name $process_id & sleep 5

sendmail_path = /usr/sbin/sendmail

newaliases_path = /usr/bin/newaliases

mailq_path = /usr/bin/mailq

setgid_group = postdrop

html_directory = /usr/share/doc/postfix-2.3.2/html

manpage_directory = /usr/share/man

sample_directory = /etc/postfix

readme_directory = /usr/share/doc/postfix-2.3.2/readme

alias_database = hash:/etc/mail/aliases

local_destination_concurrency_limit = 2

alias_maps = hash:/etc/mail/aliases

virtual_alias_maps = hash:/etc/postfix/virtual

virtual_alias_domains = hash:/etc/postfix/virtual

transport_maps = hash:/etc/postfix/transport

relay_domains = $mydestination,$transport_maps

home_mailbox = .maildir/INBOX/

smtpd_sasl_auth_enable = yes

smtpd_sasl_security_options = noanonymous

smtpd_sasl_local_domain =

broken_sasl_auth_clients = yes

smtpd_client_restrictions = permit_sasl_authenticated, reject_unauth_destination

smtpd_use_tls=yes

smtpd_tls_auth_only = yes

smtpd_tls_key_file = /etc/ssl/postfix/server.key

smtpd_tls_cert_file = /etc/ssl/postfix/server.crt

smtpd_tls_CAfile = /etc/ssl/postfix/server.pem

smtpd_tls_loglevel = 3

smtpd_tls_received_header = yes

smtpd_tls_session_cache_timeout = 3600s

tls_random_source = dev:/dev/urandom

virtual_mailbox_base = 

[root@mike nqs]#  
```

any help would be appreciated.  i'm going into withdrawl

NQS

----------

## NotQuiteSane

ok, i fixed it.

made 2 changes.

changed myhostname = nqs.is-a-geek.net to myhostname = mike.nqs.is-a-geek.net 

and commented out the following

```
virtual_alias_maps = hash:/etc/postfix/virtual

virtual_alias_domains = hash:/etc/postfix/virtual

transport_maps = hash:/etc/postfix/transport

relay_domains = $mydestination,$transport_maps 
```

so yea, i get mail again.

NQS

----------

