• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Howto change the log file path for Postfix

Ruhrpottjung

New Pleskian
Hello,

I google now a lot, but don't find a solution for my Problem and so I hope that I find here one.

I want change the log file path from /user/local/psa/var/log/maillog to /var/log/mail.log.
My question is now, how can I change the standard plesk log file path for the postfix log files ?

Thank you for the answers and excuse me my maybe badly english.

Greetings
Hans
 
Could you please clarify a necessity of this log replacing?
 
Of course I can :)
Some scripts using the normal place for the log file into /var/log/. For example pflogsum, mail graph etc.
So I want have the log files at the place where the most scripts await it. also it's more easy to make a tail -f /var/log/mail.log then a /usr/local/psa/var/log/maillog

And because I don't want change the path into all scripts I use with the plesk path I asked how to change it.
 
/usr/local/psa/var/log/maillog log is log file not only for Postfix but for whole mailsystem - spam protection filters, pop3 and imap connections, antivirus and so on. This log is used by Plesk for traffic mail calculation and for other statistics. Therefore relocation of main mail log can lead to unpredictable consequences in Plesk operation.
 
ok and how to create a second mail.log into /var/log?
I know that this will be used for anti spam, antivirus and other things, but my needs are that I have a log file also on the standard debian place. And of course that will be not into the plesk folder.

That was the reason why I ask here.
 
How about creating a symlink from /var/log/pleskmaillog to /usr/local/psa/var/log/maillog ?
In fact there's usually already one at /var/log/psa/maillog to /usr/local/psa/var/log/maillog

Note that I don't know the consequences of doing so - check that you don't have something that tries to rotate everything in /var/log/ automatically -- you might end up with a situation where logrotate tries to rotate the same file twice. I can't imagine this would be the case -- I'm just pointing out a possibility.
 
Why not just set up an appropriate rule in your syslog (or alternative daemon) configuration?

E.g. for rsyslog you just add something like in /etc/rsyslog.conf:

mail.* -/var/log/mail.all
 
Thank you

Why not just set up an appropriate rule in your syslog (or alternative daemon) configuration?

Don't understand what you mean with that?

The point is that I need for example for pflogsum also a mail rotation, means want to see by get a mail with all important details about the mail server for example what I had last time that I always saw that mail was bouncing and I saw that a local mailer send a looping mail. Also using statistic tools like mailgraph. Else it would be not important for me if the mail.log is in /usr/local/... or in /var/log/. But maybe also a good suggestion for a future version of plesk, to integrate it. I saw that also webalizer can do this jobs. Else would be fine if I could also get integrated into plea the possibility to get pflogsum mails. I remember (because now using since 15 years parallels products (confixx / plesk) that in the first time also postgrey wasn't implemented into confix now it's a part or plesk.

But only a suggestion ;) Would make my life more easy.

Thank you for your help! (before I forget: must I delete the entry of plesk or can I have to entries (one with /var/log/mal.log and one with /usr/local/psa/var/log/maillog)?)
 
before I forget: must I delete the entry of plesk or can I have to entries (one with /var/log/mal.log and one with /usr/local/psa/var/log/maillog)?

You can have two entries. You should leave /usr/local/psa/var/log/maillog as it is usually used by Support and also by Plesk to calculate mail usage statistics (if I'm not mistaken). Something else might rely on it too. It's hard to tell.
 
Hello,

that seems not to work I only have this here:

rw-r----- 1 syslog adm 745506 2012-07-04 19:05 mail.err.1
-rw-r----- 1 syslog adm 2668949 2012-07-04 19:05 mail.info.1
-rw-r----- 1 syslog adm 3307498 2012-07-04 19:05 mail.log.1
-rw-r----- 1 syslog adm 831624 2012-07-04 19:05 mail.warn.1
-rw-r----- 1 syslog adm 0 2012-07-01 17:20 mail.err
-rw-r----- 1 syslog adm 0 2012-07-01 17:20 mail.info
-rw-r----- 1 syslog adm 0 2012-07-01 17:20 mail.log
-rw-r----- 1 syslog adm 0 2012-07-01 17:20 mail.warn

why the mail.log.1 and not like said : mail.log

Thnx for the help.

Greetings
Hans
 
Seems OK to me.

mail.log.1 (and similarly numbered files) is a rotated version of mail.log, i.e. it contains old entries from it.
 
Hello,

do you look also at the date? the mail.log is from the 1st of July. So the mail.log.1 isn't a rotated version of mail.log (I think) Because else the date must be ±1 of the date from mail.log.1.
 
Maybe you had a date problem? :)

Does anything get logged in either of these files?

Anyway, post mail-related entries from your logging daemon configuration, as well as its name or configuration file name.
 
Back
Top