Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 10th November 2012, 02:31
garson garson is offline
Junior Member
 
Join Date: Nov 2012
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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.
Reply With Quote
Sponsored Links
  #2  
Old 10th November 2012, 11:17
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,744 Times in 2,577 Posts
Default

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?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 10th November 2012, 11:40
garson garson is offline
Junior Member
 
Join Date: Nov 2012
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
Reply With Quote
  #4  
Old 11th November 2012, 12:24
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,744 Times in 2,577 Posts
Default

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

Which tutorial did you use? What's in /etc/postfix/main.cf?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #5  
Old 11th November 2012, 14:17
garson garson is offline
Junior Member
 
Join Date: Nov 2012
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by falko View Post
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.
Reply With Quote
  #6  
Old 5th December 2012, 15:54
garson garson is offline
Junior Member
 
Join Date: Nov 2012
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.
Reply With Quote
  #7  
Old 10th December 2012, 16:15
garson garson is offline
Junior Member
 
Join Date: Nov 2012
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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?

Last edited by garson; 10th December 2012 at 16:22.
Reply With Quote
  #8  
Old 23rd December 2012, 00:46
garson garson is offline
Junior Member
 
Join Date: Nov 2012
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default

Problem was in webmails. They delivered messages using sendmail, so I've changed it to SMTP.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help with ISPConfig Mail and Squirrelmail m.xander Installation/Configuration 109 3rd February 2012 00:15
postfix problem jagsler Server Operation 41 7th July 2011 14:19
421 Unexpected failure Lizard King Installation/Configuration 20 7th July 2009 20:43
postfix, pop3 uvbnserved Server Operation 22 24th May 2009 21:00
Mail System Error - Returned Mail tristanlee85 General 16 16th March 2008 09:40


All times are GMT +2. The time now is 14:12.


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