Re: Issue with Postfix

2023-01-02 Thread Forums

Hello,

After checks I noticed that I had "1.1.1.1" in my resolv.conf. And that 
this DNS was specified in my dhcpcd.conf (certainly a mistake on my side).


I deleted this entry in dhcpcd.conf and restarted the service. And no 
more "1.1.1.1" in resolv.conf.


I tested to send an email from another server and it works now.

GOOD !!!


Thank's all for your help.


Le 01/01/2023 à 21:38, Shawn Heisey a écrit :

On 1/1/23 12:33, Bill Cole wrote:

also, private IP ranges should be excluded from checking in DNS lists.


Yes, but non sequitur...

... as your server connects to 192.168.1.160, I assume that servers 
sees your address to be from private range too.


Nope, the connecting address is shown in the error message's Spamhaus 
URL: 172.71.117.8. A Cloudflare address (!)


From what I can tell with a little bit of testing, spamhaus is 
reporting the IP address of the DNS server that contacted the spamhaus 
RBL.  That RBL is not used with an IP address, it is a domain name 
lookup.


Try one of the following commands out on a *NIX system with either 
"host" or "nslookup" installed.  It looks up a TXT record for 
mehl-family.fr (the OP's sender address domain) on the same RBL the OP 
uses.  The lookup is sent to 1.1.1.1, which is cloudflare's public DNS 
resolver:


host -t TXT mehl-family.fr.dbl.spamhaus.org 1.1.1.1
nslookup -type=TXT mehl-family.fr.dbl.spamhaus.org 1.1.1.1

Unless the Raspberry Pi is located in cloudflare's network, which I 
suspect is not actually possible for most people, it means that 
192.168.1.160 is using cloudflare for DNS.


I tried the above commands to 8.8.8.8 instead of 1.1.1.1, and it 
didn't report "public resolver" which I found a little bit strange.  
So the OP could probably use 8.8.8.8 and 8.8.4.4 for DNS, but that's 
not a good idea long term.  They really need to install unbound or 
bind9 on the mailserver and use 127.0.0.1 for DNS.


Not sure if this applies or not:  It is generally not a good idea to 
run a public mailserver on a typical home ISP or many small business 
ISP connections.  These networks are very often on public blocklists 
used all over the Internet, which means that a large percentage of the 
mail that gets sent by a server in one of these ISP networks will be 
denied.


Thanks,
Shawn


--
Ce message et toutes les pièces jointes (ci-après le "message") sont établis à 
l’intention exclusive des destinataires désignés. Il contient des informations 
confidentielles et pouvant être protégé par le secret professionnel. Si vous recevez ce 
message par erreur, merci d'en avertir immédiatement l'expéditeur et de détruire le 
message. Toute utilisation de ce message non conforme à sa destination, toute diffusion 
ou toute publication, totale ou partielle, est interdite, sauf autorisation expresse de 
l’émetteur. L'internet ne garantissant pas l'intégrité de ce message lors de son 
acheminement, l'expéditeur décline toute responsabilité au titre de son contenu. Bien que 
ce message ait fait l’objet d’un traitement anti-virus lors de son envoi, l’émetteur ne 
peut garantir l’absence totale de logiciels malveillants dans son contenu et ne pourrait 
être tenu pour responsable des dommages engendrés par la transmission de l’un d’eux.

Pensez environnement ! N’imprimez cet email que si c’est nécessaire. 


This message and any attachments (the "message") are intended solely for the 
addressee(s). It contains confidential information, that may be privileged. If you 
receive this message in error, please notify the sender immediately and delete the 
message. Any use of the message in violation of its purpose, any dissemination or 
disclosure, either wholly or partially is strictly prohibited, unless it has been 
explicitly authorized by the sender. As its integrity cannot be secured on the internet, 
the sender decline any liability for the content of this message. Although the sender 
endeavors to maintain a computer virus-free network, the sender does not warrant that 
this transmission is virus-free and will not be liable for any damages resulting from any 
virus transmitted.

Think environment! Print this email only if necessary.
--

Issue with Postfix

2023-01-01 Thread Forums

Hello,

I have an issue with Postfix after a new OS installation (64bits instead 
of 32bits).


OS : raspi-os (Debian for Raspberry Pi, my mailserver run on a Raspberry Pi)


What I've done:

- OS 64bits installation

- Softwares installation (Dovecot, Postfix, Clamav, Spamassassin, 
OpenDKIM, SPF)


- Put all old softwares files to new softwares (configuration and 
others) because softwares version have not changed


==> No modifications made

Mailserver hostname and IP have not changed, exactly the same.

No firewall on mailserver (stopped because I have a strange issue with it).


The issue:

- When I send an email as root or others users, just for testing, from 
another Raspberry server using commands line (echo "TEST" | mailx -r 
"no-re...@mehl-family.fr" -s "TEST" for...@mehl-family.fr) I see these 2 
messages in maillog on sending server:


*/postfix/smtp[23430]: 4972423BAF: to=/**/, 
relay=192.168.1.160[192.168.1.160]:25, delay=0.99, 
delays=0.06/0.03/0.8/0.1, dsn=5.7.1, status=bounced (host 
192.168.1.160[192.168.1.160] said: 554 5.7.1 Service unavailable; Sender 
address [no-re...@mehl-family.fr] blocked using dbl.spamhaus.org; Error: 
open resolver; https://www.spamhaus.org/returnc/pub/172.71.117.8 (in 
reply to RCPT TO command))/*


and

/*postfix/smtp[23430]: 401F723BB0: to=*//*, 
relay=192.168.1.160[192.168.1.160]:25, delay=2.9, delays=0.01/0/0/2.9, 
dsn=5.1.1, status=bounced (host 192.168.1.160[192.168.1.160] said: 550 
5.1.1*//**//*: Recipient address rejected: User unknown in virtual 
mailbox table (in reply to RCPT TO command))*/


==> But I don't see any message in mailserver maillog.


- When I send an email from an external email (as Gmail) I don't receive 
email and no message in mailserver maillog.



BUT...

- When I send an email using the same commands line from the same server 
but with old mailserver OS (32bits), with exactly the same configuration 
for all (Dovecot, etc...), I receive the email fine and I can see 
message in mailserver maillog.



I search in all directions but I don't understand why it doesn't work.



HAPPY NEW YEAR !!!


--
Ce message et toutes les pièces jointes (ci-après le "message") sont établis à 
l’intention exclusive des destinataires désignés. Il contient des informations 
confidentielles et pouvant être protégé par le secret professionnel. Si vous recevez ce 
message par erreur, merci d'en avertir immédiatement l'expéditeur et de détruire le 
message. Toute utilisation de ce message non conforme à sa destination, toute diffusion 
ou toute publication, totale ou partielle, est interdite, sauf autorisation expresse de 
l’émetteur. L'internet ne garantissant pas l'intégrité de ce message lors de son 
acheminement, l'expéditeur décline toute responsabilité au titre de son contenu. Bien que 
ce message ait fait l’objet d’un traitement anti-virus lors de son envoi, l’émetteur ne 
peut garantir l’absence totale de logiciels malveillants dans son contenu et ne pourrait 
être tenu pour responsable des dommages engendrés par la transmission de l’un d’eux.

Pensez environnement ! N’imprimez cet email que si c’est nécessaire. 


This message and any attachments (the "message") are intended solely for the 
addressee(s). It contains confidential information, that may be privileged. If you 
receive this message in error, please notify the sender immediately and delete the 
message. Any use of the message in violation of its purpose, any dissemination or 
disclosure, either wholly or partially is strictly prohibited, unless it has been 
explicitly authorized by the sender. As its integrity cannot be secured on the internet, 
the sender decline any liability for the content of this message. Although the sender 
endeavors to maintain a computer virus-free network, the sender does not warrant that 
this transmission is virus-free and will not be liable for any damages resulting from any 
virus transmitted.

Think environment! Print this email only if necessary.
--


policyd-spf error

2022-10-31 Thread Forums

Hello,

Since this morning I can receive email, whitout doing something on my 
server.


In maillog I can see the following errors:


2022-10-31 08:59:37
postfix/smtpd[6632]: NOQUEUE: reject: RCPT from 
fr-srvcomm[192.168.1.170]: 451 4.3.5 : Recipient address rejected: 
Server configuration problem; from= to= proto=ESMTP helo=

2022-10-31 08:59:37
postfix/smtpd[6632]: warning: problem talking to server 
private/policyd-spf: Connection reset by peer

2022-10-31 08:59:37
postfix/smtpd[6632]: warning: premature end-of-input on 
private/policyd-spf while reading input attribute name

2022-10-31 08:59:37
postfix/spawn[6636]: warning: command /usr/bin/policyd-spf exit status 1
2022-10-31 08:59:36
postfix/smtpd[6632]: warning: premature end-of-input on 
private/policyd-spf while reading input attribute name

2022-10-31 08:59:36
postfix/spawn[6636]: warning: command /usr/bin/policyd-spf exit status 1
2022-10-31 08:59:34
postfix/smtpd[6632]: connect from fr-srvcomm[192.168.1.170]
2022-10-31 08:59:34
postfix/postscreen[6631]: WHITELISTED [192.168.1.170]:33462
2022-10-31 08:59:34
postfix/postscreen[6631]: CONNECT from [192.168.1.170]:33462 to 
[192.168.1.160]:25



When I disable policyd-spf it's works without issue.


* main.cf:

policyd-spf_time_limit = 3600
smtpd_recipient_restrictions =
    check_policy_service unix:private/policyd-spf


* master.cf:

policyd-spf unix    -   n   n   -   0   spawn
   user=nobody  argv=/usr/bin/policyd-spf 
/etc/postfix-policyd-spf-python/policyd-spf.conf



* /etc/postfix-policyd-spf-python/policyd-spf.conf:

debugLevel = 2
TestOnly = 1

HELO_reject = Fail
Mail_From_reject = Fail

PermError_reject = False
TempError_Defer = False

skip_addresses = 127.0.0.0/8,:::127.0.0.0/104,::1

Whitelist = 192.168.1.0/24


--
Ce message et toutes les pièces jointes (ci-après le "message") sont établis à 
l’intention exclusive des destinataires désignés. Il contient des informations 
confidentielles et pouvant être protégé par le secret professionnel. Si vous recevez ce 
message par erreur, merci d'en avertir immédiatement l'expéditeur et de détruire le 
message. Toute utilisation de ce message non conforme à sa destination, toute diffusion 
ou toute publication, totale ou partielle, est interdite, sauf autorisation expresse de 
l’émetteur. L'internet ne garantissant pas l'intégrité de ce message lors de son 
acheminement, l'expéditeur décline toute responsabilité au titre de son contenu. Bien que 
ce message ait fait l’objet d’un traitement anti-virus lors de son envoi, l’émetteur ne 
peut garantir l’absence totale de logiciels malveillants dans son contenu et ne pourrait 
être tenu pour responsable des dommages engendrés par la transmission de l’un d’eux.

Pensez environnement ! N’imprimez cet email que si c’est nécessaire. 


This message and any attachments (the "message") are intended solely for the 
addressee(s). It contains confidential information, that may be privileged. If you 
receive this message in error, please notify the sender immediately and delete the 
message. Any use of the message in violation of its purpose, any dissemination or 
disclosure, either wholly or partially is strictly prohibited, unless it has been 
explicitly authorized by the sender. As its integrity cannot be secured on the internet, 
the sender decline any liability for the content of this message. Although the sender 
endeavors to maintain a computer virus-free network, the sender does not warrant that 
this transmission is virus-free and will not be liable for any damages resulting from any 
virus transmitted.

Think environment! Print this email only if necessary.
--


Re: Add a disclaimer for all senders

2022-02-06 Thread Forums
In the future I will try to learn a bit more about amavis and what you 
can do with it.


I read that you could add a disclaimer using amavis.


Le 06/02/2022 à 13:17, Matus UHLAR - fantomas a écrit :

On 06.02.22 11:07, Forums wrote:
From what I had been told and what I could read, port 465 is 
deprecated and I had to use port 587. So for outgoing emails I use 
port 587.


it was "deprecated" (not really standardised) for ~20 years, since RFC 
2476

(December 1998) was introduced, but last 4 years it's even recommended:
RFC 8314 (January 2018)

There may be subtle differences, but still, 465 and 587 have de facto 
same

usage and therefore should have same . Of course you may set different
policies in your company/network/server, I just don't recommend it.

For "local" emails (accounts used by my private servers) I use port 
25 to send because these accounts do not send to external email and 
are redirected to my personnal account. Only 4 email accounts are 
used to send/receive emails form/to external emails.


since port 25 is used for server-(mx) server traffic, it can be used for
spam sending, so different ISPs often block outgoing connections to 
port 25,

and recommend using ports above where authentication should be mandatory.


smtpd_milters = inet:localhost:12345

what does this do?


It's used by opendkim.


aha. amavis can do DKIM too, but it's your decision where to do it.


I put disclaimer filter directive under "submission" line in 
master.cf and keep "postscreen":


smtp  inet  n   -   y   -   1 postscreen

[...]

submission inet  n   -   y   -   - smtpd
    -o content_filter=disclaimer:


are you aware that submission only applies to mail submitted via 
port 587?

It's seems yes but not sure.



I mean, this way mail sent via port 587 will only be run through your
disclaimer, the rest (25 465) only through amavis.
I'm asking if this is what you wanted.




--
Ce message et toutes les pièces jointes (ci-après le "message") sont établis à 
l’intention exclusive des destinataires désignés. Il contient des informations 
confidentielles et pouvant être protégé par le secret professionnel. Si vous recevez ce 
message par erreur, merci d'en avertir immédiatement l'expéditeur et de détruire le 
message. Toute utilisation de ce message non conforme à sa destination, toute diffusion 
ou toute publication, totale ou partielle, est interdite, sauf autorisation expresse de 
l’émetteur. L'internet ne garantissant pas l'intégrité de ce message lors de son 
acheminement, l'expéditeur décline toute responsabilité au titre de son contenu. Bien que 
ce message ait fait l’objet d’un traitement anti-virus lors de son envoi, l’émetteur ne 
peut garantir l’absence totale de logiciels malveillants dans son contenu et ne pourrait 
être tenu pour responsable des dommages engendrés par la transmission de l’un d’eux.

This message and any attachments (the "message") are intended solely for the 
addressee(s). It contains confidential information, that may be privileged. If you 
receive this message in error, please notify the sender immediately and delete the 
message. Any use of the message in violation of its purpose, any dissemination or 
disclosure, either wholly or partially is strictly prohibited, unless it has been 
explicitly authorized by the sender. As its integrity cannot be secured on the internet, 
the sender decline any liability for the content of this message. Although the sender 
endeavors to maintain a computer virus-free network, the sender does not warrant that 
this transmission is virus-free and will not be liable for any damages resulting from any 
virus transmitted.
--


Re: Add a disclaimer for all senders

2022-02-06 Thread Forums
When I wanted to secure my mail server, I got help from people on forums 
and on this mailing list.


So I followed their explanations and advice (DKIM, SPF, DMARC, spams,...).

From what I had been told and what I could read, port 465 is deprecated 
and I had to use port 587. So for outgoing emails I use port 587.


For incoming emails I use port 993 because I didn't want to use POP3 but 
only IMAP.


For "local" emails (accounts used by my private servers) I use port 25 
to send because these accounts do not send to external email and are 
redirected to my personnal account. Only 4 email accounts are used to 
send/receive emails form/to external emails.



smtpd_milters = inet:localhost:12345

what does this do?


It's used by opendkim.


I put disclaimer filter directive under "submission" line in 
master.cf and keep "postscreen":


smtp  inet  n   -   y   -   1 postscreen

[...]

submission inet  n   -   y   -   -   smtpd
    -o content_filter=disclaimer:


are you aware that submission only applies to mail submitted via port 
587?

It's seems yes but not sure.

--
Ce message et toutes les pièces jointes (ci-après le "message") sont établis à 
l’intention exclusive des destinataires désignés. Il contient des informations 
confidentielles et pouvant être protégé par le secret professionnel. Si vous recevez ce 
message par erreur, merci d'en avertir immédiatement l'expéditeur et de détruire le 
message. Toute utilisation de ce message non conforme à sa destination, toute diffusion 
ou toute publication, totale ou partielle, est interdite, sauf autorisation expresse de 
l’émetteur. L'internet ne garantissant pas l'intégrité de ce message lors de son 
acheminement, l'expéditeur décline toute responsabilité au titre de son contenu. Bien que 
ce message ait fait l’objet d’un traitement anti-virus lors de son envoi, l’émetteur ne 
peut garantir l’absence totale de logiciels malveillants dans son contenu et ne pourrait 
être tenu pour responsable des dommages engendrés par la transmission de l’un d’eux.

This message and any attachments (the "message") are intended solely for the 
addressee(s). It contains confidential information, that may be privileged. If you 
receive this message in error, please notify the sender immediately and delete the 
message. Any use of the message in violation of its purpose, any dissemination or 
disclosure, either wholly or partially is strictly prohibited, unless it has been 
explicitly authorized by the sender. As its integrity cannot be secured on the internet, 
the sender decline any liability for the content of this message. Although the sender 
endeavors to maintain a computer virus-free network, the sender does not warrant that 
this transmission is virus-free and will not be liable for any damages resulting from any 
virus transmitted.
--


Re: Add a disclaimer for all senders

2022-02-05 Thread Forums

After a lot of tests I've found how to do and it works.

I put disclaimer filter directive under "submission" line in master.cf 
and keep "postscreen":


smtp  inet  n   -   y   -   1 postscreen

[...]

submission inet  n   -   y   -   -   smtpd
    -o content_filter=disclaimer:


Now disclaimer is added to email in text or html format.

Perfect.


--
Ce message et toutes les pièces jointes (ci-après le "message") sont établis à 
l’intention exclusive des destinataires désignés. Il contient des informations 
confidentielles et pouvant être protégé par le secret professionnel. Si vous recevez ce 
message par erreur, merci d'en avertir immédiatement l'expéditeur et de détruire le 
message. Toute utilisation de ce message non conforme à sa destination, toute diffusion 
ou toute publication, totale ou partielle, est interdite, sauf autorisation expresse de 
l’émetteur. L'internet ne garantissant pas l'intégrité de ce message lors de son 
acheminement, l'expéditeur décline toute responsabilité au titre de son contenu. Bien que 
ce message ait fait l’objet d’un traitement anti-virus lors de son envoi, l’émetteur ne 
peut garantir l’absence totale de logiciels malveillants dans son contenu et ne pourrait 
être tenu pour responsable des dommages engendrés par la transmission de l’un d’eux.

This message and any attachments (the "message") are intended solely for the 
addressee(s). It contains confidential information, that may be privileged. If you 
receive this message in error, please notify the sender immediately and delete the 
message. Any use of the message in violation of its purpose, any dissemination or 
disclosure, either wholly or partially is strictly prohibited, unless it has been 
explicitly authorized by the sender. As its integrity cannot be secured on the internet, 
the sender decline any liability for the content of this message. Although the sender 
endeavors to maintain a computer virus-free network, the sender does not warrant that 
this transmission is virus-free and will not be liable for any damages resulting from any 
virus transmitted.
--


Re: Add a disclaimer for all senders

2022-02-05 Thread Forums
 -o smtpd_sasl_auth_enable=yes
    -o smtpd_tls_security_level=encrypt
    -o smtpd_sasl_auth_enable=yes
    -o smtpd_sasl_type=dovecot
    -o smtpd_sasl_path=private/auth
    -o smtpd_sasl_security_options=noanonymous
    -o smtpd_sasl_local_domain=$myhostname
    -o smtpd_client_restrictions=permit_sasl_authenticated,reject
    -o smtpd_sender_restrictions=reject_sender_login_mismatch
    -o 
smtpd_recipient_restrictions=reject_non_fqdn_recipient,reject_unknown_recipient_domain,permit_sasl_authenticated,reject

smtp-amavis unix -   -   y   -   2   smtp
    -o smtp_data_done_timeout=1200
    -o disable_dns_lookups=yes
policyd-spf unix -   n   n   -   0   spawn user=nobody
    argv=/usr/bin/python3 /usr/bin/policyd-spf
    /etc/postfix-policyd-spf-python/policyd-spf.conf
127.0.0.1:10025 inet n   -   y   -   -   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
2525   inet  n   -   n   -   -   smtpd
    -o syslog_name=postfix/webmail
    -o smtpd_tls_security_level=encrypt
    -o receive_override_options=no_address_mappings
    -o 
smtpd_client_restrictions=permit_mynetworks,permit_sasl_authenticated,reject
    -o 
smtpd_recipient_restrictions=permit_mynetworks,permit_sasl_authenticated,reject

    -o milter_macro_daemon_name=ORIGINATING
pickup unix  n   -   y   60  1   pickup
cleanup    unix  n   -   y   -   0   cleanup
qmgr   unix  n   -   n   300 1   qmgr
tlsmgr unix  -   -   y   1000?   1   tlsmgr
rewrite    unix  -   -   y   -   - trivial-rewrite
bounce unix  -   -   y   -   0   bounce
defer  unix  -   -   y   -   0   bounce
trace  unix  -   -   y   -   0   bounce
verify unix  -   -   y   -   1   verify
flush  unix  n   -   y   1000?   0   flush
proxymap   unix  -   -   n   -   -   proxymap
proxywrite unix  -   -   n   -   1   proxymap
smtp   unix  -   -   y   -   -   smtp
relay  unix  -   -   y   -   -   smtp
showq  unix  n   -   y   -   -   showq
error  unix  -   -   y   -   -   error
retry  unix  -   -   y   -   -   error
discard    unix  -   -   y   -   -   discard
local  unix  -   n   n   -   -   local
virtual    unix  -   n   n   -   -   virtual
lmtp   unix  -   -   y   -   -   lmtp
anvil  unix  -   -   y   -   1   anvil
scache unix  -   -   y   -   1   scache
maildrop   unix  -   n   n   -   -   pipe flags=DRhu
    user=vmail argv=/usr/bin/maildrop -d ${recipient}
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=DRhu
    user=vmail:vmail argv=/usr/lib/dovecot/dovecot-lda -f ${sender} -d
    ${recipient}


Le 04/02/2022 à 18:21, Matus UHLAR - fantomas a écrit :

On 4 Feb 2022, at 9:05 am, Forums  wrote:

Using "smtpd" instead of "postscreen" doesn't change issue.


On 04.02.22 09:09, Viktor Dukhovni wrote:

You'll have to back up that claim with:

# postfix reload
   ... submission of a new message via TCP port 25 ...
   ... logs showing that message entering and leaving the queue ...
... unmangled (verbatim whitespace and newlines) output of:
   $ postconf -nf
   $ postconf -Mf

When a content_filter is set for smtpd(8), it is used.


it may be overriden by other FILTER: directive in any of access lists.
also, it may misbehave.


Any observations to the contrary are user errors.


Re: Add a disclaimer for all senders

2022-02-04 Thread Forums

Using "smtpd" instead of "postscreen" doesn't change issue.


Le 04/02/2022 à 14:59, Viktor Dukhovni a écrit :

=On 4 Feb 2022, at 8:39 am, Forums  wrote:

smtp  inet  n   -   y   -   1   postscreen
 -o content_filter=disclaimer:


The postscreen(8) program does not implement content filters.
That setting should be for smtpd(8).


--



Cordialement,

Philippe - Forums


Re: Add a disclaimer for all senders

2022-02-04 Thread Forums
I checked the logs again and I can't see any error message "warning" 
"error" "fatal" "panic".


For testing, my disclaimer script just write something in /tmp/file.

On master.cf I have this:

smtp  inet  n   -   y   -   1 postscreen
    -o content_filter=disclaimer:

[...]

disclaimer unix    -   n   n   -   - pipe
  flags=Rq user=filter argv=/etc/postfix/disclaimer -f ${sender} -d 
${recipient}


When I send an email it looks like that disclaimer script is not running.



Le 03/02/2022 à 19:35, Wietse Venema a écrit :

Wietse Venema:

Look in your LOGS.

http://www.postfix.org/DEBUG_README.html#logging

In particular, logs that the message is handled by your filter,
to eliiminate basic mistakes.

Wietse


Look for obvious signs of trouble
=
Postfix logs all failed and successful deliveries to a logfile.

When Postfix uses syslog logging (the default), the file is usually
called /var/log/maillog, /var/log/mail, or something similar; the
exact pathname is configured in a file called /etc/syslog.conf,
/etc/rsyslog.conf, or something similar.

When Postfix uses its own logging system (see MAILLOG_README), the
location of the logfile is configured with the Postfix maillog_file
parameter.

When Postfix does not receive or deliver mail, the first order of
business is to look for errors that prevent Postfix from working
properly:

% egrep '(warning|error|fatal|panic):' /some/log/file | more

Note: the most important message is near the BEGINNING of the output.
Error messages that come later are less useful.

The nature of each problem is indicated as follows:

- "panic" indicates a problem in the software itself that only a
   programmer can fix. Postfix cannot proceed until this is fixed.

- "fatal" is the result of missing files, incorrect permissions,
   incorrect configuration file settings that you can fix. Postfix
   cannot proceed until this is fixed.

- "error" reports an error condition. For safety reasons, a Postfix
   process will terminate when more than 13 of these happen.

- "warning" indicates a non-fatal error. These are problems that
   you may not be able to fix (such as a broken DNS server elsewhere
on the network) but may also indicate local configuration errors
that could become a problem later.


--



Cordialement,

Philippe - Forums


Add a disclaimer for all senders

2022-02-03 Thread Forums

Hello,

I try to add a disclaimer for all of my email accounts using altermime 
but that doesn't work.



I did the following:

- created the user "filter": useradd -r -c "Postfix Filters" -d 
/var/spool/filter filter


- created the directory /var/spool/filter

- changed directory permissions: chown filter:filter /var/spool/filter, 
chmod 750 /var/spool/filter


- copied /usr/share/doc/altermime/examples/postfix_filter.sh to 
/etc/postfix/disclaimer


- changed script permissions: chgrp filter /etc/postfix/disclaimer, 
chmod 750 /etc/postfix/disclaimer


- add all email accounts in /etc/postfix/disclaimer_addresses

- modify script /etc/postfix/disclaimer

- created disclaimer file /etc/postfix/disclaimer.txt with a personal 
disclaimer


- modified /etc/postfix/master.cf

- restarted postfix


When I send an email using Thunderbird to Gmaill (for example), email is 
received without disclaimer.


I can't see any error messages on mailserver logs.


Informations:

- using Thunderbird, my accounts use personal html file as signature (1 
per account)


- my mailserver use DKIM and SPF
--

####

Cordialement,

Philippe - Forums


Re: Using provider SMTP (Gmail)

2020-07-30 Thread Forums
This action modify "From:" and "Reply To:" when you send an email from 
your Gmail account.


I don't want to send email from a different "From:" address when I use 
my Gmail account.


The only thing I wanted is to have the good sender 
(xx...@mehl-family.fr) in "From:" and "Reply To" when I use Gmail SMTP 
with my personal mail server.



Le 30/07/2020 à 11:54, Arnold Greyling a écrit :




On 23 Jul 2020, at 2:20 , Forums  wrote:

Hello all.

Sorry for my english I'm french.

Due to some problems with my provider (using my private SMTP server prevents 
some emails from happening, issue with IP) I have to use an external SMTP 
(Gmail) as a relay.

It works without issue but...

When I send an email it is received with "From: " equal to Gmail account (From: 
xx...@gmail.com) instead of my personnal email (From: xx...@mehl-family.fr). And when 
receiver answer me email is sent to gmail account. But sometime answer is sent to my 
personnal email (xx...@mehl-family.fr).

In the source of email I can see that "Reply-To:" is filled in with 
"xx...@mehl-family.fr".

And I see my emails sent using xx...@mehl-family.fr in "Mails sent" in my Gmail 
account with sender=xx...@gmail.com.

Must I modify something in my Postfix configuration or is the sender making a 
mistake when he answers me?



Hi

Gmail allows you to send mail from a different From: address
The setup is described at https://support.google.com/mail/answer/22370
I haven’t done this in a very long time but I did manage to achieve what you 
want.
Unfortunately I can’t remember what settings I used.
Play around with the default address and alias settings to get the results you 
want.

Regards
Arnold

--



Cordialement,

Philippe - Forums



Using provider SMTP (Gmail)

2020-07-23 Thread Forums

Hello all.

Sorry for my english I'm french.

Due to some problems with my provider (using my private SMTP server 
prevents some emails from happening, issue with IP) I have to use an 
external SMTP (Gmail) as a relay.


It works without issue but...

When I send an email it is received with "From: " equal to Gmail account 
(From: xx...@gmail.com) instead of my personnal email (From: 
xx...@mehl-family.fr). And when receiver answer me email is sent to 
gmail account. But sometime answer is sent to my personnal email 
(xx...@mehl-family.fr).


In the source of email I can see that "Reply-To:" is filled in with 
"xx...@mehl-family.fr".


And I see my emails sent using xx...@mehl-family.fr in "Mails sent" in 
my Gmail account with sender=xx...@gmail.com.


Must I modify something in my Postfix configuration or is the sender 
making a mistake when he answers me?



--

########

Cordialement,

Philippe - Forums



Alternative SMTP server

2020-06-08 Thread Forums

Hello all.

Sorry for my english I'm french.

I have a private mail server (at home) with my domain name.

I have about 5% of my emails rejected by some SMTP servers for the 
following reasons:


- rDNS is KO (my french provider don't give us possibility to create or 
modify our rDNS)


Or

- mail server IP comes from a dynamic pool IP (but my IP is static)

So, my idea is to use automatically (managed by Postfix) an alternative 
SMTP server (Gmail SMTP with my Google account) when an email is 
rejected. But I don't know if it's possible and how to configure that.



--



Cordialement,

Philippe - Forums



SMTP filter using geo-localization

2019-01-05 Thread Philippe - Forums

Hello,

I would like to filter SMTP access using geo-localization.

I have installed geoip-bin on my mailserver.

This tool works like nslookup with an IP (geoiplookup @IP) and give 
geographic informations about this IP and especially the country (FR, 
DE,...).


My purpose is to filter IPs out of my country to reject SMTP connection.


I must made a linux script, on bash (/usr/bin/policyd-geoip).

But I don't know how the script can tell to postfix if the IP is OK or 
KO.



For postfix configuration I think that I must do that:

* master.cf:

  policy-geoip unix - n n - 0 spawn

  user=nobody argv=/usr/bin/policyd-geoip

* main.cf:

check_policy_service unix:private/policy-geoip


If someone can help me for this "project".


--
##

Philippe - Forums


Re: Good sender name

2018-12-29 Thread Philippe - Forums
If "myorigin" is by default "myhostname", no need to specify "myorigin", 
right?


But it's OK now.
The problem was that I don't spécify the good file to hash with 
"sender_canonical_maps" option. I corrected it and now I receive an 
email with the good sender name.


---
##

Philippe - Forums

Le 2018-12-29 19:21, Wietse Venema a écrit :


Philippe - Forums:


Hi,

I've made this correction:

mydomain = my-domain.fr
myhostname = my-servername.$mydomain

On all of my servers.

But always the same problem: my mailserver don't want to use
"u...@my-domain.fr" as sender name, always "user@my-servername".


Seems you haven't noticed this from my precvious email:

The default sender domain is specified with myorigin.
The default sender domain is specified with myorigin.
The default sender domain is specified with myorigin.

Wietse


Re: Good sender name

2018-12-29 Thread Philippe - Forums

Hi,

I've made this correction:

mydomain = my-domain.fr
myhostname = my-servername.$mydomain

