# Multiple domains on postfix + postgresql mail server[SOLVED]

## Thingee

I'm currently running a mailserver that has the list of domains and mailboxes in a sql db.  The first domain, example.com works fine in sending and receiving email.  I set the next domain up, example.net.  After getting example.net all setup with postfixadmin and sending an email to user@example.net from my gmail account I get an error email back from the gmail daemon saying:

 *Quote:*   

> 
> 
> This is an automatically generated Delivery Status Notification
> 
> Delivery to the following recipient failed permanently:
> ...

 

I checked /var/log/messages but that never mentions anything about example.net.  It reports all activity involving example.com just fine.  My question is basically how do I get example.net to work with my mailsever?

Here is my main.cf

```

queue_directory = /var/spool/postfix

command_directory = /usr/sbin

daemon_directory = /usr/lib/postfix

mail_owner = postfix

myhostname = host.example.com

mydomain = example.com

myorigin = $mydomain

mydestination =

#inet_interfaces = all

unknown_local_recipient_reject_code = 550

mynetworks_style = host

alias_maps = hash:/etc/mail/aliases

alias_database = hash:/etc/mail/aliases

home_mailbox = .maildir/

default_destination_concurrency_limit = 2

local_destination_concurrency_limit = 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.0/html

manpage_directory = /usr/share/man

sample_directory = /etc/postfix

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

virtual_mailbox_base = /home/vmail

virtual_mailbox_domains = pgsql:/etc/postfix/pgsql/pgsql-virtual-domains.cf

virtual_mailbox_maps = pgsql:/etc/postfix/pgsql/pgsql-virtual-maps.cf

virtual_uid_maps = pgsql:/etc/postfix/pgsql/pgsql-virtual-uid.cf

virtual_gid_maps = pgsql:/etc/postfix/pgsql/pgsql-virtual-gid.cf

virtual_alias_maps = pgsql:/etc/postfix/pgsql/pgsql-virtual.cf

smtpd_sasl_auth_enable = yes

smtpd_sasl_security_options = noanonymous

smtpd_sasl_local_domain = $myhostname

broken_sasl_auth_clients = yes

smtpd_recipient_restrictions =

        permit_sasl_authenticated,

        permit_mynetworks,

        check_relay_domains

```

----------

## Thingee

I tried to telnet through port 25 to example.net and got the following...

```

telnet example.net 25

Trying XX.XX.XXX.XXX...

Connected to host.example.com.

Escape character is '^]'.

220 host.example.com ESMTP Postfix

```

So it is connecting fine to example.com through port 25.  Still have no clue why I am not getting any errors in /var/log/messages.

----------

## magic919

It looks like the problem is not with your mail server.  Nothing in your logs and Gmail bounce.  You sure DNS is fine for example.net?

----------

## .:chrome:.

you must create a table, in your database, for all your local domains.

then you have to add, in your postfix configuration, for a query for local domains:

 */etc/postfix/main.cf wrote:*   

> 
> 
> relay_domains = pgsql:/etc/postfix/pgsql/relay_maps.cf
> 
> 

 

 */etc/postfix/pgsql/relay_maps.cf wrote:*   

> 
> 
> hosts=***.***.***.***
> 
> dbname=********
> ...

 

----------

## Thingee

 *magic919 wrote:*   

> It looks like the problem is not with your mail server.  Nothing in your logs and Gmail bounce.  You sure DNS is fine for example.net?

 

Well currently example.net has email pointing to this mail server and web stuff pointing to my web server.  The webserver is working fine, and the telnet pointed to the right mail server from the domain.

----------

## Thingee

 *k.gothmog wrote:*   

> you must create a table, in your database, for all your local domains.
> 
> then you have to add, in your postfix configuration, for a query for local domains:
> 
>  */etc/postfix/main.cf wrote:*   
> ...

 

Isn't that what virtual_mailbox_domains on my main.cf is for?  The table has example.com and example.net and /etc/postfix/pgsql/pgsql-virtual-domains.cf shows the following..

```

#

# pgsql-virtual-domains.cf

#

# Postfix virtual_mailbox_domains

# Postfix is final destination for the specified list of domains. Mail

# is delivered via the virtual_transport mail delivery transport.

#

user            = postfix

password       = XXXXXX

dbname          = postfix

hosts           = host

table           = domain

select_field    = description

where_field     = domain

additional_conditions = and backupmx = 'true' and active = 'true'

```

