LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-28-2014, 09:23 PM   #1
des_a
Senior Member
 
Registered: Sep 2006
Posts: 1,416
Blog Entries: 43

Rep: Reputation: 36
Trying to Manually Configure Postifx as smtp Server


I'm trying to configure postfix as an SMTP server. Right now, my client says it can't find the server, and I think that's because postfix is not starting because of an error in the configuration file or something. Before, the closest I've had this to working was a file where it would indeed listen, and then it would send e-mail, but it would get lost and never delivered. I want to just use the standard format for the mailbox, which I believe is mbox format.

Here is my current main.cf file:
Code:
# Please be sure to read the /usr/share/doc/postfix/README.MDK file
# to learn about differences from stock postfix to Mandriva package.
# This file contains only the parameters changed from a default install
# see /etc/postfix/main.cf.dist for a commented, fuller version of this file.

# These are changed by postfix install script
readme_directory = /usr/share/doc/postfix/README_FILES
html_directory = /usr/share/doc/postfix/html
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
command_directory = /usr/sbin
manpage_directory = /usr/share/man
daemon_directory = /usr/lib64/postfix
data_directory = /var/lib/postfix
newaliases_path = /usr/bin/newaliases
mailq_path = /usr/bin/mailq
queue_directory = /var/spool/postfix
mail_owner = postfix

# User configurable parameters

inet_interfaces = all
inet_protocols = all
mynetworks = 127.0.0.0/8 1.1.1.0/24 2.1.1.0/24 3.1.1.0/24 4.1.1.0/24
mynetworks_style = subnet
#delay_warning_time = 4h
smtpd_banner = $myhostname ESMTP $mail_name ($mail_version) (Mandriva Linux)
unknown_local_recipient_reject_code = 450
smtp-filter_destination_concurrency_limit = 2
lmtp-filter_destination_concurrency_limit = 2
myhostname = mail.$mydomain
mydomain = smiley000.net
mydestination = /etc/postfix/local-host-names, localhost.$mydomain

smtpd_sasl_local_domain =
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_sasl_authenticated_header = yes

smtpd_tls_auth_only = no
smtp_use_tls = no
smtpd_use_tls = no
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

smtpd_sender_restrictions =
 permit_sasl_authenticated,
 permit_mynetworks

smtpd_recipient_restrictions =
 permit_sasl_authenticated,
 check_recipient_access hash:/etc/postfix/filtered_domains,
 permit_mynetworks,
 reject_unauth_destination
 
Old 06-29-2014, 12:11 AM   #2
des_a
Senior Member
 
Registered: Sep 2006
Posts: 1,416

Original Poster
Blog Entries: 43

Rep: Reputation: 36
Now my file looks like this:

Code:
# Please be sure to read the /usr/share/doc/postfix/README.MDK file
# to learn about differences from stock postfix to Mandriva package.
# This file contains only the parameters changed from a default install
# see /etc/postfix/main.cf.dist for a commented, fuller version of this file.

# These are changed by postfix install script
readme_directory = /usr/share/doc/postfix/README_FILES
html_directory = /usr/share/doc/postfix/html
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
command_directory = /usr/sbin
manpage_directory = /usr/share/man
daemon_directory = /usr/lib64/postfix
data_directory = /var/lib/postfix
newaliases_path = /usr/bin/newaliases
mailq_path = /usr/bin/mailq
queue_directory = /var/spool/postfix
mail_spool_directory = /var/spool/mail
mailbox_size_limit = 0
mailbox_command = procmail -a "$EXTENSION"
mail_owner = postfix

# User configurable parameters

inet_interfaces = all
inet_protocols = all
mynetworks = 127.0.0.0/8 1.1.1.0/24 2.1.1.0/24 3.1.1.0/24 4.1.1.0/24
mynetworks_style = subnet
#delay_warning_time = 4h
smtpd_banner = $myhostname ESMTP $mail_name ($mail_version) (Mandriva Linux)
unknown_local_recipient_reject_code = 450
smtp-filter_destination_concurrency_limit = 2
lmtp-filter_destination_concurrency_limit = 2
myhostname = mail.$mydomain
mydomain = smiley000.net
mydestination = /etc/postfix/local-host-names, localhost.$mydomain

smtpd_sasl_local_domain =
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_sasl_authenticated_header = yes

smtpd_tls_auth_only = no
smtp_use_tls = no
smtpd_use_tls = no
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

smtpd_sender_restrictions =
 permit_sasl_authenticated,
 permit_mynetworks

smtpd_recipient_restrictions =
 permit_sasl_authenticated,
 check_recipient_access hash:/etc/postfix/filtered_domains,
 permit_mynetworks,
 reject_unauth_destination
I found that I accidently had another program listening on port 25, and that was why postfix wasn't working at all. I took care of that. Now postfix starts properly and everything. The problem now is that it isn't even displaying it's banner when tested with telnet.
 
Old 06-29-2014, 06:28 PM   #3
des_a
Senior Member
 
Registered: Sep 2006
Posts: 1,416

Original Poster
Blog Entries: 43

Rep: Reputation: 36
Now I got it to where it will send, but mail is lost. I found that the reason seems to be that there is no mbox for my users. So I have to figure out how to create an mbox manually. I have no idea why they weren't created with the home directories, as I'd expect them to be.
 
Old 06-30-2014, 01:21 AM   #4
des_a
Senior Member
 
Registered: Sep 2006
Posts: 1,416

Original Poster
Blog Entries: 43

Rep: Reputation: 36
Everything points to that they are supposed to be created when the user is created. But for some reason they are not being done that way. And this was another fresh install too.
 
Old 06-30-2014, 06:13 PM   #5
des_a
Senior Member
 
Registered: Sep 2006
Posts: 1,416

Original Poster
Blog Entries: 43

Rep: Reputation: 36
So I figured out how to manually create blank mailboxes for users. I'd done these commands:

Code:
touch /var/spool/mail/[mailbox name]
chmod 666 [mailbox name]
chown postfix [mailbox name]
chgrp postfix [mailbox name]
This fixed the no mailbox errors, but mail is still getting lost and not delivered.
 
Old 07-13-2014, 07:19 AM   #6
antiX-Dave
LQ Newbie
 
Registered: Dec 2013
Distribution: antiX
Posts: 22

Rep: Reputation: Disabled
Did you configure procmail to drop the mail into your users mailbox?
You seem to have postfix setup to deliver mail to procmail for filtering / final delivery.
 
Old 08-25-2014, 10:24 PM   #7
des_a
Senior Member
 
Registered: Sep 2006
Posts: 1,416

Original Poster
Blog Entries: 43

Rep: Reputation: 36
I don't know if I procmail is set up or not. I had currently had to switch gears and first work on house cleaning, and then work on some laptops that came in, and then I can get back to working on the server. I am now trying to use Magiea Linux, instead of Mandriva. I am trying it to see whether I like it or not. If I like it, I will use that, since it's newer. I wiped my Mandriva, and installed Magiea, so if I do decide to go with Mandriva, I will require a re-install, and right now I require a fresh install of Magiea, because it is the first time I've used it. So now it's housework & laptops, then back to the server...
 
Old 11-13-2014, 09:21 AM   #8
des_a
Senior Member
 
Registered: Sep 2006
Posts: 1,416

Original Poster
Blog Entries: 43

Rep: Reputation: 36
Still out there, just taking a long time to finish my server...
 
Old 01-27-2015, 06:01 PM   #9
des_a
Senior Member
 
Registered: Sep 2006
Posts: 1,416

Original Poster
Blog Entries: 43

Rep: Reputation: 36
So I'm now ready to try troubleshooting my e-mail server again, assuming this installation is going to remain stable enough to do so. If it doesn't remain stable, it's now a simple matter to re-install it again the exact same way. I do not believe I configured procmail correctly, so that is probably the problem. I will update you on what my configuration file looks like, as soon as I can. But that was probably the problem after all. How do I configure procmail?
 
Old 02-10-2015, 10:54 PM   #10
des_a
Senior Member
 
Registered: Sep 2006
Posts: 1,416

Original Poster
Blog Entries: 43

Rep: Reputation: 36
So I didn't really have a working file at all, so I copied and pasted my old one to get it working, and modified it to work for this version of Linux. Now it's hanging when I start or restart postfix, however. What do I do to fix this?
 
Old 02-23-2015, 06:22 PM   #11
des_a
Senior Member
 
Registered: Sep 2006
Posts: 1,416

Original Poster
Blog Entries: 43

Rep: Reputation: 36
See: http://www.linuxquestions.org/questi...25#post5304525 for more information on my change to Mageia Linux.
 
