HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (
-   Server Operation (
-   -   Postfix delivers mail to non existing virtual user (

garson 10th November 2012 03:31

Postfix delivers mail to non existing virtual user
I have Ubuntu 11.04, Postfix, Dovecot installed.
I've noticed when I send mail from user@mydomain (existing virtual user) to non existing user2@mydomain (non existing virtual user), mail is "delivered", folder user2 is created in
with Maildir in it.

Sending user doesn't get any message that user is unknown.

In mail.log I have found these lines:
postfix/pickup[2214]: 3A38745BCF: uid=33 from=<user@mydomain>
postfix/cleanup[6427]: 3A38745BCF: message-id=<193bdeefafab0d49467989c38614869.squirrel@192.1 68.100.30>
postfix/qmgr[2215]: 3A38745BCF: from=<user@mydomain>, size=676, nrcpt=1 (queue active)
postfix/pipe[6431]: 3A38745BCF: to=<user2@mydomain>, relay=dovecot, delay=0.04, delays=0.02/0/0/0.02, dsn=2.0.0, status=sent (delivered via dovecot service)
postfix/qmgr[2215]: 3A38745BCF: removed

When I send mail from to non existing user2@mydomain, I get:
SMTP error: 550 5.1.1 <user2@mydomain>: Recipient address rejected: User unknown in virtual mailbox table

How can I resolve this? When I send from user@mydomain to non existing user2@mydomain I should get similar message.

Thanks in advance.

falko 10th November 2012 12:17

Are you sure that Gmail sends this mail to the same server? I.e., does the MX record of the domain point to the server you're having this problem on?

garson 10th November 2012 12:40

I didn't provide this detail. My server is fetching mails from ISPs server (using fetchmail), and sending mails through ISPs server.

This is what I get when trying to send mail from gmail to non existing user @mydomain.


Mail Delivery System MAILER-DAEMON@mydomain via "my ISP"

This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error.

Reason: Some addresses were rejected by the MDA fetchmail forwards to.

The following address(es) failed:
SMTP error: 550 5.1.1 <user2@mydomain>: Recipient address rejected: User unknown in virtual mailbox table

Final-Recipient: rfc822; user2@mydomain
Last-Attempt-Date: Thu, 08 Nov 2012 14:27:23 +0100 (CET)
Action: failed
Status: 5.1.1
Diagnostic-Code: 550 5.1.1 <user2@mydomain>: Recipient address rejected: User unknown in virtual mailbox table

falko 11th November 2012 13:24

Then the account does not exist on your ISP's server.

Which tutorial did you use? What's in /etc/postfix/

garson 11th November 2012 15:17


Originally Posted by falko (Post 288140)
Then the account does not exist on your ISP's server.

Which tutorial did you use? What's in /etc/postfix/

On ISP's server there is just one account, lets say user@ispdomain. All mails for @mydomain are fetched to my server using fetchmail.

This is my :

# Debian specific: Specifying a file name will cause the first
# line of that file to be used as the name. The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no

# appending .domain is the MUA's job.

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = no

# TLS parameters
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

myhostname =
mydomain =
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin =
#mydestination =, localhost
relayhost =
mynetworks = [::ffff:]/104 [::1]/128
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
virtual_mailbox_base = /home/vmail
virtual_mailbox_domains = mysql:/etc/postfix/
virtual_mailbox_maps = mysql:/etc/postfix/
virtual_alias_maps = mysql:/etc/postfix/
relay_domains = mysql:/etc/postfix/
#local_recipient_maps = $virtual_mailbox_maps
smtpd_recipient_restrictions =
check_policy_service inet:
smtpd_sasl_auth_enable = yes
#smtpd_sasl_security_options = noanonymous
smtpd_sasl_security_options = noanonymous, noplaintext
smtpd_sasl_tls_security_options = noanonymous
smtpd_tls_auth_only = yes
#smtpd_tls_security_level = may
smtpd_tls_received_header = no
smtpd_tls_loglevel = 0
tls_random_source = dev:/dev/urandom
content_filter = smtp-amavis:[]:10024
smtpd_client_restrictions =
check_client_access hash:/etc/postfix/maps/access-client
smtpd_sender_restrictions =
check_sender_access hash:/etc/postfix/maps/sender-access
masquerade_domains =
message_size_limit = 20480000
bounce_template_file = /etc/postfix/
maximal_queue_lifetime = 1d
delay_warning_time = 0h
Thanks in advance.

garson 5th December 2012 16:54

I haven't resolved this yet.
In dovecot-deliver.log I've found this:
deliver(someuser@mydomain): Info: msgid=<7dc18b1996e8f9250ebcce3d2859a9f3.squirrel@1>: saved mail to INBOX

someuser@mydomain does not exist and folder someuser is created in /home/vmail/mydomain.

But when I remove allow_all_users=yes in userdb static section in devecot.conf, mail is not "delivered" (new folder not created) but no mail message to sender that delivery failed.

Should postfix check if user exists before passing to dovecot for delivery?


garson 10th December 2012 17:15

When I try this in Thunderbird (local network), I get User unknown in virtual mailbox table, which is good.
But, when I try to send using Horde/Roundcube/SquirrelMail, mail is "delivered".

Any thoughts about this?

garson 23rd December 2012 01:46

Problem was in webmails. They delivered messages using sendmail, so I've changed it to SMTP. :)

All times are GMT +2. The time now is 02:39.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.