0

I'm trying to configure sendmail to send emails from the Redmine installation (which I still haven't figured out how to run with Apache). When I send mails from the terminal, with the command (example):

cat some-file | mail -s "some subject" <my-address>@gmail.com

I receive the contents of file correctly from the address redmine@custom-domain. The corresponding log in /var/log/mail.log is:

Nov 10 09:06:25 localhost postfix/pickup[24578]: 50A4E65844: uid=107 from=<redmine@custom-domain>
Nov 10 09:06:25 localhost postfix/cleanup[24909]: 50A4E65844: message-id=<20151110090625.50A4E65844@custom-domain>
Nov 10 09:06:25 localhost postfix/qmgr[24579]: 50A4E65844: from=<redmine@custom-domain>, size=3932, nrcpt=1 (queue active)
Nov 10 09:06:25 localhost postfix/smtp[24915]: connect to ASPMX.L.GOOGLE.com[2607:f8b0:400e:c01::1a]:25: Network is unreachable
Nov 10 09:06:25 localhost postfix/smtp[24915]: 50A4E65844: to=<[email protected]>, relay=ASPMX.L.GOOGLE.com[74.125.28.27]:25, delay=0.32, delays=0.01/0/0.14/0.17, dsn=2.0.0, status=sent (250 2.0.0 OK 1447146380 zu2si3894448pbc.115 - gsmtp)
Nov 10 09:06:25 localhost postfix/qmgr[24579]: 50A4E65844: removed

The following is my redmine configuration:

default:
  email_delivery:
    delivery_method: :sendmail
    smtp_settings:
      address: localhost
      port: 25
      authentication: :none
      domain: custom-domain

but when I send a test mail from Redmine > Settings > Email settings, the following log is generated in the mail.log file:

Nov 10 09:02:30 localhost postfix/pickup[24578]: 09AD465844: uid=107 from=<redmine@custom-domain>
Nov 10 09:02:30 localhost postfix/cleanup[24888]: 09AD465844: message-id=<[email protected]>
Nov 10 09:02:30 localhost postfix/qmgr[24579]: 09AD465844: from=<redmine@custom-domain>, size=2336, nrcpt=1 (queue active)
Nov 10 09:02:30 localhost postfix/smtp[24890]: 09AD465844: to=<[email protected]>, relay=ASPMX.L.GOOGLE.com[74.125.28.27]:25, delay=0.69, delays=0.01/0/0.5/0.17, dsn=2.0.0, status=sent (250 2.0.0 OK 1447146146 k8si3902958pbq.49 - gsmtp)
Nov 10 09:02:30 localhost postfix/qmgr[24579]: 09AD465844: removed

From what I've able to gather so far is that, this behaviour is because of the following in Redmine's email:

message-id=<[email protected]>

My settings for /etc/postfix/main.cf are as follows:

myhostname = custom-domain
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = custom-domain, localhost, localhost.localdomain, localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = localhost
inet_protocols = all

NOTE: I've tried setting the following as well:

inet_interfaces = all
5
  • Have you checked your spam folder on Gmail?
    – adamo
    Nov 10, 2015 at 9:30
  • @adamo Damn! All the test mails are being sent to spam folder. Any reason why gmail is doing so?
    – hjpotter92
    Nov 10, 2015 at 9:34
  • I really do not know. But you can train it not to mark them as spam and eventually they will end up in your normal Inbox.
    – adamo
    Nov 10, 2015 at 9:57
  • @adamo Ah, but that'd be specific to my machine alone. The redmine setup would be open to public. Guess I'll have to ask users' to check their spam folders as well.
    – hjpotter92
    Nov 10, 2015 at 10:01
  • If all this system does is just sending out mail, alerts, notifications etc. I tend to prefer something lightweight like msmtp over a fully fledged MTA like postfix. Simply configure it to use an external SMTP service like Amazon AWS SES, SendGrid, Zoho mail or even your GMail account, and you will have less of a spam issue too. Easier to setup, easier to maintain. Downside: you cannot receive mail back.
    – JayMcTee
    Nov 10, 2015 at 11:47

0

You must log in to answer this question.

Browse other questions tagged .