Old 02-23-2015, 07:47 PM   #12
antiX-Dave
LQ Newbie
 
Registered: Dec 2013
Distribution: antiX
Posts: 22

Rep: Reputation: Disabled
Quote:
Originally Posted by des_a View Post
So I didn't really have a working file at all, so I copied and pasted my old one to get it working, and modified it to work for this version of Linux. Now it's hanging when I start or restart postfix, however. What do I do to fix this?
Have you read the log?
Typically it tells you exactly why it hangs / crashes in there.
There are a million ways that same problem can happen, so really the best I could tell you would still be a random guess. That will most likely frustrate you as well as myself whilst try to troubleshoot the issue.

As to your vnc starting automatically...
There are alot of login managers that allow vnc to be started when they are. However if you just want to allow some user to access a desktop, try something like:

Code:
#!/bin/sh
### BEGIN INIT INFO
# Provides: VNC
# Required-Start: $network
# Required-Stop: $network
# Default-Start: 3 5
# Description: start vnc server at boot
### END INIT INFO

case "$1" in
'start')
	vnc4server -geometry 1366x768 -rfbport 1401 ;
	;;
'stop'|'Default-Stop')
	killall Xvnc4 &
	rm /root/.vnc/*.pid
	rm /root/.vnc/*.log
	;;
*)
	echo "Usage: $0 { start | stop }"
	;;
esac
exit 0
As an init script (assuming you are not using systemd.... if you are not sure on starting vnc vanilla like at the moment.

Please note that you will have to make the configurations in ~/.vnc to specify a desktop and the like.

Last edited by antiX-Dave; 02-23-2015 at 07:48 PM.
 
Old 02-25-2015, 09:23 PM   #13
des_a
Senior Member
 
Registered: Sep 2006
Posts: 1,416

Original Poster
Blog Entries: 43

Rep: Reputation: 36
So I am back to the same problem as before. It no longer uses procmail, but it's the same results. Here is my file:


Code:
manpage_directory = /usr/share/man
daemon_directory = /usr/lib64/postfix
data_directory = /var/lib/postfix
newaliases_path = /usr/bin/newaliases
mailq_path = /usr/bin/mailq
queue_directory = /var/spool/postfix
mail_owner = postfix

# User configurable parameters

inet_interfaces = all
inet_protocols = all
mynetworks_style = subnet
mynetworks = 127.0.0.0/8 1.1.1.0/24 2.1.1.0/24
#delay_warning_time = 4h
smtpd_banner = $myhostname ESMTP $mail_name ($mail_version) (Mandriva Linux)
unknown_local_recipient_reject_code = 450
smtp-filter_destination_concurrency_limit = 2
lmtp-filter_destination_concurrency_limit = 2
myhostname = mail.$mydomain
mydomain = smiley000.net
mydestination = localhost.$mydomain
 
Old 02-25-2015, 09:25 PM   #14
des_a
Senior Member
 
Registered: Sep 2006
Posts: 1,416

Original Poster
Blog Entries: 43

Rep: Reputation: 36
Note that mail is not being held in the queue.
 
Old 02-25-2015, 10:43 PM   #15
des_a
Senior Member
 
Registered: Sep 2006
Posts: 1,416

Original Poster
Blog Entries: 43

Rep: Reputation: 36
It looks as if by default, on my system, mail is supposed to be delivered to ~/$USERNAME, where $USERNAME is the username of the user. However, postfix doesn't know this, and I'm having trouble telling it so. I tried telling it to deliver instead to ~/mbox, where mbox is always the name, of the file, but it still seems to have no luck. Sent mail is working fine, and I can see the sentmail being received in ~/mail/sentmail, where sentmail is always the name of the file, however the inbox always stays empty.
 
  


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
[SOLVED] What is easiest smtp server to setup and configure? alanoco79 Linux - Newbie 10 03-06-2010 12:18 AM
manually configure X server file firedancer Linux - General 1 07-12-2007 09:26 AM
Can one configure sendmail to use an SMTP server? laggerific Linux - Software 1 02-16-2006 10:49 AM
How to configure sendmail to use other smtp server? josealexandre Linux - Newbie 2 10-12-2003 05:09 PM
How to configure smtp server in RH7.3 renjith_renjith Linux - Networking 1 04-25-2003 09:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10: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