Debian – Postfix server rejecting sender address

debiandebian-wheezydovecotpostfix

I installed a mailserver (postfix / dovecot) on my Debian Wheezy system and cannot send mails.

Since I just want to administer a mail server and don't have a domain yet, I'm working with the external IP address of the server. Corresponding to the documentation this should work.

EDIT I: The user exists and I can authenticate IMAP and SMTP.

EDIT II: The MySQL user sender map (as mentioned in comments) returns user@ip

The log file shows the error message

NOQUEUE: reject: RCPT from [...]: 553 5.7.1 <user@ip>: Sender address rejected: not owned by user user@ip; from=<user@ip> to=<user@ip> proto=ESMTP helo=<[192.168.24.10]>

The sender address equals the (SASL) login user name, so the error message doesn't seem quite meaningful to me.

I might mention here that I search all over the web and didn't find a solution. I didn't edit the configs much, only enabled smtps in master.cf and hosts, IP addresses and mysql maps in the main.cf. The remaining is untouched.

What could be my problem here?

Here some config files:

main.cf

myhostname = mail.fictional-domain.local
resolve_numeric_domain = yes
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = ip, localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all

# Authentification
smtpd_sasl_type=dovecot
smtpd_sasl_path=private/auth_dovecot
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
broken_sasl_auth_clients = yes
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_ma$
smtpd_sender_login_maps = proxy:mysql:/etc/postfix/mysql_sender_login_maps.cf
smtpd_sender_restrictions = reject_authenticated_sender_login_mismatch
        reject_unknown_sender_domain
        reject_unverified_sender
smtpd_recipient_restrictions = permit_sasl_authenticated
        permit_mynetworks
        reject_unauth_destination
        reject_unknown_reverse_client_hostname
# Virtual mailboxes
#local_transport = virtual
virtual_alias_maps = proxy:mysql:/etc/postfix/mysql_virtual_alias_maps.cf
virtual_mailbox_base = /var/vmail/
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql_virtual_domains_maps.cf
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_minimum_uid = 104
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
virtual_transport = dovecot
dovecot_destination_recipient_limit = 1

master.cf

# [removed commented lines]
dovecot   unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -d ${recipient}

smtp      inet  n       -       -       -       -       smtpd
# [removed commented lines]
smtps     inet  n       -       -       -       -       smtpd
# [removed commented lines]
  -o smtpd_tls_wrappermode=yes
# [removed commented lines]
  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
# [removed commented lines]
# [removed commented lines]
pickup    fifo  n       -       -       60      1       pickup
cleanup   unix  n       -       -       -       0       cleanup
qmgr      fifo  n       -       n       300     1       qmgr
# [removed commented lines]
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
# [removed commented lines]
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
# [removed commented lines]
maildrop  unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
# [removed commented lines]
uucp      unix  -       n       n       -       -       pipe
  flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
# [removed commented lines]
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}

mysql_sender_login_maps.cf

hosts = 127.0.0.1
user = postfix
password = postfixmysqldatabase
dbname = postfixDB
query = SELECT username AS allowedUser FROM mailbox WHERE username="%s" AND active = 1 UNION SELECT goto FROM alias WHERE address="%s" AND active = 1

Best Answer

I've had this error, the problem was my

smtpd_sender_login_maps =ldap:/etc/postfix/ldap-query-file.cf

was delivering false value, as a result of my tempering with it.

Hope this'd help