LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-05-2006, 04:13 AM   #1
michaelsr
Member
 
Registered: Jan 2005
Location: Berkshire, UK
Distribution: Fedora Core 7, 8
Posts: 38

Rep: Reputation: 15
Unhappy Postfix and Dovecot mail problems


I followed a walkthrough which got me to this point.

Everything appears to be running - I can send mail to myself on my local machine using echo "hello"|mail myname. However, I cannot work out how to get postfix to pick up mail from outside. I have a gateway (running NAT) which is set to forward ports 25, 10025 and 10026 to my mailserver and I have pointed the MX record on my ISP's DNS to my fixed IP address. All seems ok so far? Do I need to open all those ports?

Additionally, I do not appear to be able to send mail.

My mailserver has a different name and domain to the address I have forwarded so I set that up in the mydestination field to reflect that. The e-mail address I am testing with is miker@wallgraveroad.co.uk (which I will allow to expire soon, so please feel free to try it if it helps). My goal is to have several domains pointed at the same server.

main.cf
Code:
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
mail_owner = postfix
myhostname = wallgraveroad.co.uk
mydomain = wallgraveroad.co.uk
myorigin = duquesne.anotherdomain.com
inet_interfaces = all
proxy_interfaces = 192.168.0.1
mydestination = wallgraveroad.co.uk, localhost
unknown_local_recipient_reject_code = 550
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
home_mailbox = Maildir/
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.1.5/samples
readme_directory = /usr/share/doc/postfix-2.1.5/README_FILES
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain = $myhostname
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions =
        permit_sasl_authenticated,
        check_relay_domains
content_filter = smtp-amavis:[127.0.0.1]:10024
relayhost = relay.firstnet.net.uk
Thanks,

Michael

Last edited by michaelsr; 06-05-2006 at 04:14 AM.
 
Old 06-05-2006, 11:46 PM   #2
paul_mat
Member
 
Registered: Nov 2004
Location: Townsville, Australia
Distribution: Fedora Core 5, CentOS 4, RHEL 4
Posts: 855

Rep: Reputation: 30
alright the best testing method for mail servers i've found is squirrelmail or some other kinda of web mail interface.

If your running Fedora and you haven't got it installed just run this command

yum install squirrelmail

Make sure apache is running

/etc/init.d/httpd status

and then go to http://localhost/webmail/

one thing I would do is figure out if it is postfix or dovecot, so send an e-mail to an e-mail address that isn;t on your domain, eg: hotmail.com, gmail.com, etc, etc if it comes in then your postfix is working okay.

Then try and send yourself an e-mail from squirrelmail to an e-mail on your domain if that comes though then you know both postfix and dovecot are working and it's probably something to do with your DNS settings.

have you setup your DNS servers in /etc/resolv.conf?
 
Old 06-06-2006, 06:59 AM   #3
michaelsr
Member
 
Registered: Jan 2005
Location: Berkshire, UK
Distribution: Fedora Core 7, 8
Posts: 38

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by paul_mat
alright the best testing method for mail servers i've found is squirrelmail or some other kinda of web mail interface.
Already tried that - Sqm can read mail from the imap server but cannot send, outside or locally.

Quote:
Make sure apache is running
All ok - web is running on this machine anyway and Sqm works fine.

Quote:
one thing I would do is figure out if it is postfix or dovecot, so send an e-mail to an e-mail address that isn;t on your domain
No error - just vanishes into the void.

Quote:
Then try and send yourself an e-mail from squirrelmail to an e-mail on your domain if that comes though then you know both postfix and dovecot are working and it's probably something to do with your DNS settings.
Same result -into the void.

Quote:
Originally Posted by paul_mat
have you setup your DNS servers in /etc/resolv.conf?
All ok as far as I know:
Code:
search mydomain myotherdomain
nameserver gateway IP address
Thanks,
Michael.
 
Old 06-06-2006, 05:01 PM   #4
paul_mat
Member
 
Registered: Nov 2004
Location: Townsville, Australia
Distribution: Fedora Core 5, CentOS 4, RHEL 4
Posts: 855

Rep: Reputation: 30
humm ... thats strange, because even when I make mail servers just for testing without a real world IP and DNS address I can sendmail to real world mail servers.

Have you set your default MTA?

alternatives --config mta

and choose postfix, make sure sendmail isn;t there at all

rpm -qa | grep sendmail
rpm -e <whatever came out of the last command>

now make sure postfix is running

/etc/init.d/postfix status

restart it just to make sure

/etc/init.d/postfix restart

look in the mail logs for any errors or what is going on

/var/log/maillog

if you see something you thing it might be but can;t figure it out, post it up here

also turn on logging with dovecot

nano /etc/dovecot.conf

add the following line

log_path = /var/log/dovecot.log

now restart dovecot and once again, check the logs see if you can see anything

/etc/init.d/dovecot restart

nano /var/log/dovecot.log
 
Old 06-07-2006, 04:17 AM   #5
r0b0
Member
 
Registered: Aug 2004
Location: Europe
Posts: 608

Rep: Reputation: 50
Quote:
Originally Posted by michaelsr
I followed a walkthrough which got me to this point.

Everything appears to be running - I can send mail to myself on my local machine using echo "hello"|mail myname. However, I cannot work out how to get postfix to pick up mail from outside. I have a gateway (running NAT) which is set to forward ports 25, 10025 and 10026 to my mailserver and I have pointed the MX record on my ISP's DNS to my fixed IP address. All seems ok so far? Do I need to open all those ports?
Yes, of course you need to open port 25. Don't know what you use 1025 or 10026 for?
Quote:
Additionally, I do not appear to be able to send mail.

main.cf
Code:
content_filter = smtp-amavis:[127.0.0.1]:10024
relayhost = relay.firstnet.net.uk
You have set up your local SMTP server to deliver all outgoing mail through server relay.firstnet.net.uk. Is that what you want?
Anyway, check log files in /var/log/mail.info. You will find out exactly what happens to your e-mail.
Come back with a record from the log file to the forum if you can't figure it out yourself.
 
Old 06-09-2006, 08:23 AM   #6
michaelsr
Member
 
Registered: Jan 2005
Location: Berkshire, UK
Distribution: Fedora Core 7, 8
Posts: 38

Original Poster
Rep: Reputation: 15
Right - I am slowly getting somewhere with this. I have started again with my main.cf (using the template that comes with postfix).

Now I can send locally via squirrel mail and it appears that I can send external mail too. However, it never arrives. The log entry is as follows:
Code:
Jun  9 13:03:57 duquesne postfix/smtp[19805]: BE4D9B3608: to=<michael@earlscourtvillage.co.uk>, relay=relay.firstnet.net.uk[212.103.224.41], delay=3, status=sent (250 ok 1149857627 qp 19171)
Jun  9 13:03:57 duquesne postfix/qmgr[19722]: BE4D9B3608: removed
Looks ok to me... The problem I found was that my smtp relay has a ".uk" on the end, which I missed out - silly mistake!

EDIT: I meant to ask - is there a way to pull e-mails out of an existing pop3 mailbox?

However, I still don't appear to be able to receive mail from the outside world and I am unclear as to where I should start looking. The MX record for wallgraveroad.co.uk is pointing to the correct address, beyond that I am lost!

Thanks again,

Michael

Last edited by michaelsr; 06-09-2006 at 08:26 AM.
 
Old 06-09-2006, 10:06 AM   #7
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
I would think your source and destination should match.. If I do a reverse lookup of the duquesne address (my mail server is configured to do this automatically) I don't think it will resolve to your IP address, so if that failed my mail server would reject your message.. of course that's just a spam rejection issue..
myorigin = duquesne.anotherdomain.com
mydestination = wallgraveroad.co.uk


Here is the config from my working mail server... maybe you will see something that tweaks your brain for a solution..
Code:
mail #>  postconf -n

