1

I can't receive mail on the virtual aliases (normal email works in and out), i didn't try the virtual domains but that's what i was going for to get to work.

So i have a Debian Wheezy 7.8 Build: 2.6.32-31-pve x86_64 GNU/Linux

  • Postgresql Version: 9.1
  • Postfix Version: 2.9.6
  • Dovecot Version: 2.1.7

Verbose output of mail.log Pastebin Logfile output

The part with timestamp 06:14:05 is from outside to an the alias admin@mydomain.cc and not forwarding properly to the real email webmaster@mydomain.cc The part with timestamp 06:14:19 is from the outside to but to the webmaster@mydomain.cc which is working

I changed the passwords and emails + my domainname in the outputs!

This is the output of my postconf -n:

append_dot_mydomain = no
biff = no
config_directory = /etc/postfix
inet_interfaces = all
inet_protocols = ipv4
local_recipient_maps =
mailbox_size_limit = 0
mydestination = $myhostname, localhost.$mydomain, localhost
mydomain = mydomain.cc
myhostname = mail.mydomain.cc
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = $mydomain
readme_directory = no
recipient_delimiter = +
relayhost =
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
smtpd_sasl_path = /private/auth
smtpd_sasl_type = dovecot
smtpd_tls_cert_file = /etc/ssl/certs/mailcert.pem
smtpd_tls_key_file = /etc/ssl/private/mail.key
smtpd_tls_protocols = !SSLv2, !SSLv3
smtpd_tls_security_level = may
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
smtpd_recipient_restrictions =
    permit_mynetworks
    permit_sasl_authenticated
    reject_unauth_destination
    check_policy_service unix:private/policy-spf


virtual_alias_maps = proxy:pgsql:/etc/postfix/pgsql-aliases.cf
virtual_mailbox_domains = proxy:pgsql:/etc/postfix/pgsql-transport.cf
virtual_mailbox_maps = proxy:pgsql:/etc/postfix/pgsql-boxes.cf
virtual_transport = lmtp:unix:private/dovecot-lmtp

pgsql-aliases.cf

user=mailboss
password=password
dbname=mail
table=aliases
select_field=email
where_field=alias
hosts=unix:/var/run/postgresql

pgsql-transport.cf

user=mailboss
password=password
dbname=mail
table=transports
select_field=transport
where_field=domain
hosts=unix:/var/run/postgresql

pgsql-boxes.cf

user=mailboss
password=dkqNL7cHX2Bxq2t
dbname=mail
table=users
select_field=maildir
where_field=email
hosts=unix:/var/run/postgresql

dovecot.conf

disable_plaintext_auth = no
mail_privileged_group = mail


userdb {
 args = /etc/dovecot/dovecot-sql.conf
  driver = sql
}
passdb {
 args = /etc/dovecot/dovecot-sql.conf
  driver = sql
}
protocols = imap lmtp


service lmtp {
    unix_listener /var/spool/postfix/private/dovecot-lmtp {
    group = postfix
    mode = 0600
    user = postfix
    }
}
protocol lmtp {
    postmaster_address=postmaster@mydomain.cc
    hostname=mydomain.cc
}

protocol imap {
  mail_plugins = " autocreate"
}
plugin {
  autocreate = Trash
  autocreate2 = Sent
  autosubscribe = Trash
  autosubscribe2 = Sent
}

service auth {
  unix_listener /var/spool/postfix/private/auth {
    group = postfix
    mode = 0660
    user = postfix
  }
}

ssl=required
ssl_cert = </etc/ssl/certs/mailcert.pem
ssl_key = </etc/ssl/private/mail.key

dovecot-sql.conf

driver = pgsql
connect = host=/var/run/postgresql/ dbname=mail user=mailboss password=password
default_pass_scheme = SHA512
password_query = SELECT email as user, password FROM users WHERE email = '%u'
user_query = SELECT email as user, 'maildir:/home/mailboxes/maildir/'||maildir as mail, '/home/mailboxes/home/'||maildir as home, 500 as uid, 500 as gid FROM users WHERE email = '%u'

So i used a couple of tutorials to set this up - it's working alright i can post more if that is needed.

I can send emails in and out with the accounts i've set up. What puzzles me though is that if i send an email to an alias i always get this message in the log. I really don't find how to fix this. Any advice is appreciated (other than showing me the postfix guidelines, i've already digged through that but i'm maybe just not able to really understand it properly^^)

Here the important part from the mail.log:

Jan 25 16:20:07 server348 postfix/smtpd[3754]: connect from smtprelay05.ispgateway.de[80.67.31.94]
Jan 25 16:20:08 server348 postfix/smtpd[3754]: 1AA7C678CD18: client=smtprelay05.ispgateway.de[80.67.31.94]
Jan 25 16:20:08 server348 postfix/cleanup[3760]: 1AA7C678CD18: message-id=<54C55E03.8060903@testinger.com>
Jan 25 16:20:08 server348 postfix/qmgr[2819]: 1AA7C678CD18: from=<horst@testinger.com>, size=1681, nrcpt=1 (queue active)
Jan 25 16:20:08 server348 postfix/smtp[3761]: 1AA7C678CD18: to=<webmaster@mydomain.cc>, orig_to=<admin@mydomain.cc>, relay=none, delay=0.04, delays=0.03/0/0/0, dsn=5.4.4, status=bounced (Host or domain name not found. Name service error for name=mydomain.cc type=A: Host not found)
Jan 25 16:20:08 server348 postfix/cleanup[3760]: 23C8C678CD22: message-id=<20150125212008.23C8C678CD22@mail.mydomain.cc>
Jan 25 16:20:08 server348 postfix/qmgr[2819]: 23C8C678CD22: from=<>, size=3799, nrcpt=1 (queue active)
Jan 25 16:20:08 server348 postfix/bounce[3762]: 1AA7C678CD18: sender non-delivery notification: 23C8C678CD22
Jan 25 16:20:08 server348 postfix/qmgr[2819]: 1AA7C678CD18: removed
Jan 25 16:20:08 server348 postfix/smtpd[3754]: disconnect from smtprelay05.ispgateway.de[80.67.31.94]
Jan 25 16:20:08 server348 postfix/smtp[3761]: 23C8C678CD22: to=<horst@test.com>, relay=mxlb.ispgateway.de[80.67.18.126]:25, delay=0.17, delays=0/0/0.06/0.11, dsn=2.0.0, status=sent (250 OK id=1YFUbI-0001AS-77)
Jan 25 16:20:08 server348 postfix/qmgr[2819]: 23C8C678CD22: removed

EDIT:

Output of dig mydomain.cc ( replaced my ip with 999.999.999.999)

; <<>> DiG 9.8.4-rpz2+rl005.12-P1 <<>> mydomain.cc
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 46821
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 3, ADDITIONAL: 3

;; QUESTION SECTION:
;mydomain.cc.                        IN      A

;; ANSWER SECTION:
mydomain.cc.         3600    IN      A       999.999.999.999

;; AUTHORITY SECTION:
mydomain.cc.         30467   IN      NS      ns1.1awww.com.
mydomain.cc.         30467   IN      NS      ns2.1awww.com.
mydomain.cc.         30467   IN      NS      ns3.1awww.com.

;; ADDITIONAL SECTION:
ns1.1awww.com.          169153  IN      A       194.50.187.134
ns2.1awww.com.          169153  IN      A       194.0.182.1
ns3.1awww.com.          169153  IN      A       193.227.117.124

;; Query time: 19 msec
;; SERVER: 213.186.33.99#53(213.186.33.99)
;; WHEN: Mon Jan 26 03:15:48 2015
;; MSG SIZE  rcvd: 159

Output of getent mydomain.cc:

Unknown database: mydomain.cc

Postfix master.cf:

# Postfix master process configuration file.  For details on the format
# of the file, see the master(5) manual page (command: "man 5 master").
#
# Do not forget to execute "postfix reload" after editing this file.
#
# ==========================================================================
# service type  private unpriv  chroot  wakeup  maxproc command + args
#               (yes)   (yes)   (yes)   (never) (100)
# ==========================================================================
smtp      inet  n       -       -       -       -       smtpd
#smtp      inet  n       -       -       -       1       postscreen
#smtpd     pass  -       -       -       -       -       smtpd
#dnsblog   unix  -       -       -       -       0       dnsblog
#tlsproxy  unix  -       -       -       -       0       tlsproxy
submission inet n       -       -       -       -       smtpd
  -o syslog_name=postfix/submission
  -o smtpd_tls_security_level=encrypt
  -o smtpd_sasl_auth_enable=yes
  -o milter_macro_daemon_name=ORIGINATING
  -o smtpd_sasl_type=dovecot
  -o smtpd_sasl_path=private/auth

#smtps     inet  n       -       -       -       -       smtpd
#  -o syslog_name=postfix/smtps
#  -o smtpd_tls_wrappermode=yes
#  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#  -o milter_macro_daemon_name=ORIGINATING
#628       inet  n       -       -       -       -       qmqpd
pickup    fifo  n       -       -       60      1       pickup
cleanup   unix  n       -       -       -       0       cleanup
qmgr      fifo  n       -       n       300     1       qmgr
#qmgr     fifo  n       -       n       300     1       oqmgr
tlsmgr    unix  -       -       -       1000?   1       tlsmgr
rewrite   unix  -       -       -       -       -       trivial-rewrite
bounce    unix  -       -       -       -       0       bounce
defer     unix  -       -       -       -       0       bounce
trace     unix  -       -       -       -       0       bounce
verify    unix  -       -       -       -       1       verify
flush     unix  n       -       -       1000?   0       flush
proxymap  unix  -       -       n       -       -       proxymap
proxywrite unix -       -       n       -       1       proxymap
smtp      unix  -       -       -       -       -       smtp
relay     unix  -       -       -       -       -       smtp
#       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq     unix  n       -       -       -       -       showq
error     unix  -       -       -       -       -       error
retry     unix  -       -       -       -       -       error
discard   unix  -       -       -       -       -       discard
local     unix  -       n       n       -       -       local
virtual   unix  -       n       n       -       -       virtual
lmtp      unix  -       -       -       -       -       lmtp
anvil     unix  -       -       -       -       1       anvil
scache    unix  -       -       -       -       1       scache
#
# ====================================================================
# Interfaces to non-Postfix software. Be sure to examine the manual
# pages of the non-Postfix software to find out what options it wants.
#
# Many of the following services use the Postfix pipe(8) delivery
# agent.  See the pipe(8) man page for information about ${recipient}
# and other message envelope options.
# ====================================================================
#
# maildrop. See the Postfix MAILDROP_README file for details.
# Also specify in main.cf: maildrop_destination_recipient_limit=1
#
maildrop  unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
#
# ====================================================================
#
# Recent Cyrus versions can use the existing "lmtp" master.cf entry.
#
# Specify in cyrus.conf:
#   lmtp    cmd="lmtpd -a" listen="localhost:lmtp" proto=tcp4
#
# Specify in main.cf one or more of the following:
#  mailbox_transport = lmtp:inet:localhost
#  virtual_transport = lmtp:inet:localhost
#
# ====================================================================
#
# Cyrus 2.1.5 (Amos Gouaux)
# Also specify in main.cf: cyrus_destination_recipient_limit=1
#
#cyrus     unix  -       n       n       -       -       pipe
#  user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}
#
# ====================================================================
# Old example of delivery via Cyrus.
#
#old-cyrus unix  -       n       n       -       -       pipe
#  flags=R user=cyrus argv=/cyrus/bin/deliver -e -m ${extension} ${user}
#
# ====================================================================
#
# See the Postfix UUCP_README file for configuration details.
#
uucp      unix  -       n       n       -       -       pipe
  flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
#
# Other external delivery methods.
#
ifmail    unix  -       n       n       -       -       pipe
  flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp     unix  -       n       n       -       -       pipe
  flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient
scalemail-backend unix  -       n       n       -       2       pipe
  flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
mailman   unix  -       n       n       -       -       pipe
  flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
  ${nexthop} ${user}

policy-spf  unix  -       n       n       -       -       spawn
     user=nobody argv=/usr/sbin/postfix-policyd-spf-perl
  • Host or domain name not found --> this error because your server fails to resolve a domain. What's the output of getent mydomain.cc and dig mydomain.cc? – masegaloeh Jan 25 '15 at 23:11
  • How about adding $mydomain to mydestination? – sebix Jan 26 '15 at 7:50
  • If i put $mydomain to mydestination i get this error: Jan 26 03:20:13 server348 postfix/trivial-rewrite[29011]: warning: do not list domain mydomain.cc in BOTH mydestination and virtual_mailbox_domains – kazoooka Jan 26 '15 at 8:22
  • Wait, was mydomain.cc listed in virtual_mailbox_domains? But why did postfix send it via SMTP instead to LMTP? Try to enabling debug via following this tutorial. – masegaloeh Jan 26 '15 at 9:13
  • Yes i've got 3 tables, users, aliases and transports, that's what the pgsql-....conf are for. So i've got one entry in the transports table -it is domain: mydomain.cc gid: 500 transport: virtual: i got it from this tutorial: shisaa.jp/postset/mailserver-2.html – kazoooka Jan 26 '15 at 9:43
2

Ouch... you obscure too much... :( Well looks like your case was simple typo

Well, looks like you want to define alias for admin@ratdotoyolo.cc to webmaster@ratdotoyolo.cc but you have typo in alias table here

Jan 26 08:32:50 server348 postfix/smtp[15138]: C9ECB678CD21: to=<webmaster@ratdotyolo.cc>, orig_to=<admin@ratdotoyolo.cc>, relay=none, delay=0.09, delays=0.08/0/0/0, dsn=5.4.4, status=bounced (Host or domain name not found. Name service error for name=ratdotyolo.cc type=A: Host not found)

That's why postfix wants to deliver it to outside via SMTP instead deliver it to dovecot via LMTP.

  • wow you are my saviour. Maybe i shouldn't have obscured my domain at all! Thank you so much for your help - that actually fixed it. The typo was in my database... what a failure of myself and that's what i search for for a week and didn't findmyself...# – kazoooka Jan 26 '15 at 14:09
  • See argument by MadHatter here about if your security is dependent on keeping the domain secret, it's bad security. Anyway congratulations :) – masegaloeh Jan 26 '15 at 14:12
  • That's totally true yeah. Cheers! (= – kazoooka Jan 26 '15 at 14:35
0

The problem is you've defined a value in the lmtp setup under dovecot that doesn't make much sense.

Under the protocol lmtp{ line, remove the hostname = mydomain.cc and restart dovecot, also remove the mydomain = mydomain.cc line from the main.cf and restart postfix.

Then see what you get back when you send an email.

  • The issue still remains the same here is another pastebin: pastebin.com/1uzL6TvS First timestamp at 08:32:39 is an email from outside to webmaster@ which goes through and works. Second timestamp at 08:32:60 is an email from outside to admin@ which doesn't go through. – kazoooka Jan 26 '15 at 13:38
  • Actually, that explains a whole bunch, when you obscure domains, for example, raty.. instead of mydomain, so, are the domains the same, or are there two different .cc domains? – NickW Jan 26 '15 at 13:57
  • I only have one domain so far. the rat one - i edited it out - i always wrote mydomain instead of the one i have in my actual configuration. – kazoooka Jan 26 '15 at 14:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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