Advertisement
ftab

I suck at postfix (or, hey kids this is y u no ISPConfig)

Feb 23rd, 2015
376
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.38 KB | None | 0 0
  1. 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)
  2.  
  3. Ubuntu 14.04.1 LTS
  4.  
  5. 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.
  6.  
  7. 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.
  8.  
  9. 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.
  10.  
  11. Hundreds of megs of logs (within minutes!) accumulating in /var/log/mail.log lead me to investigate.
  12.  
  13. 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)
  14.  
  15. 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.
  16.  
  17. (One of them is a bogus address, the rest are real addresses, I masked them out as [email protected])
  18.  
  19. ----------------------------------------------
  20. root@andromeda:~# mailq
  21. -Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient-------
  22. D6D87F27 4594 Sun Feb 22 23:32:30 [email protected]
  23. (delivery temporarily suspended: connect to 127.0.0.1[127.0.0.1]:10024: Connection refused)
  24.  
  25. 6EE3E568E22 1505 Sun Feb 22 23:51:25 [email protected]
  26. (connect to 127.0.0.1[127.0.0.1]:10024: Connection refused)
  27.  
  28. 60135641328 1542 Sun Feb 22 23:51:51 [email protected]
  29. (delivery temporarily suspended: connect to 127.0.0.1[127.0.0.1]:10024: Connection refused)
  30.  
  31. 56EC8566125 1542 Sun Feb 22 23:52:44 [email protected]
  32. (delivery temporarily suspended: connect to 127.0.0.1[127.0.0.1]:10024: Connection refused)
  33.  
  34. A16CB566EC0 1505 Sun Feb 22 23:51:37 [email protected]
  35. (delivery temporarily suspended: connect to 127.0.0.1[127.0.0.1]:10024: Connection refused)
  36.  
  37. 2662E566E54 409 Mon Feb 23 00:00:41 [email protected]
  38. (delivery temporarily suspended: connect to 127.0.0.1[127.0.0.1]:10024: Connection refused)
  39.  
  40. 734FE571BE1 3606 Sun Feb 22 18:50:39 [email protected]
  41. (connect to 127.0.0.1[127.0.0.1]:10024: Connection refused)
  42. -----------------------------------
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52. Note the (delivery temporarily suspended: connect to 127.0.0.1[127.0.0.1]:10024: Connection refused)
  53.  
  54.  
  55.  
  56.  
  57. 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).
  58.  
  59. 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:
  60.  
  61.  
  62.  
  63. -----------------------------------
  64. -Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient-------
  65. 1FEF95E6BE7 588 Sun Oct 5 23:24:02 ruins
  66. ruins
  67.  
  68. 493BE608DB7 588 Sun Nov 16 16:25:02 ruins
  69. ruins
  70.  
  71. A12F15B8679 737 Wed Dec 31 09:39:01 root
  72. root
  73.  
  74. 78A5D5EF4D2 588 Wed Jan 28 18:59:01 ruins
  75. ruins
  76.  
  77. DEDE95DCB51 588 Mon Jan 19 14:00:08 ruins
  78. ruins
  79.  
  80. F02E85D9F10 588 Tue Sep 16 23:25:01 ruins
  81. ruins
  82. -------------------------------------
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91. So, long story short:
  92.  
  93. 1. Why is it seemingly not trying to deliver any mail (even local mail from cron jobs and stuff)?
  94. 2. Why is it trying to connect to 127.0.0.1 to deliver mail, and then refusing the connection?
  95. 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?
  96. 4. How can I make it so that it will deliver mail to the internet (or try to, at least)?
  97.  
  98. Thanks <3
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105. Postfinger below.
  106. ----------------------------------------------
  107.  
  108. root@andromeda:~# ./postfinger
  109. postfinger - postfix configuration on Mon Feb 23 02:10:41 EST 2015
  110. version: 1.30
  111.  
  112. /usr/sbin/postconf: warning: /etc/postfix/main.cf: undefined parameter: virtual_mailbox_limit_maps
  113. --System Parameters--
  114. mail_version = 2.11.0
  115. hostname = andromeda
  116. 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
  117.  
  118. --Packaging information--
  119. looks like this postfix comes from deb package: postfix-2.11.0-1
  120.  
  121. /usr/sbin/postconf: warning: /etc/postfix/main.cf: undefined parameter: virtual_mailbox_limit_maps
  122. --main.cf non-default parameters--
  123. alias_database = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases
  124. alias_maps = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases
  125. append_dot_mydomain = no
  126. biff = no
  127. body_checks = regexp:/etc/postfix/body_checks
  128. broken_sasl_auth_clients = yes
  129. content_filter = amavis:[127.0.0.1]:10024
  130. dovecot_destination_recipient_limit = 1
  131. header_checks = regexp:/etc/postfix/header_checks
  132. html_directory = /usr/share/doc/postfix/html
  133. mailbox_size_limit = 512000000
  134. maildrop_destination_concurrency_limit = 1
  135. maildrop_destination_recipient_limit = 1
  136. mime_header_checks = regexp:/etc/postfix/mime_header_checks
  137. mydestination = andromeda.gamefiar.com, localhost, localhost.localdomain, 127.0.0.1
  138. myhostname = andromeda.gamefiar.com
  139. mynetworks = 127.0.0.0/8 [::1]/128
  140. myorigin = /etc/mailname
  141. nested_header_checks = regexp:/etc/postfix/nested_header_checks
  142. owner_request_special = no
  143. 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
  144. receive_override_options = no_address_mappings
  145. recipient_delimiter = +
  146. relay_domains = mysql:/etc/postfix/mysql-virtual_relaydomains.cf
  147. relay_recipient_maps = mysql:/etc/postfix/mysql-virtual_relayrecipientmaps.cf
  148. smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
  149. smtpd_client_message_rate_limit = 100
  150. smtpd_client_restrictions = check_client_access mysql:/etc/postfix/mysql-virtual_client.cf
  151. smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, check_recipient_access mysql:/etc/postfix/mysql-virtual_recipient.cf, reject_unauth_destination
  152. smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
  153. smtpd_sasl_auth_enable = yes
  154. smtpd_sasl_authenticated_header = yes
  155. smtpd_sasl_path = private/auth
  156. smtpd_sasl_type = dovecot
  157. smtpd_sender_restrictions = check_sender_access mysql:/etc/postfix/mysql-virtual_sender.cf
  158. smtpd_tls_cert_file = /etc/postfix/smtpd.cert
  159. smtpd_tls_key_file = /etc/postfix/smtpd.key
  160. smtpd_tls_security_level = may
  161. smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
  162. smtpd_use_tls = yes
  163. smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
  164. transport_maps = hash:/var/lib/mailman/data/transport-mailman, proxy:mysql:/etc/postfix/mysql-virtual_transports.cf
  165. virtual_alias_domains =
  166. 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
  167. virtual_gid_maps = static:5000
  168. virtual_mailbox_base = /var/vmail
  169. virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
  170. virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
  171. virtual_transport = dovecot
  172. virtual_uid_maps = static:5000
  173.  
  174. --master.cf--
  175. /usr/sbin/postconf: warning: /etc/postfix/main.cf: undefined parameter: virtual_mailbox_limit_maps
  176. smtp inet n - - - - smtpd
  177. submission inet n - - - - smtpd
  178. -o syslog_name=postfix/submission
  179. -o smtpd_tls_security_level=encrypt
  180. -o smtpd_sasl_auth_enable=yes
  181. -o smtpd_client_restrictions=permit_sasl_authenticated,reject
  182. smtps inet n - - - - smtpd
  183. -o syslog_name=postfix/smtps
  184. -o smtpd_tls_wrappermode=yes
  185. -o smtpd_sasl_auth_enable=yes
  186. -o smtpd_client_restrictions=permit_sasl_authenticated,reject
  187. pickup unix n - - 60 1 pickup
  188. cleanup unix n - - - 0 cleanup
  189. qmgr unix n - n 300 1 qmgr
  190. tlsmgr unix - - - 1000? 1 tlsmgr
  191. rewrite unix - - - - - trivial-rewrite
  192. bounce unix - - - - 0 bounce
  193. defer unix - - - - 0 bounce
  194. trace unix - - - - 0 bounce
  195. verify unix - - - - 1 verify
  196. flush unix n - - 1000? 0 flush
  197. proxymap unix - - n - - proxymap
  198. proxywrite unix - - n - 1 proxymap
  199. smtp unix - - - - - smtp
  200. relay unix - - - - - smtp
  201. showq unix n - - - - showq
  202. error unix - - - - - error
  203. retry unix - - - - - error
  204. discard unix - - - - - discard
  205. local unix - n n - - local
  206. virtual unix - n n - - virtual
  207. lmtp unix - - - - - lmtp
  208. anvil unix - - - - 1 anvil
  209. scache unix - - - - 1 scache
  210. maildrop unix - n n - - pipe
  211. flags=DRhu user=vmail argv=/usr/bin/maildrop -d vmail ${extension} ${recipient} ${user} ${nexthop} ${sender}
  212. uucp unix - n n - - pipe
  213. flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
  214. ifmail unix - n n - - pipe
  215. flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
  216. bsmtp unix - n n - - pipe
  217. flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient
  218. scalemail-backend unix - n n - 2 pipe
  219. flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
  220. mailman unix - n n - - pipe
  221. flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
  222. ${nexthop} ${user}
  223. dovecot unix - n n - - pipe
  224. flags=DROhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${user}@${nexthop}
  225. amavis unix - - - - 2 smtp
  226. -o smtp_data_done_timeout=1200
  227. -o smtp_send_xforward_command=yes
  228. 127.0.0.1:10025 inet n - - - - smtpd
  229. -o content_filter=
  230. -o local_recipient_maps=
  231. -o relay_recipient_maps=
  232. -o smtpd_restriction_classes=
  233. -o smtpd_client_restrictions=
  234. -o smtpd_helo_restrictions=
  235. -o smtpd_sender_restrictions=
  236. -o smtpd_recipient_restrictions=permit_mynetworks,reject
  237. -o mynetworks=127.0.0.0/8
  238. -o strict_rfc821_envelopes=yes
  239. -o receive_override_options=no_unknown_recipient_checks,no_header_body_checks
  240.  
  241. -- end of postfinger output --
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250. edit: tail of mail.log
  251.  
  252. Feb 23 02:18:44 andromeda postfix/smtp[27304]: connect to 127.0.0.1[127.0.0.1]:10024: Connection refused
  253. 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)
  254. 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)
  255. Feb 23 02:18:44 andromeda postfix/smtp[27304]: warning: mysql:/etc/postfix/mysql-virtual_relaydomains.cf: table lookup problem
  256. Feb 23 02:18:44 andromeda postfix/smtp[27304]: warning: 2636B560015: flush service failure
  257. Feb 23 02:28:44 andromeda postfix/smtp[28109]: connect to 127.0.0.1[127.0.0.1]:10024: Connection refused
  258. 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)
  259. 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)
  260. Feb 23 02:28:44 andromeda postfix/smtp[28109]: warning: mysql:/etc/postfix/mysql-virtual_relaydomains.cf: table lookup problem
  261. Feb 23 02:28:44 andromeda postfix/smtp[28109]: warning: 2636B560015: flush service failure
  262.  
  263.  
  264.  
  265. yuuuup, ispconfig msut be the problem
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement