1

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
  • Can you post your master.cf? It sound like there may be some smtpd restrictions in there that are being triggered. – squircle Nov 9 '14 at 20:17
  • @squircle: I added the master.cf for you. I'm still really new to server administration (although I did WEB server administration in the past) so you might have to explain some things more detailed =) – Julian F. Weinert Nov 9 '14 at 20:30
  • Unfortunately, you didn't include much logging information.You should also change your password since you just posted it for the whole internet to see. I have the following questions: 1) Is there a user@ip in your SQL database? 2) Can you actually authenticate as user@ip? 3) Does removing reject_unverified_sender and reloading postfix resolve the problem? – squircle Nov 9 '14 at 22:33
  • 1
    What's the output of command postmap -q 'user@ip' mysql:/etc/postfix/mysql_sender_login_maps.cf? (this command used to verify that lookup database return the expected value) – masegaloeh Nov 10 '14 at 2:17
  • Funny you thought this would be my real MySQL password... Nevertheless you would have to get into my local network to access the DB ;-) 1) YES. 2) YES, IMAP & SMTP. 3) NO. What further logging info would you need? There is just connect from..., the error and disconnect. postmap -q [...] outputs user@ip – Julian F. Weinert Nov 10 '14 at 2:21
0

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

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.