HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Server Operation (http://www.howtoforge.com/forums/forumdisplay.php?f=5)
-   -   Postfix delivers mail to non existing virtual user (http://www.howtoforge.com/forums/showthread.php?t=59489)

garson 10th November 2012 02:31

Postfix delivers mail to non existing virtual user
 
Hi.
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
/home/vmail/mydomain/
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 user@gmail.com 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 11: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 11: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.

Quote:

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:
user2@mydomain
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 12:24

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

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

garson 11th November 2012 14:17

Quote:

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/main.cf?

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 main.cf :
Quote:

# 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_cert_file=/etc/ssl/myhostname/mailserver/mail-cert.pem
smtpd_tls_key_file=/etc/ssl/myhostname/mailserver/mail-key.pem
smtpd_use_tls=yes
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 = mail.mydomain.com
mydomain = mydomain.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = mydomain.com
#mydestination = mydomain.com, localhost
relayhost = smtp.myisp.com
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
virtual_transport=dovecot
dovecot_destination_recipient_limit=1
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
virtual_mailbox_base = /home/vmail
virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_mailbox_domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf
relay_domains = mysql:/etc/postfix/mysql_relay_domains.cf
#local_recipient_maps = $virtual_mailbox_maps
smtpd_recipient_restrictions =
permit_mynetworks,
permit_sasl_authenticated,
reject_non_fqdn_hostname,
reject_non_fqdn_sender,
reject_non_fqdn_recipient,
reject_unauth_destination,
reject_unauth_pipelining,
reject_invalid_hostname,
check_policy_service inet:127.0.0.1:60000
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:[127.0.0.1]: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 = mydomain.com
message_size_limit = 20480000
bounce_template_file = /etc/postfix/bounce.cf
maximal_queue_lifetime = 1d
delay_warning_time = 0h
Thanks in advance.

garson 5th December 2012 15:54

I haven't resolved this yet.
In dovecot-deliver.log I've found this:
deliver(someuser@mydomain): Info: msgid=<7dc18b1996e8f9250ebcce3d2859a9f3.squirrel@1 92.168.100.30>: 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?

Thanks.

garson 10th December 2012 16: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 00: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 04:28.

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