PDA

View Full Version : problem seting up dovecot and postfix



rmadison
2nd January 2007, 10:50 PM
Ok first of all I am a noob at this so please be kind with my stupidity.
I have fedora 6 installed and everything works except for e-mail.
if you have any suggest please post them here or e-mail at sheehys@charter.net

when I try to telnet to port 25 to see if it is active I get the following message

# telnet localhost 25
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused
Trying ::1...
telnet: connect to address ::1: Connection refused
telnet: Unable to connect to remote host: Connection refused

in my /var/log/maillog I am getting the message repeated every 2 minutes or so.

Jan 2 13:20:16 vincennespd dovecot: pop3-login: Login: user=<vpd>, method=PLAIN, rip=::ffff:172.18.1.83, lip=::ffff:172.18.1.254
Jan 2 13:20:16 vincennespd dovecot: POP3(vpd): Disconnected: Logged out top=0/0, retr=0/0, del=0/0, size=0

I even thought I made a mastake and try following the tutor at
http://www.howtoforge.com/installing_a_lamp_system_with_fedora_core_6_p5

everything says it works but I get the above erros.
Just to be on the safe side here are copies of my iptables, and master.cf and main.cf for postfix. Thanks for all the help in advance

# Generated by iptables-save v1.3.5 on Tue Jan 2 15:05:06 2007
*mangle
:PREROUTING ACCEPT [5685:2945757]
:INPUT ACCEPT [654:92202]
:FORWARD ACCEPT [5008:2850788]
:OUTPUT ACCEPT [727:481557]
:POSTROUTING ACCEPT [5734:3332301]
COMMIT
# Completed on Tue Jan 2 15:05:06 2007
# Generated by iptables-save v1.3.5 on Tue Jan 2 15:05:06 2007
*filter
:INPUT ACCEPT [14:606]
:FORWARD DROP [1:44]
:OUTPUT ACCEPT [727:481557]
-A INPUT -i eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -i eth1 -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -s 172.18.0.0/255.255.255.0 -i eth0 -j DROP
-A INPUT -s 127.0.0.0/255.0.0.0 -i eth0 -j DROP
-A INPUT -p tcp -m tcp --dport 80 --tcp-flags SYN,RST,ACK SYN -j ACCEPT
-A INPUT -p tcp -m tcp --dport 10000 --tcp-flags SYN,RST,ACK SYN -j ACCEPT
-A INPUT -p tcp -m tcp --dport 20000 --tcp-flags SYN,RST,ACK SYN -j ACCEPT
-A INPUT -p tcp -m tcp --dport 443 --tcp-flags SYN,RST,ACK SYN -j ACCEPT
-A INPUT -p tcp -m tcp --dport 22 --tcp-flags SYN,RST,ACK SYN -j ACCEPT
-A INPUT -p tcp -m tcp --dport 25 --tcp-flags SYN,RST,ACK SYN -j ACCEPT
-A INPUT -p tcp -m tcp --dport 2200 --tcp-flags SYN,RST,ACK SYN -j ACCEPT
-A INPUT -p tcp -m tcp --dport 993 --tcp-flags SYN,RST,ACK SYN -j ACCEPT
-A INPUT -p tcp -m tcp --dport 995 --tcp-flags SYN,RST,ACK SYN -j ACCEPT
-A INPUT -p tcp -m tcp --dport 143 --tcp-flags SYN,RST,ACK SYN -j ACCEPT
-A INPUT -i eth1 -p tcp -m tcp --sport 68 --dport 67 -j ACCEPT
-A INPUT -i eth1 -p udp -m udp --sport 68 --dport 67 -j ACCEPT
-A INPUT -s 24.217.0.3 -p udp -m udp --sport 53 -j ACCEPT
-A INPUT -s 24.217.0.4 -p udp -m udp --sport 53 -j ACCEPT
-A INPUT -p udp -m udp --dport 53 -j ACCEPT
-A INPUT -s 127.0.0.0/255.0.0.0 -p tcp -m tcp --dport 20 --tcp-flags SYN,RST,ACK SYN -j ACCEPT
-A INPUT -s 127.0.0.0/255.0.0.0 -p tcp -m tcp --dport 21 --tcp-flags SYN,RST,ACK SYN -j ACCEPT
-A INPUT -p udp -j DROP
-A INPUT -p tcp -m tcp --tcp-flags SYN,RST,ACK SYN -j DROP
-A FORWARD -i eth1 -o eth0 -j ACCEPT
-A FORWARD -i eth0 -o eth1 -m state --state RELATED,ESTABLISHED -j ACCEPT
COMMIT
# Completed on Tue Jan 2 15:05:06 2007
# Generated by iptables-save v1.3.5 on Tue Jan 2 15:05:06 2007
*nat
:PREROUTING ACCEPT [257:18302]
:POSTROUTING ACCEPT [4:344]
:OUTPUT ACCEPT [34:2447]
:RH-Firewall-1-INPUT - [0:0]
-A POSTROUTING -o eth0 -j MASQUERADE
COMMIT
# Completed on Tue Jan 2 15:05:06 2007


/etc/postfix/master.cf

flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}
#
# The Cyrus deliver program has changed incompatibly, multiple times.
#
old-cyrus unix - n n - - pipe
flags=R user=cyrus argv=/usr/lib/cyrus-imapd/deliver -e -m ${extension} ${user}
# Cyrus 2.1.5 (Amos Gouaux)
# Also specify in main.cf: cyrus_destination_recipient_limit=1
cyrus unix - n n - - pipe
user=cyrus argv=/usr/lib/cyrus-imapd/deliver -e -r ${sender} -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=foo argv=/usr/local/sbin/bsmtp -f $sender $nexthop $recipient
#
#added 20070101
#
127.0.0.1:10025 inet n - n - - smtpd
#-o content_filter=
#-o smtpd_recipient_restrictions=permit_mynetworks,rej ect

/etc/postfix/main.cf

queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
mail_owner = postfix
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost
unknown_local_recipient_reject_code = 550
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
debug_peer_level = 2
debugger_command =
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
xxgdb $daemon_directory/$process_name $process_id & sleep 5

sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
html_directory = no
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix-2.3.3/samples
readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES
smtpd_sasl_local_domain =
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions =
permit_sasl_authenticated,permit_mynetworks,reject _unauth_destination,mynetworks = 127.0.0.0/8
smtpd_tls_auth_only = no
smtp_use_tls = yes
smtpd_use_tls = yes
smtp_tls_note_starttls_offer = yes
smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key
smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt
smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom
home_mailbox = Maildir/
mailbox_command =

thedude
3rd January 2007, 02:18 PM
I use postfix for my mailserver and used this -> http://fedoranews.org/mediawiki/index.php/Fedora_Weekly_News_Issue_27#Postfix_mail_server_wi th_SPAM_and_AntiVirus_protection to assist in the setup. You may need to tweal a couple of things, but it wasn't too difficult. Hope that helps.