local mailsystem with Postfix, Dovecot: MUA is tricked with wrong address information while sending to alias address? - postfix-mta

I have a local mailsystem with postfix, dovecot, virtual users, postfixadmin and getmail. Everything is working so far, except aliases.
Aliases are delivered to the (expanded) recipients correctly, but a MUA is tricked to supply wrong From: and To: addresses when clicking reply.
If I view an arriving message within my MUA (Thunderbird in this case), everything seems to be ok:
From-field: initial-sender#example.com
To-field: my-alias#mydomain.de
If I check the source of the eMail, I can see the (in my understanding) correct address information:
From: initial-sender#example.com (<= this should get the To: address in a reply-email)
To: my-alias#mydomain.de
Envelope-To: real-target-behind-alias#anotherdomain.de (<= this should get the From: address in a reply-email)
Return-Path: initial-sender#example.com (<= back to this address in case of error)
So far, so good. But if I click "Reply" now, Thunderbird prefills the address fields with wrong information:
From-field: initial-sender#example.com
To-field: my-alias#mydomain.de
So, that means I would send the reply-email in the name of the initial sender (which I am not) to my own alias.
Why is Thunderbird tricked into this fault?
Best regards, Alex

Related

How to set hostname used in JavaMail or Apache James Message-Id header?

I am having issues with mail bouncing when sending from my own server to my own active yahoo account using JavaMail. The mails are passing SPF, DKIM and DMARC according to google mail that receives the same messages being bounced by yahoo. I can send messages from other accounts to my yahoo account without issue.
The messages send fine from my server to ZMail, GMail, Microsoft mail. Looking at the emails, the only thing that I have noticed is the message header for the Message-Id. My messages have the following header:
Message-ID: <923936395.17.1634776639078#[internally visible hostname]>
I am wondering if this header could be the problem and whether there is a way in JavaMail or in the Apache James to set the hostname or IP address that gets used in this message so that rather than using the "internally visible hostname", I can get the hostname that is externally visible. I have been searching the available documentation for Apache James and JavaMail but have not found any parameters to try in order to resolve this.
According to the Decompiled SRC of sun mail it should be possible by setting some properties for your session.
props.setProperty("mail.from", user);
props.setProperty("mail.host", host);
//props.setProperty("mail.user", user);
The Id will be updated by the save method (saveChanges()) and will trigger an new ID generation (updateHeaders() -> updateMessageID()). (Looked up in the decompiled MimeMessage.class)
Leading to the HostPart called in javax.mail.internet.InternetAddress.
The relevant method is _getLocalAddress.
Here you can see that the values get extracted from the Properties or will fallback to your local machine.
Used Fields:
user.name
mail.from
mail.user
mail.host
The user.name property can also be looked up from the system props.

Temporary block from yahoo

For quite some time we have been getting the following error from yahoo:
mail.log:6452:Apr 22 19:21:06 aegir postfix/smtp[8997]: 87BCF4C93F: host mta7.am0.yahoodns.net[67.195.228.110] said: 421 4.7.0 [IPTS04] Messages from 188.93.125.68 temporarily deferred due to user complaints - 4.16.55.1; see https://help.yahoo.com/kb/postmaster/SLN3434.html (in reply to end of DATA command)
If someone did get the similar, how did you solve this issue?
I've been trying to contact Yahoo but everytime I get automated response and ticket closure as I send it.
What other thing I can offer is DMARC report if its relevant:
https://mxtoolbox.com/DmarcReportAnalyzer.aspx?id=F-9a3a8364-6cba-41f9-b93f-cfc32155a3f6
Test for headers and every check seems to be working alright:
https://www.mail-tester.com/test-m5ytebosm
Google email is showing everything is pass:
gmail email
gmail header
For now I've tried changing OpenDKIM to relaxed/relaxed from relaxed/simple.
Removed p=quarantine and added p=none
Sorted out SPF record for official signing domain just in case, added another IP address where resourcecenter is found.
Will provide additional info if needed.

Log in issues with Astersik

I just tried to get into Astersik and FreePBX because I'd like to set up a office phone network with different extensions for different people.
So I took a Raspberry Pi 3, downloaded the image here and followed this documentation. I thought for testing it should be fine.
It was so. Everything worked, no errors or something else while installation. So I opened the FreePBX site in my browser, logged in as admin, created a new user, a new Chain_SIP extension and linked both. Submitted this and applied the config (the red button in the right upper corner). I logged out, logged in with the credentials of the new user in FreePBX admin interface and the UCP interface. Everything was still fine.
Now I wanted to connect via a client to it and chose Empathy and came back to reality. I wasn't able to connect. Astersik full log tells me:
[2016-11-24 19:07:08] NOTICE[2004] chan_sip.c: Registration from
'' failed for '192.168.0.54:34061' - Wrong
password
I used that password which was shown during the process to create the extension. I tried the user (not the extension) credentials too, which didn't work and returned the same error, only 1003 is replaced by the user name.
Somewhere I found the command
asterisk -rx "sip show users"
which returns:
Username Secret Accountcode Def.Context ACL Forcerport
1003 12345678 from-internal Yes Yes
I'm sure, I missed something, but I have no ides what.
Could someone help me?
In FreePBX terminology user <> extension look at http://wiki.freepbx.org/pages/viewpage.action?pageId=5242941 for details. I believe, in your case you need to
asterisk -rx "sip show peers"
not
asterisk -rx "sip show users"

Qmail email address without hostname/domain name

In our production a user sent an email to the following address "xxx" (Literally the email is address xxx). This address is within our companies organization (xxx#company.com.ph), I am being asked how it was sent without "#company.com.ph".
I told them it was probably the configuration of our SMTP server as I am sure the application I made is not appending "#company.com.ph" to mails without (hostName/domainName).
Our SMTP server is Qmail in a Unix box. Can anyone tell me what configurations we could check to explain how this happened?
Unfortunately, I do not have a Qmail or Unixbox so I cant test it myself and I don't have access to our production servers so I could really use some help.
PS. Can anyone also give me the correct term for "#company.com.ph" is it the hostName/domainName?
Checks Done
1) According to the administrator - "defaultdomain" is set to "mail.company"
Yes by default qmail will add defaultdomain to any recipient address missing the domain part.
#company.com.ph is the domain name part of the email address.
defaultdomain file by default is in /var/qmail/control directory as from documentation: http://www.lifewithqmail.org/lwq.html#config-files

Wildcards in an email address with qmail?

I'm trying to set up an email address in qmail such that a unique identifier can be passed as part of the email address.
For example:
reply-123#example.com, reply-345#example.com, reply-99999#example.com would all go to the 'reply' user and be sent to the same shell script. Currently, email sent to reply#example.com goes to the script and I pass the unique id in the subject or message body. Would be grateful for any suggestions. Thanks!
In a default qmail setup, you can do exactly what you suggest... anything following a dash is ignored for delivery purposes, so reply-anything#example.com will be processed by the .qmail-reply file, where you would presumably send the mail to your script and look at the address to obtain the identifier.
We use this for bounce tracking - if the email is to xyz#example.com, and the sender is bounce#sender.com, then the from address is written this way:
bounce-xyz=example.com#sender.com
And a script flags the address as no good.
EDIT:
I screwed this up a bit - I guess I'm rusty on qmail. The alias thing doesn't work by default as I stated above. To support extensions for bounce#sender.com, you need a .qmail-default file in ~bounce.
See the "extension addresses" (section 4.1.5) on LWQ: http://www.lifewithqmail.org/lwq.html

Resources