Can't connect to postfix server remotely.

I set up postfix so that it uses mysql and the server works fine when sending emails to the domain (from a different account) it also works to send emails out to the world, but that only works if I am on my linode sending emails.

I cannot get client to connect to the server from anywhere else. I have it set up so that it uses sasl for authentication, but it doesn't want to let me connect.

If anyone has any suggestions that would be awesome.

  • Robbert

7 Replies

Turn on verbose logging in postfix (add the argument '-v' [without quotes] to the end of the smtpd entry in master.cf) and do a postfix reload. Postfix should then log the reason for the rejection.

The connection still doesnt' show up in the log file.

I am using the /var/log/mail.log file and the last line says:

postfix/master[2475]: reload configuration

  • Robbert

Post your master.cf and main.cf and we'll see if anything looks amiss.

main.cf

–-------

see /usr/share/postfix/main.cf.dist for a commented, fuller

version of this file.

Do not change these directory settings - they are critical to Postfix

operation.

command_directory = /usr/sbin

daemon_directory = /usr/lib/postfix

program_directory = /usr/lib/postfix

smtpdbanner = $myhostname ESMTP $mailname (Debian/GNU)

setgid_group = postdrop

biff = no

appending .domain is the MUA's job.

appenddotmydomain = no

myhostname = server.domain.com

alias_maps = hash:/etc/aliases

alias_database = hash:/etc/aliases

myorigin = /etc/mailname

mydestination = domain.com

relayhost =

mynetworks = 127.0.0.0/8, intranet.domain.com

mailbox_command =

mailboxsizelimit = 0

recipient_delimiter = +

transportmaps = mysql:/etc/postfix/mysql-virtualdomains.cf

virtualmaps = mysql:/etc/postfix/mysql-virtualforwardings.cf mysql:/etc/postfix/mysql-virtual_email2email.cf

virtualmailboxmaps = mysql:/etc/postfix/mysql-virtualdomains.cf mysql:/etc/postfix/mysql-virtualmailboxes.cf

virtualmailboxbase = /home/vmail

virtualuidmaps = static:5000

virtualgidmaps = static:5000

smtpdsaslauth_enable = yes

brokensaslauth_clients = yes

smtpdrecipientrestrictions = permitmynetworks, permitsaslauthenticated, checkrelay_domains

smtpdusetls = yes

smtpdtlscert_file = /etc/postfix/smtpd.cert

smtpdtlskey_file = /etc/postfix/smtpd.key

master.cf


==========================================================================

service type private unpriv chroot wakeup maxproc command + args

(yes) (yes) (yes) (never) (50)

==========================================================================

smtp inet n - - - - smtpd -v

628 inet n - - - - qmqpd

pickup fifo n - - 60 1 pickup

cleanup unix n - - - 0 cleanup

qmgr fifo n - - 300 1 qmgr

qmgr fifo n - - 300 1 nqmgr

rewrite unix - - - - - trivial-rewrite

bounce unix - - - - 0 bounce

defer unix - - - - 0 bounce

flush unix n - - 1000? 0 flush

smtp unix - - - - - smtp

showq unix n - - - - showq

error unix - - - - - error

local unix - n n - - local

virtual unix - n n - - virtual

lmtp unix - - n - - lmtp

#

Interfaces to non-Postfix software. Be sure to examine the manual

pages of the non-Postfix software to find out what options it wants.

The Cyrus deliver program has changed incompatibly.

#

cyrus unix - n n - - pipe

flags=R user=cyrus argv=/usr/sbin/cyrdeliver -e -m ${extension} ${user}

uucp unix - n n - - pipe

flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)

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 -d -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}

only used by postfix-tls

smtps inet n - n - - smtpd -o smtpdtlswrappermode=yes -o smtpdsaslauth_enable=yes

587 inet n - n - - smtpd -o smtpdenforcetls=yes -o smtpdsaslauth_enable=yes

Just as extra info, I used the tutorial at http://www.workaround.org/articles/ispmail/ to set this stuff up.

i found out that i had two lines commented at the bottom of my master.cf file, when I uncommented those it allowed me to connect remotely on port 587, which worked, except for the authentication.

It didn't fix anything else on the 25 port smtp server, but maybe this will help solve that problem.

  • Robbert

I can now connect to the smtp server, however the problem now is that it keeps rejecting my password. I am using mysql and it goes through pam, in the auth.log file it is still looking for the /etc/sasldb file.

  • Robbert

Well i got everything working.

The ONE thing that didnt' work was that pam didn't wanna use mysql as the authentication method. The solution to this is that you have to make sure that you make the /etc/pam.d/smtp and /var/spool/postfix/etc/pam.d/smtp are both world readable.

  • Robbert

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct