Solved Postfixadmin and FreeBSD 13.2

OK a little background... I having been asleep at the switch. I suddenly found myself with my OS at EOL. My original installation followed the sainted PurpleHatt guide. I was quite happy with the system but time caught top with me... I made the mistake of updating FreeBSD and MySQL
Anyway I resurrected the guide and with some to the point. and have postfix and dovecot where I am stuck is with Postfixadmin which I need to configure MySql The process spelled out in the guide doesn't work so I am trying to install from ports. (I have used ports through out for configuration). I think, I have once again shot myself in the foot.. I have been at this for five days I THINK I made a symbolic link to enable access to my installation at /usr/local/www/postfixadmin. and I must have done it wrong as I can not access this with my browser. I get " The requested URL was not found on this server."

I cant really find any way to find and remove those links. Any ideas would be a help.
 
Last edited:
Show me the output of the following commands:

ls -l /usr/local/www
ls -l /usr/local/etc/apache24/Includes/
grep postfixadmin /usr/local/etc/apache24/httpd.conf
cat /var/db/ports/mail_postfix/options
mysqlshow -p
pkg ver | grep mod_php
 
Show me the output of the following commands:

ls -l /usr/local/www
Code:
drwxr-xr-x   6 root         www      512 Jun  9  2021 apache24
drwxr-xr-x   7 root         www      512 Dec  6  2020 camantonewfashion.com
-rw-r--r--   1 root         www    15086 Dec 22  2019 favicon.ico
drwxr-xr-x   2 lepstein     limit    512 Jan  9  2021 filmusfamily.com
drwxr-xr-x   7 root         www      512 Dec  6  2020 gcs-bonaire.com
drwxr-xr-x   7 root         www      512 Dec  6  2020 gcsbonaire.com
Code:
drwxr-xr-x   2 streetgen    limit    512 Jan 10  2021 grapestreetgen.com
drwxr-xr-x   2 streetvoice  limit    512 Jan 10  2021 grapestreetvoice.com
drwxr-xr-x  41 root         www     2048 Sep  1 11:25 kasdivi.com
drwxr-xr-x   4 root         www      512 Jan  9  2021 lepstein
drwxr-xr-x  10 www          www     3072 Nov 15 14:24 maia
drwxr-xr-x  19 root         www     1536 Nov 15 20:37 postfixadmin
drwxr-xr-x   6 root         www      512 Dec 20  2019 sdbcoppersmith.com
drwxr-xr-x   5 jason        www      512 Feb 18  2023 theoceanwindow.com
drwxr-xr-x   5 root         www      512 Dec 20  2019 wamalali.com
drwxr-xr-x   5 root         www      512 Feb 18  2023 wandjbrewers.com


ls -l /usr/local/etc/apache24/Includes/
Code:
-rw-r--r--  1 root  wheel  145 Dec 22  2019 maia.conf
-rw-r--r--  1 root  wheel   89 Oct 27 21:15 no-accf.conf
-rwxrwxrwx  1 root  wheel  256 Dec 21  2019 php.conf
-rwxrwxrwx  1 root  wheel  136 Nov 15 21:34 postfixadmin.conf
grep postfixadmin /usr/local/etc/apache24/httpd.conf
nothing

cat /var/db/ports/mail_postfix/options
Code:
# This file is auto-generated by 'make config'.
# Options for postfix-3.4.8,1
_OPTIONS_READ=postfix-3.4.8,1
_FILE_COMPLETE_OPTIONS_LIST=BDB BLACKLISTD CDB DOCS EAI INST_BASE LDAP LDAP_SASL LMDB MYSQL NIS PCRE PGSQL SASL SQLITE TEST TLS SASLKRB5 SASLKMIT
OPTIONS_FILE_SET+=BDB
OPTIONS_FILE_UNSET+=BLACKLISTD
OPTIONS_FILE_UNSET+=CDB
OPTIONS_FILE_SET+=DOCS
OPTIONS_FILE_SET+=EAI
OPTIONS_FILE_UNSET+=INST_BASE
OPTIONS_FILE_UNSET+=LDAP
OPTIONS_FILE_UNSET+=LDAP_SASL
OPTIONS_FILE_UNSET+=LMDB
OPTIONS_FILE_SET+=MYSQL
OPTIONS_FILE_UNSET+=NIS
OPTIONS_FILE_SET+=PCRE
OPTIONS_FILE_UNSET+=PGSQL
OPTIONS_FILE_UNSET+=SASL
OPTIONS_FILE_UNSET+=SQLITE
OPTIONS_FILE_UNSET+=TEST
OPTIONS_FILE_SET+=TLS
OPTIONS_FILE_UNSET+=SASLKRB5
OPTIONS_FILE_UNSET+=SASLKMIT

mysqlshow -p

Code:
|     Databases      |
+--------------------+
| information_schema |
| maia               |
| mysql              |
| performance_schema |
| postfix            |
| sys                |
+--------------------+


No links show up


pkg ver | grep mod_php
 
Did you know the pkg-version(8) command has a -x option?

Code:
     -x pattern, --regex pattern
                 Only display the packages that match the regular expression.
                 Uses the "modern" or "extended" syntax of re_format(7).

# pkg version -vRx mod_php
that showed
Code:
FreeBSD repository is up to date.
All repositories are up to date.
mod_php80-8.0.30                   =   up-to-date with remote
 
First you need working php.

Create a test php file inside your www root and navigate to it to test if the php is working.

echo "<?php phpinfo(); ?>" >> /usr/local/www/data/test.php

http://ip_address/test.php
 
in web surfing there seems to be discussion about a postfixadmin database in mysql. Going back to my original guidebook. http://www.purplehat.org/?page_id=11. I am confused by the instruction. It says to create a postfixadmin database but al the instructions refer to postfix. The intent of my efforts are to populate a virtual_alias_maps. which I THINK is suppose to be a table in SOME database. (I am presuming postfixadminsome how does this (still trying to see how.) but I can't access the directory /usr/local/www/postfixadmin which is essentially the crux of this thread. I have therefore created on. Why not. Dont know where do go next.
 
you already have the database it's postfix. You don't need to create it again.

show me the content of /usr/local/etc/apache24/Includes/postfixadmin.conf
 
Code:
<Directory "/usr/local/www/postfixadmin/public/">
    Options Indexes
    AllowOverride AuthConfig
    Require all granted
    </Directory>
 
you are missing alias.

at top of the file put
Code:
Alias /pf "/usr/local/www/postfixadmin/public/"

Then restart/reload the apache and navigate to http://ipaddress/pf

Example:

Code:
Alias /pf "/usr/local/www/postfixadmin/public/"

<Directory "/usr/local/www/postfixadmin/public/">
    AllowOverride AuthConfig
    Options None
    Require ip 127.0.0.1
    AuthType Basic
    AuthName "Restricted area"
    AuthBasicPRovider file
    AuthUserFile "/usr/local/etc/apache24/passwords"
    Require valid-user
</Directory>
 
you are missing alias.

at top of the file put
Code:
Alias /pf "/usr/local/www/postfixadmin/public/"

Then restart/reload the apache and navigate to http://ipaddress/pf

Example:

Code:
Alias /pf "/usr/local/www/postfixadmin/public/"

<Directory "/usr/local/www/postfixadmin/public/">
    AllowOverride AuthConfig
    Options None
    Require ip 127.0.0.1
    AuthType Basic
    AuthName "Restricted area"
    AuthBasicPRovider file
    AuthUserFile "/usr/local/etc/apache24/passwords"
    Require valid-user
</Directory>
appreciate the edit. lets see how this goes
 
looking at the message log I get

Code:
postfix/smtpd[25753]: fatal: no SASL authentication mechanisms

and the mail log says

Code:
warning: proxy:mysql:/usr/local/etc/postfix/mysql_virtual_alias_maps.cf lookup error for "vscan@triggerfish.theoceanwindow.com"[/code}]

I think both are related to not having any tables in my postfix database
 
to the best of my knowledge ,,,, no

when I login as prompted I am back row the "internal Error". i.e other issue
 
login to mysql
mysql -p
then inside the mysql select the database postfix and lets see if there are tables inside.

use postfix;
show tables;
 
This database hold the information about all e-mail accounts. If you create it again it will be empty, that's why you need to restore it back from the backup and not create it again empty.
 
actually if my my.cnf is right I do have backup. I copied by /var/db/mysql. to another location. When said databases I thought something else
 
ojk I restarted my databases. and I am getting

/usr/local/bin/mysqlshow: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) ?​


which ii think is a different issue
 
Back
Top