Re: reply-to/return-path mail/smtpd question

2010-04-20 Thread Jacek Masiulaniec
On Mon, Mar 22, 2010 at 06:05:37PM +0100, Didier Wiroth wrote:
> Hello,
> (I'm using current with smtpd.)
> I'm sending mail reports to a mail address which is defined in the
> alias file like this:
> didier: dwir...@company.com
> 
> My smtpd.conf is:
> listen on lo0
> map "aliases" { source db "/etc/mail/aliases.db" }
> accept for local deliver to mbox
> accept for all relay via mail.company.com
> 
> When I get the mail, the return-path header field is:
> did...@originating.mail.host
> 
> Is it possible to "AUTOMATICALLY" change the default behavior of the
> mail command or from smtpd, so that the "return-path" is an
> existing/other mail address ?
> for example:
> return-path: 

This is task for the MUA, not MTA.

$ mail didier -f dwir...@company.com < report.txt



Re: smtpd: Aliases only work with for local alias aliases

2010-04-20 Thread Jacek Masiulaniec
On Mon, Apr 12, 2010 at 12:26:09PM +0200, Rene Maroufi wrote:
> Hello,
> 
> In my smtpd.conf i have this:
> 
> map aliases { source db "/etc/mail/aliases.db" }
> 
> and:
> 
> accept from all for local deliver to maildir
> 
> If i send a mail to an alias smtpd rejected the mail. The Log says: 530
> Recipient rejected: postmas...@lofn.maroufi
> 
> I tried something and finally this works:
> 
> accept from all for local alias aliases deliver to maildir
> 
> But the Manpage doesn't say something about "for local alias aliases"
> 
> And a second error in the Manpage: The Manpage says:
> 
>  map map { [type maptype] source mapsource }
> 
> And the maptype must be db. But if i write:
> 
> map aliases { type db source "/etc/mail/aliases.db" }
> 
> Than smtpd -n says its an syntax error.
> 
> Actually map only works without maptype and aliases works only with a
> alias mapname statement in the accept rule. Thats different from the
> manpage.

Both fixed in -current.

> 
> Cheers
> Reni
> -- 
> Reni Maroufi
> i...@maroufi.net



Re: smtpd.conf: syntax error with from local

2010-04-20 Thread Jacek Masiulaniec
On Sun, Apr 11, 2010 at 08:20:24PM +0200, Rene Maroufi wrote:
> Hi,
> 
> i tried smtpd on a snapshot from March (GENERIC#556). If i use:
> 
> accept from local for all relay
> 
> I get with smtpd -n:
> 
> /etc/mail/smtpd.conf:11: syntax error
> 
> If i remove from local, everything is OK. Whats wrong with from local?
> The manpage says from local is correct (but the default, so it isn't
> needed).

Fixed in -current.

> 
> Cheers
> Rene
> -- 
> Reni Maroufi
> i...@maroufi.net



Re: OpenSMTPd actual development and integration

2010-01-15 Thread Jacek Masiulaniec
I am familiar with DJB's writings on queue structure and others.
Fundamentally, OpenSMTPD makes use of file system atomic operations
similarly to qmail in order to achieve the same goal, the difference
lies in directory hierarchy organization which that is of secondary
importance.

But I believe Marco when he says atomic operations do not give you
guarantees in the strict sense of the word.



Re: How to remove "Operation timed out" messages" from queue with smtpctl?

2010-01-01 Thread Jacek Masiulaniec
On Sat, Dec 26, 2009 at 08:47:28AM +0100, Tomas Bodzar wrote:
> Hi all,
> 
> how can I remove "Operation timed out" messages from mail queue with
> smtpctl(8)? I have default setup for local delivery and I tested if
> it's possible to send emails to outside world as with default
> sendmail(8) configuration in OpenBSD. Now I have two messages in
> queue. I read man pages for smtpd(8), smtpctl(8) and smtpd.conf(5) and
> there is nothing about that. Is it safe to remove those files directly
> from /var/spool/smtpd/queue ?

It would be interesting to see the exact smtpctl output, and the
exact smtpd.conf that was used.



Re: sptmd(8), MDA and SpamAssassin? (semi-OT)

2009-12-21 Thread Jacek Masiulaniec
On Sun, Dec 20, 2009 at 11:10:21PM -0600, Adam Thompson wrote:
> Is there a better way?  Can I skip procmail?  (Do I want to?  Procmail 
> also seems to be the only way to have Maildir-format for some users and 
> mbox-format for others, when using smtpd(8).)  Is there any (useful) way 
> to invoke spamc(1L) as an MDA?

If there are needs such as having different mbox formats for different
users, then using a program like procmail is natural.



Re: Firefox pegging my CPU

2009-11-30 Thread Jacek Masiulaniec
Did you ktrace it?

On Mon, Nov 30, 2009 at 03:08:43AM -0500, Nick Guenther wrote:
> I installed firefox35 on 4.6 and used it happily until yesterday when
> it went crazy. It will still load pages but extremely slowly--to the
> point of being unusable. I deleted my .mozilla directory--no luck. I
> reinstalled it--no luck. I got rid of swfdec--no luck. Here's top(1):
> 
> load averages:  3.57,  3.41,  3.0203:01:56
> 62 processes:  60 idle, 2 on processor
> CPU0 states: 24.1% user,  0.0% nice,  4.3% system,  5.9% interrupt, 65.7% idle
> CPU1 states: 35.9% user,  0.0% nice,  6.4% system,  0.1% interrupt, 57.6% idle
> Memory: Real: 170M/496M act/tot  Free: 1000M  Swap: 0K/2910M used/tot
> 
>   PID USERNAME PRI NICE  SIZE   RES STATE WAIT  TIMECPU COMMAND
>  5413 kousu 630   52M   80M onproc/0  - 3:13 78.76%
> firefox35-bin
>  9499 _x11   20   20M   39M sleep/1   select8:04 29.98% Xorg
>  5556 kousu  20 2468K 3812K sleep/1   select2:11 10.84% ssh
> 24095 kousu  20 9600K   18M sleep/1   poll  1:07  7.18% Terminal
> 15752 kousu  20  844K 1456K sleep/1   netio 0:16  0.98% sftp
>  3515 kousu  20  920K 2152K sleep/1   select0:04  0.05% wmii
> 17588 kousu  20   19M   43M sleep/0   poll  0:07  0.00% 
> liferea-bin
> 24351 kousu 180  592K  408K sleep/1   pause 0:09  0.00% sh
> 16769 kousu  20  544K 2088K sleep/1   poll  0:01  0.00% autocutsel
> 11276 kousu  20 1808K 4188K sleep/1   poll  0:00  0.00% gconfd-2
> 13162 kousu -60  636K  488K idle  piperd0:00  0.00% sh
> 28545 kousu  20 2168K 4600K sleep/0   poll  0:00  0.00% gconfd-2
> 25080 kousu  20  600K 1528K sleep/0   poll  0:00  0.00% top
> 28316 root   20  476K 1168K idle  select0:00  0.00% famd
> 11756 _pflogd40  604K  332K sleep/1   bpf   0:00  0.00% pflogd
>  1948 kousu  30 1652K 3172K idle  ttyin 0:00  0.00% lynx
> 30910 kousu  20  484K  780K sleep/0   select0:00  0.00% ifstat
>  6337 kousu  30  716K  580K idle  ttyin 0:00  0.00% ksh
> 
> Is anyone else seeing this? Any tips on how to debug it? Clearly
> something has changed on my system because it was fine for a good
> month until just now.
> 
> Thanks,
> -Nick



Re: imsg framework

2009-11-19 Thread Jacek Masiulaniec
On Thu, Nov 19, 2009 at 04:48:06PM -0600, Marco Peereboom wrote:
> but still no man pages...
> 
> tsk tsk tsk

It's worth noting that thanks to syncing done by eric@ and pyr@ at
c2k9, the imsg lib is now possible, and thus the doc will come when
the lib is done.



Re: imsg framework

2009-11-19 Thread Jacek Masiulaniec
On Thu, Nov 19, 2009 at 05:56:15PM +0200, Gregory Edigarov wrote:
> Hello,
> 
> just wonder is there any information about it available?
> I mean the source is good to look for details but I would like to have
> a big picture first.

The source code is really rather simple, you should be able to work things
out just by reading it.

Check out http://www.openbsd.org/papers/, imsg is described at high level in
few presentations.



Re: smtpd IP log

2009-11-13 Thread Jacek Masiulaniec
On Mon, Oct 19, 2009 at 06:21:51PM +0200, Philippe NICOLAS wrote:
> Hello
> 
> I tried smtpd for a while and I must admit it is very convenient to use !
> 
> Anyway is it possible for smtpd to log the IP of the remote server in the
> maillog as sendmail did it ?

That is what happens in -current.

> 
> Thanks



Re: no hostname in mails sent with smtpd in a crontab

2009-10-15 Thread Jacek Masiulaniec
On Wed, Oct 14, 2009 at 04:37:17PM -0700, Claus Assmann wrote:
> > smtpd currently does no content inspection.  However, even the most
> > basic SMTP implementation needs to parse message content, eg.  to
> > add missing domainpart to From:, add missing Date: or Message-Id:
> > or to strip Return-Path:.  So, we need to come up with a solution
> > that will cater for all these cases, and possibly more.
> 
> You need that only in an MSA, not in an MTA. My MTA package doesn't
> offer that either, that's why it uses some other software as MSA
> which adds all the required headers if they are missing (a decent
> MUA doesn't need any fixups, but you can't rely on that as there
> are obviously other programs that submit mail).

Correct, my statement was too strong: MTA can do without inspection
but MSA must do it, and our current thinking is that smtpd will not
separate out MSA as another program.

However, nothing is final yet - we are considering other options.



Re: no hostname in mails sent with smtpd in a crontab

2009-10-14 Thread Jacek Masiulaniec
On Wed, Oct 14, 2009 at 03:01:57PM -0700, patrick keshishian wrote:
> On Wed, Oct 14, 2009 at 1:52 PM, Gilles Chehade  wrote:
> > this was discussed with jacekm@ and the issue is actually a bit
> > trickier than i initially assumed, we'll fix that soon but it's
> > not a five minutes fix as it looks like ;)
> 
> as a bystander/observer to this discussion thread, this sounds
> interesting and I was wondering if there would/could be any narrative
> to the core of the problem and fix?

smtpd currently does no content inspection.  However, even the most
basic SMTP implementation needs to parse message content, eg.  to
add missing domainpart to From:, add missing Date: or Message-Id:
or to strip Return-Path:.  So, we need to come up with a solution
that will cater for all these cases, and possibly more.



Re: smtpd update

2009-09-22 Thread Jacek Masiulaniec
On Thu, Sep 17, 2009 at 02:09:17PM +0200, Michael wrote:
> > smtpd has recently benefited from many changes to the local and remote
> > delivery code paths.  Their aim is to advance smtpd few steps further to
> > being well suited for production use.  I have been working on this for a
> > number of weeks, and to put it bluntly - the changes are massive.
> > 
> > So, please grab the latest smtpd and give it a spin.
> 
> I've changed from sendmail to smtpd on some routers which only forward
> cronjob mails and it works just fine... mostly. ;-)
> 
> On one machine I am also accepting mails, grep the text and send it as
> SMS. Sending mails with tls and receiving mails without tls works just
> fine, however, when using "listen on vr0 tls" it doesn't work when
> following "man starttls", because it tells you to create a DSA certificate.
> 
> In this case the sending machine is another OpenBSD box with sendmail.
> opensmtpd complains here that no shared cipher could be found. After
> switching to an RSA certificate it works just fine.