----------

## .:chrome:.

did you have tried with telnet?

telnet localhost 25

etc...

----------

## Thingee

 *k.gothmog wrote:*   

> did you have tried with telnet?
> 
> telnet localhost 25
> 
> etc...

 

Yes.  That was actually my second post on this topic  :Razz: .  Like I said, this mail server works with example.com which is set in main.cf, but when I add example.net onto the domain table and email user@example.net I have no luck.

----------

## magic919

If nothing is appearing in your mail logs then how can it be your mail server that has the problem?  If Gmail has tried to send it then Postfix would log the rejection.

----------

## Thingee

 *magic919 wrote:*   

> If nothing is appearing in your mail logs then how can it be your mail server that has the problem?  If Gmail has tried to send it then Postfix would log the rejection.

 

So what would you advise that I do?  I'm really stumped on this one if I don't have logs to refer to.  The logs aren't even logging any mail coming from my gmail account to user@example.net.

----------

## Thingee

Tried messing with it today and still didn't have any luck.  If it helps anyone, I followed this guide to get my first domain working: http://gentoo-wiki.com/HOWTO_Email:_A_Complete_Virtual_System

----------

## magic919

Does Postfix normally write to your logs?

Do you see any sign of this in your logs?

If the answers are No and No then why do you think this is your mail server at fault?

----------

## Thingee

 *magic919 wrote:*   

> Does Postfix normally write to your logs?
> 
> Do you see any sign of this in your logs?
> 
> If the answers are No and No then why do you think this is your mail server at fault?

 

Postfix is currently writing to  /var/log/messages for example.com.  If someone logs in the through pop3, squirrelmail for example.com, it logs it.  If somebody sends or gets an email it logs it for example.com.  However, example.net shows no sign of either of these on the log.  And it doesn't create the .maildir for the example.net so I know it is not getting anything for example.net.  Currently all users are stored in the home directory "vmail".  So for a user on example.com it would be /home/vmail/example.com/USERNAME/.maildir.  However, this never gets created for example.net.  And since I know this gets created automatically by postfix when it gets its first email for that user, I know its not working correctly because of something I did.

----------

## magic919

Postfix writes all the standard activities to the syslog.

POP3 and all that are nothing to do with Postfix.

If Postfix was incorrectly configured for example.net then it would refuse email for example.net or bounce email for example.net or accept it and stick it in a deferred queue if there was some other funky config.

Your logs show NOTHING.

The other MTA is not even trying your server.

If the other MTA did try your server it would be in your logs.

It cannot be your mail server if you have nothing in your logs.  It does not mean that Postfix does not know how to log for just that domain.  There is nothing happening at your mail server.

If you can send an email from another SMTP server you have visibility of then do that and watch those logs to see why it fails.

----------

## Thingee

 *magic919 wrote:*   

> Postfix writes all the standard activities to the syslog.
> 
> POP3 and all that are nothing to do with Postfix.
> 
> If Postfix was incorrectly configured for example.net then it would refuse email for example.net or bounce email for example.net or accept it and stick it in a deferred queue if there was some other funky config.
> ...

 

First of all thanks for helping me on this magic919.  I'm don't mean to be arguing that my mail server is the problem.  I'm just telling you what I know and see.

I don't have any other SMTP server but this one.  I know the DNS is all setup correctly because doing telnet to example.net through port 25 goes to my mail server.  What else could be my problem?

----------

## magic919

Don't worry about me.  I could have just cruised on by after all  :Smile: 

telnet example.net 25 proves little regarding suitable DNS set up for an MTA.  From the point of view of a mail server it only cares about MX records.   You could have a domain and point that to an IP but you'll get no email.

Stick your domain on this site http://www.dnsreport.com/ and check it.  Pay particular attention to the MX section.

----------

## Thingee

Hey sorry for the long time before a reply back.  I've been busy at work and school x_X.

Alright, thanks to checking the DNS information, I found that the spam server was not redirecting to the mail server afterwards.  After fixing this I sent out another email I got another relay access denied, but this time from the spam server.  I set mynetworks_style to subnet and now the mail server accepts the connection from the spam server.  Now the .maildir is not being created for the user.  I'm reading the system log and it shows the email coming in from the spam server but it never creates /home/vmail/example.net/USERNAME/.maildir

I read throught the system log but I am finding nothing useful to my problem of why the .maildir isn't being created.

Here is my system log for the email that was sent to rob@example.net...

spamphibian.example.net is the spam server

thingee@gmail.com is my current email address that is sending an email to rob@example.net

rob@example.net is the email address that I am trying to send an email to

```

Sep  8 23:45:40 eagle postfix/smtpd[11531]: connect from spamphibian.example.net[xx.xx.xxx.xxx]

Sep  8 23:45:40 eagle postfix/smtpd[11531]: match_list_match: spamphibian.example.net: no match

Sep  8 23:45:40 eagle postfix/smtpd[11531]: match_list_match: xx.xx.xxx.xxx: no match

Sep  8 23:45:40 eagle postfix/smtpd[11531]: match_list_match: spamphibian.example.net: no match

Sep  8 23:45:40 eagle postfix/smtpd[11531]: match_list_match: xx.xx.xxx.xxx: no match

Sep  8 23:45:40 eagle postfix/smtpd[11531]: match_hostname: spamphibian.example.net ~? 66.0.0.0/8

Sep  8 23:45:40 eagle postfix/smtpd[11531]: match_hostaddr: xx.xx.xxx.xxx ~? 66.0.0.0/8

Sep  8 23:45:40 eagle postfix/smtpd[11531]: > spamphibian.example.net[xx.xx.xxx.xxx]: 220 eagle.example.com ESMTP Postfix

Sep  8 23:45:40 eagle postfix/smtpd[11531]: < spamphibian.example.net[xx.xx.xxx.xxx]: helo new-host-2

Sep  8 23:45:40 eagle postfix/smtpd[11531]: > spamphibian.example.net[xx.xx.xxx.xxx]: 250 eagle.example.com

Sep  8 23:45:40 eagle postfix/smtpd[11531]: < spamphibian.example.net[xx.xx.xxx.xxx]: mail from:<thingee@gmail.com>

Sep  8 23:45:40 eagle postfix/smtpd[11531]: extract_addr: input: <thingee@gmail.com>

Sep  8 23:45:40 eagle postfix/smtpd[11531]: smtpd_check_addr: addr=thingee@gmail.com

Sep  8 23:45:40 eagle postfix/smtpd[11531]: connect to subsystem private/rewrite

Sep  8 23:45:40 eagle postfix/smtpd[11531]: send attr request = rewrite

Sep  8 23:45:40 eagle postfix/smtpd[11531]: send attr rule = local

Sep  8 23:45:40 eagle postfix/smtpd[11531]: send attr address = thingee@gmail.com

Sep  8 23:45:40 eagle postfix/smtpd[11531]: private/rewrite socket: wanted attribute: flags

Sep  8 23:45:40 eagle postfix/smtpd[11531]: input attribute name: flags

Sep  8 23:45:40 eagle postfix/smtpd[11531]: input attribute value: 0

Sep  8 23:45:40 eagle postfix/smtpd[11531]: private/rewrite socket: wanted attribute: address

Sep  8 23:45:40 eagle postfix/smtpd[11531]: input attribute name: address

Sep  8 23:45:40 eagle postfix/smtpd[11531]: input attribute value: thingee@gmail.com

Sep  8 23:45:40 eagle postfix/smtpd[11531]: private/rewrite socket: wanted attribute: (list terminator)

Sep  8 23:45:40 eagle postfix/smtpd[11531]: input attribute name: (end)

Sep  8 23:45:40 eagle postfix/smtpd[11531]: rewrite_clnt: local: thingee@gmail.com -> thingee@gmail.com

Sep  8 23:45:40 eagle postfix/smtpd[11531]: send attr request = resolve

Sep  8 23:45:40 eagle postfix/smtpd[11531]: send attr sender =

Sep  8 23:45:40 eagle postfix/smtpd[11531]: send attr address = thingee@gmail.com

Sep  8 23:45:40 eagle postfix/smtpd[11531]: private/rewrite socket: wanted attribute: flags

Sep  8 23:45:40 eagle postfix/smtpd[11531]: input attribute name: flags

Sep  8 23:45:40 eagle postfix/smtpd[11531]: input attribute value: 0

Sep  8 23:45:40 eagle postfix/smtpd[11531]: private/rewrite socket: wanted attribute: transport

Sep  8 23:45:40 eagle postfix/smtpd[11531]: input attribute name: transport

Sep  8 23:45:40 eagle postfix/smtpd[11531]: input attribute value: smtp

Sep  8 23:45:40 eagle postfix/smtpd[11531]: private/rewrite socket: wanted attribute: nexthop

Sep  8 23:45:40 eagle postfix/smtpd[11531]: input attribute name: nexthop

Sep  8 23:45:40 eagle postfix/smtpd[11531]: input attribute value: gmail.com

Sep  8 23:45:40 eagle postfix/smtpd[11531]: private/rewrite socket: wanted attribute: recipient

Sep  8 23:45:40 eagle postfix/smtpd[11531]: input attribute name: recipient

Sep  8 23:45:40 eagle postfix/smtpd[11531]: input attribute value: thingee@gmail.com

Sep  8 23:45:40 eagle postfix/smtpd[11531]: private/rewrite socket: wanted attribute: flags

Sep  8 23:45:40 eagle postfix/smtpd[11531]: input attribute name: flags

Sep  8 23:45:40 eagle postfix/smtpd[11531]: input attribute value: 4096

Sep  8 23:45:40 eagle postfix/smtpd[11531]: private/rewrite socket: wanted attribute: (list terminator)

Sep  8 23:45:40 eagle postfix/smtpd[11531]: input attribute name: (end)

Sep  8 23:45:40 eagle postfix/smtpd[11531]: resolve_clnt: `' -> `thingee@gmail.com' -> transp=`smtp' host=`gmail.com' rcpt=`thingee@gmail.com' flags= class=default

