Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I just followed this excellent tutorial on setting up a mail server with Postfix/Dovecot/etc.

I got through it, and I can send email just fine. The domain I'm using is jonah.name. However, I cannot receive emails from external emails or other internal mailboxes. If I try to send an email to a user in it, I get a "Undelivered Mail Returned to Sender" email back, telling me that the user is unknown. This is what comes up in /var/log/mail.log:

Aug 17 21:31:27 localhost postfix/smtpd[810]: connect from gateway09.websitewelcome.com[69.93.179.27]
Aug 17 21:31:28 localhost postfix/trivial-rewrite[816]: warning: do not list domain jonah.name in BOTH mydestination and virtual_mailbox_domains
Aug 17 21:31:28 localhost postgrey[27058]: action=pass, reason=triplet found, client_name=gateway09.websitewelcome.com, client_address=69.93.179.27, sender=jonah@nucleussystems.com, recipient=jonah@jonah.name
Aug 17 21:31:28 localhost postfix/smtpd[810]: 79B1D38947: client=gateway09.websitewelcome.com[69.93.179.27]
Aug 17 21:31:28 localhost postfix/cleanup[819]: 79B1D38947: message-id=<502EB82E.5030406@nucleussystems.com>
Aug 17 21:31:28 localhost postfix/qmgr[732]: 79B1D38947: from=<jonah@nucleussystems.com>, size=1634, nrcpt=1 (queue active)
Aug 17 21:31:28 localhost postfix/smtpd[810]: disconnect from gateway09.websitewelcome.com[69.93.179.27]
Aug 17 21:31:30 localhost postfix/smtpd[826]: connect from remotebox[127.0.0.1]
Aug 17 21:31:30 localhost postfix/trivial-rewrite[816]: warning: do not list domain jonah.name in BOTH mydestination and virtual_mailbox_domains
Aug 17 21:31:30 localhost postfix/smtpd[826]: 622BF3894A: client=remotebox[127.0.0.1]
Aug 17 21:31:30 localhost postfix/cleanup[819]: 622BF3894A: message-id=<502EB82E.5030406@nucleussystems.com>
Aug 17 21:31:30 localhost postfix/smtpd[826]: disconnect from remotebox[127.0.0.1]
Aug 17 21:31:30 localhost postfix/qmgr[732]: 622BF3894A: from=<jonah@nucleussystems.com>, size=2050, nrcpt=1 (queue active)
Aug 17 21:31:30 localhost postfix/trivial-rewrite[816]: warning: do not list domain jonah.name in BOTH mydestination and virtual_mailbox_domains
Aug 17 21:31:30 localhost amavis[30938]: (30938-10) Passed CLEAN, [69.93.179.27] <jonah@nucleussystems.com> -> <jonah@jonah.name>, Message-ID: <502EB82E.5030406@nucleussystems.com>, mail_id: jbjlO+jljnPM, Hits: -0.001, size: 1634, queued_as: 622BF3894A, 1855 ms
Aug 17 21:31:30 localhost postfix/smtp[821]: 79B1D38947: to=<jonah@jonah.name>, relay=127.0.0.1[127.0.0.1]:10024, delay=2.3, delays=0.41/0.01/0/1.9, dsn=2.0.0, status=sent (250 2.0.0 from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as 622BF3894A)
Aug 17 21:31:30 localhost postfix/qmgr[732]: 79B1D38947: removed
Aug 17 21:31:30 localhost postfix/local[827]: 622BF3894A: to=<jonah@jonah.name>, relay=local, delay=0.02, delays=0/0.01/0/0.01, dsn=5.1.1, status=bounced (unknown user: "jonah")
Aug 17 21:31:30 localhost postfix/cleanup[819]: 65CAF38953: message-id=<20120817213130.65CAF38953@jonah.name>
Aug 17 21:31:30 localhost postfix/bounce[828]: 622BF3894A: sender non-delivery notification: 65CAF38953
Aug 17 21:31:30 localhost postfix/qmgr[732]: 65CAF38953: from=<>, size=3832, nrcpt=1 (queue active)
Aug 17 21:31:30 localhost postfix/qmgr[732]: 622BF3894A: removed
Aug 17 21:31:30 localhost postfix/smtp[829]: 65CAF38953: to=<jonah@nucleussystems.com>, relay=mail.nucleussystems.com[50.116.72.68]:25, delay=0.46, delays=0/0.01/0.33/0.11, dsn=2.0.0, status=sent (250 OK id=1T2U8g-0008VP-Qb)
Aug 17 21:31:30 localhost postfix/qmgr[732]: 65CAF38953: removed

The log confirms (line 18) that the user is "unknown". I re-double-checked all of the configuration files that connect to MySQL, but I couldn't find any flaws. Here are the MySQL virtual configuration files:

# /etc/postfix/mysql_virtual_alias_domainaliases_maps.cf

user = mail
password = **password**
hosts = 127.0.0.1
dbname = mail
query = SELECT goto FROM alias,alias_domain
  WHERE alias_domain.alias_domain = '%d'
  AND alias.address=concat('%u', '@', alias_domain.target_domain)
  AND alias.active = 1

# /etc/postfix/mysql_virtual_alias_maps.cf

user = mail
password = **password**
hosts = 127.0.0.1
dbname = mail
table = alias
select_field = goto
where_field = address
additional_conditions = and active = '1'

# /etc/postfix/mysql_virtual_domain_maps.cf

user = mail
password = **password**
hosts = 127.0.0.1
dbname = mail
table = domain
select_field = domain
where_field = domain
additional_conditions = and backupmx = '0' and active = '1'

# /etc/postfix/mysql_virtual_mailbox_domainaliases_maps.cf

user = mail
password = **password**
hosts = 127.0.0.1
dbname = mail
query = SELECT maildir FROM mailbox, alias_domain
  WHERE alias_domain.alias_domain = '%d'
  AND mailbox.username=concat('%u', '@', alias_domain.target_domain )
  AND mailbox.active = 1

# /etc/postfix/mysql_virtual_mailbox_maps.cf

user = mail
password = **password**
hosts = 127.0.0.1
dbname = mail
table = mailbox
select_field = CONCAT(domain, '/', local_part)
where_field = username
additional_conditions = and active = '1'
share|improve this question

2 Answers 2

up vote 2 down vote accepted

Isn't Answer in the log above? "warning: do not list domain jonah.name in BOTH mydestination and virtual_mailbox_domains"

Edit :

Try "mydestination = localhost"

"mydestination : The list of domains that are delivered via the $local_transport mail delivery transport." ie postfix tried to find a real user called jonah. According to your setup, you want user jonah to be virtual, so jonah.name must not be part of mydestination (I agree, it's tricky).

share|improve this answer
    
It's just a warning, so I don't think so. It goes right past it without any other problems. Interestingly enough, I commented out the mydestination directive in main.cf and restarted the service, but it still gives that error. –  Jonah Aug 17 '12 at 21:47
2  
try "mydestination = localhost" –  user130370 Aug 17 '12 at 21:53
    
THAT FIXED IT!!!!!! You, sir, are a boss. –  Jonah Aug 17 '12 at 21:58
    
So why is that? What does the mydestination directive do that it would cause that problem? –  Jonah Aug 17 '12 at 21:59
    
When you commented out the mydestination line, it falled back on default value, which is likely to include jonah.name –  user130370 Aug 17 '12 at 22:02

It looks like the sender is greylisted, if the sender retry after about 300 seconds it is supposed to pass. You can also disable the greylisting.

share|improve this answer
    
Thanks @Alex, I disabled greylisting and I updated the error log. It says the user is unknown, so I guess there's an issue connecting to MySQL. –  Jonah Aug 17 '12 at 21:36
    
Sorry can't help much, I'm also using postfix/dovecot/greylist etc but not in virtual mode! –  Alexandre Lavoie Aug 17 '12 at 21:38
    
Okay, thanks anyway Alex. At least I'm getting closer, I know it's a problem with accessing the user list. –  Jonah Aug 17 '12 at 21:50

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.