starttls(8) instructions should now work on -current smtpd.



Re: smtpd update

2009-09-16 Thread Jacek Masiulaniec
On Wed, 16 Sep 2009 15:54:36 +0200, Landry Breuil 
wrote:
> On Wed, Sep 16, 2009 at 11:14 AM, Jacek Masiulaniec
>  wrote:
>> Hi,
>>
>> smtpd has recently benefited from many changes to the local and remote
>> delivery code paths.  Their aim is to advance smtpd few steps further to
>> being well suited for production use.  I have been working on this for a
>> number of weeks, and to put it bluntly - the changes are massive.
>>
>> So, please grab the latest smtpd and give it a spin.
>>
>> If you are not already using smtpd but would like to start, edit
>> /etc/mailer.conf
>>
>> sendmail/usr/sbin/smtpctl
>> send-mail   /usr/sbin/smtpctl
>> mailq   /usr/sbin/smtpctl
>> makemap /usr/libexec/smtpd/makemap
>> newaliases  /usr/libexec/smtpd/makemap
>>
>> and run
>>
>> # echo sendmail_flags=NO >> /etc/rc.conf.local
>> # echo smtpd_flags= >> /etc/rc.conf.local
>> # newaliases
> 
> And i suppose, comment the sendmail clientmqueue runner job in crontab ?

This is no longer necessary.  My recent commit turned clientmqueue in cron
into a noop when smtpd is enabled.



smtpd update

2009-09-16 Thread Jacek Masiulaniec
Hi,

smtpd has recently benefited from many changes to the local and remote
delivery code paths.  Their aim is to advance smtpd few steps further to
being well suited for production use.  I have been working on this for a
number of weeks, and to put it bluntly - the changes are massive.

So, please grab the latest smtpd and give it a spin.

If you are not already using smtpd but would like to start, edit
/etc/mailer.conf

sendmail/usr/sbin/smtpctl
send-mail   /usr/sbin/smtpctl
mailq   /usr/sbin/smtpctl
makemap /usr/libexec/smtpd/makemap
newaliases  /usr/libexec/smtpd/makemap

and run

# echo sendmail_flags=NO >> /etc/rc.conf.local
# echo smtpd_flags= >> /etc/rc.conf.local
# newaliases

Finally, reboot the box to verify smtpd is started automatically.

Thanks,

Jacek



Re: Rewriting Addresses in SMTPD

2009-06-01 Thread Jacek Masiulaniec
On Sun, May 31, 2009 at 10:56:50PM -0400, Aaron W. Hsu wrote:
> Is there a way in smtpd(8) yet, to do something like genericstables in 
> sendmail? Right now, when my client sendmail sends out a mail, it 
> rewrites the envelope and the From addresses to be valid email addresses 
> with the domain that I want tacked on to the username. I couldn't 
> find a way to do this in smtpd.conf(5), which seems to have aliases 
> and virtual domain maps for receiving mail, but not sending it.

We don't have it yet.  We will at one point.

> If this is better done before the mail is sent to smtpd(8), is there 
> a way to do this with mail(1)?

You may pass sendmail options to mail(1), eg.:

  echo test | mail root -f f...@foo.com -F "Fred"

Not sure how useful that is in your case.



Re: smtpd authentication?

2009-03-31 Thread Jacek Masiulaniec
On Tue, Mar 31, 2009 at 12:49:29AM -0400, Aaron W. Hsu wrote:
> Does the recently linked in smtpd support things like certificate based 
> authentication for relay?

Not yet. It will at one point.



Re: smtpd, please test

2009-03-17 Thread Jacek Masiulaniec
We came up with simplified instructions.  Fetch these scripts:

  http://www.poolp.org/~jacekm/smtpd-enable
  http://www.poolp.org/~jacekm/smtpd-disable

Then, run the following on a recent snap after cvs up:

  sudo smtpd-enable

To deactivate:

  sudo smtpd-disable

On Tue, Mar 17, 2009 at 01:55:14AM +0100, Gilles Chehade wrote:
> Hi misc@,
> 
> As some of you may have noticed, smtpd has been enabled in the
> build and we encourage you guys to start testing it and report
> bugs you run into.
> 
> What would be great is if you could replace your sendmail with
> smtpd on your laptop/desktop and started using it as a backend
> for your mua; or if you could set it up on some test box where
> you receive mail (with a secondary MX) as a destination MX.
> 
> PLEASE do not run this in production, it is NOT ready. Really,
> don't do it, you will be unhappy and I will point my finger at
> you and laugh. Really ... don't.



Re: Segmentation fault in sh script using base utilities only

2007-08-05 Thread Jacek Masiulaniec

On 4 Aug 2007, at 19:31, Andris wrote:

Hi, I'm writing a set of small utilities as scripts, and I got a
segmentation fault working on one of them.

The script is suppoused to align text with spaces. Say you have
this file:

Foo1\tFoo2
Br\tBar2
Baz

Where \t are horizontal tabs. My script would replace the tabs with an
adequate number of spaces to align foo2 and bar2.


Writing replacement for "column -t", huh?

Jacek



locate(1) improvements

2007-06-21 Thread Jacek Masiulaniec
Index: locate.1
===
RCS file: /cvs/src/usr.bin/locate/locate/locate.1,v
retrieving revision 1.24
diff -u -p -r1.24 locate.1
--- locate.131 May 2007 19:20:12 -  1.24
+++ locate.121 Jun 2007 14:50:03 -
@@ -106,7 +106,7 @@ of databases to be searched.
 .Pp
 .Ar database
 may be a colon-separated list of databases.
-A single colon is a reference to the default database.
+An empty database name is a reference to the default database.
 .Pp
 .Dl $ locate -d $HOME/lib/mydb: foo
 .Pp
@@ -164,7 +164,7 @@ instead of the
 .Xr stdio 3
 library.
 This is the default behavior.
-Usually faster in most cases.
+It performs better in most cases.
 .It Fl S
 Print some statistics about the database and exit.
 .It Fl s