Control Web Panel

WebPanel => E-Mail => Topic started by: Administrator on November 02, 2014, 03:41:53 AM

Title: How to Rebuild Postfix Mail Server
Post by: Administrator on November 02, 2014, 03:41:53 AM
Starting from the CWP version 0.9.6+ you have a new awesome Postfix Mail Server Manager (reBuilder)
With single click select additional Mail Server options and rebuild your mail server according to your needs.

Location in the CWP.admin area
Left Menu --> Email --> Postfix Manager

Options
- AntiSpam and AntiVirus Protection (Spamassassin and ClamAV are scanning all your incoming emails, this requires server with min. 1Gb RAM).
- rDNS check (Drop all emails if no rDNS/PTR)
- Reject Unknown Hostname (Reject unless the hostname has valid DNS record.)


AntiSpam and AntiVirus

It's possible that ClamAV Antivirus will work with 512MB RAM server but its recommended to have 1GB+ RAM.
Title: Re: How to Rebuild Postfix Mail Server
Post by: calivent on April 08, 2016, 04:20:10 PM
ClamAV almost always brings problems, such as installing Spamassassin only because it is enough to stop some spam.
or I can use the dnsbl only to block spam?
Title: Re: How to Rebuild Postfix Mail Server
Post by: Jae on April 08, 2016, 11:22:31 PM
Using rbl only blocking, still allowing email with virus passing through your server, and these days, crypto virus is scaring most.
Title: Re: How to Rebuild Postfix Mail Server
Post by: budisetiaji on May 09, 2016, 03:26:04 AM
I already create email accounts on the CWP server but have not enabled clamav, amavis and others associated with the configuration of email, by enabling all features in the "Rebuild Postfix Configuration" whether to delete e-mail accounts that have been made?

Thanks and regards,
Budi Setiaji
Title: Re: How to Rebuild Postfix Mail Server
Post by: Sandeep on May 09, 2016, 09:23:20 AM
no email accounts will NOT be deleted
Title: Re: How to Rebuild Postfix Mail Server
Post by: arifin on November 05, 2016, 01:34:51 AM
Hi,

whenever I select the following during Rebuild Postfix Mail Server, I can not send and receive email?

AntiSpam/AntiVirus (recommended): ClamAV, Amavis & Spamassassin, Requires 1Gb+ RAM

any ideas ?

