Email Not Working...

itconstruct

Active Member
Aug 3, 2009
77
0
26
I have noticed over the last two week's that email has stopped working when backups are being taken and no email is sent.

I am not sure if this has something to do with the issues I was having two weeks ago or not - I posted a thread about this at the time and resolved my other issues.

It seems to have the email address configured in the web system but the machine is not sending them.

I would also like to know how I can do a check if my windows samba mounts are up before a backup is taken and if not mount them before starting the backup process.
 
take a look in the syslog (/var/log/syslog/) about email logs.
 
take a look in the syslog (/var/log/syslog/) about email logs.

The file is shown below(snippet from top of file as can't attach as .txt file)

Code:
Mar  6 06:25:01 proxmox kernel: imklog 3.18.6, log source = /proc/kmsg started.
Mar  6 06:25:01 proxmox rsyslogd: [origin software="rsyslogd" swVersion="3.18.6" x-pid="3192" x-info="http://www.rsyslog.com"] restart
Mar  6 06:27:18 proxmox proxwww[16003]: Starting new child 16003
Mar  6 06:29:49 proxmox proxwww[16078]: Starting new child 16078
Mar  6 06:30:01 proxmox /USR/SBIN/CRON[16081]: (root) CMD (/usr/share/vzctl/scripts/vpsreboot)
Mar  6 06:30:01 proxmox /USR/SBIN/CRON[16084]: (root) CMD (/usr/share/vzctl/scripts/vpsnetclean)
Mar  6 06:30:01 proxmox /USR/SBIN/CRON[16086]: (root) CMD (test -x /usr/lib/atsar/atsa1 && /usr/lib/atsar/atsa1)
Mar  6 06:32:19 proxmox proxwww[16199]: Starting new child 16199
Mar  6 06:34:49 proxmox proxwww[16270]: Starting new child 16270
Mar  6 06:35:01 proxmox /USR/SBIN/CRON[16273]: (root) CMD (/usr/share/vzctl/scripts/vpsreboot)
Mar  6 06:35:01 proxmox /USR/SBIN/CRON[16275]: (root) CMD (/usr/share/vzctl/scripts/vpsnetclean)
Mar  6 06:37:14 proxmox proxwww[16397]: Starting new child 16397
Mar  6 06:39:44 proxmox proxwww[16523]: Starting new child 16523
Mar  6 06:40:01 proxmox /USR/SBIN/CRON[16531]: (root) CMD (/usr/share/vzctl/scripts/vpsreboot)
Mar  6 06:40:01 proxmox /USR/SBIN/CRON[16533]: (root) CMD (/usr/share/vzctl/scripts/vpsnetclean)
Mar  6 06:40:01 proxmox /USR/SBIN/CRON[16536]: (root) CMD (test -x /usr/lib/atsar/atsa1 && /usr/lib/atsar/atsa1)
Mar  6 06:42:15 proxmox proxwww[16651]: Starting new child 16651
however I could not find anything about emails in this file! :o
 
I have the same issue since ProxmoxVE 1.4 and have just been living without it. It's never worked here.

I don't see anything mail related in syslog, either.
I looked around and saw a few empty files in /var/log that seemed related, however I could very well be looking in the wrong place.
When I run 'postfix status' from the command line it'll say 'the Postfix mail system is running: PID: 2800' & put that into a log.

It hasn't seemed important enough to bother posting about, although it would be nice if it worked.

-----EDIT-----

As if by some strange miracle, I received the first email ever from the 'backup tool' just now.
All I did was try all the postfix commands. Yesterday.

The first time I ran just 'postfix' without any arguments afterward, which returned usage suggestions.
I did every command presented by the usage suggestions, in no particular order, and today it sent me a nice report.
 
Last edited:
Hi,
you can try to insert your smtp-server as ralay-host in /etc/postfix/main.cf
Like
Code:
relayhost = 192.168.111.22
after that
Code:
postfix reload
tail /var/log/mail.log
And look in /root/.forward - is the mailaddress correct? Is the Queue empty (mailq)?
Send a mail from the console - just to see if it works:
Code:
sendmail -bm root@foo.bar
This is a testmail
.
Check with mailq and the log.

Perhaps it's help

Udo
 
try starting postfix:

Code:
/etc/init.d/postfix start

but postfix should run automatically, review the log (see /var/log/syslog/)
 
try starting postfix:

Code:
/etc/init.d/postfix start
but postfix should run automatically, review the log (see /var/log/syslog/)

proxmox:/var/log# /etc/init.d/postfix start
Starting Postfix Mail Transport Agent: postfix.
proxmox:/var/log# postfix status
postfix/postfix-script: the Postfix mail system is not running
 
Hi,
try to start the master-process in foreground:
Code:
/usr/lib/postfix/master -d

Any hints?

Udo


proxmox:/var/log# /usr/lib/postfix/master -d
proxmox:/var/log# postfix status
postfix/postfix-script: the Postfix mail system is not running
proxmox:/var/log# /etc/init.d/postfix start
Starting Postfix Mail Transport Agent: postfix.
proxmox:/var/log# postfix status
postfix/postfix-script: the Postfix mail system is not running
 
Hi,
please post the output of:
Code:
ls -lsa /var/spool/postfix/pid
ls -lsa /etc/postfix
ls -lsa /usr/lib/postfix
cat /etc/postfix/master.cf 
cat /etc/postfix/main.cf
Udo

edit:
and also
Code:
grep postfix /var/log/syslog
 
Last edited:
Hi,
please post the output of:
Code:
ls -lsa /var/spool/postfix/pid
ls -lsa /etc/postfix
ls -lsa /usr/lib/postfix
cat /etc/postfix/master.cf 
cat /etc/postfix/main.cf
Udo

edit:
and also
Code:
grep postfix /var/log/syslog

The output is as follows:

Code:
proxmox:/var/log# ls -lsa /var/spool/postfix/pid
total 12
4 drwxr-xr-x  2 postfix root 4096 Dec 15 01:17 .
4 drwxr-xr-x 20 root    root 4096 Feb 16 20:32 ..
4 -rw-------  1 root    root   33 Mar  9 08:04 master.pid
0 -rw-------  1 root    root    0 Nov 11 16:42 unix.cleanup
0 -rw-------  1 root    root    0 Dec 10 01:01 unix.defer
0 -rw-------  1 root    root    0 Dec 15 01:17 unix.local
0 -rw-------  1 root    root    0 Nov 11 16:42 unix.smtp
proxmox:/var/log# ls -lsa /etc/postfix
total 80
 4 drwxr-xr-x  3 root root  4096 Feb 16 20:32 .
 4 drwxr-xr-x 75 root root  4096 Mar  7 03:03 ..
 4 -rw-r--r--  1 root root   318 Nov 11 10:22 dynamicmaps.cf
 4 -rw-r--r--  1 root root   519 Nov 11 10:22 main.cf
 8 -rw-r--r--  1 root root  4300 Nov 11 10:22 master.cf
24 -rwxr-xr-x  1 root root 22774 Sep 14  2008 post-install
20 -rw-r--r--  1 root root 18231 Sep 14  2008 postfix-files
 8 -rwxr-xr-x  1 root root  7421 Sep 14  2008 postfix-script
 4 drwxr-xr-x  2 root root  4096 Sep 14  2008 sasl
proxmox:/var/log# ls -lsa /usr/lib/postfix
total 1044
  4 drwxr-xr-x  2 root root   4096 Feb 16 20:32 .
 12 drwxr-xr-x 45 root root  12288 Feb 21 10:56 ..
 20 -rwxr-xr-x  1 root root  18624 Sep 14  2008 anvil
 48 -rwxr-xr-x  1 root root  48144 Sep 14  2008 bounce
120 -rwxr-xr-x  1 root root 115552 Sep 14  2008 cleanup
 12 -rw-r--r--  1 root root  10168 Sep 14  2008 dict_tcp.so
 12 -rwxr-xr-x  1 root root  10280 Sep 14  2008 discard
 12 -rwxr-xr-x  1 root root  10272 Sep 14  2008 error
 20 -rwxr-xr-x  1 root root  18800 Sep 14  2008 flush
  0 lrwxrwxrwx  1 root root      4 Feb 16 20:32 lmtp -> smtp
 68 -rwxr-xr-x  1 root root  64480 Sep 14  2008 local
 40 -rwxr-xr-x  1 root root  39848 Sep 14  2008 master
 64 -rwxr-xr-x  1 root root  60248 Sep 14  2008 oqmgr
 16 -rwxr-xr-x  1 root root  14624 Sep 14  2008 pickup
 24 -rwxr-xr-x  1 root root  23264 Sep 14  2008 pipe
 16 -rwxr-xr-x  1 root root  14536 Sep 14  2008 proxymap
 72 -rwxr-xr-x  1 root root  68456 Sep 14  2008 qmgr
 24 -rwxr-xr-x  1 root root  23072 Sep 14  2008 qmqpd
 16 -rwxr-xr-x  1 root root  14480 Sep 14  2008 scache
 16 -rwxr-xr-x  1 root root  14752 Sep 14  2008 showq
116 -rwxr-xr-x  1 root root 114688 Sep 14  2008 smtp
208 -rwxr-xr-x  1 root root 205312 Sep 14  2008 smtpd
 12 -rwxr-xr-x  1 root root  10368 Sep 14  2008 spawn
 20 -rwxr-xr-x  1 root root  19008 Sep 14  2008 tlsmgr
 32 -rwxr-xr-x  1 root root  31520 Sep 14  2008 trivial-rewrite
 16 -rwxr-xr-x  1 root root  14560 Sep 14  2008 verify
 24 -rwxr-xr-x  1 root root  22896 Sep 14  2008 virtual
4.
Code:
proxmox:/var/log# cat /etc/postfix/master.cf
#
# Postfix master process configuration file.  For details on the format
# of the file, see the master(5) manual page (command: "man 5 master").
#
# Do not forget to execute "postfix reload" after editing this file.
#
# ==========================================================================
# service type  private unpriv  chroot  wakeup  maxproc command + args
#               (yes)   (yes)   (yes)   (never) (100)
# ==========================================================================
smtp      inet  n       -       -       -       -       smtpd
#submission inet n       -       -       -       -       smtpd
#  -o smtpd_tls_security_level=encrypt
#  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#  -o milter_macro_daemon_name=ORIGINATING
#smtps     inet  n       -       -       -       -       smtpd
#  -o smtpd_tls_wrappermode=yes
#  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#  -o milter_macro_daemon_name=ORIGINATING
#628      inet  n       -       -       -       -       qmqpd
pickup    fifo  n       -       -       60      1       pickup
cleanup   unix  n       -       -       -       0       cleanup
qmgr      fifo  n       -       n       300     1       qmgr
#qmgr     fifo  n       -       -       300     1       oqmgr
tlsmgr    unix  -       -       -       1000?   1       tlsmgr
rewrite   unix  -       -       -       -       -       trivial-rewrite
bounce    unix  -       -       -       -       0       bounce
defer     unix  -       -       -       -       0       bounce
trace     unix  -       -       -       -       0       bounce
verify    unix  -       -       -       -       1       verify
flush     unix  n       -       -       1000?   0       flush
proxymap  unix  -       -       n       -       -       proxymap
proxywrite unix -       -       n       -       1       proxymap
smtp      unix  -       -       -       -       -       smtp
# When relaying mail as backup MX, disable fallback_relay to avoid MX loops
relay     unix  -       -       -       -       -       smtp
        -o smtp_fallback_relay=
#       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq     unix  n       -       -       -       -       showq
error     unix  -       -       -       -       -       error
retry     unix  -       -       -       -       -       error
discard   unix  -       -       -       -       -       discard
local     unix  -       n       n       -       -       local
virtual   unix  -       n       n       -       -       virtual
lmtp      unix  -       -       -       -       -       lmtp
anvil     unix  -       -       -       -       1       anvil
scache    unix  -       -       -       -       1       scache
#
# ====================================================================
# Interfaces to non-Postfix software. Be sure to examine the manual
# pages of the non-Postfix software to find out what options it wants.
#
# Many of the following services use the Postfix pipe(8) delivery
# agent.  See the pipe(8) man page for information about ${recipient}
# and other message envelope options.
# ====================================================================
#
# maildrop. See the Postfix MAILDROP_README file for details.
# Also specify in main.cf: maildrop_destination_recipient_limit=1
#
maildrop  unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
#
# See the Postfix UUCP_README file for configuration details.
#
uucp      unix  -       n       n       -       -       pipe
  flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
#
# Other external delivery methods.
#
ifmail    unix  -       n       n       -       -       pipe
  flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp     unix  -       n       n       -       -       pipe
  flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient
scalemail-backend unix  -       n       n       -       2       pipe
  flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
mailman   unix  -       n       n       -       -       pipe
  flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
  ${nexthop} ${user}
5.
Code:
proxmox:/var/log# cat /etc/postfix/main.cf
# See /usr/share/postfix/main.cf.dist for a commented, more complete version

smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = $myhostname, localhost.$mydomain, localhost
relayhost =
mynetworks = 127.0.0.0/8
inet_interfaces = loopback-only
recipient_delimiter = +

And the extra one....
Code:
proxmox:/var/log# grep postfix /var/log/syslog
Mar  9 07:45:05 proxmox postfix/master[30154]: fatal: bind 127.0.0.1 port 25: Address already in use
Mar  9 07:45:14 proxmox postfix/postfix-script[30168]: the Postfix mail system is not running
Mar  9 07:45:19 proxmox postfix/master[30241]: fatal: bind 127.0.0.1 port 25: Address already in use
Mar  9 07:45:22 proxmox postfix/postfix-script[30249]: the Postfix mail system is not running
Mar  9 08:04:11 proxmox postfix/master[1117]: fatal: bind 127.0.0.1 port 25: Address already in use
Mar  9 08:04:17 proxmox postfix/postfix-script[1122]: the Postfix mail system is not running
Mar  9 08:04:22 proxmox postfix/master[1184]: fatal: bind 127.0.0.1 port 25: Address already in use
Mar  9 08:04:25 proxmox postfix/postfix-script[1192]: the Postfix mail system is not running
 
Code:
proxmox:/var/log# grep postfix /var/log/syslog
Mar  9 07:45:05 proxmox postfix/master[30154]: fatal: bind 127.0.0.1 port 25: Address already in use
Mar  9 07:45:14 proxmox postfix/postfix-script[30168]: the Postfix mail system is not running
Mar  9 07:45:19 proxmox postfix/master[30241]: fatal: bind 127.0.0.1 port 25: Address already in use
Mar  9 07:45:22 proxmox postfix/postfix-script[30249]: the Postfix mail system is not running
Mar  9 08:04:11 proxmox postfix/master[1117]: fatal: bind 127.0.0.1 port 25: Address already in use
Mar  9 08:04:17 proxmox postfix/postfix-script[1122]: the Postfix mail system is not running
Mar  9 08:04:22 proxmox postfix/master[1184]: fatal: bind 127.0.0.1 port 25: Address already in use
Mar  9 08:04:25 proxmox postfix/postfix-script[1192]: the Postfix mail system is not running

Hi,
you have one process running that bind the smtp-port. So postfix (or another instand of postfix) can't bind port 25.
Look with
Code:
netstat -anp | grep :25
which process use the port.

Udo
 
Hi,
you have one process running that bind the smtp-port. So postfix (or another instand of postfix) can't bind port 25.
Look with
Code:
netstat -anp | grep :25
which process use the port.

Udo

proxmox:/var/log# netstat -anp | grep :25
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 5129/master
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 5826/master
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 6588/master
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 7817/master
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 6934/master
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 31158/master
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 30747/master
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 26952/sendmail: MTA
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 4171/master
 
proxmox:/var/log# netstat -anp | grep :25
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 5129/master
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 5826/master
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 6588/master
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 7817/master
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 6934/master
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 31158/master
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 30747/master
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 26952/sendmail: MTA
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 4171/master

Whow!
how do you get a sendmail-process? Is this a standard-proxmox-install?
First kill all processes:
Code:
kill 5129 5826 6588 7817 6934 31158 30747 26952 4171
Than remove sendmail
Code:
dpkg -l | grep sendmail
remove the packet with apt-get remove sendmai...
control if no process bind port 25.
Then start the master again in the foreground, like decribed before.

Udo
 
Whow!
how do you get a sendmail-process? Is this a standard-proxmox-install?
First kill all processes:
Code:
kill 5129 5826 6588 7817 6934 31158 30747 26952 4171
Than remove sendmail
Code:
dpkg -l | grep sendmail
remove the packet with apt-get remove sendmai...
control if no process bind port 25.
Then start the master again in the foreground, like decribed before.

Udo

Yeah ok... Little story. I had two putty windows open and accidentally installed sendmail on proxmox machine then realised and thought I had removed it as it was needing for something else I was installing on a virtual machine.

Yes it is a standard install of proxmox. Don't think I would want to do it any other way.

This has now fixed the issue and all the emails have now been sent through as they were all in the queue waiting to be sent!

Thank you Udo and Tom for your help in this matter.