Trying to Manually Configure Postifx as smtp Server
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
# 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.
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.
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.
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.
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...
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?
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?
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.