Sep  8 23:45:40 eagle postfix/smtpd[11531]: ctable_locate: install entry key thingee@gmail.com

Sep  8 23:45:40 eagle postfix/smtpd[11531]: extract_addr: in: <thingee@gmail.com>, result: thingee@gmail.com

Sep  8 23:45:40 eagle postfix/smtpd[11531]: fsspace: .: block size 4096, blocks free 16733878

Sep  8 23:45:40 eagle postfix/smtpd[11531]: smtpd_check_queue: blocks 4096 avail 16733878 min_free 0 msg_size_limit 10240000

Sep  8 23:45:40 eagle postfix/smtpd[11531]: > spamphibian.example.net[xx.xx.xxx.xxx]: 250 2.1.0 Ok

Sep  8 23:45:40 eagle postfix/smtpd[11531]: < spamphibian.example.net[xx.xx.xxx.xxx]: rcpt to:<rob@example.net>

Sep  8 23:45:40 eagle postfix/smtpd[11531]: extract_addr: input: <rob@example.net>

Sep  8 23:45:40 eagle postfix/smtpd[11531]: smtpd_check_addr: addr=rob@example.net

Sep  8 23:45:40 eagle postfix/smtpd[11531]: send attr request = rewrite

Sep  8 23:45:40 eagle postfix/smtpd[11531]: send attr rule = local

Sep  8 23:45:40 eagle postfix/smtpd[11531]: send attr address = rob@example.net

Sep  8 23:45:40 eagle postfix/smtpd[11531]: private/rewrite socket: wanted attribute: flags

Sep  8 23:45:40 eagle postfix/smtpd[11531]: input attribute name: flags

Sep  8 23:45:40 eagle postfix/smtpd[11531]: input attribute value: 0

Sep  8 23:45:40 eagle postfix/smtpd[11531]: private/rewrite socket: wanted attribute: address

Sep  8 23:45:40 eagle postfix/smtpd[11531]: input attribute name: address

Sep  8 23:45:40 eagle postfix/smtpd[11531]: input attribute value: rob@example.net

Sep  8 23:45:40 eagle postfix/smtpd[11531]: private/rewrite socket: wanted attribute: (list terminator)

Sep  8 23:45:40 eagle postfix/smtpd[11531]: input attribute name: (end)

Sep  8 23:45:40 eagle postfix/smtpd[11531]: rewrite_clnt: local: rob@example.net -> rob@example.net

Sep  8 23:45:40 eagle postfix/smtpd[11531]: send attr request = resolve

Sep  8 23:45:40 eagle postfix/smtpd[11531]: send attr sender =

Sep  8 23:45:40 eagle postfix/smtpd[11531]: send attr address = rob@example.net

Sep  8 23:45:40 eagle postfix/smtpd[11531]: private/rewrite socket: wanted attribute: flags

Sep  8 23:45:40 eagle postfix/smtpd[11531]: input attribute name: flags

Sep  8 23:45:40 eagle postfix/smtpd[11531]: input attribute value: 0

Sep  8 23:45:40 eagle postfix/smtpd[11531]: private/rewrite socket: wanted attribute: transport

Sep  8 23:45:40 eagle postfix/smtpd[11531]: input attribute name: transport

Sep  8 23:45:40 eagle postfix/smtpd[11531]: input attribute value: smtp

Sep  8 23:45:40 eagle postfix/smtpd[11531]: private/rewrite socket: wanted attribute: nexthop

Sep  8 23:45:40 eagle postfix/smtpd[11531]: input attribute name: nexthop

Sep  8 23:45:40 eagle postfix/smtpd[11531]: input attribute value: example.net

Sep  8 23:45:40 eagle postfix/smtpd[11531]: private/rewrite socket: wanted attribute: recipient

Sep  8 23:45:40 eagle postfix/smtpd[11531]: input attribute name: recipient

Sep  8 23:45:40 eagle postfix/smtpd[11531]: input attribute value: rob@example.net

Sep  8 23:45:40 eagle postfix/smtpd[11531]: private/rewrite socket: wanted attribute: flags

Sep  8 23:45:40 eagle postfix/smtpd[11531]: input attribute name: flags

Sep  8 23:45:40 eagle postfix/smtpd[11531]: input attribute value: 4096

Sep  8 23:45:40 eagle postfix/smtpd[11531]: private/rewrite socket: wanted attribute: (list terminator)

Sep  8 23:45:40 eagle postfix/smtpd[11531]: input attribute name: (end)

Sep  8 23:45:40 eagle postfix/smtpd[11531]: resolve_clnt: `' -> `rob@example.net' -> transp=`smtp' host=`example.net' rcpt=`rob@example.net' fl

ags= class=default

Sep  8 23:45:40 eagle postfix/smtpd[11531]: ctable_locate: install entry key rob@example.net

Sep  8 23:45:40 eagle postfix/smtpd[11531]: extract_addr: in: <rob@example.net>, result: rob@example.net

Sep  8 23:45:40 eagle postfix/smtpd[11531]: send attr request = rewrite

Sep  8 23:45:40 eagle postfix/smtpd[11531]: send attr rule = local

Sep  8 23:45:40 eagle postfix/smtpd[11531]: send attr address = postmaster

Sep  8 23:45:40 eagle postfix/smtpd[11531]: private/rewrite socket: wanted attribute: flags

Sep  8 23:45:40 eagle postfix/smtpd[11531]: input attribute name: flags

Sep  8 23:45:40 eagle postfix/smtpd[11531]: input attribute value: 0

Sep  8 23:45:40 eagle postfix/smtpd[11531]: private/rewrite socket: wanted attribute: address

Sep  8 23:45:40 eagle postfix/smtpd[11531]: input attribute name: address

Sep  8 23:45:40 eagle postfix/smtpd[11531]: input attribute value: postmaster@example.com

Sep  8 23:45:40 eagle postfix/smtpd[11531]: private/rewrite socket: wanted attribute: (list terminator)

Sep  8 23:45:40 eagle postfix/smtpd[11531]: input attribute name: (end)

Sep  8 23:45:40 eagle postfix/smtpd[11531]: rewrite_clnt: local: postmaster -> postmaster@example.com

Sep  8 23:45:40 eagle postfix/smtpd[11531]: >>> START Recipient address RESTRICTIONS <<<

Sep  8 23:45:40 eagle postfix/smtpd[11531]: generic_checks: name=permit_sasl_authenticated

Sep  8 23:45:40 eagle postfix/smtpd[11531]: generic_checks: name=permit_sasl_authenticated status=0

Sep  8 23:45:40 eagle postfix/smtpd[11531]: generic_checks: name=permit_mynetworks

Sep  8 23:45:40 eagle postfix/smtpd[11531]: permit_mynetworks: spamphibian.example.net xx.xx.xxx.xxx

Sep  8 23:45:40 eagle postfix/smtpd[11531]: match_hostname: spamphibian.example.net ~? 66.0.0.0/8

Sep  8 23:45:40 eagle postfix/smtpd[11531]: match_hostaddr: xx.xx.xxx.xxx ~? 66.0.0.0/8

Sep  8 23:45:40 eagle postfix/smtpd[11531]: generic_checks: name=permit_mynetworks status=1

Sep  8 23:45:40 eagle postfix/smtpd[11531]: >>> CHECKING RECIPIENT MAPS <<<

Sep  8 23:45:40 eagle postfix/smtpd[11531]: ctable_locate: leave existing entry key rob@example.net

Sep  8 23:45:40 eagle postfix/smtpd[11531]: maps_find: recipient_canonical_maps: rob@example.net: not found

Sep  8 23:45:40 eagle postfix/smtpd[11531]: match_list_match: example.net: no match

Sep  8 23:45:40 eagle postfix/smtpd[11531]: maps_find: recipient_canonical_maps: @example.net: not found

Sep  8 23:45:40 eagle postfix/smtpd[11531]: mail_addr_find: rob@example.net -> (not found)

Sep  8 23:45:40 eagle postfix/smtpd[11531]: maps_find: canonical_maps: rob@example.net: not found

Sep  8 23:45:40 eagle postfix/smtpd[11531]: match_list_match: example.net: no match

Sep  8 23:45:40 eagle postfix/smtpd[11531]: maps_find: canonical_maps: @example.net: not found

Sep  8 23:45:40 eagle postfix/smtpd[11531]: mail_addr_find: rob@example.net -> (not found)

Sep  8 23:45:40 eagle postfix/smtpd[11531]: dict_pgsql_get_active: attempting to connect to host localhost

Sep  8 23:45:40 eagle postfix/smtpd[11531]: dict_pgsql: successful connection to host localhost

Sep  8 23:45:40 eagle postfix/smtpd[11531]: dict_pgsql: successful query from host localhost

Sep  8 23:45:40 eagle postfix/smtpd[11531]: dict_pgsql_lookup: retrieved 1 rows

Sep  8 23:45:40 eagle postfix/smtpd[11531]: maps_find: virtual_alias_maps: pgsql:/etc/postfix/pgsql/pgsql-virtual.cf(0,lock|fold_fix): rob@example.net = rob@example.net

Sep  8 23:45:40 eagle postfix/smtpd[11531]: mail_addr_find: rob@example.net -> rob@example.net

Sep  8 23:45:40 eagle postfix/smtpd[11531]: smtpd_check_rewrite: trying: permit_inet_interfaces

Sep  8 23:45:40 eagle postfix/smtpd[11531]: permit_inet_interfaces: spamphibian.example.net xx.xx.xxx.xxx

Sep  8 23:45:40 eagle postfix/smtpd[11531]: before input_transp_cleanup: cleanup flags = enable_header_body_filter enable_automatic_bcc enable_address_mapping enable_milters

Sep  8 23:45:40 eagle postfix/smtpd[11531]: after input_transp_cleanup: cleanup flags = enable_header_body_filter enable_automatic_bcc enable_address_mapping

Sep  8 23:45:40 eagle postfix/smtpd[11531]: connect to subsystem public/cleanup

Sep  8 23:45:40 eagle postfix/smtpd[11531]: public/cleanup socket: wanted attribute: queue_id

Sep  8 23:45:40 eagle postfix/smtpd[11531]: input attribute name: queue_id

Sep  8 23:45:40 eagle postfix/smtpd[11531]: input attribute value: 9D27083022F

Sep  8 23:45:40 eagle postfix/smtpd[11531]: public/cleanup socket: wanted attribute: (list terminator)

Sep  8 23:45:40 eagle postfix/smtpd[11531]: input attribute name: (end)

Sep  8 23:45:40 eagle postfix/smtpd[11531]: send attr flags = 50

Sep  8 23:45:40 eagle postfix/smtpd[11531]: 9D27083022F: client=spamphibian.example.net[xx.xx.xxx.xxx]

Sep  8 23:45:40 eagle postfix/smtpd[11531]: > spamphibian.example.net[xx.xx.xxx.xxx]: 250 2.1.5 Ok

Sep  8 23:45:40 eagle postfix/smtpd[11531]: < spamphibian.example.net[xx.xx.xxx.xxx]: data

Sep  8 23:45:40 eagle postfix/smtpd[11531]: > spamphibian.example.net[xx.xx.xxx.xxx]: 354 End data with <CR><LF>.<CR><LF>

Sep  8 23:45:40 eagle postfix/smtpd[11531]: public/cleanup socket: wanted attribute: status

Sep  8 23:45:40 eagle postfix/cleanup[11537]: 9D27083022F: message-id=<8fc5027f0609081531r378194a2rc7690f164d2a527c@mail.gmail.com>

Sep  8 23:45:40 eagle postfix/qmgr[11418]: 9D27083022F: from=<thingee@gmail.com>, size=2510, nrcpt=1 (queue active)

Sep  8 23:45:40 eagle postfix/smtpd[11531]: input attribute name: status

Sep  8 23:45:40 eagle postfix/smtpd[11531]: input attribute value: 0

Sep  8 23:45:40 eagle postfix/smtpd[11531]: public/cleanup socket: wanted attribute: reason

Sep  8 23:45:40 eagle postfix/smtpd[11531]: input attribute name: reason

Sep  8 23:45:40 eagle postfix/smtpd[11531]: input attribute value: (end)

Sep  8 23:45:40 eagle postfix/smtpd[11531]: public/cleanup socket: wanted attribute: (list terminator)

Sep  8 23:45:40 eagle postfix/smtpd[11531]: input attribute name: (end)

Sep  8 23:45:40 eagle postfix/smtpd[11531]: > spamphibian.example.net[xx.xx.xxx.xxx]: 250 2.0.0 Ok: queued as 9D27083022F

Sep  8 23:45:40 eagle postfix/smtpd[11531]: < spamphibian.example.net[xx.xx.xxx.xxx]: quit

Sep  8 23:45:40 eagle postfix/smtpd[11531]: > spamphibian.example.net[xx.xx.xxx.xxx]: 221 2.0.0 Bye

Sep  8 23:45:40 eagle postfix/smtpd[11531]: match_hostname: spamphibian.example.net ~? 66.0.0.0/8

Sep  8 23:45:40 eagle postfix/smtpd[11531]: match_hostaddr: xx.xx.xxx.xxx ~? 66.0.0.0/8

Sep  8 23:45:40 eagle postfix/smtpd[11531]: disconnect from spamphibian.example.net[xx.xx.xxx.xxx]

Sep  8 23:45:40 eagle postfix/smtpd[11531]: master_notify: status 1

Sep  8 23:45:40 eagle postfix/smtpd[11531]: connection closed

Sep  8 23:45:40 eagle postfix/smtp[11539]: 9D27083022F: to=<rob@example.net>, relay=spamphibian.example.net[xx.xx.xxx.xxx]:25, delay=0.14, delays=0.1/0.0

1/0.01/0.02, dsn=4.4.6, status=deferred (host spamphibian.example.net[xx.xx.xxx.xxx] said: 451 4.4.6 Routing loop detected (in reply to end of DATA command))

```

----------

## magic919

Welcome back  :Smile: 

Looks like your server does not think it is the final destination for rob@example.net.  So it then tries to pass the message to spam gateway but realises this would just create a loop and fails with the error message about routing loop detected.

Virtual user must not be correctly set up.

This final bit tells it all.

```

Sep  8 23:45:40 eagle postfix/smtp[11539]: 9D27083022F: to=<rob@example.net>, relay=spamphibian.example.net[xx.xx.xxx.xxx]:25, delay=0.14, delays=0.1/0.0

1/0.01/0.02, dsn=4.4.6, status=deferred (host spamphibian.example.net[xx.xx.xxx.xxx] said: 451 4.4.6 Routing loop detected (in reply to end of DATA command)) 

```

Note that the log entry is for smtp, not smtpD.  This is Postfix trying to send a message out, as an smtp client.

----------

## Thingee

Yup you're right.  I forgot to put a trailing slash on the user rob's .maildir location row in the database.  Instantly that fixed the problem, thanks again!.

----------

## magic919

All's well that ends well.  Good to see it all sorted.

----------