thanks
Title: Re: How to Rebuild Postfix Mail Server
Post by: lexz on November 11, 2016, 01:54:45 PM
I just started a new thread before I found this. I have the same problem :(

Hi,

whenever I select the following during Rebuild Postfix Mail Server, I can not send and receive email?

AntiSpam/AntiVirus (recommended): ClamAV, Amavis & Spamassassin, Requires 1Gb+ RAM

any ideas ?

thanks
Title: Re: How to Rebuild Postfix Mail Server
Post by: Jae on November 12, 2016, 02:37:41 AM
mas @arifin @lexz

Try to keep amavis, clam and spamassasin running but let postfix bypass them all..
in mail.cf comment this line "content_filter = smtp-amavis:[127.0.0.1]:10024"
in master.cf comment this line "-o content_filter=smtp-amavis:127.0.0.1:10024"
restart postfix, will make it ignore both amavis, clam and spamassasin

then one by one enable them
Title: Re: How to Rebuild Postfix Mail Server
Post by: lexz on November 12, 2016, 05:14:34 PM
@Jae First thank you for your answer.

I tried rebuilding postfix including ClamAV, Amavis & Spamassassin and editing the configfiles.

I couldn't find the mail.cf file. (I found a main.cf but did not had the rule you said)
In the master.cf I commented the line and restarted the server. Still the same result. :(
Title: Re: How to Rebuild Postfix Mail Server
Post by: Jae on November 13, 2016, 01:23:06 AM
include log from /var/log/maillog to post, will help more
Title: Re: How to Rebuild Postfix Mail Server
Post by: lexz on November 14, 2016, 05:22:15 PM
@Jae
I rebuilded the server and get the following output in my log.

Hope it can help!
Thank you!

Code: [Select]
Nov 14 18:12:06 myhostname postfix/postfix-script[25977]: starting the Postfix mail system
Nov 14 18:12:06 myhostname postfix/master[25978]: daemon started -- version 2.6.6, configuration /etc/postfix
Nov 14 18:12:23 myhostname postfix/smtpd[26105]: fatal: open database /etc/postfix/sender_whitelist.db: Bad file descriptor
Nov 14 18:12:24 myhostname postfix/master[25978]: warning: process /usr/libexec/postfix/smtpd pid 26105 exit status 1
Nov 14 18:12:24 myhostname postfix/master[25978]: warning: /usr/libexec/postfix/smtpd: bad command startup -- throttling
Nov 14 18:12:24 myhostname spamd[26097]: spamd: server started on port 783/tcp (running version 3.3.1)
Nov 14 18:12:24 myhostname spamd[26097]: spamd: server pid: 26097
Nov 14 18:12:24 myhostname spamd[26097]: spamd: server successfully spawned child process, pid 26107
Nov 14 18:12:24 myhostname spamd[26097]: spamd: server successfully spawned child process, pid 26108
Nov 14 18:12:24 myhostname spamd[26097]: prefork: child states: IS
Nov 14 18:12:24 myhostname spamd[26097]: prefork: child states: II
Nov 14 18:12:25 myhostname amavis[26137]: starting. /usr/sbin/amavisd at [I Removed the hostname] amavisd-new-2.9.1 (20140627), Unicode aware, LANG="en_US.UTF-8"
Nov 14 18:12:26 myhostname amavis[26139]: Net::Server: Group Not Defined.  Defaulting to EGID '489 489'
Nov 14 18:12:26 myhostname amavis[26139]: Net::Server: User Not Defined.  Defaulting to EUID '489'
Nov 14 18:12:26 myhostname amavis[26139]: Module Amavis::Conf        2.321
Nov 14 18:12:26 myhostname amavis[26139]: Module Archive::Zip        1.30
Nov 14 18:12:26 myhostname amavis[26139]: Module BerkeleyDB          0.43
Nov 14 18:12:26 myhostname amavis[26139]: Module Compress::Raw::Zlib 2.021
Nov 14 18:12:26 myhostname amavis[26139]: Module Compress::Zlib      2.021
Nov 14 18:12:26 myhostname amavis[26139]: Module Crypt::OpenSSL::RSA 0.25
Nov 14 18:12:26 myhostname amavis[26139]: Module DB_File             1.82
Nov 14 18:12:26 myhostname amavis[26139]: Module Digest::MD5         2.39
Nov 14 18:12:26 myhostname amavis[26139]: Module Digest::SHA         5.47
Nov 14 18:12:26 myhostname amavis[26139]: Module Encode              2.35
Nov 14 18:12:26 myhostname amavis[26139]: Module File::Temp          0.22
Nov 14 18:12:26 myhostname amavis[26139]: Module IO::Socket::INET6   2.56
Nov 14 18:12:26 myhostname amavis[26139]: Module MIME::Entity        5.427
Nov 14 18:12:26 myhostname amavis[26139]: Module MIME::Parser        5.427
Nov 14 18:12:26 myhostname amavis[26139]: Module MIME::Tools         5.427
Nov 14 18:12:26 myhostname amavis[26139]: Module Mail::DKIM::Signer  0.37
Nov 14 18:12:26 myhostname amavis[26139]: Module Mail::DKIM::Verifier 0.37
Nov 14 18:12:26 myhostname amavis[26139]: Module Mail::Header        2.04
Nov 14 18:12:26 myhostname amavis[26139]: Module Mail::Internet      2.04
Nov 14 18:12:26 myhostname amavis[26139]: Module Mail::SPF           v2.008
Nov 14 18:12:26 myhostname amavis[26139]: Module Mail::SpamAssassin  3.003001
Nov 14 18:12:26 myhostname amavis[26139]: Module Net::DNS            0.65
Nov 14 18:12:26 myhostname amavis[26139]: Module Net::Server         0.99
Nov 14 18:12:26 myhostname amavis[26139]: Module NetAddr::IP         4.027
Nov 14 18:12:26 myhostname amavis[26139]: Module Razor2::Client::Version 2.84
Nov 14 18:12:26 myhostname amavis[26139]: Module Scalar::Util        1.21
Nov 14 18:12:26 myhostname amavis[26139]: Module Socket              1.82
Nov 14 18:12:26 myhostname amavis[26139]: Module Socket6             0.23
Nov 14 18:12:26 myhostname amavis[26139]: Module Time::HiRes         1.9721
Nov 14 18:12:26 myhostname amavis[26139]: Module URI                 1.40
Nov 14 18:12:26 myhostname amavis[26139]: Module Unix::Syslog        1.1
Nov 14 18:12:26 myhostname amavis[26139]: Amavis::ZMQ code     NOT loaded
Nov 14 18:12:26 myhostname amavis[26139]: Amavis::DB code      loaded
Nov 14 18:12:26 myhostname amavis[26139]: SQL base code        NOT loaded
Nov 14 18:12:26 myhostname amavis[26139]: SQL::Log code        NOT loaded
Nov 14 18:12:26 myhostname amavis[26139]: SQL::Quarantine      NOT loaded
Nov 14 18:12:26 myhostname amavis[26139]: Lookup::SQL code     NOT loaded
Nov 14 18:12:26 myhostname amavis[26139]: Lookup::LDAP code    NOT loaded
Nov 14 18:12:26 myhostname amavis[26139]: AM.PDP-in proto code loaded
Nov 14 18:12:26 myhostname amavis[26139]: SMTP-in proto code   loaded
Nov 14 18:12:26 myhostname amavis[26139]: Courier proto code   NOT loaded
Nov 14 18:12:26 myhostname amavis[26139]: SMTP-out proto code  loaded
Nov 14 18:12:26 myhostname amavis[26139]: Pipe-out proto code  NOT loaded
Nov 14 18:12:26 myhostname amavis[26139]: BSMTP-out proto code NOT loaded
Nov 14 18:12:26 myhostname amavis[26139]: Local-out proto code loaded
Nov 14 18:12:26 myhostname amavis[26139]: OS_Fingerprint code  NOT loaded
Nov 14 18:12:26 myhostname amavis[26139]: ANTI-VIRUS code      loaded
Nov 14 18:12:26 myhostname amavis[26139]: ANTI-SPAM code       loaded
Nov 14 18:12:26 myhostname amavis[26139]: ANTI-SPAM-EXT code   NOT loaded
Nov 14 18:12:26 myhostname amavis[26139]: ANTI-SPAM-C code     NOT loaded
Nov 14 18:12:26 myhostname amavis[26139]: ANTI-SPAM-SA code    loaded
Nov 14 18:12:26 myhostname amavis[26139]: Unpackers code       loaded
Nov 14 18:12:26 myhostname amavis[26139]: DKIM code            loaded
Nov 14 18:12:26 myhostname amavis[26139]: Tools code           NOT loaded
Nov 14 18:12:26 myhostname amavis[26139]: Found $file            at /usr/bin/file
Nov 14 18:12:26 myhostname amavis[26139]: Found $altermime       at /usr/bin/altermime
Nov 14 18:12:26 myhostname amavis[26139]: Internal decoder for .mail
Nov 14 18:12:26 myhostname amavis[26139]: Found decoder for    .F    at /usr/bin/unfreeze
Nov 14 18:12:26 myhostname amavis[26139]: Found decoder for    .Z    at /usr/bin/uncompress
Nov 14 18:12:26 myhostname amavis[26139]: Found decoder for    .gz   at /usr/bin/gzip -d
Nov 14 18:12:26 myhostname amavis[26139]: Found decoder for    .bz2  at /usr/bin/bzip2 -d
Nov 14 18:12:26 myhostname amavis[26139]: No ext program for   .xz, tried: xzdec, xz -dc, unxz -c, xzcat
Nov 14 18:12:26 myhostname amavis[26139]: No ext program for   .lzma, tried: lzmadec, xz -dc --format=lzma, lzma -dc, unlzma -c, lzcat, lzmadec
Nov 14 18:12:26 myhostname amavis[26139]: Found decoder for    .lrz  at /usr/bin/lrzip -q -k -d -o -
Nov 14 18:12:26 myhostname amavis[26139]: Found decoder for    .lzo  at /usr/bin/lzop -d
Nov 14 18:12:26 myhostname amavis[26139]: Found decoder for    .rpm  at /usr/bin/rpm2cpio
Nov 14 18:12:26 myhostname amavis[26139]: Found decoder for    .cpio at /bin/cpio
Nov 14 18:12:26 myhostname amavis[26139]: Found decoder for    .tar  at /bin/cpio
Nov 14 18:12:26 myhostname amavis[26139]: Found decoder for    .deb  at /usr/bin/ar
Nov 14 18:12:26 myhostname amavis[26139]: Found decoder for    .rar  at /usr/bin/unrar
Nov 14 18:12:26 myhostname amavis[26139]: Found decoder for    .arj  at /usr/bin/unarj
Nov 14 18:12:26 myhostname amavis[26139]: Found decoder for    .arc  at /usr/bin/nomarch
Nov 14 18:12:26 myhostname amavis[26139]: Found decoder for    .zoo  at /usr/bin/zoo
Nov 14 18:12:26 myhostname amavis[26139]: Found decoder for    .cab  at /usr/bin/cabextract
Nov 14 18:12:26 myhostname amavis[26139]: Internal decoder for .tnef
Nov 14 18:12:26 myhostname amavis[26139]: Found decoder for    .zip  at /usr/bin/7za
Nov 14 18:12:26 myhostname amavis[26139]: Found decoder for    .kmz  at /usr/bin/7za
Nov 14 18:12:26 myhostname amavis[26139]: Found decoder for    .7z   at /usr/bin/7za
Nov 14 18:12:26 myhostname amavis[26139]: Found decoder for    .xz   at /usr/bin/7z
Nov 14 18:12:26 myhostname amavis[26139]: Found decoder for    .lzma at /usr/bin/7z
Nov 14 18:12:26 myhostname amavis[26139]: Found decoder for    .jar  at /usr/bin/7z
Nov 14 18:12:26 myhostname amavis[26139]: Found decoder for    .swf  at /usr/bin/7z
Nov 14 18:12:26 myhostname amavis[26139]: Found decoder for    .lha  at /usr/bin/7z
Nov 14 18:12:26 myhostname amavis[26139]: Found decoder for    .iso  at /usr/bin/7z
Nov 14 18:12:26 myhostname amavis[26139]: Found decoder for    .exe  at /usr/bin/unrar; /usr/bin/lha; /usr/bin/unarj
Nov 14 18:12:26 myhostname amavis[26139]: Using primary internal av scanner code for ClamAV-clamd
Nov 14 18:12:26 myhostname amavis[26139]: Found secondary av scanner ClamAV-clamscan at /usr/bin/clamscan
Nov 14 18:12:26 myhostname amavis[26139]: Deleting db files  in /var/spool/amavisd/db
Nov 14 18:12:26 myhostname amavis[26139]: Creating db in /var/spool/amavisd/db/; BerkeleyDB 0.43, libdb 4.7
Nov 14 18:12:26 myhostname clamd[26163]: Received 0 file descriptor(s) from systemd.
Nov 14 18:12:26 myhostname clamd[26163]: clamd daemon 0.99.2 (OS: linux-gnu, ARCH: x86_64, CPU: x86_64)
Nov 14 18:12:26 myhostname clamd[26163]: Running as user amavis (UID 489, GID 489)
Nov 14 18:12:26 myhostname clamd[26163]: Log file size limited to 1048576 bytes.
Nov 14 18:12:26 myhostname clamd[26163]: Reading databases from /var/lib/clamav
Nov 14 18:12:26 myhostname clamd[26163]: Not loading PUA signatures.
Nov 14 18:12:26 myhostname clamd[26163]: Bytecode: Security mode set to "TrustSigned".
Nov 14 18:18:07 myhostname postfix/smtpd[26578]: fatal: open database /etc/postfix/sender_whitelist.db: Bad file descriptor
Nov 14 18:18:08 myhostname postfix/master[26300]: warning: process /usr/libexec/postfix/smtpd pid 26578 exit status 1
Nov 14 18:18:08 myhostname postfix/master[26300]: warning: /usr/libexec/postfix/smtpd: bad command startup -- throttling
Title: Re: How to Rebuild Postfix Mail Server
Post by: Jae on November 15, 2016, 08:53:00 AM
Code: [Select]
myhostname postfix/smtpd[26105]: fatal: open database /etc/postfix/sender_whitelist.db: Bad file descriptor
Nov 14 18:12:24 myhostname postfix/master[25978]: warning: process /usr/libexec/postfix/smtpd pid 26105 exit status 1
Nov 14 18:12:24 myhostname postfix/master[25978]: warning: /usr/libexec/postfix/smtpd: bad command startup -- throttling

comment out this line in main.cf

Code: [Select]
check_sender_access hash:/etc/postfix/sender_whitelist,

restart postfix and check maillog if any other error
Title: Re: How to Rebuild Postfix Mail Server
Post by: lexz on November 18, 2016, 09:58:47 PM
I removed "check_sender_access hash:/etc/postfix/sender_whitelist," from main.cf and the server is working!

Is it neccesary to do something after I changed it?
Or is it safe to run the server this way?

Thank you for your help!
Title: Re: How to Rebuild Postfix Mail Server
Post by: Sandeep on November 19, 2016, 10:49:03 AM
I removed "check_sender_access hash:/etc/postfix/sender_whitelist," from main.cf and the server is working!

Is it neccesary to do something after I changed it?
Or is it safe to run the server this way?

Thank you for your help!

it is safe
Title: Re: How to Rebuild Postfix Mail Server
Post by: gxjenkins on January 12, 2017, 04:52:46 PM
What are the commands I need to run to completely remove and re-install email server and its services?

Thanks.
Title: Re: How to Rebuild Postfix Mail Server
Post by: Administrator on January 13, 2017, 06:21:04 AM
in the cwp menu you have postfix manager where you can rebuild the mail server
Title: Re: How to Rebuild Postfix Mail Server
Post by: gxjenkins on January 13, 2017, 11:25:57 PM
Thanks, but running Posfix is what I believed started the problem. The server has only been running for a couple of weeks, and I didn't have a problem right after installing the panel until I ran Posfix. I was hoping a set of commands would just let me remove and re-install the mail services to fix my problem.
Title: Re: How to Rebuild Postfix Mail Server
Post by: zouhairkas on February 26, 2019, 11:37:01 PM
mas @arifin @lexz

Try to keep amavis, clam and spamassasin running but let postfix bypass them all..
in mail.cf comment this line "content_filter = smtp-amavis:[127.0.0.1]:10024"
in master.cf comment this line "-o content_filter=smtp-amavis:127.0.0.1:10024"
restart postfix, will make it ignore both amavis, clam and spamassasin

then one by one enable them

do you want to say main.cf ??
Title: Re: How to Rebuild Postfix Mail Server
Post by: AayMajjy on August 17, 2019, 06:52:02 AM
@Jae First thank you for your answer.

I tried rebuilding post (https://www.mangazuki.online/manga/danberu-nan-kiro-moteru/)fix including ClamAV, Amavis & Spamassassin and editing the configfiles.

I couldn't find the mail.cf file. (I found a main.cf but did not had the rule you said)
In the master.cf I commented the line and restarted the server. Still the same result. :(

Hey I already create email accounts on the CWP server but have not enabled clamav, amavis and others associated with the configuration of email, by enabling all features in the "Rebuild Postfix Configuration" whether to delete e-mail accounts that have been made?
Title: Re: How to Rebuild Postfix Mail Server
Post by: miloschadti on September 11, 2019, 06:18:03 PM
Hello everyone,

I am using CWP on the fourth server, according to CloudLinux, and in this last installation I can not use option to recompile the mail server (MailServer Manager), the recompilation is interrupted and then the log is displayed with the errors, which are Below, I don't know what else to do.

log Installing DKIM & SPF

Loaded plugins: fastestmirror, rhnplugin
This system is receiving updates from CLN.
No Packages marked for removal
Loaded plugins: fastestmirror, rhnplugin
This system is receiving updates from CLN.
Loading mirror speeds from cached hostfile
 * epel: mirror.ci.ifes.edu.br
Resolving Dependencies
-> Running transaction check
---> Package clamd.x86_64 0: 0.101.4-1.el7 will be installed
-> Processing Dependency: clamav-filesystem = 0.101.4-1.el7 for package: clamd-0.101.4-1.el7.x86_64
-> Processing Dependency: clamav-lib = 0.101.4-1.el7 for package: clamd-0.101.4-1.el7.x86_64
-> Finished Dependency Resolution
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest
Loaded plugins: fastestmirror, rhnplugin
This system is receiving updates from CLN.
Loading mirror speeds from cached hostfile
 * epel: mirror.ci.ifes.edu.br
Package opendkim-2.11.0-0.1.el7.x86_64 already installed and latest version
Package libopendkim-2.11.0-0.1.el7.x86_64 already installed and latest version
Package perl-Mail-DKIM-0.39-8.el7.noarch
Package perl-Mail-SPF-2.8.0-4.el7.noarch already installed and latest version
Resolving Dependencies
-> Running transaction check
---> Package clamd.x86_64 0: 0.101.4-1.el7 will be installed
-> Processing Dependency: clamav-filesystem = 0.101.4-1.el7 for package: clamd-0.101.4-1.el7.x86_64
-> Processing Dependency: clamav-lib = 0.101.4-1.el7 for package: clamd-0.101.4-1.el7.x86_64
---> Package pypolicyd-spf.noarch 0: 1.3.2-5.el7 will be installed
-> Processing Dependency: python-ipaddr for package: pypolicyd-spf-1.3.2-5.el7.noarch
-> Processing Dependency: python-pyspf for package: pypolicyd-spf-1.3.2-5.el7.noarch
-> Running transaction check
---> Package clamd.x86_64 0: 0.101.4-1.el7 will be installed
-> Processing Dependency: clamav-filesystem = 0.101.4-1.el7 for package: clamd-0.101.4-1.el7.x86_64
-> Processing Dependency: clamav-lib = 0.101.4-1.el7 for package: clamd-0.101.4-1.el7.x86_64
---> Package python-ipaddr.noarch 0: 2.1.11-2.el7 will be installed
---> Package python-pyspf.noarch 0: 2.0.11-5.el7 will be installed
-> Processing Dependency: python-pydns for package: python-pyspf-2.0.11-5.el7.noarch
-> Running transaction check
---> Package clamd.x86_64 0: 0.101.4-1.el7 will be installed
-> Processing Dependency: clamav-filesystem = 0.101.4-1.el7 for package: clamd-0.101.4-1.el7.x86_64
-> Processing Dependency: clamav-lib = 0.101.4-1.el7 for package: clamd-0.101.4-1.el7.x86_64
---> Package python-pydns.noarch 0: 2.3.6-2.el7 will be installed
-> Finished Dependency Resolution
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest
You have a troubles with yum. Fix it before install!
Title: Re: How to Rebuild Postfix Mail Server
Post by: AayMajjy on May 20, 2021, 07:58:27 AM
@Jae First thank you for your answer.

I tried rebuilding call (https://dubaicallgirlsinuae.com)fix including ClamAV, Amavis & Spamassassin and editing the configfiles.

I couldn't find the mail.cf file. (I found a main.cf but did not had the rule you said)
In the master.cf I commented the line and restarted the server. Still the same result. :(

Hey I already create email accounts on the CWP server but have not enabled clamav, amavis and others associated with the configuration of email, by enabling all features in the "Rebuild Postfix Configuration" whether to delete e-mail accounts that have been made?

The server has only been running for a couple of weeks, and I didn't have a problem right after installing the panel until I ran Posfix. I was hoping a set of commands would just let me remove and re-install the mail services to fix my problem.
Title: Re: How to Rebuild Postfix Mail Server
Post by: AayMajjy on December 16, 2021, 01:27:33 PM
@Jae First thank you for your answer.

I tried rebuilding hotels in dubai (https://dubaisearch.ae/hotels/) fix including ClamAV, Amavis & Spamassassin and editing the configfiles.

I couldn't find the mail.cf file. (I found a main.cf but did not had the rule you said)
In the master.cf I commented the line and restarted the server. Still the same result. :(

Hey I already create email accounts on the CWP server but have not enabled clamav, amavis and others associated with the configuration of email, by enabling all features in the "Rebuild Postfix Configuration" whether to delete e-mail accounts that have been made?

Did you Got the Answer?
Title: Re: How to Rebuild Postfix Mail Server
Post by: Netino on December 16, 2021, 11:45:49 PM
Seems you have a problem in yum or RPM database.

Try:
https://www.tecmint.com/rebuild-corrupted-rpm-database-in-centos/ (https://www.tecmint.com/rebuild-corrupted-rpm-database-in-centos/)

Regards,
Netino