append_dot_mydomain = no
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
debug_peer_level = 2
home_mailbox = Maildir/
local_destination_concurrency_limit = 1
local_recipient_maps = unix:passwd.byname $alias_maps
mail_spool_directory = /var/spool/mail
mailbox_command = /usr/local/bin/maildrop
mailq_path = /usr/bin/mailq
manpage_directory = /usr/local/man
masquerade_domains = $mydomain
message_size_limit = 5120000
mime_header_checks = regexp:/etc/postfix/mime_header_checks.regexp
mydestination = $mydomain $myhostname localhost.$mydomain
mydomain = mailservices.dot
myhostname = mail.mailservices.dot
mynetworks = 172.0.0.0/8, 192.168.0.0/24
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases
proxy_interfaces = 172.16.1.21
readme_directory = /etc/postfix
sample_directory = /etc/postfix
sendmail_path = /usr/sbin/sendmail
setgid_group = postdrop
smtpd_banner = $myhostname
smtpd_data_restrictions = reject_unauth_pipelining
smtpd_recipient_restrictions = permit_mynetworks          
	reject_non_fqdn_hostname          
	reject_non_fqdn_sender          
	reject_non_fqdn_recipient          
	check_recipient_access hash:/etc/postfix/filtered_domains          
	reject_unknown_sender_domain          
	reject_unknown_recipient_domain   
	reject_unauth_destination       
	reject_invalid_hostname         
	reject_rbl_client bl.spamcop.net       
	reject_rbl_client relays.ordb.org        
	reject_rbl_client list.dsbl.org        
	reject_rbl_client sbl-xbl.spamhaus.org   
	reject_rbl_client dul.dnsbl.sorbs.net  
	permit
unknown_local_recipient_reject_code = 550
in case you are womdering mynetworks 172.x.x.x is the DMZ the mail server sits in and 192.x.x.x is my internal network.. that's why there are 2 listed.. and no that's not the real domain name


but might I also suggest you check out the postfix users mail list ? Read the instructions on asking a question they want some specific information (postconf -n, REAL domain name and REAL IP addresses, etc.. otherwise they waste their time) they can usually spot the problem in one or two mail exchanges.. beside the developer there are some really bright people in there that are intimately familiar with postfix..

http://www.postfix.org/lists.html

Quote:
EDIT: I meant to ask - is there a way to pull e-mails out of an existing pop3 mailbox?
Fetchmail is for mail retreival from pop3 and Imap servers http://fetchmail.berlios.de/index.html
Quote:
G1. What is fetchmail and why should I bother?

Fetchmail is a one-stop solution to the remote mail retrieval problem for Unix machines, quite useful to anyone with an intermittent or dynamic-IP connection to a remote mailserver, SLIP or PPP dialup, or leased line when SMTP isn't desired. Fetchmail can collect mail using any variant of POP or IMAP and forwards to a the local SMTP (via TCP socket) or LMTP (via TCP or Unix socket) listener or into an MDA program, enabling all the normal forwarding/filtering/aliasing mechanisms that would apply to local mail or mail arriving via a full-time TCP/IP connection.

Fetchmail is not a toy or a coder's learning exercise, but an industrial-strength tool capable of transparently handling every retrieval demand from those of a simple single-user ISP connection up to mail retrieval and rerouting for an entire client domain. Fetchmail is easy to configure, unobtrusive in operation, powerful, feature-rich, and well documented.

Last edited by farslayer; 06-09-2006 at 10:09 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
postfix dovecot Maildir Danny Regan Debian 3 11-15-2005 04:08 PM
Postfix Dovecot Help BigAppleFan Linux - Newbie 7 08-15-2005 05:08 PM
Postfix Dovecot Spamassassin php4u Fedora 1 04-09-2005 02:48 AM
Postfix and Dovecot umbraeOtheisles Linux - Software 3 11-23-2004 07:36 AM
postfix with dovecot on fc2 rnj Fedora 1 10-09-2004 04:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration