Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- So, I think I may have configured Postfix wrong...nothing is getting delivered, not even local mail from cron jobs. It's just sitting in the queue. (Postconf/postfinger and tl;dr at the end)
- Ubuntu 14.04.1 LTS
- While unfortunately it's been a while since I installed the server and I can't recall my exact steps, I do know I had attempted to (or did) set up ISPConfig on it, so if that helps shed any light on where I went wrong.
- The server, andromeda.gamefiar.com, is intended to mail out things to the internet periodically (user signs up, needs email confirmation, etc). I don't particularly care to get the output of the cron jobs (they were supposed to be redirecting their output to a log file anyway...), but mailing users on the forums who sign up, recover pass, or get an update to a subscribed thread, that's kinda necessary. And any stray output from a cron job really needs to get put in some kind of mailbox instead of hanging out in the queue clogging the tubes.
- I started moving stuff from my old server to this server today (it's not so "new" anymore, I set it up initially in Sept 2013 with one site) and I spotted some odd activity in top while I was monitoring progress of database imports and whatnot. showq (and other postfix-related processes) using up an exorbitant amount of CPU time, load averages in the 40s and 50s, etc.
- Hundreds of megs of logs (within minutes!) accumulating in /var/log/mail.log lead me to investigate.
- I did a postcat on some of the things I spotted in the mailq and there were all my cron job mails. The cron jobs were mailing the local account every time they ran (and I have a cron job that runs every minute, among others)
- So I just cleared out several. hundred. thousand(!) items from the mailq from almost a year and a half worth of it trying to mail local accounts, and boiled it down to just the 7 emails I'd really like for it to try to send.
- (One of them is a bogus address, the rest are real addresses, I masked them out as [email protected])
- ----------------------------------------------
- root@andromeda:~# mailq
- -Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient-------
- D6D87F27 4594 Sun Feb 22 23:32:30 [email protected]
- (delivery temporarily suspended: connect to 127.0.0.1[127.0.0.1]:10024: Connection refused)
- 6EE3E568E22 1505 Sun Feb 22 23:51:25 [email protected]
- (connect to 127.0.0.1[127.0.0.1]:10024: Connection refused)
- 60135641328 1542 Sun Feb 22 23:51:51 [email protected]
- (delivery temporarily suspended: connect to 127.0.0.1[127.0.0.1]:10024: Connection refused)
- 56EC8566125 1542 Sun Feb 22 23:52:44 [email protected]
- (delivery temporarily suspended: connect to 127.0.0.1[127.0.0.1]:10024: Connection refused)
- A16CB566EC0 1505 Sun Feb 22 23:51:37 [email protected]
- (delivery temporarily suspended: connect to 127.0.0.1[127.0.0.1]:10024: Connection refused)
- 2662E566E54 409 Mon Feb 23 00:00:41 [email protected]
- (delivery temporarily suspended: connect to 127.0.0.1[127.0.0.1]:10024: Connection refused)
- 734FE571BE1 3606 Sun Feb 22 18:50:39 [email protected]
- (connect to 127.0.0.1[127.0.0.1]:10024: Connection refused)
- -----------------------------------
- Note the (delivery temporarily suspended: connect to 127.0.0.1[127.0.0.1]:10024: Connection refused)
- I was seeing this on pretty much every mail addressed to a local user with the @ (e.g. [email protected]) or to any internet user (real address).
- I did not see this connection refused line on anything that was addressed to simply "ruins" or "root" (no @andromeda.gamefiar.com). For all of that stuff, it was just sitting there in the queue and never ending up in any kind of mail directory like I'd normally see. Here's a sample of the queue before I cleaned it out:
- -----------------------------------
- -Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient-------
- 1FEF95E6BE7 588 Sun Oct 5 23:24:02 ruins
- ruins
- 493BE608DB7 588 Sun Nov 16 16:25:02 ruins
- ruins
- A12F15B8679 737 Wed Dec 31 09:39:01 root
- root
- 78A5D5EF4D2 588 Wed Jan 28 18:59:01 ruins
- ruins
- DEDE95DCB51 588 Mon Jan 19 14:00:08 ruins
- ruins
- F02E85D9F10 588 Tue Sep 16 23:25:01 ruins
- ruins
- -------------------------------------
- So, long story short:
- 1. Why is it seemingly not trying to deliver any mail (even local mail from cron jobs and stuff)?
- 2. Why is it trying to connect to 127.0.0.1 to deliver mail, and then refusing the connection?
- 3. How can I make it so that it will deliver local mail, so the output of a cron job ends up in the mailbox of the user who owns the crontab?
- 4. How can I make it so that it will deliver mail to the internet (or try to, at least)?
- Thanks <3
- Postfinger below.
- ----------------------------------------------
- root@andromeda:~# ./postfinger
- postfinger - postfix configuration on Mon Feb 23 02:10:41 EST 2015
- version: 1.30
- /usr/sbin/postconf: warning: /etc/postfix/main.cf: undefined parameter: virtual_mailbox_limit_maps
- --System Parameters--
- mail_version = 2.11.0
- hostname = andromeda
- uname = Linux andromeda 3.13.0-35-generic #62-Ubuntu SMP Fri Aug 15 01:58:42 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
- --Packaging information--
- looks like this postfix comes from deb package: postfix-2.11.0-1
- /usr/sbin/postconf: warning: /etc/postfix/main.cf: undefined parameter: virtual_mailbox_limit_maps
- --main.cf non-default parameters--
- alias_database = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases
- alias_maps = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases
- append_dot_mydomain = no
- biff = no
- body_checks = regexp:/etc/postfix/body_checks
- broken_sasl_auth_clients = yes
- content_filter = amavis:[127.0.0.1]:10024
- dovecot_destination_recipient_limit = 1
- header_checks = regexp:/etc/postfix/header_checks
- html_directory = /usr/share/doc/postfix/html
- mailbox_size_limit = 512000000
- maildrop_destination_concurrency_limit = 1
- maildrop_destination_recipient_limit = 1
- mime_header_checks = regexp:/etc/postfix/mime_header_checks
- mydestination = andromeda.gamefiar.com, localhost, localhost.localdomain, 127.0.0.1
- myhostname = andromeda.gamefiar.com
- mynetworks = 127.0.0.0/8 [::1]/128
- myorigin = /etc/mailname
- nested_header_checks = regexp:/etc/postfix/nested_header_checks
- owner_request_special = no
- proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps
- receive_override_options = no_address_mappings
- recipient_delimiter = +
- relay_domains = mysql:/etc/postfix/mysql-virtual_relaydomains.cf
- relay_recipient_maps = mysql:/etc/postfix/mysql-virtual_relayrecipientmaps.cf
- smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
- smtpd_client_message_rate_limit = 100
- smtpd_client_restrictions = check_client_access mysql:/etc/postfix/mysql-virtual_client.cf
- smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, check_recipient_access mysql:/etc/postfix/mysql-virtual_recipient.cf, reject_unauth_destination
- smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
- smtpd_sasl_auth_enable = yes
- smtpd_sasl_authenticated_header = yes
- smtpd_sasl_path = private/auth
- smtpd_sasl_type = dovecot
- smtpd_sender_restrictions = check_sender_access mysql:/etc/postfix/mysql-virtual_sender.cf
- smtpd_tls_cert_file = /etc/postfix/smtpd.cert
- smtpd_tls_key_file = /etc/postfix/smtpd.key
- smtpd_tls_security_level = may
- smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
- smtpd_use_tls = yes
- smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
- transport_maps = hash:/var/lib/mailman/data/transport-mailman, proxy:mysql:/etc/postfix/mysql-virtual_transports.cf
- virtual_alias_domains =
- virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, proxy:mysql:/etc/postfix/mysql-virtual_email2email.cf, hash:/var/lib/mailman/data/virtual-mailman
- virtual_gid_maps = static:5000
- virtual_mailbox_base = /var/vmail
- virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
- virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
- virtual_transport = dovecot
- virtual_uid_maps = static:5000
- --master.cf--
- /usr/sbin/postconf: warning: /etc/postfix/main.cf: undefined parameter: virtual_mailbox_limit_maps
- smtp inet n - - - - smtpd
- submission inet n - - - - smtpd
- -o syslog_name=postfix/submission
- -o smtpd_tls_security_level=encrypt
- -o smtpd_sasl_auth_enable=yes
- -o smtpd_client_restrictions=permit_sasl_authenticated,reject
- smtps inet n - - - - smtpd
- -o syslog_name=postfix/smtps
- -o smtpd_tls_wrappermode=yes
- -o smtpd_sasl_auth_enable=yes
- -o smtpd_client_restrictions=permit_sasl_authenticated,reject
- pickup unix n - - 60 1 pickup
- cleanup unix n - - - 0 cleanup
- qmgr unix n - n 300 1 qmgr
- 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
- relay unix - - - - - smtp
- 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
- maildrop unix - n n - - pipe
- flags=DRhu user=vmail argv=/usr/bin/maildrop -d vmail ${extension} ${recipient} ${user} ${nexthop} ${sender}
- uucp unix - n n - - pipe
- flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
- 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}
- dovecot unix - n n - - pipe
- flags=DROhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${user}@${nexthop}
- amavis unix - - - - 2 smtp
- -o smtp_data_done_timeout=1200
- -o smtp_send_xforward_command=yes
- 127.0.0.1:10025 inet n - - - - smtpd
- -o content_filter=
- -o local_recipient_maps=
- -o relay_recipient_maps=
- -o smtpd_restriction_classes=
- -o smtpd_client_restrictions=
- -o smtpd_helo_restrictions=
- -o smtpd_sender_restrictions=
- -o smtpd_recipient_restrictions=permit_mynetworks,reject
- -o mynetworks=127.0.0.0/8
- -o strict_rfc821_envelopes=yes
- -o receive_override_options=no_unknown_recipient_checks,no_header_body_checks
- -- end of postfinger output --
- edit: tail of mail.log
- Feb 23 02:18:44 andromeda postfix/smtp[27304]: connect to 127.0.0.1[127.0.0.1]:10024: Connection refused
- Feb 23 02:18:44 andromeda postfix/smtp[27304]: 2636B560015: to=<[email protected]>, orig_to=<root>, relay=none, delay=583, delays=583/0.01/0/0, dsn=4.4.1, status=deferred (connect to 127.0.0.1[127.0.0.1]:10024: Connection refused)
- Feb 23 02:18:44 andromeda postfix/smtp[27304]: warning: connect to mysql server 127.0.0.1: Access denied for user 'ispconfig'@'localhost' (using password: YES)
- Feb 23 02:18:44 andromeda postfix/smtp[27304]: warning: mysql:/etc/postfix/mysql-virtual_relaydomains.cf: table lookup problem
- Feb 23 02:18:44 andromeda postfix/smtp[27304]: warning: 2636B560015: flush service failure
- Feb 23 02:28:44 andromeda postfix/smtp[28109]: connect to 127.0.0.1[127.0.0.1]:10024: Connection refused
- Feb 23 02:28:44 andromeda postfix/smtp[28109]: 2636B560015: to=<[email protected]>, orig_to=<root>, relay=none, delay=1182, delays=1182/0.01/0/0, dsn=4.4.1, status=deferred (connect to 127.0.0.1[127.0.0.1]:10024: Connection refused)
- Feb 23 02:28:44 andromeda postfix/smtp[28109]: warning: connect to mysql server 127.0.0.1: Access denied for user 'ispconfig'@'localhost' (using password: YES)
- Feb 23 02:28:44 andromeda postfix/smtp[28109]: warning: mysql:/etc/postfix/mysql-virtual_relaydomains.cf: table lookup problem
- Feb 23 02:28:44 andromeda postfix/smtp[28109]: warning: 2636B560015: flush service failure
- yuuuup, ispconfig msut be the problem
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement