[SOLVED]Install a Relay Mail Host on pfSense (postfix)
-
My suggestion is that you don't use an MTA on pfSense at all under any circumstances :-)
If you want e-mail notifications, there are some PHP modules out there which can just send mail only, not receive.
-
My suggestion is that you don't use an MTA on pfSense at all under any circumstances :-)
If you want e-mail notifications, there are some PHP modules out there which can just send mail only, not receive.
Cool, can you point me to such PHP modules I can install in 1.2.3-RELEASE?Ā I would be more than happy to install them as I don't need the potential security risks of a full-blown MTA on my firewall.Ā Essentially, I just need to be able to send email from the monit application installed on my firewall(s) to receive alerts, etc.
-
I don't know if there is a full-blown sendmail work-alike done in PHP, but someone could use the smtp.inc file from pfSense 2.0 and write a small front-end to it that takes the message and sends it where it needs to go:
http://redmine.pfsense.org/repositories/entry/pfsense/etc/inc/smtp.inc
The whole notification system had a lot of work done in 2.0
You see how the SMTP settings are done here:
http://redmine.pfsense.org/repositories/entry/pfsense/usr/local/www/system_advanced_notifications.php
Not sure how much of that would work on 1.2.3 since it only has PHP 4.x and pfSense 2.0 is on PHP 5.x
You may just have to google around for a PHP sendmail drop-in or work-alike and see what turns up.
-
Sorry for my arrogant attitudeā¦........:(
-
- What does, "ps aux" give you?
ps aux does not show anything relaled to postfixā¦
- How are you trying to start postfix?
I made the following from the beginning
1.- pkg_add -r postfix.tbz from (ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-7-stable/Latest/postfix.tbz)
2.- edited /usr/local/etc/rc.d/postfix, just to change :${postfix_enable="YES"}
3.- cp /usr/local/etc/rc.d/postfix /usr/local/etc/rc.d/postfix.sh
4.- Added postfix_enable="YES" into /boot/loader.conf
5.- Reboot- What does your postfix main.cf file have?
I“ve got 2, but i didn“t changed anything yet in those files
/usr/local/etc/postfix/main.cf
/usr/local/etc/libexec/postfix/main.cf- How are you trying to connect using telnet?Ā From the local machine or from a machine on your LAN?
From both (obviously using localhost from pfsense, and LAN interface ip from LAN)
Thanks a lot!!!
-
If i try to stop / start postfix, this is the output
#postfix stop postfix/postfix-scrcipt: stopping the Postfix mail system sed: pid/master.pid: No such file or directory usage: kill [-s signal_name] pid ... kill -l [exit_status] kill -signal_name pid ... kill -signal_number pid ... /libexec/ld-elf.so.1: /usr/local/libexec/postfix/master: Undefined symbol "close from" postfix/postfix-script: waiting for the Postfix mail system to terminate /libexec/ld-elf.so.1: /usr/local/libexec/postfix/master: Undefined symbol "close from" postfix/postfix-script: waiting for the Postfix mail system to terminate /libexec/ld-elf.so.1: /usr/local/libexec/postfix/master: Undefined symbol "close from" postfix/postfix-script: waiting for the Postfix mail system to terminate /libexec/ld-elf.so.1: /usr/local/libexec/postfix/master: Undefined symbol "close from" postfix/postfix-script: waiting for the Postfix mail system to terminate /libexec/ld-elf.so.1: /usr/local/libexec/postfix/master: Undefined symbol "close from" postfix/postfix-script: waiting for the Postfix mail system to terminate /libexec/ld-elf.so.1: /usr/local/libexec/postfix/master: Undefined symbol "close from" postfix/postfix-script: waiting for the Postfix mail system to terminate postfix/postfix-script: warning: stopping the Postfix mail system with force awk: can“t open file pid/master.pid source line number 1 # postfix start postfix/postfix-script: fatal: the Postfix mail system is already running #
-
ok. News.
I installed a fresh postfix on pfSense Box for FreeBSD 7.2 (postfix-current-2.6.20090212,4.tbz)
PostFix is running now (at least 25 port is opened), and ps -aux shows 2 processes running for postfix (pickup and qmgr) but now I got the following message in system log:
postfix/smtpd: fatal open database /etc/aliases.db: No such file or directory
if I search for aliases i found
/etc/aliasesĀ Ā (which is a link to mail/aliases) (/etc/mail/ is empty)
/usr/local/etc/postfix/dist/aliases
/usr/local/etc/postfix/aliasesThanks
-
Great, you are almost there!
To get the /etc/aliases.db file created, edit the /etc/aliases file and make any necessary changes.Ā For me, I changed the "root:Ā you"Ā to "root:Ā rkelley@abcxyz.com" then ran /usr/local/bin/newaliases to build the /etc/aliases.db file.
Also, getting the /usr/local/postfix/main.cf file tuned properly is very important!Ā Here is what I have in mine:
undisclosed_recipients_header = To:rkelley@abcxyz.com queue_directory = /var/spool/postfix command_directory = /usr/local/sbin daemon_directory = /usr/local/libexec/postfix data_directory = /var/db/postfix mail_owner = postfix myorigin = <domain_name>unknown_local_recipient_reject_code = 550 mynetworks_style = host relayhost = <pfsense_lan_ip>debug_peer_level = 2 debugger_command = Ā Ā Ā Ā PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin Ā Ā Ā Ā ddd $daemon_directory/$process_name $process_id & sleep 5 sendmail_path = /usr/local/sbin/sendmail newaliases_path = /usr/local/bin/newaliases mailq_path = /usr/local/bin/mailq setgid_group = maildrop html_directory = no manpage_directory = /usr/local/man sample_directory = /usr/local/etc/postfix readme_directory = no</pfsense_lan_ip></domain_name>
Make sure to put in the correct information for your relayhost, undisclosed_recipients_header, and myorigin.Ā Once done, simply restart postfix and send yourself an email.
Let me know how you make outā¦
-
-
Ok. Finished.
My pfSense box is able to relay mail to another relay host. After a bit tailoring of main.cf
mynetworks_style=subnet
relaydomains = xyz.com
relayhost = ip.add.re.ss of LANApart of your suggestions relayhost, undisclosed_recipients_header, and myorigin
Thank you very much for you help
-
No problem, glad to help.
Now that you have installed Postfix , please make sure to lock down your firewall as much as possibleā¦
-
Sure! hehe My pfsense cluster is now a Swiss Army Knife hehe
Thanks again!