On all of my servers.

But always the same problem: my mailserver don't want to use 
"u...@my-domain.fr" as sender name, always "user@my-servername".



---
######

Philippe - Forums

Le 2018-12-23 21:59, Wietse Venema a écrit :


Philippe - Forums:


On all of my 4 other servers I have this:

mydomain = my-domain.fr
myhostname = my-servername.$mydomain
mynetworks_style = host
mynetworks = 127.0.0.0/8

On my mailserver I have this:

mydomain = my-domain.fr
myhostname = my-mailservername.$mydomain
myorigin = $mydomain
mydestination = $myhostname
mynetworks_style = subnet
mynetworks = 127.0.0.0/8 192.168.1.0/24


This is obviously fake information, so I am going to give a useless
response. The default myorigin value is $myhostname, but on some
system you use 'myorigin = $mydomain' so that would explain the
difference in the senders addresses.

Wietse


Re: Good sender name

2018-12-23 Thread Philippe - Forums

On all of my 4 other servers I have this:

mydomain = my-domain.fr
myhostname = my-servername.$mydomain
mynetworks_style = host
mynetworks = 127.0.0.0/8

On my mailserver I have this:

mydomain = my-domain.fr
myhostname = my-mailservername.$mydomain
myorigin = $mydomain
mydestination = $myhostname
mynetworks_style = subnet
mynetworks = 127.0.0.0/8 192.168.1.0/24

---
##

Philippe - Forums

Le 2018-12-22 23:57, Wietse Venema a écrit :


Philippe - Forums:


Hello.

I want to have the good sender name when an email is sending from my
mailserver.

I explain my problem:

I have 5 different servers including my mailserver.

When I send an email from my mailserver with a user (for example :
user=backup) I receive the mail from "backup@server-name".

When I send an email from my 4 other servers with the same user 
(backup)

I receive the mail from "bac...@my-domain.fr".


http://www.postfix.org/BASIC_CONFIGURATION_README.html#myorigin

Wietse

The myorigin parameter specifies the domain that appears in mail
that is posted on this machine. The default is to use the local
machine name, $myhostname, which defaults to the name of the machine.
Unless you are running a really small site, you probably want to
change that into $mydomain, which defaults to the parent domain of
the machine name.

For the sake of consistency between sender and recipient addresses,
myorigin also specifies the domain name that is appended to an
unqualified recipient address.

Examples (specify only one of the following):

/etc/postfix/main.cf:
myorigin = $myhostname (default: send mail as "user@$myhostname")
myorigin = $mydomain   (probably desirable: "user@$mydomain")


Good sender name

2018-12-22 Thread Philippe - Forums
Hello. 

I want to have the good sender name when an email is sending from my
mailserver. 

I explain my problem: 

I have 5 different servers including my mailserver. 

When I send an email from my mailserver with a user (for example :
user=backup) I receive the mail from "backup@server-name". 

When I send an email from my 4 other servers with the same user (backup)
I receive the mail from "bac...@my-domain.fr".

-- 
## 

Philippe - Forums

Re: More secure postfix

2018-12-22 Thread Philippe - Forums
It's seem to be good with this option. 

Thanks.

---
## 

Philippe - Forums 

Le 2018-12-22 22:46, Wietse Venema a écrit :

> Philippe - Forums: 
> 
>> Yes, with this option I can't send an email with my smartphone, because
>> the smartphone IP have not proper reverse DNS. 
>> 
>> And there is my problem: reject all IPs without proper reverse DNS but
>> accept my smartphone.
> 
> Use permit_sasl_authenticated before reject_unknown_client_hostname.
> 
> Wietse

Re: More secure postfix

2018-12-22 Thread Philippe - Forums
Yes, with this option I can't send an email with my smartphone, because
the smartphone IP have not proper reverse DNS. 

And there is my problem: reject all IPs without proper reverse DNS but
accept my smartphone.

---
## 

Philippe - Forums 

Le 2018-12-22 10:55, Matus UHLAR - fantomas a écrit :

> On 22.12.18 10:13, Philippe - Forums wrote: 
> 
>> I would like to secure more my postfix.
>> 
>> My SMTP configuration actually is:
>> 
>> _smtpd_tls_cert_file=/path/to/certs/fullchain.pem_
>> _smtpd_tls_key_file=/path/to/certs/privkey.pem_
>> _smtpd_tls_CAfile=/path/to/certs/chain.pem_
>> _smtpd_use_tls=yes_
>> _smtpd_tls_session_cache_database =
>> btree:${data_directory}/smtpd_scache_
>> _smtpd_tls_security_level = may_
> 
> please avoid those underscores and avoid line wrapping when possible.
> 
>> But with this configuration I can't send an email from my smartphone
>> (reject).
> 
> what's in the logs? It's hard to see in crystall ball (especially when I
> don't have any)
> 
> I only can guess one thing:
> 
>> smtpd_client_restrictions =
>> permit_mynetworks,
>> reject_unknown_client_hostname,
>> permit
> 
> this however can cause rejecting even client authentication, when client
> connects from IP without proper reverse/direct DNS records

More secure postfix

2018-12-22 Thread Philippe - Forums
Hello, 

I would like to secure more my postfix. 

My SMTP configuration actually is: 

_smtpd_tls_cert_file=/path/to/certs/fullchain.pem_
_smtpd_tls_key_file=/path/to/certs/privkey.pem_
_smtpd_tls_CAfile=/path/to/certs/chain.pem_
_smtpd_use_tls=yes_
_smtpd_tls_session_cache_database =
btree:${data_directory}/smtpd_scache_
_smtpd_tls_security_level = may_ 

_smtp_tls_cert_file=/path/to/certs/fullchain.pem_
_smtp_tls_key_file=/path/to/certs/privkey.pem_
_smtp_tls_CAfile=/path/to/certs/chain.pem_
_smtp_use_tls=yes_
_smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache_

_smtpd_sasl_type = dovecot_
_smtpd_sasl_path = private/auth_

_smtp_sasl_auth_enable = yes_
_smtp_sasl_security_options = noanonymous_
_smtp_sasl_password_maps = hash:/etc/postfix/sasl/sasl_passwd_

_smtpd_client_restrictions =_
_permit_mynetworks,_
_reject_unknown_client_hostname,_
_permit_

_smtpd_sender_restrictions =_
_permit_mynetworks,_
_permit_sasl_authenticated,_
_reject_non_fqdn_sender,_
_reject_unknown_sender_domain,_
_permit_

_smtpd_relay_restrictions =_
_permit_mynetworks,_
_permit_sasl_authenticated,_
_defer_unauth_destination_

_smtpd_recipient_restrictions =_
_permit_sasl_authenticated,_
_permit_mynetworks,_
_reject_unauth_destination,_
_reject_rbl_client b.barracudacentral.org,_
_reject_rbl_client zen.spamhaus.org_

_smtpd_helo_restrictions =_
_permit_mynetworks,_
_permit_sasl_authenticated,_
_check_sender_access hash:/etc/postfix/rejected-recipient,_
_check_client_access hash:/etc/postfix/client_check_access_
_reject_unknown_helo_hostname,_
_reject_non_fqdn_helo_hostname,_
_reject_invalid_helo_hostname,_
_permit_ 

_smtpd_helo_required = yes_
_smtpd_delay_reject = yes_ 

But with this configuration I can't send an email from my smartphone
(reject). 

-- 
## 

Philippe - Forums

Re: Specify good mail sender

2018-05-16 Thread forums
Sorry, I made a mistake... 

When I send a mail from SERVER1 with the user USER to my personnel mail,
I receive the mail "FROM USER@SERVER1.MYDOMAIN". 

And not "FROM USER@MYDOMAIN". 

---
## 

Philippe - Forums 

Le 2018-05-16 20:10, for...@mehl-family.fr a écrit :

> I'm french, sorry for my english. 
> 
> I didn't understand anything. 
> 
> Or certainly that my explanation was not very clear. 
> 
> I retry to explain... 
> 
> _(THE LINK WAS A BAD LINK INSERTED BY DEFAULT INTO MY SENT E-MAIL)_ 
> 
> When I send a mail from SERVER1 with the user USER to my personnel mail, I 
> receive the mail "FROM USER@MYDOMAIN". 
> 
> But when I send a mail from MAILSERVER1 with the user USER to my personnel 
> mail, I receive the mail "FROM USER@MAILSERVER1". 
> 
> The postfix configuration for SERVER1 is a "basic" configuration (just to 
> send mail). 
> 
> _MYDOMAIN = MYDOMAIN_
> _MYHOSTNAME = SERVER1.$MYDOMAIN_
> _MYNETWORKS_STYLE = HOST_
> _MYNETWORKS = 127.0.0.0/8_
> relayhost = xx.xx.xx.xx (MAILSERVER1 IP)
> 
> The postfix configuration for MAILSERVER1 is a "SMTP" configuration (used 
> with dovecot). 
> 
> _MYDOMAIN = MYDOMAIN_
> _MYHOSTNAME = MAILSERVER1.$MYDOMAIN_
> _MYORIGIN = MYDOMAIN_
> _MYDESTINATION = $MYHOSTNAME_
> _RELAYHOST = [IS SMTP]:25_
> _MYNETWORKS = 127.0.0.0/8 192.168.1.0/24_
> _MAILBOX_SIZE_LIMIT = 2048_
> _RECIPIENT_DELIMITER = +_
> _INET_INTERFACES = ALL_
> _INET_PROTOCOLS = IPV4_
> _MYNETWORKS_STYLE = SUBNET_ 
> 
> I hope that my explanation is clearer you.
> 
> ---
> ## 
> 
> Philippe - Forums 
> 
> Le 2018-05-16 19:28, /dev/rob0 a écrit : 
> On Wed, May 16, 2018 at 06:48:55PM +0200, for...@mehl-family.fr wrote: I 
> can't specifie the good mail sender with postfix. 
> What you describe most likely is not a Postfix problem.
> 
> I explain: 
> 
> I have a server mail cluster with 2 nodes (but only one works, the
> second is going to be made). 
> 
> Node names is "node1" and "node2", cluster name is "node". On 
> node1, the server name is "node1" and the mail server name (for 
> postfix) is "node". The servers are on a personnal domain 
> (my_domain.fr).
> 
> On all of my servers (mail servers and others), the postfix
> configuration is: 
> 
> . 
> 
> mydomain = my_domain.fr 
> 
> myhostname = server_name.$mydomain 
> Neither of which is directly relevant.  See:
> 
> http://www.postfix.org/BASIC_CONFIGURATION_README.html
> http://www.postfix.org/postconf.5.html#myorigin
> 
> (with "node" for relay to others servers and mail server 
> configuration for "node1")
> 
> When I send a mail from a local server (linux) with a linux user,
> I receive the mail with "from user@server.my_domain.fr" [1]. So,
> that's OK.
> 
> But when I send a mail from the mail server with a linux user, 
> How did you send the mail?  Typically the MUA would set a sender 
> address.  Is the sender set in the MUA?  We might have been able to 
> tell, if you had shown us LOGS.
> 
> I receive the mail with "from user@node1" [1] instead of "from
> user@node1.my_domain.fr" [1]. 
> Your link was not a real link.
> 
> I don't understand where is the bad configuration. 
> Right, and we could possibly tell you, as above.  But most likely 
> your OS has preconfigured your mail(1) command to set a sender
> domain name.
> 
> Links:
> --
> [1]
> https://mehlsrvmail:40030/?_task=mail&_caps=pdf%3D0%2Cflash%3D1%2Ctiff%3D0%2Cwebp%3D0&_uid=59&_mbox=Sent&_framed=1&_action=preview#NOP

Re: Problem when I send a mail

2018-05-16 Thread forums
The files are the same.

---
## 

Philippe - Forums 

Le 2018-05-16 19:45, Viktor Dukhovni a écrit :

>> On May 16, 2018, at 1:20 PM, for...@mehl-family.fr wrote:
>> 
>> My SMTP server is running in chroot.
>> 
>> Here is the line in /etc/postfix/master.cf :
>> 
>> smtp   inet  n   -   y   -   -   smtpd
> 
> You can disable chroot, or make sure that /etc/hosts and nsswitch.conf,
> ... are the same in the chroot jail as outside.

Re: Specify good mail sender

2018-05-16 Thread forums
I'm french, sorry for my english. 

I didn't understand anything. 

Or certainly that my explanation was not very clear. 

I retry to explain... 

_(THE LINK WAS A BAD LINK INSERTED BY DEFAULT INTO MY SENT E-MAIL)_ 

When I send a mail from SERVER1 with the user USER to my personnel mail,
I receive the mail "FROM USER@MYDOMAIN". 

But when I send a mail from MAILSERVER1 with the user USER to my
personnel mail, I receive the mail "FROM USER@MAILSERVER1". 

The postfix configuration for SERVER1 is a "basic" configuration (just
to send mail). 

_MYDOMAIN = MYDOMAIN_
_MYHOSTNAME = SERVER1.$MYDOMAIN_
_MYNETWORKS_STYLE = HOST_
_MYNETWORKS = 127.0.0.0/8_
relayhost = xx.xx.xx.xx (MAILSERVER1 IP)

The postfix configuration for MAILSERVER1 is a "SMTP" configuration
(used with dovecot). 

_MYDOMAIN = MYDOMAIN_
_MYHOSTNAME = MAILSERVER1.$MYDOMAIN_
_MYORIGIN = MYDOMAIN_
_MYDESTINATION = $MYHOSTNAME_
_RELAYHOST = [IS SMTP]:25_
_MYNETWORKS = 127.0.0.0/8 192.168.1.0/24_
_MAILBOX_SIZE_LIMIT = 2048_
_RECIPIENT_DELIMITER = +_
_INET_INTERFACES = ALL_
_INET_PROTOCOLS = IPV4_
_MYNETWORKS_STYLE = SUBNET_ 

I hope that my explanation is clearer you.

---
## 

Philippe - Forums 

Le 2018-05-16 19:28, /dev/rob0 a écrit :

> On Wed, May 16, 2018 at 06:48:55PM +0200, for...@mehl-family.fr wrote: 
> 
>> I can't specifie the good mail sender with postfix.
> 
> What you describe most likely is not a Postfix problem.
> 
>> I explain: 
>> 
>> I have a server mail cluster with 2 nodes (but only one works, the
>> second is going to be made). 
>> 
>> Node names is "node1" and "node2", cluster name is "node". On 
>> node1, the server name is "node1" and the mail server name (for 
>> postfix) is "node". The servers are on a personnal domain 
>> (my_domain.fr).
>> 
>> On all of my servers (mail servers and others), the postfix
>> configuration is: 
>> 
>> . 
>> 
>> mydomain = my_domain.fr 
>> 
>> myhostname = server_name.$mydomain
> 
> Neither of which is directly relevant.  See:
> 
> http://www.postfix.org/BASIC_CONFIGURATION_README.html
> http://www.postfix.org/postconf.5.html#myorigin
> 
>> (with "node" for relay to others servers and mail server 
>> configuration for "node1")
>> 
>> When I send a mail from a local server (linux) with a linux user,
>> I receive the mail with "from user@server.my_domain.fr" [1]. So,
>> that's OK.
>> 
>> But when I send a mail from the mail server with a linux user,
> 
> How did you send the mail?  Typically the MUA would set a sender 
> address.  Is the sender set in the MUA?  We might have been able to 
> tell, if you had shown us LOGS.
> 
>> I receive the mail with "from user@node1" [1] instead of "from
>> user@node1.my_domain.fr" [1].
> 
> Your link was not a real link.
> 
>> I don't understand where is the bad configuration.
> 
> Right, and we could possibly tell you, as above.  But most likely 
> your OS has preconfigured your mail(1) command to set a sender
> domain name.
> 
>> Links:
>> --
>> [1]
>> https://mehlsrvmail:40030/?_task=mail&_caps=pdf%3D0%2Cflash%3D1%2Ctiff%3D0%2Cwebp%3D0&_uid=59&_mbox=Sent&_framed=1&_action=preview#NOP

Re: Problem when I send a mail

2018-05-16 Thread forums
My SMTP server is running in chroot. 

Here is the line in /etc/postfix/master.cf : 

smtp   inet  n   -   y   -   -   smtpd 

---
## 

Philippe - Forums 

Le 2018-05-15 23:39, Viktor Dukhovni a écrit :

>> On May 15, 2018, at 5:31 PM, for...@mehl-family.fr wrote:
>> 
>> My /etc/nsswitch.conf contain that :
>> 
>> hosts:  files mdns4_minimal [NOTFOUND=return] dns
>> networks:   files
> 
> Your SMTP server may be running in a chroot jail.

Re: Problem when I send a mail

2018-05-16 Thread forums
I am thus going to remove the "local" DNS (192.168.1.1) 

I planned to go up a firewall on a new server, and to transform it into
DNS. 

---
## 

Philippe - Forums 

Le 2018-05-16 06:58, Bill Cole a écrit :

> On 15 May 2018, at 16:58, for...@mehl-family.fr wrote:
> 
>> I don't want to configure DNS server on my machine.
> 
> That's perfectly fine but it is not relevant.
> 
> What you *want* has no effect on what *works*. If you want Postfix to 
> recognize an IP in RFC1918 private space as having a valid name, you MUST set 
> up your own DNS server that serves the relevant zone under in-addr.arpa. This 
> is true whether or not you *want* to configure such a server.
> 
>> I use 2 DNS (/etc/resolv.conf) :
>> 
>> - 1.1.1.1
> 
> Which will *correctly* reply that 192.168.1.1 has no name, because on the 
> public Internet, 192.168.1.1 has no name
> 
>> - 192.168.1.1
> 
> Which will never be used as long as 1.1.1.1 responds with reasonable speed.

Specify good mail sender

2018-05-16 Thread forums
Hi, 

I can't specifie the good mail sender with postfix. 

I explain: 

I have a server mail cluster with 2 nodes (but only one works, the
second is going to be made). 

Node names is "node1" and "node2", cluster name is "node". On node1, the
server name is "node1" and the mail server name (for postfix) is "node".
The servers are on a personnal domain (my_domain.fr). 

On all of my servers (mail servers and others), the postfix
configuration is: 

. 

mydomain = my_domain.fr 

myhostname = server_name.$mydomain 

. 

(with "node" for relay to others servers and mail server configuration
for "node1") 

When I send a mail from a local server (linux) with a linux user, I
receive the mail with "from user@server.my_domain.fr" [1]. So, that's
OK. 

But when I send a mail from the mail server with a linux user, I receive
the mail with "from user@node1" [1] instead of "from
user@node1.my_domain.fr" [1]. 

I don't understand where is the bad configuration. 

-- 
## 

Philippe - Forums 

Links:
--
[1]
https://mehlsrvmail:40030/?_task=mail&_caps=pdf%3D0%2Cflash%3D1%2Ctiff%3D0%2Cwebp%3D0&_uid=59&_mbox=Sent&_framed=1&_action=preview#NOP

Re: Problem when I send a mail

2018-05-15 Thread forums
My /etc/nsswitch.conf contain that : 

hosts:  files mdns4_minimal [NOTFOUND=return] dns
networks:   files 

---
## 

Philippe - Forums 

Le 2018-05-15 23:21, Viktor Dukhovni a écrit :

> On May 15, 2018, at 2:57 PM, Matus UHLAR - fantomas  wrote:
> 
> I have tried with add this entry on /etc/hosts :
> 
> 192.168.1.1 my.domain.fr
> 
> But no change... 
> postfix does not use /etc/hosts.
> postfix uses DNS, you should configure DNS server on your machine.

Postfix (as it should) uses DNS in the SMTP client when sending mail.
On the receiving SMTP server, Postfix uses the platform's getnameinfo(3)
and getaddrinfo(3) interfaces to resolve IP -> name -> IP.  So if
/etc/hosts does not do the trick, it must not be the preferred source
in /etc/nsswitch.conf or similar OS configuration.

Re: Problem when I send a mail

2018-05-15 Thread forums
I don't want to configure DNS server on my machine. 

I use 2 DNS (/etc/resolv.conf) : 

- 1.1.1.1 

- 192.168.1.1

---
## 

Philippe - Forums 

Le 2018-05-15 20:57, Matus UHLAR - fantomas a écrit :

> On 15.05.18 20:53, for...@mehl-family.fr wrote: 
> 
>> I have tried with add this entry on /etc/hosts :
>> 
>> 192.168.1.1 my.domain.fr
>> 
>> But no change...
> 
> postfix does not use /etc/hosts.
> postfix uses DNS, you should configure DNS server on your machine.
> 
> On May 15, 2018 11:34:30 AM PDT, for...@mehl-family.fr wrote: When I send a 
> mail with roundcube from my computer I find this message on my maillog :
> 
> _MAY 15 20:16:51 MYSERVER POSTFIX/SMTPD[29843]: CONNECT FROM 
> UNKNOWN[192.168.1.1]_
> 
> 192.168.1.1 is my box IP
> 
> My computer is in the same lan than my mailserver (home network).
> 
> I think I have a bad configuration somewhere, postfix or server network.
> 
> I takes any sugsestion.

Re: Problem when I send a mail

2018-05-15 Thread forums
I have tried with add this entry on /etc/hosts : 

192.168.1.1 my.domain.fr 

But no change...

---
## 

Philippe - Forums 

Le 2018-05-15 20:51, Dennis Carr a écrit :

> This is fairly normal. It just means that postfix can't figure out the name 
> of the connecting box by resolution or host look-up.
> 
> -Dennis Carr
> 
> On May 15, 2018 11:34:30 AM PDT, for...@mehl-family.fr wrote: 
> 
>> Hi, 
>> 
>> When I send a mail with roundcube from my computer I find this message on my 
>> maillog : 
>> 
>> _MAY 15 20:16:51 MYSERVER POSTFIX/SMTPD[29843]: CONNECT FROM 
>> UNKNOWN[192.168.1.1]_ 
>> 
>> 192.168.1.1 is my box IP 
>> 
>> My computer is in the same lan than my mailserver (home network). 
>> 
>> I think I have a bad configuration somewhere, postfix or server network. 
>> 
>> I takes any sugsestion. 
>> 
>> Thank's. 
>> 
>> -- 
>> ## 
>> 
>> Philippe - Forums
> 
> -- 
> Sent from my Android device with K-9 Mail. Please excuse my brevity.

Problem when I send a mail

2018-05-15 Thread forums
Hi, 

When I send a mail with roundcube from my computer I find this message
on my maillog : 

_MAY 15 20:16:51 MYSERVER POSTFIX/SMTPD[29843]: CONNECT FROM
UNKNOWN[192.168.1.1]_ 

192.168.1.1 is my box IP 

My computer is in the same lan than my mailserver (home network). 

I think I have a bad configuration somewhere, postfix or server network.


I takes any sugsestion. 

Thank's. 

-- 
## 

Philippe - Forums

Fwd: Good sender

2018-05-10 Thread forums
Hi, 

I can't specifie the good mail sender with postfix. 

I explain: 

I have a server mail cluster with 2 nodes (but only one works, the
second is going to be made). 

Node names is "node1" and "node2", cluster name is "node". On node1, the
server name is "node1" and the mail server name (for postfix) is "node".
The servers are on a personnal domain (my_domain.fr). 

On all of my servers (mail servers and others), the postfix
configuration is: 

. 

mydomain = my_domain.fr 

myhostname = server_name.$mydomain 

. 

(with "node" for relay to others servers and mail server configuration
for "node1") 

When I send a mail from a local server (linux) with a linux user, I
receive the mail with "from user@server.my_domain.fr". So, that's OK. 

But when I send a mail from the mail server with a linux user, I receive
the mail with "from user@node1" instead of "from
user@node1.my_domain.fr". 

I don't understand where is the bad configuration.

Postfix configuration

2018-04-05 Thread forums
Hi, 

Sorry for my english, I'm french. 

I have some doubts about my Postfix configuration. 

I have a private mail server, at my home, allowing me to have my
personal e-mails ( @my_domain.fr ) 

My architecture is the following one (on Raspberry Pi with Raspbian): 

- 1 mail server with Postfix, Dovecot, Amavis, Spamassassin, ClamAV 

- 3 others severs, not mail servers 

I can send and receive e-mails, from inside and outside without any
problem. 

I use a SMTP relay (my provider SMTP). 

I have a domain and the MX record is OK. 

But I'm not sure about my Postfix configuration. 

Here it is: 

* main.cf: 

_SMTPD_BANNER = $MYHOSTNAME ESMTP $MAIL_NAME (RASPBIAN)_
_BIFF = NO_
_APPEND_DOT_MYDOMAIN = NO_
_#DELAY_WARNING_TIME = 4H_
_README_DIRECTORY = NO_
_# TLS PARAMETERS_
_SMTPD_TLS_CERT_FILE=/DIRECTORY_OF_SSL_FILES/FULLCHAIN.PEM_
_SMTPD_TLS_KEY_FILE=/DIRECTORY_OF_SSL_FILES/PRIVKEY.PEM_
_SMTPD_TLS_CAFILE=/DIRECTORY_OF_SSL_FILES/CHAIN.PEM_
_SMTPD_USE_TLS=YES_
_SMTPD_TLS_SESSION_CACHE_DATABASE =
BTREE:${DATA_DIRECTORY}/SMTPD_SCACHE_
_SMTPD_TLS_SECURITY_LEVEL = MAY_
_SMTP_TLS_CERT_FILE=/DIRECTORY_OF_SSL_FILES/FULLCHAIN.PEM_
_SMTP_TLS_KEY_FILE=/DIRECTORY_OF_SSL_FILES/PRIVKEY.PEM_
_SMTP_TLS_CAFILE=/DIRECTORY_OF_SSL_FILES/CHAIN.PEM_
_SMTP_USE_TLS=YES_
_SMTP_TLS_SESSION_CACHE_DATABASE = BTREE:${DATA_DIRECTORY}/SMTP_SCACHE_
_SMTPD_RELAY_RESTRICTIONS = PERMIT_MYNETWORKS,
PERMIT_SASL_AUTHENTICATED, DEFER_UNAUTH_DESTINATION_
_#MYHOSTNAME = MY_HOSTNAME_
_ALIAS_MAPS = HASH:/ETC/ALIASES_
_ALIAS_DATABASE = HASH:/ETC/ALIASES_
_MYORIGIN = MY_DOMAIN.FR_
_MYDESTINATION = MY_SERVER1, MY_SERVER2, MY_SERVER3_
_RELAYHOST = [IP_RELAY_HOST]:25_
_MYNETWORKS = 127.0.0.0/8 192.168.1.0/24_
_MAILBOX_SIZE_LIMIT = 1024_
_RECIPIENT_DELIMITER = +_
_INET_INTERFACES = ALL_
_INET_PROTOCOLS = IPV4_
_VIRTUAL_MAILBOX_DOMAINS =
MYSQL:/ETC/POSTFIX/MYSQL-VIRTUAL-MAILBOX-DOMAINS.CF_
_VIRTUAL_MAILBOX_MAPS =
MYSQL:/ETC/POSTFIX/MYSQL-VIRTUAL-MAILBOX-MAPS.CF_
_VIRTUAL_ALIAS_MAPS = MYSQL:/ETC/POSTFIX/MYSQL-VIRTUAL-ALIAS-MAPS.CF_
_# SASL_
_SMTPD_SASL_TYPE = DOVECOT_
_SMTPD_SASL_PATH = PRIVATE/AUTH_
_SMTP_SASL_AUTH_ENABLE = YES_
_SMTP_SASL_SECURITY_OPTIONS = NOANONYMOUS_
_SMTP_SASL_PASSWORD_MAPS = HASH:/ETC/POSTFIX/SASL/SASL_PASSWD_
_SMTPD_RECIPIENT_RESTRICTIONS = PERMIT_SASL_AUTHENTICATED,
PERMIT_MYNETWORKS, REJECT_UNAUTH_DESTINATION_
_VIRTUAL_TRANSPORT = DOVECOT_
_DOVECOT_DESTINATION_RECIPIENT_LIMIT = 1_
_CONTENT_FILTER = SMTP-AMAVIS:[127.0.0.1]:10024_
_#SENDER_CANONICAL_MAPS = HASH:/ETC/POSTFIX/CANONICAL_
_# TAILLE DES PIÈCES JOINTES_
_MESSAGE_SIZE_LIMIT = 2048_
_COMPATIBILITY_LEVEL = 2_ 

* 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"
OR_
_# ON-LINE: HTTP://WWW.POSTFIX.ORG/MASTER.5.HTML)._
_#_
_# 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   -   -   -   1   POSTSCREEN_
_#SMTPD PASS  -   -   -   -   -   SMTPD_
_#DNSBLOG   UNIX  -   -   -   -   0   DNSBLOG_
_#TLSPROXY  UNIX  -   -   -   -   0   TLSPROXY_
_SMTP   INET  N   -   Y   -   -   SMTPD_
_#  -O SYSLOG_NAME=POSTFIX/SUBMISSION_
_#  -O SMTPD_REJECT_UNLISTED_RECIPIENT=NO_
_#  -O SMTPD_CLIENT_RESTRICTIONS=$MUA_CLIENT_RESTRICTIONS_
_#  -O SMTPD_HELO_RESTRICTIONS=$MUA_HELO_RESTRICTIONS_
_#  -O SMTPD_SENDER_RESTRICTIONS=$MUA_SENDER_RESTRICTIONS_
_#  -O SMTPD_RECIPIENT_RESTRICTIONS=_
_#  -O SMTPD_RELAY_RESTRICTIONS=PERMIT_SASL_AUTHENTICATED,REJECT_
_SUBMISSION INET  N   -   Y   -   -   SMTPD_
_-O SMTPD_TLS_SECURITY_LEVEL=MAY_
_-O SMTPD_SASL_AUTH_ENABLE=YES_
_-O MILTER_MACRO_DAEMON_NAME=ORIGINATING_
_#  -O SYSLOG_NAME=POSTFIX/SMTPS_
_#  -O SMTPD_TLS_WRAPPERMODE=YES_
_#  -O SMTPD_REJECT_UNLISTED_RECIPIENT=NO_
_#  -O SMTPD_HELO_RESTRICTIONS=$MUA_HELO_RESTRICTIONS_
_#  -O SMTPD_RELAY_RESTRICTIONS=PERMIT_SASL_AUTHENTICATED,REJECT_
_#  -O MILTER_MACRO_DAEMON_NAME=ORIGINATING_
_SMTPS  INET  N   -   Y   -   -   SMTPD_
_-O SMTPD_SASL_AUTH_ENABLE=YES_
_-O SMTPD_TLS_SECURITY_LEVEL=ENCRYPT_
_-O SMTPD_SASL_AUTH_ENABLE=YES_
_-O SMTPD_SASL_TYPE=DOVECOT_
_-O SMTPD_SASL_PATH=PRIVATE/AUTH_
_-O SMTPD_SASL_SECURITY_OPTIONS=NOANONYMOUS_
_-O SMTPD_SASL_LOCAL_DOMAIN=$MYHOSTNAME_
_-O SMTPD_CLIENT_RESTRICTIONS=PERMIT_SASL_AUTHENTICATED,REJECT_
_-O SMTPD_SENDER_RESTRICTIONS=REJECT_SENDER_LOGIN_MISMATCH_
_-O
SMTPD_RECIPIENT_RESTRICTIONS=REJECT_NON_FQDN_RECIPIENT,REJECT_UNKNOWN_RECIPIENT_DOMAIN,PERMIT_SASL_AUTHENTICATED,REJECT_
_SMTP-AMAVIS UNIX - - Y - 2 SMTP_
_   -O SMTP_DATA_DON